CVS commit: src/external/bsd/libelf/lib
Module Name:src Committed By: martin Date: Thu Dec 27 08:06:28 UTC 2012 Modified Files: src/external/bsd/libelf/lib: Makefile Log Message: ia64 compiler bug workaround: reduce -O to 1 for one file To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libelf/lib/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/libelf/lib/Makefile diff -u src/external/bsd/libelf/lib/Makefile:1.2 src/external/bsd/libelf/lib/Makefile:1.3 --- src/external/bsd/libelf/lib/Makefile:1.2 Sat Dec 19 09:01:32 2009 +++ src/external/bsd/libelf/lib/Makefile Thu Dec 27 08:06:28 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2009/12/19 09:01:32 thorpej Exp $ +# $NetBSD: Makefile,v 1.3 2012/12/27 08:06:28 martin Exp $ .include bsd.init.mk @@ -49,6 +49,10 @@ LIBELF_GENSRCS= libelf_fsize.c libelf_ms CLEANFILES+= ${LIBELF_GENSRCS} CPPFLAGS+= -I${.CURDIR} +.if ${HAVE_GCC:U} == 45 ${MACHINE_CPU} == ia64 +COPTS.libelf_extended.c+= ${${ACTIVE_CC} == gcc :? -O1 :} +.endif + MAN= elf.3 \ elf_begin.3 \ elf_cntl.3 \
CVS commit: src/sys/arch/ia64/include
Module Name:src Committed By: martin Date: Thu Dec 27 08:22:36 UTC 2012 Modified Files: src/sys/arch/ia64/include: signal.h Log Message: Provide sig_atomic_t. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/include/signal.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/arch/ia64/include/signal.h diff -u src/sys/arch/ia64/include/signal.h:1.1 src/sys/arch/ia64/include/signal.h:1.2 --- src/sys/arch/ia64/include/signal.h:1.1 Fri Apr 7 14:21:18 2006 +++ src/sys/arch/ia64/include/signal.h Thu Dec 27 08:22:36 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: signal.h,v 1.1 2006/04/07 14:21:18 cherry Exp $ */ +/* $NetBSD: signal.h,v 1.2 2012/12/27 08:22:36 martin Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California. @@ -34,4 +34,6 @@ #ifndef _IA64_SIGNAL_H_ #define _IA64_SIGNAL_H_ +typedef long sig_atomic_t; + #endif /* !_IA64_SIGNAL_H_ */
CVS commit: src/lib/libc/arch/ia64/gen
Module Name:src Committed By: martin Date: Thu Dec 27 10:41:18 UTC 2012 Modified Files: src/lib/libc/arch/ia64/gen: Makefile.inc Log Message: Add fpclassify{,d} To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/ia64/gen/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/lib/libc/arch/ia64/gen/Makefile.inc diff -u src/lib/libc/arch/ia64/gen/Makefile.inc:1.4 src/lib/libc/arch/ia64/gen/Makefile.inc:1.5 --- src/lib/libc/arch/ia64/gen/Makefile.inc:1.4 Sat Sep 23 17:39:34 2006 +++ src/lib/libc/arch/ia64/gen/Makefile.inc Thu Dec 27 10:41:18 2012 @@ -1,7 +1,9 @@ -# $NetBSD: Makefile.inc,v 1.4 2006/09/23 17:39:34 cherry Exp $ +# $NetBSD: Makefile.inc,v 1.5 2012/12/27 10:41:18 martin Exp $ SRCS+= bswap16.c bswap32.c bswap64.c SRCS+= flt_rounds.c fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c SRCS+= isinff_ieee754.c isinfd_ieee754.c SRCS+= isnanf_ieee754.c isnand_ieee754.c +SRCS+= fpclassifyf_ieee754.c fpclassifyd_ieee754.c +
CVS commit: src/crypto/external/bsd/netpgp/lib/verify
Module Name:src Committed By: martin Date: Thu Dec 27 14:16:16 UTC 2012 Modified Files: src/crypto/external/bsd/netpgp/lib/verify: Makefile Log Message: Compile bignum.c with -O1 only on ia64 to avoid a gcc bug To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/netpgp/lib/verify/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/netpgp/lib/verify/Makefile diff -u src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.4 src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.5 --- src/crypto/external/bsd/netpgp/lib/verify/Makefile:1.4 Thu Nov 22 21:20:44 2012 +++ src/crypto/external/bsd/netpgp/lib/verify/Makefile Thu Dec 27 14:16:16 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2012/11/22 21:20:44 agc Exp $ +# $NetBSD: Makefile,v 1.5 2012/12/27 14:16:16 martin Exp $ LIB=netpgpverify SRCS=libverify.c b64.c pgpsum.c @@ -17,3 +17,8 @@ INCS=verify.h INCSDIR=/usr/include/netpgp .include bsd.lib.mk + +.if ${HAVE_GCC:U} == 45 ${MACHINE_CPU} == ia64 +COPTS.bignum.c+= ${${ACTIVE_CC} == gcc :? -O1 :} +.endif +
CVS commit: src/doc
Module Name:src Committed By: martin Date: Thu Dec 27 14:16:57 UTC 2012 Modified Files: src/doc: HACKS Log Message: Note another ia64 compiler workaround To generate a diff of this commit: cvs rdiff -u -r1.126 -r1.127 src/doc/HACKS Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/HACKS diff -u src/doc/HACKS:1.126 src/doc/HACKS:1.127 --- src/doc/HACKS:1.126 Thu Dec 27 08:07:36 2012 +++ src/doc/HACKS Thu Dec 27 14:16:57 2012 @@ -1,4 +1,4 @@ -# $NetBSD: HACKS,v 1.126 2012/12/27 08:07:36 martin Exp $ +# $NetBSD: HACKS,v 1.127 2012/12/27 14:16:57 martin Exp $ # # This file is intended to document workarounds for currently unsolved # (mostly) compiler bugs. @@ -767,3 +767,15 @@ port ia64 {standard input}:85: Warning: This is the location of the conflicting usage kcah + hack compiler error with gcc 4.5.x + cdate Thu Dec 27 15:15:25 CET 2012 + who martin + file src/crypto/external/bsd/netpgp/lib/verify/Makefile: 1.5 + descr + workaround for: + {standard input}: Assembler messages: + {standard input}:22979: Warning: Use of 'mov' may violate WAW dependency 'GR%, % in 1 - 127' (impliedf), specific resource number is 8 + {standard input}:22978: Warning: This is the location of the conflicting usage + kcah + +
CVS commit: src/sys/arch/i386/conf
Module Name:src Committed By: skrll Date: Thu Dec 27 14:39:39 UTC 2012 Modified Files: src/sys/arch/i386/conf: ALL Log Message: Add some usb devices. To generate a diff of this commit: cvs rdiff -u -r1.349 -r1.350 src/sys/arch/i386/conf/ALL 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/i386/conf/ALL diff -u src/sys/arch/i386/conf/ALL:1.349 src/sys/arch/i386/conf/ALL:1.350 --- src/sys/arch/i386/conf/ALL:1.349 Mon Dec 17 20:38:00 2012 +++ src/sys/arch/i386/conf/ALL Thu Dec 27 14:39:39 2012 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.349 2012/12/17 20:38:00 mbalmer Exp $ +# $NetBSD: ALL,v 1.350 2012/12/27 14:39:39 skrll Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ include arch/i386/conf/std.i386 options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident ALL-$Revision: 1.349 $ +#ident ALL-$Revision: 1.350 $ maxusers 64 # estimated number of users @@ -1210,6 +1210,10 @@ uhidev* at uhub? port ? configuration ? ums* at uhidev? reportid ? wsmouse* at ums? mux 0 +# USB Touchscreens +uts* at uhidev? reportid ? +wsmouse* at uts? mux 0 + # USB eGalax touch-panel uep* at uhub? port ? wsmouse* at uep? mux 0 @@ -1235,6 +1239,7 @@ uhid* at uhidev? reportid ? # USB LCDs and USB-VGA adaptors udl* at uhub? port ? # DisplayLink DL-1x0/1x5 +wsdisplay* at udl? # USB Printer ulpt* at uhub? port ? configuration ? interface ? @@ -1287,13 +1292,19 @@ atu* at uhub? port ? # Atmel AT76C50XX otus* at uhub? port ? # Atheros AR9001U ural* at uhub? port ? # Ralink Technology RT2500USB 802.11a/b/g rum* at uhub? port ? # Ralink Technology RT2501/RT2601 802.11a/b/g +run* at uhub? port ? # Ralink Technology RT(2[78]|30)00 802.11a/b/g/n upgt* at uhub? port ? # Intersil PrismGT +urtw* at uhub? port ? # Realtek RTL8187/RTL8187B 802.11b/g +urtwn* at uhub? port ? # Realtek RTL8188CU/RTL8192CU 802.11b/g/n zyd* at uhub? port ? # Zydas ZD1211 # Prolific PL2301/PL2302 host-to-host adapter upl* at uhub? port ? # Serial adapters +uark* at uhub? port ? # ArkMicroChips 3116 serial adapter +ucom* at uark? portno? + ubsa* at uhub? port ? # Belkin serial adapter ucom* at ubsa? portno ?
CVS commit: src/sys/sys
Module Name:src Committed By: christos Date: Thu Dec 27 14:41:10 UTC 2012 Modified Files: src/sys/sys: mbuf.h Log Message: - hit me with your parenthesis stick - remove extra void * To generate a diff of this commit: cvs rdiff -u -r1.149 -r1.150 src/sys/sys/mbuf.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/mbuf.h diff -u src/sys/sys/mbuf.h:1.149 src/sys/sys/mbuf.h:1.150 --- src/sys/sys/mbuf.h:1.149 Sun Apr 29 12:36:54 2012 +++ src/sys/sys/mbuf.h Thu Dec 27 09:41:10 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mbuf.h,v 1.149 2012/04/29 16:36:54 dsl Exp $ */ +/* $NetBSD: mbuf.h,v 1.150 2012/12/27 14:41:10 christos Exp $ */ /*- * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc. @@ -508,7 +508,7 @@ do { \ #define MEXTMALLOC(m, size, how) \ do { \ (m)-m_ext_storage.ext_buf = \ - (void *)malloc((size), mbtypes[(m)-m_type], (how)); \ + malloc((size), mbtypes[(m)-m_type], (how)); \ if ((m)-m_ext_storage.ext_buf != NULL) { \ MCLINITREFERENCE(m); \ (m)-m_data = (m)-m_ext.ext_buf; \ @@ -559,10 +559,10 @@ do { \ m_tag_delete_chain((m), NULL);\ (n) = (m)-m_next; \ if ((m)-m_flags M_EXT) { \ - m_ext_free(m); \ + m_ext_free((m)); \ } else { \ - KASSERT(m-m_type != MT_FREE);\ - m-m_type = MT_FREE; \ + KASSERT((m)-m_type != MT_FREE);\ + (m)-m_type = MT_FREE; \ pool_cache_put(mb_cache, (m));\ }\
CVS commit: src/sys/dev/usb
Module Name:src Committed By: christos Date: Thu Dec 27 14:47:27 UTC 2012 Modified Files: src/sys/dev/usb: if_otus.c Log Message: better patch (no functional change); centralize freeing in one place. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/if_otus.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/usb/if_otus.c diff -u src/sys/dev/usb/if_otus.c:1.15 src/sys/dev/usb/if_otus.c:1.16 --- src/sys/dev/usb/if_otus.c:1.15 Wed Dec 26 20:11:13 2012 +++ src/sys/dev/usb/if_otus.c Thu Dec 27 09:47:27 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: if_otus.c,v 1.15 2012/12/27 01:11:13 christos Exp $ */ +/* $NetBSD: if_otus.c,v 1.16 2012/12/27 14:47:27 christos Exp $ */ /* $OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $ */ /*- @@ -18,7 +18,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_otus.c,v 1.15 2012/12/27 01:11:13 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: if_otus.c,v 1.16 2012/12/27 14:47:27 christos Exp $); /*- * Driver for Atheros AR9001U chipset. * http://www.atheros.com/pt/bulletins/AR9001USBBulletin.pdf @@ -1788,10 +1788,9 @@ otus_tx(struct otus_softc *sc, struct mb if (wh-i_fc[1] IEEE80211_FC1_PROTECTED) { /* XXX: derived from upgt_tx_task() and ural_tx_data() */ k = ieee80211_crypto_encap(ic, ni, m); - if (k == NULL) { - m_freem(m); + if (k == NULL) return ENOBUFS; - } + wh = mtod(m, struct ieee80211_frame *); } @@ -1875,7 +1874,6 @@ otus_tx(struct otus_softc *sc, struct mb xferlen = sizeof(*head) + m-m_pkthdr.len; m_copydata(m, 0, m-m_pkthdr.len, (void *)head[1]); - m_freem(m); DPRINTFN(5, tx queued=%d len=%d mac=0x%04x phy=0x%08x rate=%d\n, sc-sc_tx_queued, head-len, head-macctl, head-phyctl, @@ -1886,7 +1884,6 @@ otus_tx(struct otus_softc *sc, struct mb if (__predict_false(error != USBD_IN_PROGRESS error != 0)) return error; - ieee80211_free_node(ni); sc-sc_tx_queued++; sc-sc_tx_cur = (sc-sc_tx_cur + 1) % OTUS_TX_DATA_LIST_COUNT; @@ -1950,11 +1947,14 @@ sendit: bpf_mtap3(ic-ic_rawbpf, m); if (otus_tx(sc, m, ni) != 0) { + m_freem(m); ieee80211_free_node(ni); ifp-if_oerrors++; continue; } + m_freem(m); + ieee80211_free_node(ni); sc-sc_tx_timer = 5; ifp-if_timer = 1; }
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Thu Dec 27 15:17:01 UTC 2012 Added Files: src/sys/rump: VERSION Log Message: Since cvs does not provide a version number for the entire tree, provide identifiers which can be used by external parties to check if the NetBSD source tree is of required vintage. inspired by a buildrump.sh bug report due to an out-of-date src To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/rump/VERSION Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/rump/VERSION diff -u /dev/null src/sys/rump/VERSION:1.1 --- /dev/null Thu Dec 27 15:17:01 2012 +++ src/sys/rump/VERSION Thu Dec 27 15:17:01 2012 @@ -0,0 +1,12 @@ +# $NetBSD: VERSION,v 1.1 2012/12/27 15:17:01 pooka Exp $ +# +# Since cvs does not provide a version number for the entire tree, provide +# identifiers which can be used by external parties to check if the NetBSD +# source tree is of required vintage. +# +# This file is of the format NAME=date:subdate. Subdate is incremented +# if there are multiple version bumps during one day and is reset to 0 +# when date is bumped. +# + +BUILDRUMP=20121227:0
CVS commit: src/sys/arch/ia64/include
Module Name:src Committed By: martin Date: Thu Dec 27 15:58:56 UTC 2012 Modified Files: src/sys/arch/ia64/include: pte.h Log Message: Hide inline functions from userland To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/include/pte.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/arch/ia64/include/pte.h diff -u src/sys/arch/ia64/include/pte.h:1.1 src/sys/arch/ia64/include/pte.h:1.2 --- src/sys/arch/ia64/include/pte.h:1.1 Fri Apr 7 14:21:18 2006 +++ src/sys/arch/ia64/include/pte.h Thu Dec 27 15:58:55 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: pte.h,v 1.1 2006/04/07 14:21:18 cherry Exp $ */ +/* $NetBSD: pte.h,v 1.2 2012/12/27 15:58:55 martin Exp $ */ /*- * Copyright (c) 2001 Doug Rabson @@ -71,6 +71,7 @@ typedef uint64_t pt_entry_t; +#ifdef _KERNEL static __inline pt_entry_t pte_atomic_clear(pt_entry_t *ptep, uint64_t val) { @@ -82,6 +83,7 @@ pte_atomic_set(pt_entry_t *ptep, uint64_ { return (atomic_set_64(ptep, val)); } +#endif /* * A long-format VHPT entry.
CVS commit: src/sys/dev/pci
Module Name:src Committed By: jmcneill Date: Thu Dec 27 16:23:48 UTC 2012 Modified Files: src/sys/dev/pci: if_vr.c Log Message: - reset the chip if the tx engine gets stuck after a link state change, from OpenBSD - no need to do a full reset of the chip when enabling or disabling promiscuous mode To generate a diff of this commit: cvs rdiff -u -r1.111 -r1.112 src/sys/dev/pci/if_vr.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/pci/if_vr.c diff -u src/sys/dev/pci/if_vr.c:1.111 src/sys/dev/pci/if_vr.c:1.112 --- src/sys/dev/pci/if_vr.c:1.111 Sun Jul 22 14:33:04 2012 +++ src/sys/dev/pci/if_vr.c Thu Dec 27 16:23:48 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: if_vr.c,v 1.111 2012/07/22 14:33:04 matt Exp $ */ +/* $NetBSD: if_vr.c,v 1.112 2012/12/27 16:23:48 jmcneill Exp $ */ /*- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_vr.c,v 1.111 2012/07/22 14:33:04 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: if_vr.c,v 1.112 2012/12/27 16:23:48 jmcneill Exp $); @@ -231,6 +231,11 @@ struct vr_softc { uint32_t vr_save_membase; uint32_t vr_save_irq; + bool vr_link; + int vr_flags; +#define VR_F_RESTART 0x1 /* restart on next tick */ + int vr_if_flags; + krndsource_t rnd_source; /* random source */ }; @@ -399,21 +404,44 @@ static void vr_mii_statchg(struct ifnet *ifp) { struct vr_softc *sc = ifp-if_softc; + int i; /* * In order to fiddle with the 'full-duplex' bit in the netconfig * register, we first have to put the transmit and/or receive logic * in the idle state. */ - VR_CLRBIT16(sc, VR_COMMAND, (VR_CMD_TX_ON|VR_CMD_RX_ON)); + if ((sc-vr_mii.mii_media_status IFM_ACTIVE) + IFM_SUBTYPE(sc-vr_mii.mii_media_active) != IFM_NONE) { + sc-vr_link = true; + + if (CSR_READ_2(sc, VR_COMMAND) (VR_CMD_TX_ON|VR_CMD_RX_ON)) + VR_CLRBIT16(sc, VR_COMMAND, + (VR_CMD_TX_ON|VR_CMD_RX_ON)); - if (sc-vr_mii.mii_media_active IFM_FDX) - VR_SETBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX); - else - VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX); + if (sc-vr_mii.mii_media_active IFM_FDX) + VR_SETBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX); + else + VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_FULLDUPLEX); - if (sc-vr_ec.ec_if.if_flags IFF_RUNNING) VR_SETBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_RX_ON); + } else { + sc-vr_link = false; + VR_CLRBIT16(sc, VR_COMMAND, VR_CMD_TX_ON|VR_CMD_RX_ON); + for (i = VR_TIMEOUT; i 0; i--) { + delay(10); + if (!(CSR_READ_2(sc, VR_COMMAND) + (VR_CMD_TX_ON|VR_CMD_RX_ON))) +break; + } + if (i == 0) { +#ifdef VR_DEBUG + printf(%s: rx shutdown error!\n, + device_xname(sc-vr_dev)); +#endif + sc-vr_flags |= VR_F_RESTART; + } + } } #define vr_calchash(addr) \ @@ -979,6 +1007,11 @@ vr_start(struct ifnet *ifp) struct vr_descsoft *ds; int error, firsttx, nexttx, opending; + if ((ifp-if_flags (IFF_RUNNING|IFF_OACTIVE)) != IFF_RUNNING) + return; + if (sc-vr_link == false) + return; + /* * Remember the previous txpending and the first transmit * descriptor we use. @@ -1228,6 +1261,7 @@ vr_init(struct ifnet *ifp) CSR_WRITE_4(sc, VR_TXADDR, VR_CDTXADDR(sc, VR_NEXTTX(sc-vr_txlast))); /* Set current media. */ + sc-vr_link = true; if ((error = ether_mediachange(ifp)) != 0) goto out; @@ -1263,19 +1297,37 @@ vr_ioctl(struct ifnet *ifp, u_long comma s = splnet(); - error = ether_ioctl(ifp, command, data); - if (error == ENETRESET) { - /* - * Multicast list has changed; set the hardware filter - * accordingly. - */ - if (ifp-if_flags IFF_RUNNING) - vr_setmulti(sc); + switch (command) { + case SIOCSIFFLAGS: + if ((error = ifioctl_common(ifp, command, data)) != 0) + break; + + switch (ifp-if_flags (IFF_UP | IFF_RUNNING)) { + case IFF_RUNNING: + vr_stop(ifp, 1); + break; + case IFF_UP: + vr_init(ifp); + break; + case IFF_UP | IFF_RUNNING: + if ((ifp-if_flags ^ sc-vr_if_flags) == IFF_PROMISC) +vr_setmulti(sc); + else +vr_init(ifp); + break; + } + sc-vr_if_flags = ifp-if_flags; + break; + default: + if ((error = ether_ioctl(ifp, command, data)) != ENETRESET) + break; error = 0; + if (command == SIOCADDMULTI || command == SIOCDELMULTI) + vr_setmulti(sc); } - splx(s); - return (error); + + return error; } static void @@ -1299,6 +1351,11 @@ vr_tick(void *arg) int s; s = splnet(); + if (sc-vr_flags VR_F_RESTART) { + printf(%s: restarting\n, device_xname(sc-vr_dev)); + vr_init(sc-vr_ec.ec_if); + sc-vr_flags = ~VR_F_RESTART; + } mii_tick(sc-vr_mii); splx(s);
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Thu Dec 27 16:42:33 UTC 2012 Modified Files: src/sys/dev/usb: aubtfwl.c emdtv.c if_atu.c if_aue.c if_axe.c if_cue.c if_kue.c if_otus.c if_rum.c if_run.c if_udav.c if_upgt.c if_upl.c if_ural.c if_url.c if_urtw.c if_urtwn.c if_zyd.c uberry.c udl.c udsbr.c uhso.c uipaq.c urio.c uscanner.c usscanner.c Log Message: Consistent/Correct error message from failing usbd_set_config. Use aprint_error_dev. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/usb/aubtfwl.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/emdtv.c src/sys/dev/usb/uberry.c cvs rdiff -u -r1.44 -r1.45 src/sys/dev/usb/if_atu.c src/sys/dev/usb/if_url.c cvs rdiff -u -r1.127 -r1.128 src/sys/dev/usb/if_aue.c cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/if_axe.c cvs rdiff -u -r1.63 -r1.64 src/sys/dev/usb/if_cue.c cvs rdiff -u -r1.77 -r1.78 src/sys/dev/usb/if_kue.c cvs rdiff -u -r1.16 -r1.17 src/sys/dev/usb/if_otus.c cvs rdiff -u -r1.43 -r1.44 src/sys/dev/usb/if_rum.c cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_run.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/if_udav.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/if_upgt.c src/sys/dev/usb/udl.c cvs rdiff -u -r1.42 -r1.43 src/sys/dev/usb/if_upl.c cvs rdiff -u -r1.40 -r1.41 src/sys/dev/usb/if_ural.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/if_urtw.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_urtwn.c cvs rdiff -u -r1.32 -r1.33 src/sys/dev/usb/if_zyd.c cvs rdiff -u -r1.21 -r1.22 src/sys/dev/usb/udsbr.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/uhso.c cvs rdiff -u -r1.18 -r1.19 src/sys/dev/usb/uipaq.c cvs rdiff -u -r1.39 -r1.40 src/sys/dev/usb/urio.c cvs rdiff -u -r1.72 -r1.73 src/sys/dev/usb/uscanner.c cvs rdiff -u -r1.35 -r1.36 src/sys/dev/usb/usscanner.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/usb/aubtfwl.c diff -u src/sys/dev/usb/aubtfwl.c:1.3 src/sys/dev/usb/aubtfwl.c:1.4 --- src/sys/dev/usb/aubtfwl.c:1.3 Fri Dec 23 00:51:43 2011 +++ src/sys/dev/usb/aubtfwl.c Thu Dec 27 16:42:32 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: aubtfwl.c,v 1.3 2011/12/23 00:51:43 jakllsch Exp $ */ +/* $NetBSD: aubtfwl.c,v 1.4 2012/12/27 16:42:32 skrll Exp $ */ /* * Copyright (c) 2011 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: aubtfwl.c,v 1.3 2011/12/23 00:51:43 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: aubtfwl.c,v 1.4 2012/12/27 16:42:32 skrll Exp $); #include sys/param.h #include dev/usb/usb.h @@ -110,7 +110,8 @@ aubtfwl_attach_hook(device_t self) error = usbd_set_config_no(sc-sc_udev, 1, 0); if (error != 0) { - aprint_error_dev(self, could not set configuration no\n); + aprint_error_dev(self, failed to set configuration + , err=%s\n, usbd_errstr(error)); goto out_firmware; } Index: src/sys/dev/usb/emdtv.c diff -u src/sys/dev/usb/emdtv.c:1.8 src/sys/dev/usb/emdtv.c:1.9 --- src/sys/dev/usb/emdtv.c:1.8 Sun Mar 11 01:06:06 2012 +++ src/sys/dev/usb/emdtv.c Thu Dec 27 16:42:32 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: emdtv.c,v 1.8 2012/03/11 01:06:06 mrg Exp $ */ +/* $NetBSD: emdtv.c,v 1.9 2012/12/27 16:42:32 skrll Exp $ */ /*- * Copyright (c) 2008, 2011 Jared D. McNeill jmcne...@invisible.ca @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: emdtv.c,v 1.8 2012/03/11 01:06:06 mrg Exp $); +__KERNEL_RCSID(0, $NetBSD: emdtv.c,v 1.9 2012/12/27 16:42:32 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -128,7 +128,8 @@ emdtv_attach(device_t parent, device_t s status = usbd_set_config_no(sc-sc_udev, 1, 1); if (status != USBD_NORMAL_COMPLETION) { - aprint_error_dev(sc-sc_dev, couldn't set config no\n); + aprint_error_dev(sc-sc_dev, failed to set configuration + , err=%s\n, usbd_errstr(status)); return; } Index: src/sys/dev/usb/uberry.c diff -u src/sys/dev/usb/uberry.c:1.8 src/sys/dev/usb/uberry.c:1.9 --- src/sys/dev/usb/uberry.c:1.8 Fri Dec 23 00:51:44 2011 +++ src/sys/dev/usb/uberry.c Thu Dec 27 16:42:32 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: uberry.c,v 1.8 2011/12/23 00:51:44 jakllsch Exp $ */ +/* $NetBSD: uberry.c,v 1.9 2012/12/27 16:42:32 skrll Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uberry.c,v 1.8 2011/12/23 00:51:44 jakllsch Exp $); +__KERNEL_RCSID(0, $NetBSD: uberry.c,v 1.9 2012/12/27 16:42:32 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -127,7 +127,8 @@ uberry_charge(struct uberry_softc *sc) err = usbd_set_config_no(sc-sc_udev, UBERRY_CONFIG_NO, 1); if (err) { - aprint_error_dev(sc-sc_dev, setting config no failed\n); + aprint_error_dev(sc-sc_dev, failed to set configuration + , err=%s\n, usbd_errstr(err)); return; } } @@ -145,7 +146,8 @@ uberry_dual_mode(struct uberry_softc *sc err = usbd_set_config_no(sc-sc_udev, UBERRY_CONFIG_NO,
CVS commit: src/sys/arch/ia64/stand
Module Name:src Committed By: martin Date: Thu Dec 27 20:21:51 UTC 2012 Modified Files: src/sys/arch/ia64/stand/common: bootstrap.h fileload.c interp.c misc.c readdir.c src/sys/arch/ia64/stand/efi/libefi: bootinfo.c devicename.c efi.c efifsdev.h exec.c src/sys/arch/ia64/stand/ia64/efi: main.c src/sys/arch/ia64/stand/ia64/ski: acpi_stub.c bootinfo.c devicename.c efi_stub.c exec.c libski.h main.c sal_stub.c Log Message: Make it all compile To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/stand/common/bootstrap.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/stand/common/fileload.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/stand/common/interp.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/stand/common/misc.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/common/readdir.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/efi/libefi/bootinfo.c \ src/sys/arch/ia64/stand/efi/libefi/efi.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/stand/efi/libefi/devicename.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/ia64/stand/efi/libefi/efifsdev.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/stand/efi/libefi/exec.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/ia64/stand/ia64/efi/main.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/ia64/stand/ia64/ski/acpi_stub.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/stand/ia64/ski/bootinfo.c \ src/sys/arch/ia64/stand/ia64/ski/devicename.c \ src/sys/arch/ia64/stand/ia64/ski/efi_stub.c \ src/sys/arch/ia64/stand/ia64/ski/main.c \ src/sys/arch/ia64/stand/ia64/ski/sal_stub.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/ia64/stand/ia64/ski/exec.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/stand/ia64/ski/libski.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/arch/ia64/stand/common/bootstrap.h diff -u src/sys/arch/ia64/stand/common/bootstrap.h:1.7 src/sys/arch/ia64/stand/common/bootstrap.h:1.8 --- src/sys/arch/ia64/stand/common/bootstrap.h:1.7 Thu Jun 30 20:09:31 2011 +++ src/sys/arch/ia64/stand/common/bootstrap.h Thu Dec 27 20:21:50 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: bootstrap.h,v 1.7 2011/06/30 20:09:31 wiz Exp $ */ +/* $NetBSD: bootstrap.h,v 1.8 2012/12/27 20:21:50 martin Exp $ */ /*- * Copyright (c) 1998 Michael Smith msm...@freebsd.org @@ -57,6 +57,7 @@ extern char command_errbuf[]; /* XXX bla #define CMD_OK 0 #define CMD_ERROR 1 + /* interp.c */ void interact(void); int include(const char *filename); @@ -124,6 +125,7 @@ struct console }; extern struct console *consoles[]; void cons_probe(void); +int ischar(void); /* * Plug-and-play enumerator/configurator interface. @@ -211,6 +213,7 @@ int mod_loadkld(const char *name, int struct preloaded_file *file_alloc(void); struct preloaded_file *file_findfile(char *name, char *type); +int file_loadkernel(char *filename, int argc, char *argv[]); void file_discard(struct preloaded_file *fp); int elf64_loadfile(char *filename, u_int64_t dest, struct preloaded_file **result); @@ -330,6 +333,12 @@ time_t time(time_t *tloc); /* calloc.c */ void*calloc(unsigned int, unsigned int); +/* various string functions */ +size_t strspn(const char *s1, const char *s2); +size_t strlen(const char *s); +char *strcpy(char * restrict dst, const char * restrict src); +char *strcat(char * restrict s, const char * restrict append); + /* pager.c */ extern void pager_open(void); extern void pager_close(void); Index: src/sys/arch/ia64/stand/common/fileload.c diff -u src/sys/arch/ia64/stand/common/fileload.c:1.2 src/sys/arch/ia64/stand/common/fileload.c:1.3 --- src/sys/arch/ia64/stand/common/fileload.c:1.2 Wed Mar 18 16:00:12 2009 +++ src/sys/arch/ia64/stand/common/fileload.c Thu Dec 27 20:21:51 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: fileload.c,v 1.2 2009/03/18 16:00:12 cegger Exp $ */ +/* $NetBSD: fileload.c,v 1.3 2012/12/27 20:21:51 martin Exp $ */ /*- * Copyright (c) 1998 Michael Smith msm...@freebsd.org @@ -33,8 +33,9 @@ */ #include lib/libsa/stand.h +#include lib/libsa/loadfile.h +#include lib/libkern/libkern.h #include sys/param.h -#include sys/lkm.h #include sys/queue.h #include bootstrap.h @@ -266,10 +267,11 @@ file_alloc(void) if ((fp = alloc(sizeof(struct preloaded_file))) != NULL) { memset(fp, 0, sizeof(struct preloaded_file)); - +/* if (fp-marks = alloc(sizeof(u_long))) { memset(fp-marks, 0, sizeof(u_long)); } +*/ } return (fp); } Index: src/sys/arch/ia64/stand/common/interp.c diff -u src/sys/arch/ia64/stand/common/interp.c:1.4 src/sys/arch/ia64/stand/common/interp.c:1.5 --- src/sys/arch/ia64/stand/common/interp.c:1.4 Mon Jul 20 04:59:03 2009 +++ src/sys/arch/ia64/stand/common/interp.c Thu Dec 27 20:21:51 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: interp.c,v 1.4 2009/07/20 04:59:03 kiyohara Exp $ */ +/* $NetBSD: interp.c,v 1.5 2012/12/27 20:21:51 martin Exp $ */ /*- * Copyright (c)
CVS commit: src/lib/libc/gen
Module Name:src Committed By: christos Date: Thu Dec 27 21:17:47 UTC 2012 Modified Files: src/lib/libc/gen: glob.3 glob.c Log Message: Instead of changing the code to match the documentation, change the documentation to match the code. NOCHECK is used only by csh(1) and csh(1) is too broken for words (histchars quoting is special). To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/lib/libc/gen/glob.3 cvs rdiff -u -r1.32 -r1.33 src/lib/libc/gen/glob.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/gen/glob.3 diff -u src/lib/libc/gen/glob.3:1.41 src/lib/libc/gen/glob.3:1.42 --- src/lib/libc/gen/glob.3:1.41 Sun Aug 12 09:31:41 2012 +++ src/lib/libc/gen/glob.3 Thu Dec 27 16:17:47 2012 @@ -1,4 +1,4 @@ -.\ $NetBSD: glob.3,v 1.41 2012/08/12 13:31:41 christos Exp $ +.\ $NetBSD: glob.3,v 1.42 2012/12/27 21:17:47 christos Exp $ .\ .\ Copyright (c) 1989, 1991, 1993, 1994 .\ The Regents of the University of California. All rights reserved. @@ -31,7 +31,7 @@ .\ .\ @(#)glob.3 8.3 (Berkeley) 4/16/94 .\ -.Dd August 12, 2012 +.Dd December 27, 2012 .Dt GLOB 3 .Os .Sh NAME @@ -185,7 +185,8 @@ does not match any pathname, then returns a list consisting of only .Fa pattern , -with the number of total pathnames set to 1, and the number of matched +with one level of backslash escapes removed, +the number of total pathnames set to 1, and the number of matched pathnames set to 0. .It Dv GLOB_NOSORT By default, the pathnames are sorted in ascending Index: src/lib/libc/gen/glob.c diff -u src/lib/libc/gen/glob.c:1.32 src/lib/libc/gen/glob.c:1.33 --- src/lib/libc/gen/glob.c:1.32 Mon Dec 17 20:39:56 2012 +++ src/lib/libc/gen/glob.c Thu Dec 27 16:17:47 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: glob.c,v 1.32 2012/12/18 01:39:56 christos Exp $ */ +/* $NetBSD: glob.c,v 1.33 2012/12/27 21:17:47 christos Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = @(#)glob.c 8.3 (Berkeley) 10/13/93; #else -__RCSID($NetBSD: glob.c,v 1.32 2012/12/18 01:39:56 christos Exp $); +__RCSID($NetBSD: glob.c,v 1.33 2012/12/27 21:17:47 christos Exp $); #endif #endif /* LIBC_SCCS and not lint */ @@ -163,7 +163,7 @@ static int g_lstat(Char *, __gl_stat_t static DIR *g_opendir(Char *, glob_t *); static Char *g_strchr(const Char *, int); static int g_stat(Char *, __gl_stat_t *, glob_t *); -static int glob0(const char *, const Char *, glob_t *, struct glob_limit *); +static int glob0(const Char *, glob_t *, struct glob_limit *); static int glob1(Char *, glob_t *, struct glob_limit *); static int glob2(Char *, Char *, Char *, const Char *, glob_t *, struct glob_limit *); @@ -171,8 +171,8 @@ static int glob3(Char *, Char *, Char * const Char *, glob_t *, struct glob_limit *); static int globextend(const Char *, glob_t *, struct glob_limit *); static const Char *globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const char *, const Char *, glob_t *, struct glob_limit *); -static int globexp2(const char *, const Char *, const Char *, glob_t *, int *, +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, struct glob_limit *); static int match(const Char *, const Char *, const Char *); #ifdef DEBUG @@ -222,9 +222,9 @@ glob(const char * __restrict pattern, in *bufnext = EOS; if (flags GLOB_BRACE) - return globexp1(pattern, patbuf, pglob, limit); + return globexp1(patbuf, pglob, limit); else - return glob0(pattern, patbuf, pglob, limit); + return glob0(patbuf, pglob, limit); } /* @@ -233,7 +233,7 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const char *orig, const Char *pattern, glob_t *pglob, struct glob_limit *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; @@ -249,13 +249,13 @@ globexp1(const char *orig, const Char *p /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE pattern[1] == RBRACE pattern[2] == EOS) - return glob0(orig, pattern, pglob, limit); + return glob0(pattern, pglob, limit); while ((ptr = (const Char *) g_strchr(ptr, LBRACE)) != NULL) - if (!globexp2(orig, ptr, pattern, pglob, rv, limit)) + if (!globexp2(ptr, pattern, pglob, rv, limit)) return rv; - return glob0(orig, pattern, pglob, limit); + return glob0(pattern, pglob, limit); } @@ -265,7 +265,7 @@ globexp1(const char *orig, const Char *p * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const char *orig, const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, struct glob_limit *limit) { int i; @@ -311,7 +311,7 @@ globexp2(const char
CVS commit: src/bin/csh
Module Name:src Committed By: christos Date: Thu Dec 27 21:19:20 UTC 2012 Modified Files: src/bin/csh: extern.h str.c Log Message: sprinkle const, no functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/bin/csh/extern.h cvs rdiff -u -r1.13 -r1.14 src/bin/csh/str.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/csh/extern.h diff -u src/bin/csh/extern.h:1.24 src/bin/csh/extern.h:1.25 --- src/bin/csh/extern.h:1.24 Wed Nov 9 14:16:01 2011 +++ src/bin/csh/extern.h Thu Dec 27 16:19:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.24 2011/11/09 19:16:01 christos Exp $ */ +/* $NetBSD: extern.h,v 1.25 2012/12/27 21:19:20 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -307,27 +307,27 @@ void showall(Char **, struct command *); * str.c: */ #ifdef SHORT_STRINGS -Char *s_strchr(Char *, int); -Char *s_strrchr(Char *, int); -Char *s_strcat(Char *, Char *); +Char *s_strchr(const Char *, int); +Char *s_strrchr(const Char *, int); +Char *s_strcat(Char *, const Char *); #ifdef NOTUSED -Char *s_strncat(Char *, Char *, size_t); +Char *s_strncat(Char *, const Char *, size_t); #endif -Char *s_strcpy(Char *, Char *); -Char *s_strncpy(Char *, Char *, size_t); -Char *s_strspl(Char *, Char *); -size_t s_strlen(Char *); -int s_strcmp(Char *, Char *); -int s_strncmp(Char *, Char *, size_t); -Char *s_strsave(Char *); -Char *s_strend(Char *); -Char *s_strstr(Char *, Char *); +Char *s_strcpy(Char *, const Char *); +Char *s_strncpy(Char *, const Char *, size_t); +Char *s_strspl(const Char *, const Char *); +size_t s_strlen(const Char *); +int s_strcmp(const Char *, const Char *); +int s_strncmp(const Char *, const Char *, size_t); +Char *s_strsave(const Char *); +Char *s_strend(const Char *); +Char *s_strstr(const Char *, const Char *); Char *str2short(const char *); Char **blk2short(char **); -char *short2str(Char *); -char **short2blk(Char **); +char *short2str(const Char *); +char **short2blk(Char * const *); #endif -char *short2qstr(Char *); -char *vis_str(Char *); +char *short2qstr(const Char *); +char *vis_str(const Char *); #endif /* !_EXTERN_H_ */ Index: src/bin/csh/str.c diff -u src/bin/csh/str.c:1.13 src/bin/csh/str.c:1.14 --- src/bin/csh/str.c:1.13 Thu Aug 7 05:05:07 2003 +++ src/bin/csh/str.c Thu Dec 27 16:19:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.13 2003/08/07 09:05:07 agc Exp $ */ +/* $NetBSD: str.c,v 1.14 2012/12/27 21:19:20 christos Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = @(#)str.c 8.1 (Berkeley) 5/31/93; #else -__RCSID($NetBSD: str.c,v 1.13 2003/08/07 09:05:07 agc Exp $); +__RCSID($NetBSD: str.c,v 1.14 2012/12/27 21:19:20 christos Exp $); #endif #endif /* not lint */ @@ -75,7 +75,7 @@ blk2short(char **src) } char ** -short2blk(Char **src) +short2blk(Char *const *src) { char **dst, **sdst; size_t n; @@ -125,7 +125,7 @@ str2short(const char *src) } char * -short2str(Char *src) +short2str(const Char *src) { static char *sdst = NULL; static size_t dstsize = 0; @@ -155,7 +155,7 @@ short2str(Char *src) } Char * -s_strcpy(Char *dst, Char *src) +s_strcpy(Char *dst, const Char *src) { Char *sdst; @@ -166,7 +166,7 @@ s_strcpy(Char *dst, Char *src) } Char * -s_strncpy(Char *dst, Char *src, size_t n) +s_strncpy(Char *dst, const Char *src, size_t n) { Char *sdst; @@ -185,7 +185,7 @@ s_strncpy(Char *dst, Char *src, size_t n } Char * -s_strcat(Char *dst, Char *src) +s_strcat(Char *dst, const Char *src) { short *sdst; @@ -226,30 +226,30 @@ s_strncat(Char *dst, Char *src, size_t n #endif Char * -s_strchr(Char *str, int ch) +s_strchr(const Char *str, int ch) { do if (*str == ch) - return (str); + return __UNCONST(str); while (*str++); return (NULL); } Char * -s_strrchr(Char *str, int ch) +s_strrchr(const Char *str, int ch) { -Char *rstr; +const Char *rstr; rstr = NULL; do if (*str == ch) rstr = str; while (*str++); -return (rstr); +return __UNCONST(rstr); } size_t -s_strlen(Char *str) +s_strlen(const Char *str) { size_t n; @@ -259,7 +259,7 @@ s_strlen(Char *str) } int -s_strcmp(Char *str1, Char *str2) +s_strcmp(const Char *str1, const Char *str2) { for (; *str1 *str1 == *str2; str1++, str2++) continue; @@ -279,7 +279,7 @@ s_strcmp(Char *str1, Char *str2) } int -s_strncmp(Char *str1, Char *str2, size_t n) +s_strncmp(const Char *str1, const Char *str2, size_t n) { if (n == 0) return (0); @@ -305,24 +305,26 @@ s_strncmp(Char *str1, Char *str2, size_t } Char * -s_strsave(Char *s) +s_strsave(const Char *s) { -Char *n, *p; +const Char *p; +Char *n; if (s == 0) s = STRNULL; for (p = s; *p++;) continue; -n = p = (Char *)xmalloc((size_t)((p - s) * sizeof(Char))); -while
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: msaitoh Date: Fri Dec 28 03:48:00 UTC 2012 Modified Files: src/sys/arch/arm/arm: cpufunc.c Log Message: Enable DCache Streaming Switch and Write Allocate. This change improve system performance significantly. To generate a diff of this commit: cvs rdiff -u -r1.118 -r1.119 src/sys/arch/arm/arm/cpufunc.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/arm/arm/cpufunc.c diff -u src/sys/arch/arm/arm/cpufunc.c:1.118 src/sys/arch/arm/arm/cpufunc.c:1.119 --- src/sys/arch/arm/arm/cpufunc.c:1.118 Mon Nov 12 18:00:34 2012 +++ src/sys/arch/arm/arm/cpufunc.c Fri Dec 28 03:48:00 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cpufunc.c,v 1.118 2012/11/12 18:00:34 skrll Exp $ */ +/* $NetBSD: cpufunc.c,v 1.119 2012/12/28 03:48:00 msaitoh Exp $ */ /* * arm7tdmi support code Copyright (c) 2001 John Fremlin @@ -49,7 +49,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: cpufunc.c,v 1.118 2012/11/12 18:00:34 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: cpufunc.c,v 1.119 2012/12/28 03:48:00 msaitoh Exp $); #include opt_compat_netbsd.h #include opt_cpuoptions.h @@ -3352,6 +3352,7 @@ void sheeva_setup(char *args) { int cpuctrl, cpuctrlmask; + uint32_t sheeva_ext; cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_SYST_ENABLE | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE @@ -3369,6 +3370,15 @@ sheeva_setup(char *args) cpuctrl = parse_cpu_options(args, sheeva_options, cpuctrl); + /* Enable DCache Streaming Switch and Write Allocate */ + __asm volatile(mrc p15, 1, %0, c15, c1, 0 + : =r (sheeva_ext)); + + sheeva_ext |= FC_DCACHE_STREAM_EN | FC_WR_ALLOC_EN; + + __asm volatile(mcr p15, 1, %0, c15, c1, 0 + :: r (sheeva_ext)); + /* * Sheeva has L2 Cache. Enable/Disable it here. * Really not support yet...
CVS commit: src/common/lib/libc/arch/arm/string
Module Name:src Committed By: matt Date: Fri Dec 28 05:15:08 UTC 2012 Modified Files: src/common/lib/libc/arch/arm/string: strlen_neon.S Log Message: Debug. This becomes faster than the normal strlen at about 80 characters. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/arm/string/strlen_neon.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/arm/string/strlen_neon.S diff -u src/common/lib/libc/arch/arm/string/strlen_neon.S:1.2 src/common/lib/libc/arch/arm/string/strlen_neon.S:1.3 --- src/common/lib/libc/arch/arm/string/strlen_neon.S:1.2 Sat Dec 15 22:23:31 2012 +++ src/common/lib/libc/arch/arm/string/strlen_neon.S Fri Dec 28 05:15:08 2012 @@ -29,32 +29,31 @@ #include machine/asm.h -RCSID($NetBSD: strlen_neon.S,v 1.2 2012/12/15 22:23:31 matt Exp $) +RCSID($NetBSD: strlen_neon.S,v 1.3 2012/12/28 05:15:08 matt Exp $) .text ENTRY(strlen) - mov ip, r0 /* we r0 for return value */ + mov ip, r0 /* we use r0 for return value */ ands r1, r0, #15 /* verify qword alignment */ neg r0, r1 /* subtract misalignment from count */ veor q2, q2, q2 /* clear mask */ mov r3, #7 /* NBBY - 1 */ vdup.32 q3, r3 /* dup throughout q3 */ - mov r3, #0x04 /* magic since there are 4 bytes per U32 */ - orr r3, r3, lsl #8 /* copy to next 8 bits */ + movw r3, #0x0404 /* magic since there are 4 bytes per U32 */ orr r3, r3, lsl #16 /* copy to upper 16 bits */ beq .Lmain_loop veor q0, q0, q0 /* clear q0 */ vmvn q2, q2 /* set all 16 bytes of mask to all 1s */ bic ip, ip, #15 /* qword align string address */ - lsl r2, r1, #3 /* convert to bits */ - neg r2, r2 /* make negative since we are shifting right */ - tst r1, #8 /* do we need skip the first 8? */ - bne 1f /* yes, we need to skip */ - veor d4, d4, d4 /* clear lower 8 bytes (upper is set) */ - vmov s2, r2 /* set shift amount for upper half */ - b 2f -1: vmov s0, r2 /* set shift amount for lower half */ -2: vshl.u64 q2, q2, q0 /* shift */ + lsl r1, r1, #3 /* convert to bits */ + cmp r1, #64 + rsbgt r1, r1, #128 /*64? BE so we are shifting LSW right */ + movgt r2, #0 /*64? leave MSW alone */ + rsble r2, r1, #64 /* =64? BE so we are shifting MSW right */ + movle r1, #64 /* =64? clear LSW */ + vmov d0, r1, r2 /* set shifts for lower and upper halves */ + vmovl.u32 q0, d0 /* 2 U32 - 2 U64 */ + vshl.u64 q2, q2, q0 /* shift */ /* * Main loop. Load 16 bytes, do a clz, */ @@ -65,25 +64,23 @@ ENTRY(strlen) #endif vswp d0, d1 /* swap dwords to get BE qword */ vorr q0, q0, q2 /* or in leading byte mask */ - veor q2, q2, q2 /* clear byte mask */ + veor q2, q2, q2 /* clear leading byte mask */ vceq.i8 q1, q0, #0 /* test each byte for 0 */ /* Why couldn't there be a 64-bit CLZ? */ - vclz.i32 q1, q1 /* count leading zeroes to find the 0 byte */ - vadd.i32 q1, q1, q3 /* round up to byte bounary */ + vclz.u32 q1, q1 /* count leading zeroes to find the 0 byte */ + vadd.u32 q1, q1, q3 /* round up to byte bounary */ vshr.u32 q1, q1, #3 /* convert to bytes */ - vmovn.i32 d0, q1 /* 4 I32 - 4 I16 */ - vmovn.i16 d0, q0 /* 4 I16 - 4 I8 */ + vmovn.u32 d0, q1 /* 4 I32 - 4 I16 */ + vmovn.u16 d0, q0 /* 4 I16 - 4 I8 */ vmov r2, s0 /* get counts */ - cmp r2, r3 /* count eq 4 in each byte? */ - addeq r0, #16 /* no NULs */ + eors r2, r2, r3 /* xor with 0x04040404 */ + addeq r0, #16 /* 0? no NULs */ beq .Lmain_loop /* get next qword */ -/* r2[31:24] already has 1st word byte count */ - tst r2, #(4 24) /* first word has 4 non-NUL? */ - addne r2, r2, r2, lsl #8 /* add second word byte-count */ - tstne r2, #(4 16) /* second word has 4 non-NUL? */ - addne r2, r2, r2, lsl #16 /* add thirs word byte-count */ - tstne r2, #(4 8) /* third has 4 non-NULL? */ - addne r2, r2, r2, lsl #24 /* add fourth word byte-count */ - add r0, r0, r2, lsr #24 /* add accumulated byte-count to length */ + clz ip, r2 /* count leading zeros */ + mov r2, r2, lsl ip /* discard them */ + mov ip, ip, lsr #3 /* divide leading zeroes by 8 */ + add r0, r0, ip, lsl #2 /* multiple by 4 and add to count */ + and r2, r2, #(3 29) + add r0, r0, r2, lsr #29 RET /* and return. */ END(strlen)
CVS commit: src/sys/arch/xen
Module Name:src Committed By: cherry Date: Fri Dec 28 06:29:56 UTC 2012 Modified Files: src/sys/arch/xen/include: evtchn.h hypervisor.h src/sys/arch/xen/x86: hypervisor_machdep.c src/sys/arch/xen/xen: evtchn.c Log Message: Simplify the xen event handler callback by: - moving the interrupt handler callback traversal into a separate function. - using evt_iterate_bits() to scan through the pending bitfield - removing cross-cpu pending actions - events recieved on the wrong vcpu are re-routed via hypervisor_send_event(). - simplifying nested while() loops by encapsulating them in equivalent functions. Many thanks for multiple reviews by bouyer@ and jym@ To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/xen/include/evtchn.h cvs rdiff -u -r1.39 -r1.40 src/sys/arch/xen/include/hypervisor.h cvs rdiff -u -r1.23 -r1.24 src/sys/arch/xen/x86/hypervisor_machdep.c cvs rdiff -u -r1.65 -r1.66 src/sys/arch/xen/xen/evtchn.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/xen/include/evtchn.h diff -u src/sys/arch/xen/include/evtchn.h:1.20 src/sys/arch/xen/include/evtchn.h:1.21 --- src/sys/arch/xen/include/evtchn.h:1.20 Tue Sep 20 00:12:23 2011 +++ src/sys/arch/xen/include/evtchn.h Fri Dec 28 06:29:56 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: evtchn.h,v 1.20 2011/09/20 00:12:23 jym Exp $ */ +/* $NetBSD: evtchn.h,v 1.21 2012/12/28 06:29:56 cherry Exp $ */ /* * @@ -33,6 +33,9 @@ extern struct evtsource *evtsource[]; +#include sys/mutex.h +extern kmutex_t evtlock[]; + void events_default_setup(void); void events_init(void); bool events_suspend(void); Index: src/sys/arch/xen/include/hypervisor.h diff -u src/sys/arch/xen/include/hypervisor.h:1.39 src/sys/arch/xen/include/hypervisor.h:1.40 --- src/sys/arch/xen/include/hypervisor.h:1.39 Sun Nov 25 08:39:35 2012 +++ src/sys/arch/xen/include/hypervisor.h Fri Dec 28 06:29:56 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor.h,v 1.39 2012/11/25 08:39:35 cherry Exp $ */ +/* $NetBSD: hypervisor.h,v 1.40 2012/12/28 06:29:56 cherry Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -142,6 +142,7 @@ void hypervisor_unmask_event(unsigned in void hypervisor_mask_event(unsigned int); void hypervisor_clear_event(unsigned int); void hypervisor_enable_ipl(unsigned int); +void hypervisor_do_iplpending(unsigned int, void *); void hypervisor_set_ipending(uint32_t, int, int); void hypervisor_machdep_attach(void); void hypervisor_machdep_resume(void); Index: src/sys/arch/xen/x86/hypervisor_machdep.c diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.23 src/sys/arch/xen/x86/hypervisor_machdep.c:1.24 --- src/sys/arch/xen/x86/hypervisor_machdep.c:1.23 Sun Nov 25 08:39:36 2012 +++ src/sys/arch/xen/x86/hypervisor_machdep.c Fri Dec 28 06:29:56 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor_machdep.c,v 1.23 2012/11/25 08:39:36 cherry Exp $ */ +/* $NetBSD: hypervisor_machdep.c,v 1.24 2012/12/28 06:29:56 cherry Exp $ */ /* * @@ -54,7 +54,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.23 2012/11/25 08:39:36 cherry Exp $); +__KERNEL_RCSID(0, $NetBSD: hypervisor_machdep.c,v 1.24 2012/12/28 06:29:56 cherry Exp $); #include sys/param.h #include sys/systm.h @@ -187,7 +187,7 @@ stipending(void) */ while (vci-evtchn_upcall_pending) { - cli(); + x86_disable_intr(); vci-evtchn_upcall_pending = 0; @@ -195,7 +195,7 @@ stipending(void) s-evtchn_pending, s-evtchn_mask, evt_set_pending, ret); - sti(); + x86_enable_intr(); } #if 0 @@ -284,6 +284,82 @@ do_hypervisor_callback(struct intrframe #endif } +/* Iterate through pending events and call the event handler */ +struct splargs { + int ipl; + struct intrframe *regs; +}; + +static inline void +evt_do_iplcallback(unsigned int evtch, unsigned int l1i, +unsigned int l2i, void *args) +{ + KASSERT(args != NULL); + struct splargs *sargs = args; + + struct intrhand *ih; + int (*ih_fun)(void *, void *); + + int ipl = sargs-ipl; + struct cpu_info *ci = curcpu(); + struct intrframe *regs = sargs-regs; + + KASSERT(evtsource[evtch] != 0); + + KASSERT(ci-ci_ilevel == ipl); + + KASSERT(x86_read_psl() != 0); + x86_enable_intr(); + mutex_spin_enter(evtlock[evtch]); + ih = evtsource[evtch]-ev_handlers; + while (ih != NULL) { + if (ih-ih_cpu != ci) { /* Skip non-local handlers */ + ih = ih-ih_evt_next; + continue; + } + if (ih-ih_level == ipl) { + KASSERT(x86_read_psl() == 0); + x86_disable_intr(); + ci-ci_ilevel = ih-ih_level; + x86_enable_intr(); + ih_fun = (void *)ih-ih_fun; + ih_fun(ih-ih_arg, regs); + if (ci-ci_ilevel != ipl) { + printf(evtchn_do_event: + handler %p didn't lower + ipl %d %d\n, + ih_fun, ci-ci_ilevel, ipl); + } + } + ih = ih-ih_evt_next; + } + mutex_spin_exit(evtlock[evtch]); + hypervisor_enable_event(evtch); + x86_disable_intr(); + +
CVS commit: src/common/lib/libc/arch/arm/string
Module Name:src Committed By: matt Date: Fri Dec 28 07:10:41 UTC 2012 Added Files: src/common/lib/libc/arch/arm/string: strlen_armv6.S Log Message: strlen implementation for armv6 and later. Uses clz and uqadd8 to really speed the search for NUL. as fast as normal strlen at about a length of 6 or 7 and 2-3 times faster starting around 10. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/common/lib/libc/arch/arm/string/strlen_armv6.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/common/lib/libc/arch/arm/string/strlen_armv6.S diff -u /dev/null src/common/lib/libc/arch/arm/string/strlen_armv6.S:1.1 --- /dev/null Fri Dec 28 07:10:42 2012 +++ src/common/lib/libc/arch/arm/string/strlen_armv6.S Fri Dec 28 07:10:41 2012 @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2012 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 machine/asm.h + +RCSID($NetBSD: strlen_armv6.S,v 1.1 2012/12/28 07:10:41 matt Exp $) + + .text +ENTRY(strlen) + ands r1, r0, #3 /* get misalignment */ + bic ip, r0, #3 /* align to word boundary */ + ldr r3, [ip], #4 /* load first word */ + neg r0, r1 /* subtract misalignment from length */ + beq .Lpre_main_loop /* misaligned? no, go to loop */ + /* + * For misaligned string, we need to make sure that the bytes before + * the start of the string will not cause a false match to a NUL. + */ + mvn r2, #0 /* create a mask */ + and r1, r0, #3 /* find out how many bytes to clear */ + mov r1, r1, lsl #3 /* bytes - bits */ +#ifdef __ARMEL__ + mov r2, r2, lsr r1 /* clear relavent bytes */ +#else + mov r2, r2, lsl r1 /* clear relavent bytes */ +#endif + orr r3, r3, r2 /* orr in mask for leading bytes */ +.Lpre_main_loop: +#ifdef _ARM_ARCH_7 + movw r1, #0xfefe /* magic constant; 254 in each byte */ +#else + mov r1, #0xfe /* put 254 in low byte */ + orr r1, r1, r1, lsl #8 /* move to next byte */ +#endif + orr r1, r1, r1, lsl #16 /* move to next halfword */ +.Lmain_loop: + /* + * Add 254 to each byte using the UQADD8 (unsigned saturating add 8) + * instruction. For every non-NUL byte, the result for that byte will + * become 255. For NUL, it will be 254. When we complement the + * result, if the result is non-0 then we must have encountered a NUL. + */ + uqadd8 r3, r3, r1 /* magic happens here */ + mvns r3, r3 /* is the complemented result 0? */ + bne .Lreturn /*no, return # of bytes */ + add r0, r0, #4 /* add 4 to the count */ + ldr r3, [ip], #4 /* load next word */ + b .Lmain_loop /* and go */ +.Lreturn: + /* + * We encountered a NUL. Find out where by doing a CLZ and then + * shifting right by 3. That will be the number of non-NUL bytes. + */ +#ifdef __ARMEL__ + rev r3, r3 /* we want this in BE for the CLZ */ +#endif + clz r3, r3 /* count how many leading zeros */ + add r0, r0, r3, lsr #3 /* divide that by 8 and add to count */ + RET +END(strlen)