CVS commit: othersrc/libexec/tnftpd
Module Name:othersrc Committed By: lukem Date: Thu Mar 21 07:44:03 UTC 2013 Modified Files: othersrc/libexec/tnftpd: ChangeLog THANKS Log Message: Add a bunch of names in the ChangeLog to THANKS. Strip out email addresses; they're often out of date. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 othersrc/libexec/tnftpd/ChangeLog cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/THANKS Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/libexec/tnftpd/ChangeLog diff -u othersrc/libexec/tnftpd/ChangeLog:1.56 othersrc/libexec/tnftpd/ChangeLog:1.57 --- othersrc/libexec/tnftpd/ChangeLog:1.56 Thu Mar 21 04:02:52 2013 +++ othersrc/libexec/tnftpd/ChangeLog Thu Mar 21 07:44:03 2013 @@ -1,4 +1,4 @@ -$NetBSD: ChangeLog,v 1.56 2013/03/21 04:02:52 lukem Exp $ +$NetBSD: ChangeLog,v 1.57 2013/03/21 07:44:03 lukem Exp $ Thu Mar 21 03:50:21 UTC 2013 lukem @@ -90,7 +90,7 @@ Tue Oct 28 08:15:35 UTC 2008 lukem overflow a 32bit time_t when multiplied by 86400, causing a user whose password hasn't changed for 1.5 years to be incorrectly locked out. - Problem noted by Takashi SHIRAI shi...@unixusers.net + Problem noted by Takashi SHIRAI. Thu Oct 9 02:06:46 UTC 2008 lukem @@ -144,14 +144,13 @@ Sun Sep 21 16:34:30 UTC 2008 lukem just fail on them. This prevents CSRF-like attacks, when a web browser is used to access an ftp server. - Reported by Maksymilian Arciemowicz c...@securityreason.com. - Fix mostly derived from OpenBSD, written - by Moritz Jodeit mor...@openbsd.org + Reported by Maksymilian Arciemowicz. + Fix mostly derived from OpenBSD, written by Moritz Jodeit. * Enhance -C to support an optional @host ('-C user[@host]'): checks whether user as connecting from host would be granted access by ftpusers(5). Support IPv6 in the host directive of ftpusers(5). - Both features from Rudolf Cejka cej...@fit.vutbr.cz + Both features from Rudolf Cejka. (FreeBSD's tnftpd port maintainer). Sat Sep 20 01:47:15 UTC 2008 lukem @@ -544,7 +543,7 @@ Wed Dec 10 02:30:19 UTC 2003 lukem Patches provided by Joel Baker in PR 22284 - Add ftpd_loginx() and ftpd_logwtmpx() and use them to hold wtmpx file open while a session. Close bin/21692 by - b...@krille.update.uu.se. + Johnny Billquist. - Fix typos accidentally introduced in rev 1.70 as part of the large number support. (NetBSD yacc didn't barf on these, although Solaris and HP/UX's did...) @@ -571,7 +570,7 @@ Wed Dec 10 01:33:35 UTC 2003 lukem Thu Jul 31 09:10:49 UTC 2003 lukem * work-around missing LLONG_MAX and LLONG_MIN on Darwin. - Patch from Yuji Yamano yyam...@netbsd.org + Patch from Yuji Yamano. Mon Mar 3 03:42:42 UTC 2003 lukem @@ -595,7 +594,7 @@ Thu Feb 27 03:15:51 UTC 2003 lukem Wed Feb 26 14:51:51 UTC 2003 lukem - * fixes from Tetsuya Isaki is...@netbsd.org: + * fixes from Tetsuya Isaki: - provide adhoc definition of LOGIN_NAME_MAX for slackware 8.1 - need unistd.h before fnmatch.h; tnftpd.h already did this, but configure.in did not. (for slackware 8.1) @@ -657,7 +656,7 @@ Thu May 23 02:43:41 UTC 2002 lukem Sat Mar 16 01:28:28 UTC 2002 lukem * libukem/glob.c: Fix two problems in the KNR-ANSI conversion - noticed by Yuji Yamano yyam...@kt.rim.or.jp + noticed by Yuji Yamano. Thu Mar 14 06:02:31 UTC 2002 lukem @@ -802,9 +801,9 @@ Sat Mar 17 12:02:51 UTC 2001 lukem * merge ftpd from NetBSD-current (20010317): - make sure we do not return stray at the end of stirng, - like bla\0. From: William C. Allen alle...@home.com + like bla\0. From William C. Allen. - ensure replydirname() do not truncate the names. - From: Paul Janzen pjan...@foatdi.harvard.edu + From Paul Janzen. - don't support t(erabyte) as a suffix in strsuftoll() #ifdef NO_LONG_LONG - Use GLOB_LIMIT. Also fix a bug where gl_offs was not Index: othersrc/libexec/tnftpd/THANKS diff -u othersrc/libexec/tnftpd/THANKS:1.4 othersrc/libexec/tnftpd/THANKS:1.5 --- othersrc/libexec/tnftpd/THANKS:1.4 Thu Mar 21 04:01:09 2013 +++ othersrc/libexec/tnftpd/THANKS Thu Mar 21 07:44:03 2013 @@ -1,12 +1,21 @@ tnftpd would not be as useable without the enhancements, fixes, or input from the following people: -Bruce Cran br...@cran.org.uk -Christos Zoulas chris...@netbsd.org -Curt Sampson c...@netbsd.org -Greg A. Woods wo...@planix.com +Bruce Cran +Christos Zoulas +Curt Sampson +Greg A. Woods +Johnny Billquist Jun-ichiro itojun Hagino -Luke Mewburn lu...@netbsd.org -Matthew R. Green m...@eterna.com.au -Simon Burge sim...@netbsd.org -Todd Vierling t...@netbsd.org +Luke Mewburn +Maksymilian Arciemowicz +Matthew R. Green +Moritz Jodeit +Paul Janzen +Rudolf Cejka +Simon Burge +Takashi SHIRAI +Tetsuya Isaki +Todd Vierling +William C. Allen +Yuji Yamano
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Thu Mar 21 12:33:11 UTC 2013 Modified Files: src/sys/dev/pci: if_bge.c if_bgereg.h if_bgevar.h Log Message: - Sync with FreeBSD and OpenBSD. Almost the same as OpenBSD rev. 1.325: - Sync the ring setup code closer to FreeBSD's driver - Do not touch the jumbo replenish threshold register on chips that do not have jumbo support - Add/sync some of the comments - Use macro. - Remove unused code. To generate a diff of this commit: cvs rdiff -u -r1.221 -r1.222 src/sys/dev/pci/if_bge.c cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/if_bgereg.h cvs rdiff -u -r1.12 -r1.13 src/sys/dev/pci/if_bgevar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.221 src/sys/dev/pci/if_bge.c:1.222 --- src/sys/dev/pci/if_bge.c:1.221 Tue Mar 19 16:49:11 2013 +++ src/sys/dev/pci/if_bge.c Thu Mar 21 12:33:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.221 2013/03/19 16:49:11 msaitoh Exp $ */ +/* $NetBSD: if_bge.c,v 1.222 2013/03/21 12:33:11 msaitoh Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.221 2013/03/19 16:49:11 msaitoh Exp $); +__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.222 2013/03/21 12:33:11 msaitoh Exp $); #include vlan.h @@ -2478,10 +2478,10 @@ bge_blockinit(struct bge_softc *sc) { volatile struct bge_rcb *rcb; bus_size_t rcb_addr; - int i; struct ifnet *ifp = sc-ethercom.ec_if; bge_hostaddr taddr; uint32_t dmactl, val; + int i, limit; /* * Initialize the memory window pointer register so that @@ -2508,12 +2508,6 @@ bge_blockinit(struct bge_softc *sc) } /* Step 35: Configure mbuf pool watermarks */ -#ifdef ORIG_WPAUL_VALUES - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 24); - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 24); - CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 48); -#else - /* new broadcom docs strongly recommend these: */ if (BGE_IS_5717_PLUS(sc)) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); @@ -2534,7 +2528,6 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x20); CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_HIWAT, 0x60); } -#endif /* Step 36: Configure DMA resource watermarks */ CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_LOWAT, 5); @@ -2586,28 +2579,83 @@ bge_blockinit(struct bge_softc *sc) return ENXIO; } + /* + * Summary of rings supported by the controller: + * + * Standard Receive Producer Ring + * - This ring is used to feed receive buffers for standard + * sized frames (typically 1536 bytes) to the controller. + * + * Jumbo Receive Producer Ring + * - This ring is used to feed receive buffers for jumbo sized + * frames (i.e. anything bigger than the standard frames) + * to the controller. + * + * Mini Receive Producer Ring + * - This ring is used to feed receive buffers for mini + * sized frames to the controller. + * - This feature required external memory for the controller + * but was never used in a production system. Should always + * be disabled. + * + * Receive Return Ring + * - After the controller has placed an incoming frame into a + * receive buffer that buffer is moved into a receive return + * ring. The driver is then responsible to passing the + * buffer up to the stack. Many versions of the controller + * support multiple RR rings. + * + * Send Ring + * - This ring is used for outgoing frames. Many versions of + * the controller support multiple send rings. + */ + /* Step 41: Initialize the standard RX ring control block */ rcb = sc-bge_rdata-bge_info.bge_std_rx_rcb; BGE_HOSTADDR(rcb-bge_hostaddr, BGE_RING_DMA_ADDR(sc, bge_rx_std_ring)); - if (BGE_IS_5717_PLUS(sc)) + if (BGE_IS_5717_PLUS(sc)) { + /* + * Bits 31-16: Programmable ring size (2048, 1024, 512, .., 32) + * Bits 15-2 : Maximum RX frame size + * Bit 1 : 1 = Ring Disabled, 0 = Ring ENabled + * Bit 0 : Reserved + */ rcb-bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(512, BGE_MAX_FRAMELEN 2); - else if (BGE_IS_5705_PLUS(sc)) + } else if (BGE_IS_5705_PLUS(sc)) { + /* + * Bits 31-16: Programmable ring size (512, 256, 128, 64, 32) + * Bits 15-2 : Reserved (should be 0) + * Bit 1 : 1 = Ring Disabled, 0 = Ring Enabled + * Bit 0 : Reserved + */ rcb-bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(512, 0); - else + } else { + /* + * Ring size is always XXX entries + * Bits 31-16: Maximum RX frame size + * Bits 15-2 : Reserved (should be 0) + * Bit 1 : 1 = Ring Disabled, 0 = Ring Enabled + * Bit 0 : Reserved + */ rcb-bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); + } if (BGE_ASICREV(sc-bge_chipid) == BGE_ASICREV_BCM5717 || BGE_ASICREV(sc-bge_chipid) == BGE_ASICREV_BCM5719 ||
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Thu Mar 21 12:47:16 UTC 2013 Modified Files: src/sys/dev/usb: usb.h Log Message: Add some defines from the USB 2.0 specification and suppliments. Also, add some accessor macros while I'm here. To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/sys/dev/usb/usb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usb.h diff -u src/sys/dev/usb/usb.h:1.100 src/sys/dev/usb/usb.h:1.101 --- src/sys/dev/usb/usb.h:1.100 Sun Jan 13 06:56:30 2013 +++ src/sys/dev/usb/usb.h Thu Mar 21 12:47:16 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: usb.h,v 1.100 2013/01/13 06:56:30 skrll Exp $ */ +/* $NetBSD: usb.h,v 1.101 2013/03/21 12:47:16 skrll Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */ /* @@ -134,6 +134,7 @@ MALLOC_DECLARE(M_USBHC); #define USB_STACK_VERSION 2 #define USB_MAX_DEVICES 128 +#define USB_MIN_DEVICES 2 /* unused + root HUB */ #define USB_START_ADDR 0 #define USB_CONTROL_ENDPOINT 0 @@ -183,11 +184,16 @@ typedef struct { uWord wLength; } UPACKED usb_device_request_t; +#define UT_GET_DIR(a) ((a) 0x80) #define UT_WRITE 0x00 #define UT_READ 0x80 + +#define UT_GET_TYPE(a) ((a) 0x60) #define UT_STANDARD 0x00 #define UT_CLASS 0x20 #define UT_VENDOR 0x40 + +#define UT_GET_RECIPIENT(a) ((a) 0x1f) #define UT_DEVICE 0x00 #define UT_INTERFACE 0x01 #define UT_ENDPOINT 0x02 @@ -216,7 +222,7 @@ typedef struct { #define UT_WRITE_VENDOR_OTHER (UT_WRITE | UT_VENDOR | UT_OTHER) #define UT_WRITE_VENDOR_ENDPOINT (UT_WRITE | UT_VENDOR | UT_ENDPOINT) -/* Requests */ +/* Standard Requests Codes from the USB 2.0 spec, table 9-4 */ #define UR_GET_STATUS 0x00 #define UR_CLEAR_FEATURE 0x01 #define UR_SET_FEATURE 0x03 @@ -246,10 +252,16 @@ typedef struct { #define UR_SET_INTERFACE 0x0b #define UR_SYNCH_FRAME 0x0c -/* Feature numbers */ +/* + * Feature selectors. USB 2.0 spec, table 9-6 and OTG and EH suppliment, + * table 6-2 + */ #define UF_ENDPOINT_HALT 0 #define UF_DEVICE_REMOTE_WAKEUP 1 #define UF_TEST_MODE 2 +#define UF_DEVICE_B_HNP_ENABLE 3 +#define UF_DEVICE_A_HNP_SUPPORT 4 +#define UF_DEVICE_A_ALT_HNP_SUPPORT 5 #define USB_MAX_IPACKET 8 /* maximum size of the initial packet */ @@ -368,7 +380,10 @@ typedef struct { #define UR_GET_TT_STATE 0x0a #define UR_STOP_TT 0x0b -/* Hub features */ +/* + * Hub features from USB 2.0 spec, table 11-17 and updated by the + * LPM ECN table 4-7. + */ #define UHF_C_HUB_LOCAL_POWER 0 #define UHF_C_HUB_OVER_CURRENT 1 #define UHF_PORT_CONNECTION 0 @@ -378,6 +393,7 @@ typedef struct { #define UHF_PORT_RESET 4 #define UHF_PORT_POWER 8 #define UHF_PORT_LOW_SPEED 9 +#define UHF_PORT_L1 10 #define UHF_C_PORT_CONNECTION 16 #define UHF_C_PORT_ENABLE 17 #define UHF_C_PORT_SUSPEND 18 @@ -385,6 +401,7 @@ typedef struct { #define UHF_C_PORT_RESET 20 #define UHF_PORT_TEST 21 #define UHF_PORT_INDICATOR 22 +#define UHF_C_PORT_L1 23 typedef struct { uByte bDescLength;
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Thu Mar 21 12:56:03 UTC 2013 Modified Files: src/sys/dev/pci: if_bge.c if_bgereg.h Log Message: Wait for the bootcode to complete initialization for 5717 and newer devices. See BCM5718 programmer's guide's step 13, Device reset Procedure, Section 7. 57781's document has the same note. I verified the loop really looped on those chips. But, I don't know why tg3 doesn't it. To generate a diff of this commit: cvs rdiff -u -r1.222 -r1.223 src/sys/dev/pci/if_bge.c cvs rdiff -u -r1.67 -r1.68 src/sys/dev/pci/if_bgereg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_bge.c diff -u src/sys/dev/pci/if_bge.c:1.222 src/sys/dev/pci/if_bge.c:1.223 --- src/sys/dev/pci/if_bge.c:1.222 Thu Mar 21 12:33:11 2013 +++ src/sys/dev/pci/if_bge.c Thu Mar 21 12:56:03 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bge.c,v 1.222 2013/03/21 12:33:11 msaitoh Exp $ */ +/* $NetBSD: if_bge.c,v 1.223 2013/03/21 12:56:03 msaitoh Exp $ */ /* * Copyright (c) 2001 Wind River Systems @@ -79,7 +79,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.222 2013/03/21 12:33:11 msaitoh Exp $); +__KERNEL_RCSID(0, $NetBSD: if_bge.c,v 1.223 2013/03/21 12:56:03 msaitoh Exp $); #include vlan.h @@ -3992,6 +3992,20 @@ bge_reset(struct bge_softc *sc) /* Step 28: Fix up byte swapping */ CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS); + /* + * Wait for the bootcode to complete initialization. + * See BCM5718 programmer's guide's step 13, Device reset Procedure, + * Section 7. + */ + if (BGE_IS_5717_PLUS(sc)) { + for (i = 0; i 1000*1000; i++) { + val = bge_readmem_ind(sc, BGE_SRAM_FW_MB); + if (val == BGE_SRAM_FW_MB_RESET_MAGIC) +break; + DELAY(10); + } + } + /* Step 21: 5822 B0 errata */ if (BGE_CHIPREV(sc-bge_chipid) == BGE_CHIPREV_5704_BX) { pcireg_t msidata; Index: src/sys/dev/pci/if_bgereg.h diff -u src/sys/dev/pci/if_bgereg.h:1.67 src/sys/dev/pci/if_bgereg.h:1.68 --- src/sys/dev/pci/if_bgereg.h:1.67 Thu Mar 21 12:33:11 2013 +++ src/sys/dev/pci/if_bgereg.h Thu Mar 21 12:56:03 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_bgereg.h,v 1.67 2013/03/21 12:33:11 msaitoh Exp $ */ +/* $NetBSD: if_bgereg.h,v 1.68 2013/03/21 12:56:03 msaitoh Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2001 @@ -2178,6 +2178,7 @@ * code from running. */ #define BGE_SRAM_FW_MB_MAGIC 0x4B657654 +#define BGE_SRAM_FW_MB_RESET_MAGIC 0xB49A89AB typedef struct { volatile u_int32_t bge_addr_hi;
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Thu Mar 21 13:22:37 UTC 2013 Modified Files: src/sys/arch/x86/x86: errata.c Log Message: PR/47677 Aktado: x86_errata() should be avoided if NetBSD runs as a KVM guest. XXX: pullup to 6 To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/errata.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/errata.c diff -u src/sys/arch/x86/x86/errata.c:1.20 src/sys/arch/x86/x86/errata.c:1.21 --- src/sys/arch/x86/x86/errata.c:1.20 Fri Apr 6 13:23:39 2012 +++ src/sys/arch/x86/x86/errata.c Thu Mar 21 09:22:37 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: errata.c,v 1.20 2012/04/06 17:23:39 chs Exp $ */ +/* $NetBSD: errata.c,v 1.21 2013/03/21 13:22:37 christos Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: errata.c,v 1.20 2012/04/06 17:23:39 chs Exp $); +__KERNEL_RCSID(0, $NetBSD: errata.c,v 1.21 2013/03/21 13:22:37 christos Exp $); #include sys/types.h #include sys/systm.h @@ -329,6 +329,11 @@ x86_errata(void) int i, j, upgrade; static int again; + /* don't run if we are under a hypervisor */ + if (cpu_feature[1] CPUID2_RAZ) + return; + + /* only for AMD */ if (cpu_vendor != CPUVENDOR_AMD) return;
CVS commit: src/sys/compat/linux/arch/arm
Module Name:src Committed By: pooka Date: Thu Mar 21 15:03:47 UTC 2013 Modified Files: src/sys/compat/linux/arch/arm: linux_types.h Log Message: Fix stat64 by making it match i386. Other archs might still be broken, but this is the one I could test. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/compat/linux/arch/arm/linux_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/linux/arch/arm/linux_types.h diff -u src/sys/compat/linux/arch/arm/linux_types.h:1.8 src/sys/compat/linux/arch/arm/linux_types.h:1.9 --- src/sys/compat/linux/arch/arm/linux_types.h:1.8 Sun Jan 11 02:45:48 2009 +++ src/sys/compat/linux/arch/arm/linux_types.h Thu Mar 21 15:03:47 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_types.h,v 1.8 2009/01/11 02:45:48 christos Exp $ */ +/* $NetBSD: linux_types.h,v 1.9 2013/03/21 15:03:47 pooka Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -76,34 +76,33 @@ struct linux_stat { * insane amounts of padding around dev_t's. */ struct linux_stat64 { - unsigned short lst_dev; - unsigned char __pad0[10]; + unsigned long long lst_dev; + unsigned int __pad1; #define LINUX_STAT64_HAS_BROKEN_ST_INO 1 - unsigned long __lst_ino; + unsigned int __lst_ino; unsigned int lst_mode; unsigned int lst_nlink; - unsigned long lst_uid; - unsigned long lst_gid; + unsigned int lst_uid; + unsigned int lst_gid; - unsigned short lst_rdev; - unsigned char __pad3[10]; + unsigned long long lst_rdev; + unsigned int __pad2; long long lst_size; - unsigned long lst_blksize; + unsigned int lst_blksize; - unsigned long lst_blocks; /* Number 512-byte blocks allocated. */ - unsigned long __pad4; /* future possible st_blocks high bits*/ + unsigned long long lst_blocks; /* Number 512-byte blocks allocated. */ - unsigned long lst_atime; - unsigned long __pad5; + unsigned int lst_atime; + unsigned int lst_atime_nsec; - unsigned long lst_mtime; - unsigned long __pad6; + unsigned int lst_mtime; + unsigned int lst_mtime_nsec; - unsigned long lst_ctime; - unsigned long __pad7; /* will be high 32 bits of ctime someday */ + unsigned int lst_ctime; + unsigned int lst_ctime_nsec; unsigned long long lst_ino; };
CVS commit: src/etc/etc.evbarm
Module Name:src Committed By: mlelstv Date: Thu Mar 21 15:16:43 UTC 2013 Modified Files: src/etc/etc.evbarm: Makefile.inc Log Message: fix ALL_KERNELS handling To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/etc/etc.evbarm/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/etc.evbarm/Makefile.inc diff -u src/etc/etc.evbarm/Makefile.inc:1.49 src/etc/etc.evbarm/Makefile.inc:1.50 --- src/etc/etc.evbarm/Makefile.inc:1.49 Tue Mar 19 22:16:54 2013 +++ src/etc/etc.evbarm/Makefile.inc Thu Mar 21 15:16:43 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.49 2013/03/19 22:16:54 garbled Exp $ +# $NetBSD: Makefile.inc,v 1.50 2013/03/21 15:16:43 mlelstv Exp $ # # etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets # @@ -65,13 +65,16 @@ KERNEL_SETS+= HDL_G INTEGRATOR_CP IXM12 .if ${MACHINE_ARCH} == arm || ${MACHINE_ARCH} == earm \ || ${MACHINE_ARCH} == earmhf -BUILD_KERNELS+= RPI_INSTALL KERNEL_SETS+= RPI +BUILD_KERNELS+= RPI_INSTALL smp_rpi: ${IMAGE.kern}/netbsd-RPI.bin.gz __mkimage +.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI) +SNAP_MD_POST_DEPS+= smp_rpi +.endif MKI_OPTS.smp_rpi_inst=-b smp_rpi_inst: ${IMAGE.instk}/netbsd-RPI_INSTALL.bin.gz __mkimage -.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI) -SNAP_MD_POST_DEPS+= smp_rpi smp_rpi_inst +.if empty(ALL_KERNELS) || !empty(ALL_KERNELS:MRPI_INSTALL) +SNAP_MD_POST_DEPS+= smp_rpi_inst .endif .endif
CVS commit: src/lib
Module Name:src Committed By: christos Date: Thu Mar 21 16:49:12 UTC 2013 Modified Files: src/lib/libc/include: reentrant.h src/lib/libc/thread-stub: thread-stub.c src/lib/libpthread: Makefile pthread.c pthread_cancelstub.c pthread_cond.c pthread_int.h pthread_misc.c pthread_mutex.c pthread_once.c pthread_rwlock.c pthread_specific.c pthread_tsd.c Log Message: - Allow libpthread to be dlopened again, by providing libc stubs to libpthread. - Fail if the dlopened libpthread does pthread_create(). From manu@ - Discussed at length in the mailing lists; approved by core@ - This was chosen as the least intrusive patch that will provide the necessary functionality. XXX: pullup to 6 To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/lib/libc/include/reentrant.h cvs rdiff -u -r1.22 -r1.23 src/lib/libc/thread-stub/thread-stub.c cvs rdiff -u -r1.79 -r1.80 src/lib/libpthread/Makefile cvs rdiff -u -r1.142 -r1.143 src/lib/libpthread/pthread.c cvs rdiff -u -r1.37 -r1.38 src/lib/libpthread/pthread_cancelstub.c cvs rdiff -u -r1.58 -r1.59 src/lib/libpthread/pthread_cond.c cvs rdiff -u -r1.88 -r1.89 src/lib/libpthread/pthread_int.h cvs rdiff -u -r1.14 -r1.15 src/lib/libpthread/pthread_misc.c cvs rdiff -u -r1.55 -r1.56 src/lib/libpthread/pthread_mutex.c cvs rdiff -u -r1.2 -r1.3 src/lib/libpthread/pthread_once.c cvs rdiff -u -r1.32 -r1.33 src/lib/libpthread/pthread_rwlock.c cvs rdiff -u -r1.25 -r1.26 src/lib/libpthread/pthread_specific.c cvs rdiff -u -r1.10 -r1.11 src/lib/libpthread/pthread_tsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/include/reentrant.h diff -u src/lib/libc/include/reentrant.h:1.15 src/lib/libc/include/reentrant.h:1.16 --- src/lib/libc/include/reentrant.h:1.15 Sun Jun 3 17:27:30 2012 +++ src/lib/libc/include/reentrant.h Thu Mar 21 12:49:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: reentrant.h,v 1.15 2012/06/03 21:27:30 joerg Exp $ */ +/* $NetBSD: reentrant.h,v 1.16 2013/03/21 16:49:11 christos Exp $ */ /*- * Copyright (c) 1997, 1998, 2003 The NetBSD Foundation, Inc. @@ -221,6 +221,56 @@ __END_DECLS #define thr_enabled() (__isthreaded) #define thr_setcancelstate(n, o) __libc_thr_setcancelstate((n),(o)) #define thr_curcpu() __libc_thr_curcpu() + +#else /* __LIBC_THREAD_STUBS */ + +__BEGIN_DECLS +void __libc_thr_init_stub(void); + +int __libc_mutex_init_stub(mutex_t *, const mutexattr_t *); +int __libc_mutex_lock_stub(mutex_t *); +int __libc_mutex_trylock_stub(mutex_t *); +int __libc_mutex_unlock_stub(mutex_t *); +int __libc_mutex_destroy_stub(mutex_t *); + +int __libc_mutexattr_init_stub(mutexattr_t *); +int __libc_mutexattr_destroy_stub(mutexattr_t *); +int __libc_mutexattr_settype_stub(mutexattr_t *, int); + +int __libc_cond_init_stub(cond_t *, const condattr_t *); +int __libc_cond_signal_stub(cond_t *); +int __libc_cond_broadcast_stub(cond_t *); +int __libc_cond_wait_stub(cond_t *, mutex_t *); +int __libc_cond_timedwait_stub(cond_t *, mutex_t *, + const struct timespec *); +int __libc_cond_destroy_stub(cond_t *); + +int __libc_rwlock_init_stub(rwlock_t *, const rwlockattr_t *); +int __libc_rwlock_rdlock_stub(rwlock_t *); +int __libc_rwlock_wrlock_stub(rwlock_t *); +int __libc_rwlock_tryrdlock_stub(rwlock_t *); +int __libc_rwlock_trywrlock_stub(rwlock_t *); +int __libc_rwlock_unlock_stub(rwlock_t *); +int __libc_rwlock_destroy_stub(rwlock_t *); + +int __libc_thr_keycreate_stub(thread_key_t *, void (*)(void *)); +int __libc_thr_setspecific_stub(thread_key_t, const void *); +void *__libc_thr_getspecific_stub(thread_key_t); +int __libc_thr_keydelete_stub(thread_key_t); + +int __libc_thr_once_stub(once_t *, void (*)(void)); +int __libc_thr_sigsetmask_stub(int, const sigset_t *, sigset_t *); +thr_t __libc_thr_self_stub(void); +int __libc_thr_yield_stub(void); +int __libc_thr_create_stub(thr_t *, const thrattr_t *, + void *(*)(void *), void *); +void __libc_thr_exit_stub(void *); +int *__libc_thr_errno_stub(void); +int __libc_thr_setcancelstate_stub(int, int *); +int __libc_thr_equal_stub(pthread_t, pthread_t); +unsigned int __libc_thr_curcpu_stub(void); +__END_DECLS + #endif /* __LIBC_THREAD_STUBS */ #define FLOCKFILE(fp) __flockfile_internal(fp, 1) Index: src/lib/libc/thread-stub/thread-stub.c diff -u src/lib/libc/thread-stub/thread-stub.c:1.22 src/lib/libc/thread-stub/thread-stub.c:1.23 --- src/lib/libc/thread-stub/thread-stub.c:1.22 Fri Sep 16 12:05:59 2011 +++ src/lib/libc/thread-stub/thread-stub.c Thu Mar 21 12:49:11 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: thread-stub.c,v 1.22 2011/09/16 16:05:59 joerg Exp $ */ +/* $NetBSD: thread-stub.c,v 1.23 2013/03/21 16:49:11 christos Exp $ */ /*- * Copyright (c) 2003, 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #if defined(LIBC_SCCS) !defined(lint) -__RCSID($NetBSD: thread-stub.c,v 1.22 2011/09/16 16:05:59 joerg Exp $);
CVS commit: src/tests/lib/libpthread
Module Name:src Committed By: christos Date: Thu Mar 21 16:50:22 UTC 2013 Modified Files: src/tests/lib/libpthread: Makefile Added Files: src/tests/lib/libpthread/dlopen: Makefile t_dlopen.c t_dso_pthread_create.c t_main_pthread_create.c src/tests/lib/libpthread/dlopen/dso: Makefile h_pthread_dlopen.c Log Message: new dlopen tests for libpthread from manu@ To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libpthread/Makefile cvs rdiff -u -r0 -r1.1 src/tests/lib/libpthread/dlopen/Makefile \ src/tests/lib/libpthread/dlopen/t_dlopen.c \ src/tests/lib/libpthread/dlopen/t_dso_pthread_create.c \ src/tests/lib/libpthread/dlopen/t_main_pthread_create.c cvs rdiff -u -r0 -r1.1 src/tests/lib/libpthread/dlopen/dso/Makefile \ src/tests/lib/libpthread/dlopen/dso/h_pthread_dlopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libpthread/Makefile diff -u src/tests/lib/libpthread/Makefile:1.8 src/tests/lib/libpthread/Makefile:1.9 --- src/tests/lib/libpthread/Makefile:1.8 Tue Sep 11 22:00:55 2012 +++ src/tests/lib/libpthread/Makefile Thu Mar 21 12:50:21 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2012/09/12 02:00:55 manu Exp $ +# $NetBSD: Makefile,v 1.9 2013/03/21 16:50:21 christos Exp $ NOMAN= # defined @@ -48,4 +48,6 @@ PROGS+= h_resolv FILESDIR= ${TESTSDIR} FILES= d_mach +SUBDIR= dlopen + .include bsd.test.mk Added files: Index: src/tests/lib/libpthread/dlopen/Makefile diff -u /dev/null src/tests/lib/libpthread/dlopen/Makefile:1.1 --- /dev/null Thu Mar 21 12:50:22 2013 +++ src/tests/lib/libpthread/dlopen/Makefile Thu Mar 21 12:50:21 2013 @@ -0,0 +1,22 @@ +# $NetBSD: Makefile,v 1.1 2013/03/21 16:50:21 christos Exp $ + +NOMAN= # defined + +.include bsd.own.mk + +TESTSDIR= ${TESTSBASE}/lib/libpthread/dlopen +CPPFLAGS+= -DTESTDIR=\${TESTSDIR:Q}/\ +RPATH=-Wl,-rpath=${TESTDIR} + +LDADD+=${RPATH} + +.if (${MKPIC:Uno} != no) +SUBDIR+= dso +TESTS_C+= t_dlopen +TESTS_C+= t_main_pthread_create +LDADD.t_main_pthread_create+=-lpthread +PDADD.t_main_pthread_create+=${LIBPTHREAD} +TESTS_C+= t_dso_pthread_create +.endif + +.include bsd.test.mk Index: src/tests/lib/libpthread/dlopen/t_dlopen.c diff -u /dev/null src/tests/lib/libpthread/dlopen/t_dlopen.c:1.1 --- /dev/null Thu Mar 21 12:50:22 2013 +++ src/tests/lib/libpthread/dlopen/t_dlopen.c Thu Mar 21 12:50:21 2013 @@ -0,0 +1,171 @@ +/* $NetBSD: t_dlopen.c,v 1.1 2013/03/21 16:50:21 christos Exp $ */ +/*- + * Copyright (c) 2013 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Emmanuel Dreyfus + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in + *the documentation and/or other materials provided with the + *distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include sys/cdefs.h +__RCSID($NetBSD: t_dlopen.c,v 1.1 2013/03/21 16:50:21 christos Exp $); + +#include atf-c.h +#include dlfcn.h +#include pthread.h +#include unistd.h + +ATF_TC(dlopen); + +ATF_TC_HEAD(dlopen, tc) +{ + atf_tc_set_md_var(tc, descr, + Test if dlopen can load -lpthread DSO); +} + +#define DSO TESTDIR /h_pthread_dlopen.so + +ATF_TC_BODY(dlopen, tc) +{ + void *handle; + int (*testf_dso_null)(void); + handle = dlopen(DSO, RTLD_NOW | RTLD_LOCAL); + ATF_REQUIRE_MSG(handle != NULL, dlopen fails: %s, dlerror()); + + testf_dso_null = dlsym(handle, testf_dso_null); + ATF_REQUIRE_MSG(testf_dso_null != NULL, dlsym fails: %s, dlerror()); + + ATF_REQUIRE(testf_dso_null() == 0xcafe); + + ATF_REQUIRE(dlclose(handle) == 0); +} + +ATF_TC(dlopen_mutex); + +ATF_TC_HEAD(dlopen_mutex, tc) +{ + atf_tc_set_md_var(tc, descr, + Test if dlopen can load -lpthread DSO
CVS commit: src/distrib/sets/lists
Module Name:src Committed By: christos Date: Thu Mar 21 16:51:07 UTC 2013 Modified Files: src/distrib/sets/lists/debug: mi src/distrib/sets/lists/tests: mi Log Message: new dlopen tests for libpthread. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.529 -r1.530 src/distrib/sets/lists/tests/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.15 src/distrib/sets/lists/debug/mi:1.16 --- src/distrib/sets/lists/debug/mi:1.15 Tue Mar 12 11:17:58 2013 +++ src/distrib/sets/lists/debug/mi Thu Mar 21 12:51:07 2013 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.15 2013/03/12 15:17:58 njoly Exp $ +# $NetBSD: mi,v 1.16 2013/03/21 16:51:07 christos Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/libdata/debug/bin/cat.debug comp-util-debug debug ./usr/libdata/debug/bin/chio.debug comp-util-debug debug @@ -1746,6 +1746,11 @@ ./usr/libdata/debug/usr/tests/lib/libposix/posix2/t_rename.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libppath/t_ppath.debug tests-lib-debug debug,atf ./usr/libdata/debug/usr/tests/lib/libprop/t_basic.debug tests-lib-debug debug,atf +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/h_pthread_dlopen.so.1.debug tests-lib-debug debug,atf +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_dso_pthread_create.debug tests-lib-debug debug,atf +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_dlopen.debug tests-lib-debug debug,atf +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen/t_main_pthread_create.debug tests-lib-debug debug,atf + ./usr/libdata/debug/usr/tests/lib/libpthread/h_atexit.debug tests-lib-tests debug,atf ./usr/libdata/debug/usr/tests/lib/libpthread/h_cancel.debug tests-lib-tests debug,atf ./usr/libdata/debug/usr/tests/lib/libpthread/h_exit.debug tests-lib-tests debug,atf Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.529 src/distrib/sets/lists/tests/mi:1.530 --- src/distrib/sets/lists/tests/mi:1.529 Fri Mar 8 12:02:29 2013 +++ src/distrib/sets/lists/tests/mi Thu Mar 21 12:51:07 2013 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.529 2013/03/08 17:02:29 martin Exp $ +# $NetBSD: mi,v 1.530 2013/03/21 16:51:07 christos Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -123,6 +123,7 @@ ./usr/libdata/debug/usr/tests/lib/libppathtests-lib-debug ./usr/libdata/debug/usr/tests/lib/libproptests-lib-debug ./usr/libdata/debug/usr/tests/lib/libpthreadtests-lib-debug +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen tests-lib-debug ./usr/libdata/debug/usr/tests/lib/librt tests-lib-debug ./usr/libdata/debug/usr/tests/lib/librumpclient tests-lib-debug ./usr/libdata/debug/usr/tests/lib/librumphijack tests-lib-debug @@ -2393,6 +2394,13 @@ ./usr/tests/lib/libprop/Kyuafile tests-lib-tests atf,kyua ./usr/tests/lib/libprop/t_basic tests-lib-tests atf ./usr/tests/lib/libpthread tests-lib-tests +./usr/tests/lib/libpthread/dlopen tests-lib-tests +./usr/tests/lib/libpthread/dlopen/Atffile tests-lib-tests atf +./usr/tests/lib/libpthread/dlopen/h_pthread_dlopen.so tests-lib-tests atf +./usr/tests/lib/libpthread/dlopen/h_pthread_dlopen.so.1 tests-lib-tests atf +./usr/tests/lib/libpthread/dlopen/t_dlopen tests-lib-tests atf +./usr/tests/lib/libpthread/dlopen/t_dso_pthread_create tests-lib-tests atf +./usr/tests/lib/libpthread/dlopen/t_main_pthread_create tests-lib-tests atf ./usr/tests/lib/libpthread/Atffile tests-lib-tests atf ./usr/tests/lib/libpthread/Kyuafile tests-lib-tests atf,kyua ./usr/tests/lib/libpthread/d_mach tests-lib-tests atf
CVS commit: src/sys/net80211
Module Name:src Committed By: christos Date: Thu Mar 21 17:10:25 UTC 2013 Modified Files: src/sys/net80211: _ieee80211.h Log Message: Don't attempt to dereference ANYC (since it is a pointer to 0x1). Fixes random crashes in hostap mode (race conditions in the interrupt handler while the interface comes up or down). To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/net80211/_ieee80211.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net80211/_ieee80211.h diff -u src/sys/net80211/_ieee80211.h:1.8 src/sys/net80211/_ieee80211.h:1.9 --- src/sys/net80211/_ieee80211.h:1.8 Sat Jan 10 07:53:45 2009 +++ src/sys/net80211/_ieee80211.h Thu Mar 21 13:10:25 2013 @@ -151,43 +151,35 @@ struct ieee80211_channel { #define IEEE80211_CHAN_ALLTURBO \ (IEEE80211_CHAN_ALL | IEEE80211_CHAN_TURBO) -#define IEEE80211_IS_CHAN_FHSS(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) -#define IEEE80211_IS_CHAN_A(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_A) == IEEE80211_CHAN_A) -#define IEEE80211_IS_CHAN_B(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_B) == IEEE80211_CHAN_B) -#define IEEE80211_IS_CHAN_PUREG(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) -#define IEEE80211_IS_CHAN_G(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_G) == IEEE80211_CHAN_G) -#define IEEE80211_IS_CHAN_ANYG(_c) \ - (IEEE80211_IS_CHAN_PUREG(_c) || IEEE80211_IS_CHAN_G(_c)) -#define IEEE80211_IS_CHAN_T(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_T) == IEEE80211_CHAN_T) -#define IEEE80211_IS_CHAN_108G(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_108G) == IEEE80211_CHAN_108G) - -#define IEEE80211_IS_CHAN_2GHZ(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_2GHZ) != 0) -#define IEEE80211_IS_CHAN_5GHZ(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_5GHZ) != 0) -#define IEEE80211_IS_CHAN_OFDM(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_OFDM) != 0) -#define IEEE80211_IS_CHAN_CCK(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_CCK) != 0) -#define IEEE80211_IS_CHAN_GFSK(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_GFSK) != 0) -#define IEEE80211_IS_CHAN_HALF(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_HALF) != 0) -#define IEEE80211_IS_CHAN_QUARTER(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_QUARTER) != 0) +#define IEEE80211_IS_CHAN_ANYC(_c) \ + ((_c) == IEEE80211_CHAN_ANYC) + +#define _IEEE80211_IS_CHAN(_c, _ch) \ + (!IEEE80211_IS_CHAN_ANYC(_c) \ + ((_c)-ic_flags IEEE80211_CHAN_ ## _ch) == IEEE80211_CHAN_ ## _ch) + +#define IEEE80211_IS_CHAN_FHSS(_c) _IEEE80211_IS_CHAN(_c, FHSS) +#define IEEE80211_IS_CHAN_A(_c) _IEEE80211_IS_CHAN(_c, A) +#define IEEE80211_IS_CHAN_B(_c) _IEEE80211_IS_CHAN(_c, B) +#define IEEE80211_IS_CHAN_PUREG(_c) _IEEE80211_IS_CHAN(_c, PUREG) +#define IEEE80211_IS_CHAN_G(_c) _IEEE80211_IS_CHAN(_c, G) +#define IEEE80211_IS_CHAN_ANYG(_c) _IEEE80211_IS_CHAN(_c, ANYG) +#define IEEE80211_IS_CHAN_T(_c) _IEEE80211_IS_CHAN(_c, T) +#define IEEE80211_IS_CHAN_108G(_c) _IEEE80211_IS_CHAN(_c, 108G) + +#define IEEE80211_IS_CHAN_2GHZ(_c) _IEEE80211_IS_CHAN(_c, 2GHZ) +#define IEEE80211_IS_CHAN_5GHZ(_c) _IEEE80211_IS_CHAN(_c, 5GHZ) +#define IEEE80211_IS_CHAN_OFDM(_c) _IEEE80211_IS_CHAN(_c, OFDM) +#define IEEE80211_IS_CHAN_CCK(_c) _IEEE80211_IS_CHAN(_c, CCK) +#define IEEE80211_IS_CHAN_GFSK(_c) _IEEE80211_IS_CHAN(_c, GFSK) +#define IEEE80211_IS_CHAN_HALF(_c) _IEEE80211_IS_CHAN(_c, HALF) +#define IEEE80211_IS_CHAN_QUARTER(_c) _IEEE80211_IS_CHAN(_c, QUARTER) #define IEEE80211_IS_CHAN_FULL(_c) \ - (((_c)-ic_flags (IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HALF)) == 0) -#define IEEE80211_IS_CHAN_GSM(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_GSM) != 0) -#define IEEE80211_IS_CHAN_PASSIVE(_c) \ - (((_c)-ic_flags IEEE80211_CHAN_PASSIVE) != 0) + (!IEEE80211_IS_CHAN_ANYC(_c) \ + ((_c)-ic_flags (IEEE80211_CHAN_QUARTER | IEEE80211_CHAN_HALF)) == 0) + +#define IEEE80211_IS_CHAN_GSM(_c) _IEEE80211_IS_CHAN(_c, GSM) +#define IEEE80211_IS_CHAN_PASSIVE(_c) _IEEE80211_IS_CHAN(_c, PASSIVE) /* ni_chan encoding for FH phy */
CVS commit: src/etc
Module Name:src Committed By: christos Date: Thu Mar 21 17:45:05 UTC 2013 Modified Files: src/etc: services Log Message: PR/47678: Dr. Wolfgang Stukenbrock: remove local iscsi entry which conflicted with the iana assigned one. This port has been assigned to iscsi-target. To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/etc/services Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/services diff -u src/etc/services:1.96 src/etc/services:1.97 --- src/etc/services:1.96 Thu Feb 21 22:42:06 2013 +++ src/etc/services Thu Mar 21 13:45:03 2013 @@ -1,4 +1,4 @@ -# $NetBSD: services,v 1.96 2013/02/22 03:42:06 christos Exp $ +# $NetBSD: services,v 1.97 2013/03/21 17:45:03 christos Exp $ # See also: services(5), http://www.sethwklein.net/projects/iana-etc/ # # Last Updated @@ -19764,7 +19764,6 @@ nfsd 2049/tcp # Sun NFS eklogin 2105/tcp # Kerberos encrypted `rlogin' zephyr-hm-srv 2105/udp # Zephyr hm-serv connection ekshell2 2106/tcp # Encrypted kshell - UColorado, Boulder -iscsi 3260/tcp fud 4201/udp # Cyrus IMAP finger-like service X11 6000/tcp # X Window System ircd 6667/tcp # Often used IRC port (also see 194)
CVS commit: src/sys/net80211
Module Name:src Committed By: christos Date: Thu Mar 21 18:30:09 UTC 2013 Modified Files: src/sys/net80211: _ieee80211.h ieee80211.c Log Message: Instead of always checking for ANYC, make it a valid channel To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/net80211/_ieee80211.h cvs rdiff -u -r1.53 -r1.54 src/sys/net80211/ieee80211.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net80211/_ieee80211.h diff -u src/sys/net80211/_ieee80211.h:1.9 src/sys/net80211/_ieee80211.h:1.10 --- src/sys/net80211/_ieee80211.h:1.9 Thu Mar 21 13:10:25 2013 +++ src/sys/net80211/_ieee80211.h Thu Mar 21 14:30:09 2013 @@ -107,11 +107,12 @@ struct ieee80211_channel { u_int16_t ic_flags; /* see below */ }; +extern const struct ieee80211_channel ieee80211_channel_anyc; + #define IEEE80211_CHAN_MAX 255 #define IEEE80211_CHAN_BYTES 32 /* howmany(IEEE80211_CHAN_MAX, NBBY) */ #define IEEE80211_CHAN_ANY 0x /* token for ``any channel'' */ -#define IEEE80211_CHAN_ANYC \ - ((struct ieee80211_channel *) 0x1) +#define IEEE80211_CHAN_ANYC (__UNCONST(ieee80211_channel_anyc)) /* bits 0-3 are for private use by drivers */ /* channel attributes */ @@ -155,8 +156,7 @@ struct ieee80211_channel { ((_c) == IEEE80211_CHAN_ANYC) #define _IEEE80211_IS_CHAN(_c, _ch) \ - (!IEEE80211_IS_CHAN_ANYC(_c) \ - ((_c)-ic_flags IEEE80211_CHAN_ ## _ch) == IEEE80211_CHAN_ ## _ch) + (((_c)-ic_flags IEEE80211_CHAN_ ## _ch) == IEEE80211_CHAN_ ## _ch) #define IEEE80211_IS_CHAN_FHSS(_c) _IEEE80211_IS_CHAN(_c, FHSS) #define IEEE80211_IS_CHAN_A(_c) _IEEE80211_IS_CHAN(_c, A) Index: src/sys/net80211/ieee80211.c diff -u src/sys/net80211/ieee80211.c:1.53 src/sys/net80211/ieee80211.c:1.54 --- src/sys/net80211/ieee80211.c:1.53 Mon Apr 5 03:22:24 2010 +++ src/sys/net80211/ieee80211.c Thu Mar 21 14:30:09 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211.c,v 1.53 2010/04/05 07:22:24 joerg Exp $ */ +/* $NetBSD: ieee80211.c,v 1.54 2013/03/21 18:30:09 christos Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -36,7 +36,7 @@ __FBSDID($FreeBSD: src/sys/net80211/ieee80211.c,v 1.22 2005/08/10 16:22:29 sam Exp $); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, $NetBSD: ieee80211.c,v 1.53 2010/04/05 07:22:24 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: ieee80211.c,v 1.54 2013/03/21 18:30:09 christos Exp $); #endif /* @@ -73,6 +73,10 @@ __KERNEL_RCSID(0, $NetBSD: ieee80211.c, #include net/if_ether.h #endif +const struct ieee80211_channel ieee80211_channel_anyc = { + 0, 0 +}; + struct ieee80211com_head ieee80211com_head = LIST_HEAD_INITIALIZER(ieee80211com_head);
CVS commit: src/etc/mtree
Module Name:src Committed By: christos Date: Thu Mar 21 19:17:53 UTC 2013 Modified Files: src/etc/mtree: NetBSD.dist.tests Log Message: new test directories To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/etc/mtree/NetBSD.dist.tests Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist.tests diff -u src/etc/mtree/NetBSD.dist.tests:1.95 src/etc/mtree/NetBSD.dist.tests:1.96 --- src/etc/mtree/NetBSD.dist.tests:1.95 Sun Feb 24 19:31:51 2013 +++ src/etc/mtree/NetBSD.dist.tests Thu Mar 21 15:17:51 2013 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.tests,v 1.95 2013/02/25 00:31:51 jmmv Exp $ +# $NetBSD: NetBSD.dist.tests,v 1.96 2013/03/21 19:17:51 christos Exp $ ./usr/libdata/debug/usr/tests ./usr/libdata/debug/usr/tests/atf @@ -110,6 +110,7 @@ ./usr/libdata/debug/usr/tests/lib/libppath ./usr/libdata/debug/usr/tests/lib/libprop ./usr/libdata/debug/usr/tests/lib/libpthread +./usr/libdata/debug/usr/tests/lib/libpthread/dlopen ./usr/libdata/debug/usr/tests/lib/librt ./usr/libdata/debug/usr/tests/lib/librumpclient ./usr/libdata/debug/usr/tests/lib/librumphijack @@ -277,6 +278,7 @@ ./usr/tests/lib/libppath ./usr/tests/lib/libprop ./usr/tests/lib/libpthread +./usr/tests/lib/libpthread/dlopen ./usr/tests/lib/librt ./usr/tests/lib/librumpclient ./usr/tests/lib/librumphijack
CVS commit: src/sys/sys
Module Name:src Committed By: plunky Date: Thu Mar 21 20:05:57 UTC 2013 Modified Files: src/sys/sys: param.h Log Message: Bump minor number for removal of kauth_access_action(), as per http://mail-index.netbsd.org/source-changes/2013/03/18/msg042340.html Welcome to 6.99.18 To generate a diff of this commit: cvs rdiff -u -r1.426 -r1.427 src/sys/sys/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/sys/param.h diff -u src/sys/sys/param.h:1.426 src/sys/sys/param.h:1.427 --- src/sys/sys/param.h:1.426 Mon Mar 18 13:36:23 2013 +++ src/sys/sys/param.h Thu Mar 21 20:05:56 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.426 2013/03/18 13:36:23 para Exp $ */ +/* $NetBSD: param.h,v 1.427 2013/03/21 20:05:56 plunky Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -63,7 +63,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 699001700 /* NetBSD 6.99.17 */ +#define __NetBSD_Version__ 699001800 /* NetBSD 6.99.18 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) = __NetBSD_Version__)
CVS commit: src/sys/dev/rasops
Module Name:src Committed By: martin Date: Thu Mar 21 21:00:12 UTC 2013 Modified Files: src/sys/dev/rasops: rasops32.c rasops8.c Log Message: Add syntatic sugar to avoid hurting my eyes To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/rasops/rasops32.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/rasops/rasops8.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/rasops/rasops32.c diff -u src/sys/dev/rasops/rasops32.c:1.25 src/sys/dev/rasops/rasops32.c:1.26 --- src/sys/dev/rasops/rasops32.c:1.25 Tue Oct 23 15:12:59 2012 +++ src/sys/dev/rasops/rasops32.c Thu Mar 21 21:00:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rasops32.c,v 1.25 2012/10/23 15:12:59 macallan Exp $ */ +/* $NetBSD: rasops32.c,v 1.26 2013/03/21 21:00:12 martin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rasops32.c,v 1.25 2012/10/23 15:12:59 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: rasops32.c,v 1.26 2013/03/21 21:00:12 martin Exp $); #include opt_rasops.h @@ -61,9 +61,9 @@ rasops32_init(struct rasops_info *ri) ri-ri_bpos = 16; } - if (FONT_IS_ALPHA(ri-ri_font)) { - ri-ri_ops.putchar = rasops32_putchar_aa; - } else +// if (FONT_IS_ALPHA(ri-ri_font)) { +// ri-ri_ops.putchar = rasops32_putchar_aa; +// } else ri-ri_ops.putchar = rasops32_putchar; } Index: src/sys/dev/rasops/rasops8.c diff -u src/sys/dev/rasops/rasops8.c:1.32 src/sys/dev/rasops/rasops8.c:1.33 --- src/sys/dev/rasops/rasops8.c:1.32 Wed Jan 25 20:18:04 2012 +++ src/sys/dev/rasops/rasops8.c Thu Mar 21 21:00:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rasops8.c,v 1.32 2012/01/25 20:18:04 macallan Exp $ */ +/* $NetBSD: rasops8.c,v 1.33 2013/03/21 21:00:12 martin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rasops8.c,v 1.32 2012/01/25 20:18:04 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: rasops8.c,v 1.33 2013/03/21 21:00:12 martin Exp $); #include opt_rasops.h @@ -76,7 +76,7 @@ void rasops8_init(struct rasops_info *ri) { - if FONT_IS_ALPHA(ri-ri_font) { + if (FONT_IS_ALPHA(ri-ri_font)) { ri-ri_ops.putchar = rasops8_putchar_aa; } else { switch (ri-ri_font-fontwidth) {
CVS commit: src/sys/dev/rasops
Module Name:src Committed By: martin Date: Thu Mar 21 21:01:10 UTC 2013 Modified Files: src/sys/dev/rasops: rasops32.c Log Message: Ooops, backout local change not intended to be commited with the last change To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/rasops/rasops32.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/rasops/rasops32.c diff -u src/sys/dev/rasops/rasops32.c:1.26 src/sys/dev/rasops/rasops32.c:1.27 --- src/sys/dev/rasops/rasops32.c:1.26 Thu Mar 21 21:00:12 2013 +++ src/sys/dev/rasops/rasops32.c Thu Mar 21 21:01:10 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: rasops32.c,v 1.26 2013/03/21 21:00:12 martin Exp $ */ +/* $NetBSD: rasops32.c,v 1.27 2013/03/21 21:01:10 martin Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rasops32.c,v 1.26 2013/03/21 21:00:12 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: rasops32.c,v 1.27 2013/03/21 21:01:10 martin Exp $); #include opt_rasops.h @@ -61,9 +61,9 @@ rasops32_init(struct rasops_info *ri) ri-ri_bpos = 16; } -// if (FONT_IS_ALPHA(ri-ri_font)) { -// ri-ri_ops.putchar = rasops32_putchar_aa; -// } else + if (FONT_IS_ALPHA(ri-ri_font)) { + ri-ri_ops.putchar = rasops32_putchar_aa; + } else ri-ri_ops.putchar = rasops32_putchar; }
CVS commit: src/external/bsd/mdocml/dist
Module Name:src Committed By: christos Date: Thu Mar 21 21:42:16 UTC 2013 Modified Files: src/external/bsd/mdocml/dist: libmandoc.h read.c roff.c Log Message: support expanding numbered registers To generate a diff of this commit: cvs rdiff -u -r1.1.1.9 -r1.2 src/external/bsd/mdocml/dist/libmandoc.h cvs rdiff -u -r1.6 -r1.7 src/external/bsd/mdocml/dist/read.c cvs rdiff -u -r1.7 -r1.8 src/external/bsd/mdocml/dist/roff.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/mdocml/dist/libmandoc.h diff -u src/external/bsd/mdocml/dist/libmandoc.h:1.1.1.9 src/external/bsd/mdocml/dist/libmandoc.h:1.2 --- src/external/bsd/mdocml/dist/libmandoc.h:1.1.1.9 Mon Jan 30 11:44:17 2012 +++ src/external/bsd/mdocml/dist/libmandoc.h Thu Mar 21 17:42:16 2013 @@ -73,6 +73,7 @@ void roff_reset(struct roff *); enum rofferr roff_parseln(struct roff *, int, char **, size_t *, int, int *); void roff_endparse(struct roff *); +size_t roff_expand_nr(struct roff *, const char *, char *, size_t); int roff_regisset(const struct roff *, enum regs); unsigned int roff_regget(const struct roff *, enum regs); void roff_regunset(struct roff *, enum regs); Index: src/external/bsd/mdocml/dist/read.c diff -u src/external/bsd/mdocml/dist/read.c:1.6 src/external/bsd/mdocml/dist/read.c:1.7 --- src/external/bsd/mdocml/dist/read.c:1.6 Thu Feb 16 15:58:23 2012 +++ src/external/bsd/mdocml/dist/read.c Thu Mar 21 17:42:16 2013 @@ -353,6 +353,22 @@ mparse_buf_r(struct mparse *curp, struct continue; } + if ('\\' == blk.buf[i] 'n' == blk.buf[i + 1]) { +int j, k; +i += 2; +if ('(' == blk.buf[i]) /* ) */ + i++; +resize_buf(ln, 256); +for (j = i, k = pos; i j + 256 + i (int)blk.sz + !isspace((unsigned char)blk.buf[i]);) +ln.buf[k++] = blk.buf[i++]; + +ln.buf[k] = '\0'; +pos += roff_expand_nr(curp-roff, +ln.buf + pos, ln.buf + pos, 256); + } + /* * Found escape and at least one other character. * When it's a newline character, skip it. Index: src/external/bsd/mdocml/dist/roff.c diff -u src/external/bsd/mdocml/dist/roff.c:1.7 src/external/bsd/mdocml/dist/roff.c:1.8 --- src/external/bsd/mdocml/dist/roff.c:1.7 Mon Jan 30 13:50:45 2012 +++ src/external/bsd/mdocml/dist/roff.c Thu Mar 21 17:42:16 2013 @@ -21,8 +21,10 @@ #include assert.h #include ctype.h +#include stdio.h #include stdlib.h #include string.h +#include stdint.h #include mandoc.h #include libroff.h @@ -117,6 +119,7 @@ struct roff { struct eqn_node *last_eqn; /* last equation parsed */ struct eqn_node *first_eqn; /* first equation parsed */ struct eqn_node *eqn; /* current equation being parsed */ + struct roff_nr *nr[64]; /* numbered register set */ }; struct roffnode { @@ -1234,21 +1237,70 @@ roff_regunset(struct roff *r, enum regs r-regs[(int)reg].set = 0; } +struct roff_nr { + char *str; + uint32_t hash; + intmax_t val; + struct roff_nr *next; +}; + +static uint32_t +hash_str(const char *str) +{ + const uint8_t *s = (const uint8_t *)str; + uint8_t c; + uint32_t hv = 0; + while ((c = *s++) != '\0') + hv = hv * 33 + c; /* perl: k=33, r=r+r/32 */ + return hv + (hv 5); +} + +static struct roff_nr * +hash_find(struct roff *r, const char *str, uint32_t *h) +{ + struct roff_nr *e; + *h = hash_str(str) % __arraycount(r-nr); + + for (e = r-nr[*h]; e; e = e-next) + if (e-hash == *h strcmp(e-str, str) == 0) + return e; + return NULL; +} + +static struct roff_nr * +hash_insert(struct roff *r, const char *str, uint32_t h) +{ + struct roff_nr *e; + + e = mandoc_malloc(sizeof(*e)); + e-str = mandoc_strdup(str); + e-hash = h; + e-next = r-nr[h]; + r-nr[h] = e; + return e; +} + /* ARGSUSED */ static enum rofferr roff_nr(ROFF_ARGS) { const char *key; char *val; - int iv; + uint32_t hv; + struct roff_nr *h; val = *bufp + pos; key = roff_getname(r, val, ln, pos); + if ((h = hash_find(r, key, hv)) == NULL) + h = hash_insert(r, key, hv); + + h-val = mandoc_strntoi(val, strlen(val), 10); + if (0 == strcmp(key, nS)) { r-regs[(int)REG_nS].set = 1; - if ((iv = mandoc_strntoi(val, strlen(val), 10)) = 0) - r-regs[(int)REG_nS].u = (unsigned)iv; + if (h-val = 0) + r-regs[(int)REG_nS].u = (unsigned)h-val; else r-regs[(int)REG_nS].u = 0u; } @@ -1256,6 +1308,19 @@ roff_nr(ROFF_ARGS) return(ROFF_IGN); } +size_t +roff_expand_nr(struct roff *r, const char *key, char *lp, size_t lpl) +{ + uint32_t hv; + struct roff_nr *h; + + if ((h = hash_find(r, key, hv)) == NULL) + return 0; + + /* XXX: support .af */ + return snprintf(lp, lpl, %jd, h-val); +} + /* ARGSUSED */ static enum rofferr roff_rm(ROFF_ARGS)
CVS commit: src/external/bsd/top/bin
Module Name:src Committed By: christos Date: Thu Mar 21 21:43:23 UTC 2013 Modified Files: src/external/bsd/top/bin: Makefile Log Message: mandoc can now print numbered registers. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/bsd/top/bin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/top/bin/Makefile diff -u src/external/bsd/top/bin/Makefile:1.8 src/external/bsd/top/bin/Makefile:1.9 --- src/external/bsd/top/bin/Makefile:1.8 Wed Mar 20 22:04:05 2013 +++ src/external/bsd/top/bin/Makefile Thu Mar 21 17:43:22 2013 @@ -1,10 +1,9 @@ -# $NetBSD: Makefile,v 1.8 2013/03/21 02:04:05 christos Exp $ +# $NetBSD: Makefile,v 1.9 2013/03/21 21:43:22 christos Exp $ .include bsd.own.mk PROG= top BINDIR= /usr/bin -NOMANDOC= yes TOPDIR=${.CURDIR}/../dist .PATH: ${TOPDIR} ${TOPDIR}/machine
CVS commit: src/doc
Module Name:src Committed By: wiz Date: Thu Mar 21 23:06:42 UTC 2013 Modified Files: src/doc: 3RDPARTY Log Message: file-5.14 out. To generate a diff of this commit: cvs rdiff -u -r1.1012 -r1.1013 src/doc/3RDPARTY Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1012 src/doc/3RDPARTY:1.1013 --- src/doc/3RDPARTY:1.1012 Sat Mar 16 01:00:16 2013 +++ src/doc/3RDPARTY Thu Mar 21 23:06:42 2013 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1012 2013/03/16 01:00:16 christos Exp $ +# $NetBSD: 3RDPARTY,v 1.1013 2013/03/21 23:06:42 wiz Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -341,7 +341,7 @@ Please use expat as the vendor tag for Package: file Version: 5.12 -Current Vers: 5.12 +Current Vers: 5.14 Maintainer: Christos Zoulas chris...@zoulas.com Archive Site: ftp://ftp.astron.com/pub/file/ Home Page: http://www.darwinsys.com/file/
CVS commit: src/external/bsd/mdocml/dist
Module Name:src Committed By: christos Date: Fri Mar 22 01:24:47 UTC 2013 Modified Files: src/external/bsd/mdocml/dist: libmandoc.h read.c roff.c Log Message: move the code to expand variables in one place and use it to expand variables inside conditionals. still conditionals with variables don't work. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/mdocml/dist/libmandoc.h cvs rdiff -u -r1.7 -r1.8 src/external/bsd/mdocml/dist/read.c cvs rdiff -u -r1.8 -r1.9 src/external/bsd/mdocml/dist/roff.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/mdocml/dist/libmandoc.h diff -u src/external/bsd/mdocml/dist/libmandoc.h:1.2 src/external/bsd/mdocml/dist/libmandoc.h:1.3 --- src/external/bsd/mdocml/dist/libmandoc.h:1.2 Thu Mar 21 17:42:16 2013 +++ src/external/bsd/mdocml/dist/libmandoc.h Thu Mar 21 21:24:46 2013 @@ -73,7 +73,8 @@ void roff_reset(struct roff *); enum rofferr roff_parseln(struct roff *, int, char **, size_t *, int, int *); void roff_endparse(struct roff *); -size_t roff_expand_nr(struct roff *, const char *, char *, size_t); +void roff_expand_nr(struct roff *, const char *, int *, size_t, + char **, int *, size_t *); int roff_regisset(const struct roff *, enum regs); unsigned int roff_regget(const struct roff *, enum regs); void roff_regunset(struct roff *, enum regs); Index: src/external/bsd/mdocml/dist/read.c diff -u src/external/bsd/mdocml/dist/read.c:1.7 src/external/bsd/mdocml/dist/read.c:1.8 --- src/external/bsd/mdocml/dist/read.c:1.7 Thu Mar 21 17:42:16 2013 +++ src/external/bsd/mdocml/dist/read.c Thu Mar 21 21:24:46 2013 @@ -354,19 +354,8 @@ mparse_buf_r(struct mparse *curp, struct } if ('\\' == blk.buf[i] 'n' == blk.buf[i + 1]) { -int j, k; -i += 2; -if ('(' == blk.buf[i]) /* ) */ - i++; -resize_buf(ln, 256); -for (j = i, k = pos; i j + 256 - i (int)blk.sz - !isspace((unsigned char)blk.buf[i]);) -ln.buf[k++] = blk.buf[i++]; - -ln.buf[k] = '\0'; -pos += roff_expand_nr(curp-roff, -ln.buf + pos, ln.buf + pos, 256); +roff_expand_nr(curp-roff, +blk.buf, i, blk.sz, ln.buf, pos, ln.sz); } /* Index: src/external/bsd/mdocml/dist/roff.c diff -u src/external/bsd/mdocml/dist/roff.c:1.8 src/external/bsd/mdocml/dist/roff.c:1.9 --- src/external/bsd/mdocml/dist/roff.c:1.8 Thu Mar 21 17:42:16 2013 +++ src/external/bsd/mdocml/dist/roff.c Thu Mar 21 21:24:46 2013 @@ -177,6 +177,8 @@ static enum rofferr roff_cond(ROFF_ARGS static enum rofferr roff_cond_text(ROFF_ARGS); static enum rofferr roff_cond_sub(ROFF_ARGS); static enum rofferr roff_ds(ROFF_ARGS); +static void roff_expand_nr_inplace(struct roff *, char **, int *, +size_t *); static enum roffrule roff_evalcond(const char *, int *); static void roff_free1(struct roff *); static void roff_freestr(struct roffkv *); @@ -1053,6 +1055,12 @@ roff_cond_text(ROFF_ARGS) ep = (*bufp)[pos]; for ( ; NULL != (ep = strchr(ep, '\\')); ep++) { ep++; + if (*ep == 'n') { + int i = ep - *bufp - 1; + roff_expand_nr_inplace(r, bufp, i, szp); + ep = *bufp + i; + continue; + } if ('}' != *ep) continue; *ep = ''; @@ -1308,17 +1316,76 @@ roff_nr(ROFF_ARGS) return(ROFF_IGN); } -size_t -roff_expand_nr(struct roff *r, const char *key, char *lp, size_t lpl) +void +roff_expand_nr(struct roff *r, const char *src, int *sp, size_t slen, +char **dst, int *dp, size_t *dlenp) { uint32_t hv; struct roff_nr *h; + int l, s, d; + char e, *key; - if ((h = hash_find(r, key, hv)) == NULL) - return 0; + s = *sp + 2; /* skip \\\n */ + d = *dp; + + if ('[' == src[s]) { /* XXX: Support builtins */ + s++; + e = ']'; + } else + e = '\0'; + + for (l = s; l (int)slen; l++) { + if (e) { + if (src[l] == e) +break; + } else { + if (isspace((unsigned char)src[l])) +break; + } + } + *sp = l; + l -= s; + key = mandoc_malloc(l + 1); + memcpy(key, src + s, l); + key[l] = '\0'; + + if ((h = hash_find(r, key, hv)) == NULL) { + free(key); + return; + } + if (*dst == NULL || *dlenp - *dp 256) + *dst = mandoc_realloc(*dst, *dlenp += 256); /* XXX: support .af */ - return snprintf(lp, lpl, %jd, h-val); + *dp += snprintf(*dst + *dp, *dlenp - *dp, %jd, h-val); +} + +static void +roff_expand_nr_inplace(struct roff *r, char **src, int *sp, size_t *slenp) +{ + int j, i, k; + size_t dlen; + char *dst; + + k = i = *sp; + + dst = NULL; + j = 0; + dlen = 0; + + roff_expand_nr(r, *src, i, *slenp, dst, j, dlen); + + if (j) { + int l = j - (i - k); + if (l 0) { + *slenp += l; + *src = mandoc_realloc(*src, *slenp); + } + memmove(*src + j + k, *src + i, *slenp - i); + memcpy(*src + k, dst, j); + free(dst); + } + *sp = k + j; } /* ARGSUSED */