CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: nakayama Date: Tue Oct 28 13:04:51 UTC 2014 Modified Files: src/sys/arch/sparc64/sparc64: machdep.c Log Message: Sync cpu_reboot with i386: - avoid sync and unmount after panic. - remove vfs_shutdown, we call vfs_sync_all and vfs_unmount* instead. - resurrect doshutdownhooks since some drivers still use it (eg. sab(4)). To generate a diff of this commit: cvs rdiff -u -r1.279 -r1.280 src/sys/arch/sparc64/sparc64/machdep.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/sparc64/sparc64/machdep.c diff -u src/sys/arch/sparc64/sparc64/machdep.c:1.279 src/sys/arch/sparc64/sparc64/machdep.c:1.280 --- src/sys/arch/sparc64/sparc64/machdep.c:1.279 Sun Sep 21 16:37:34 2014 +++ src/sys/arch/sparc64/sparc64/machdep.c Tue Oct 28 13:04:51 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.279 2014/09/21 16:37:34 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.280 2014/10/28 13:04:51 nakayama Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.279 2014/09/21 16:37:34 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.280 2014/10/28 13:04:51 nakayama Exp $); #include opt_ddb.h #include opt_multiprocessor.h @@ -599,10 +599,13 @@ cpu_reboot(int howto, char *user_boot_st */ maybe_dump(howto); - if ((howto RB_NOSYNC) == 0 !syncdone) { + /* + * If we've panic'd, don't make the situation potentially + * worse by syncing or unmounting the file systems. + */ + if ((howto RB_NOSYNC) == 0 panicstr == NULL) { if (!syncdone) { - syncdone = true; - vfs_shutdown(); + syncdone = true; /* XXX used to force unmount as well, here */ vfs_sync_all(l); /* @@ -630,6 +633,7 @@ cpu_reboot(int howto, char *user_boot_st splhigh(); haltsys: + doshutdownhooks(); #ifdef MULTIPROCESSOR /* Stop all secondary cpus */
CVS commit: src/lib/libperfuse
Module Name:src Committed By: manu Date: Tue Oct 28 16:54:11 UTC 2014 Modified Files: src/lib/libperfuse: ops.c Log Message: Fix invalid free in deletextattr FUSE handler Do not free FUSE message on error as it was not allocated. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/lib/libperfuse/ops.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/libperfuse/ops.c diff -u src/lib/libperfuse/ops.c:1.76 src/lib/libperfuse/ops.c:1.77 --- src/lib/libperfuse/ops.c:1.76 Sat Oct 11 04:19:38 2014 +++ src/lib/libperfuse/ops.c Tue Oct 28 16:54:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ops.c,v 1.76 2014/10/11 04:19:38 manu Exp $ */ +/* $NetBSD: ops.c,v 1.77 2014/10/28 16:54:11 manu Exp $ */ /*- * Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved. @@ -3633,9 +3633,11 @@ perfuse_node_deleteextattr(struct puffs_ (void)strlcpy(np, attrname, attrnamelen); error = xchg_msg(pu, opc, pm, NO_PAYLOAD_REPLY_LEN, wait_reply); + if (error != 0) + goto out; ps-ps_destroy_msg(pm); - +out: node_rele(opc); return error; }
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: riz Date: Tue Oct 28 17:44:47 UTC 2014 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: Work around the problem in PR port-amd64/49150 for all CPUs under Xen. The problem (calling xrstor, which is privileged in Xen) has appeared on some Intel CPUs as well, so implement the workaround (ensure that x86_xsave_features is 0) for all CPUs, not just AMD CPUs. XXX pullup to 7 To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/arch/x86/x86/identcpu.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/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.46 src/sys/arch/x86/x86/identcpu.c:1.47 --- src/sys/arch/x86/x86/identcpu.c:1.46 Tue Oct 14 03:16:56 2014 +++ src/sys/arch/x86/x86/identcpu.c Tue Oct 28 17:44:47 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.46 2014/10/14 03:16:56 jnemeth Exp $ */ +/* $NetBSD: identcpu.c,v 1.47 2014/10/28 17:44:47 riz Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: identcpu.c,v 1.46 2014/10/14 03:16:56 jnemeth Exp $); +__KERNEL_RCSID(0, $NetBSD: identcpu.c,v 1.47 2014/10/28 17:44:47 riz Exp $); #include opt_xen.h @@ -757,10 +757,9 @@ cpu_probe_fpu(struct cpu_info *ci) /* XXX these probably ought to be per-cpu */ if (descs[2] 512) x86_fpu_save_size = descs[2]; -#ifdef XEN - if (cpu_vendor != CPUVENDOR_AMD) +#ifndef XEN + x86_xsave_features = (uint64_t)descs[3] 32 | descs[0]; #endif - x86_xsave_features = (uint64_t)descs[3] 32 | descs[0]; } void
CVS commit: src/sys/arch/riscv/include
Module Name:src Committed By: dennis Date: Tue Oct 28 19:46:18 UTC 2014 Modified Files: src/sys/arch/riscv/include: byte_swap.h Log Message: Correct 32 and 64 bit byte swap inlines. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/include/byte_swap.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/riscv/include/byte_swap.h diff -u src/sys/arch/riscv/include/byte_swap.h:1.1 src/sys/arch/riscv/include/byte_swap.h:1.2 --- src/sys/arch/riscv/include/byte_swap.h:1.1 Fri Sep 19 17:36:26 2014 +++ src/sys/arch/riscv/include/byte_swap.h Tue Oct 28 19:46:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: byte_swap.h,v 1.1 2014/09/19 17:36:26 matt Exp $ */ +/* $NetBSD: byte_swap.h,v 1.2 2014/10/28 19:46:18 dennis Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -63,9 +63,9 @@ static __inline uint64_t __byte_swap_u64_variable(uint64_t v) { v = ((v 0x00ff) (56 - 0)) | ((v (56 - 0)) 0x00ff) - | ((v 0xff00) (48 - 8)) | ((v (48 - 8)) 0xff00) - | ((v 0x00ff) (40 - 16)) | ((v (40 - 16)) 0x00ff) - | ((v 0xff00) (32 - 24)) | ((v (32 - 24)) 0xff00); + | ((v 0xff00) (48 - 8)) | ((v (48 - 8)) 0xff00) + | ((v 0x00ff) (40 - 16)) | ((v (40 - 16)) 0x00ff) + | ((v 0xff00) (32 - 24)) | ((v (32 - 24)) 0xff00); return v; } @@ -75,7 +75,7 @@ static __inline uint32_t __byte_swap_u32_variable(uint32_t v) { v = ((v 0x00ff) (24 - 0)) | ((v (24 - 0)) 0x00ff) - | ((v 0xff00) (16 - 8)) | ((v (16 - 8)) 0xff00); + | ((v 0xff00) (16 - 8)) | ((v (16 - 8)) 0xff00); return v; }
CVS commit: src/sys/arch/riscv/include
Module Name:src Committed By: dennis Date: Tue Oct 28 20:25:36 UTC 2014 Modified Files: src/sys/arch/riscv/include: byte_swap.h Log Message: Shave an instruction from the generated code for the 32 bit byte swap inline. Prune 5 or 9 instructions (depending on what you count) from the 64 bit byte swap inline. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/riscv/include/byte_swap.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/riscv/include/byte_swap.h diff -u src/sys/arch/riscv/include/byte_swap.h:1.2 src/sys/arch/riscv/include/byte_swap.h:1.3 --- src/sys/arch/riscv/include/byte_swap.h:1.2 Tue Oct 28 19:46:18 2014 +++ src/sys/arch/riscv/include/byte_swap.h Tue Oct 28 20:25:36 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: byte_swap.h,v 1.2 2014/10/28 19:46:18 dennis Exp $ */ +/* $NetBSD: byte_swap.h,v 1.3 2014/10/28 20:25:36 dennis Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -62,10 +62,12 @@ __BEGIN_DECLS static __inline uint64_t __byte_swap_u64_variable(uint64_t v) { - v = ((v 0x00ff) (56 - 0)) | ((v (56 - 0)) 0x00ff) - | ((v 0xff00) (48 - 8)) | ((v (48 - 8)) 0xff00) - | ((v 0x00ff) (40 - 16)) | ((v (40 - 16)) 0x00ff) - | ((v 0xff00) (32 - 24)) | ((v (32 - 24)) 0xff00); + const uint64_t m1 = 0xull; + const uint64_t m0 = 0x00ff00ff00ff00ffull; + + v = (v 32) | (v 32); + v = ((v 16) m1) | ((v m1) 16); + v = ((v 8) m0) | ((v m0) 8); return v; } @@ -74,8 +76,10 @@ __byte_swap_u64_variable(uint64_t v) static __inline uint32_t __byte_swap_u32_variable(uint32_t v) { - v = ((v 0x00ff) (24 - 0)) | ((v (24 - 0)) 0x00ff) - | ((v 0xff00) (16 - 8)) | ((v (16 - 8)) 0xff00); + const uint32_t m = 0xff00ff; + + v = (v 16) | (v 16); + v = ((v 8) m) | ((v m) 8); return v; }
CVS commit: src/crypto/external/bsd/openssh/dist
Module Name:src Committed By: joerg Date: Tue Oct 28 21:35:57 UTC 2014 Modified Files: src/crypto/external/bsd/openssh/dist: sshbuf.h Log Message: Mark sshbuf_putfv as __printflike. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/dist/sshbuf.h 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/openssh/dist/sshbuf.h diff -u src/crypto/external/bsd/openssh/dist/sshbuf.h:1.2 src/crypto/external/bsd/openssh/dist/sshbuf.h:1.3 --- src/crypto/external/bsd/openssh/dist/sshbuf.h:1.2 Sun Oct 19 16:30:59 2014 +++ src/crypto/external/bsd/openssh/dist/sshbuf.h Tue Oct 28 21:35:56 2014 @@ -161,7 +161,8 @@ int sshbuf_putb(struct sshbuf *buf, cons /* Append using a printf(3) format */ int sshbuf_putf(struct sshbuf *buf, const char *fmt, ...) __attribute__((format(printf, 2, 3))); -int sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap); +int sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap) + __printflike(2, 0); /* Functions to extract or store big-endian words of various sizes */ int sshbuf_get_u64(struct sshbuf *buf, u_int64_t *valp);
CVS commit: src/crypto/external/bsd/openssh/dist
Module Name:src Committed By: joerg Date: Tue Oct 28 21:36:16 UTC 2014 Modified Files: src/crypto/external/bsd/openssh/dist: sshd.c Log Message: sighup_handler is not dead. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/crypto/external/bsd/openssh/dist/sshd.c 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/openssh/dist/sshd.c diff -u src/crypto/external/bsd/openssh/dist/sshd.c:1.14 src/crypto/external/bsd/openssh/dist/sshd.c:1.15 --- src/crypto/external/bsd/openssh/dist/sshd.c:1.14 Sun Oct 19 16:30:59 2014 +++ src/crypto/external/bsd/openssh/dist/sshd.c Tue Oct 28 21:36:16 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sshd.c,v 1.14 2014/10/19 16:30:59 christos Exp $ */ +/* $NetBSD: sshd.c,v 1.15 2014/10/28 21:36:16 joerg Exp $ */ /* $OpenBSD: sshd.c,v 1.428 2014/07/15 15:54:14 millert Exp $ */ /* * Author: Tatu Ylonen y...@cs.hut.fi @@ -44,7 +44,7 @@ */ #include includes.h -__RCSID($NetBSD: sshd.c,v 1.14 2014/10/19 16:30:59 christos Exp $); +__RCSID($NetBSD: sshd.c,v 1.15 2014/10/28 21:36:16 joerg Exp $); #include sys/types.h #include sys/param.h #include sys/ioctl.h @@ -287,7 +287,7 @@ close_startup_pipes(void) */ /*ARGSUSED*/ -__dead static void +static void sighup_handler(int sig) { int save_errno = errno;
CVS commit: src/crypto/external/bsd/openssh/dist
Module Name:src Committed By: joerg Date: Tue Oct 28 21:36:30 UTC 2014 Modified Files: src/crypto/external/bsd/openssh/dist: umac.c Log Message: xor32 may be unused, mark it so. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/openssh/dist/umac.c 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/openssh/dist/umac.c diff -u src/crypto/external/bsd/openssh/dist/umac.c:1.7 src/crypto/external/bsd/openssh/dist/umac.c:1.8 --- src/crypto/external/bsd/openssh/dist/umac.c:1.7 Mon Oct 20 10:31:32 2014 +++ src/crypto/external/bsd/openssh/dist/umac.c Tue Oct 28 21:36:30 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: umac.c,v 1.7 2014/10/20 10:31:32 martin Exp $ */ +/* $NetBSD: umac.c,v 1.8 2014/10/28 21:36:30 joerg Exp $ */ /* $OpenBSD: umac.c,v 1.11 2014/07/22 07:13:42 guenther Exp $ */ /* --- * @@ -67,7 +67,7 @@ /* -- */ #include includes.h -__RCSID($NetBSD: umac.c,v 1.7 2014/10/20 10:31:32 martin Exp $); +__RCSID($NetBSD: umac.c,v 1.8 2014/10/28 21:36:30 joerg Exp $); #include sys/types.h #include sys/endian.h #include string.h @@ -239,7 +239,7 @@ xor64(uint8_t *dp, int di, uint8_t *sp, memcpy(dp + sizeof(dst) * di, dst, sizeof(dst)); } -static inline void +__unused static inline void xor32(uint8_t *dp, int di, uint8_t *sp, int si) { uint32_t dst, src;
CVS import: src/external/bsd/openresolv/dist
Module Name:src Committed By: roy Date: Tue Oct 28 22:37:59 UTC 2014 Update of /cvsroot/src/external/bsd/openresolv/dist In directory ivanova.netbsd.org:/tmp/cvs-serv18537 Log Message: Import openresolv-3.6.1 with the following changes: * Don't update when nothing has been deleted * Backup resolv.conf to resolv.conf.bak when it doesn't have an openresolv signature Restore it when the new resolv.conf only has the openresolv signature * Document prepend_search and prepend_nameservers * Implement append_search and append_nameservers * Implement replace and replace_sub to allow for keyword/value/replacement Status: Vendor Tag: roy Release Tags: openresolv-3-6-1 U src/external/bsd/openresolv/dist/README U src/external/bsd/openresolv/dist/resolvconf.in C src/external/bsd/openresolv/dist/resolvconf.8.in C src/external/bsd/openresolv/dist/resolvconf.conf.5.in U src/external/bsd/openresolv/dist/libc.in U src/external/bsd/openresolv/dist/dnsmasq.in U src/external/bsd/openresolv/dist/named.in U src/external/bsd/openresolv/dist/pdnsd.in U src/external/bsd/openresolv/dist/unbound.in 2 conflicts created by this import. Use the following command to help the merge: cvs checkout -jroy:yesterday -jroy src/external/bsd/openresolv/dist
CVS commit: src/external/bsd/openresolv/dist
Module Name:src Committed By: roy Date: Tue Oct 28 22:39:25 UTC 2014 Modified Files: src/external/bsd/openresolv/dist: resolvconf.8.in resolvconf.conf.5.in Log Message: Sync To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/openresolv/dist/resolvconf.8.in cvs rdiff -u -r1.10 -r1.11 \ src/external/bsd/openresolv/dist/resolvconf.conf.5.in 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/openresolv/dist/resolvconf.8.in diff -u src/external/bsd/openresolv/dist/resolvconf.8.in:1.3 src/external/bsd/openresolv/dist/resolvconf.8.in:1.4 --- src/external/bsd/openresolv/dist/resolvconf.8.in:1.3 Mon Oct 20 09:11:35 2014 +++ src/external/bsd/openresolv/dist/resolvconf.8.in Tue Oct 28 22:39:25 2014 @@ -22,7 +22,7 @@ .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\ SUCH DAMAGE. .\ -.Dd October 20, 2014 +.Dd October 26, 2014 .Dt RESOLVCONF 8 SMM .Os .Sh NAME @@ -81,7 +81,7 @@ will supply files that the resolver shou assumes it has a job to do. In some situations .Nm -needs to act as a deterent to writing to +needs to act as a deterrent to writing to .Pa /etc/resolv.conf . Where this file cannot be made immutable or you just need to toggle this behaviour, @@ -220,6 +220,8 @@ as private. .El .Sh FILES .Bl -ohang +.It Pa /etc/resolv.conf.bak +Backup file of the original resolv.conf. .It Pa @SYSCONFDIR@/resolvconf.conf Configuration file for .Nm . Index: src/external/bsd/openresolv/dist/resolvconf.conf.5.in diff -u src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.10 src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.11 --- src/external/bsd/openresolv/dist/resolvconf.conf.5.in:1.10 Mon Oct 20 09:11:35 2014 +++ src/external/bsd/openresolv/dist/resolvconf.conf.5.in Tue Oct 28 22:39:25 2014 @@ -22,7 +22,7 @@ .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\ SUCH DAMAGE. .\ -.Dd October 20, 2014 +.Dd October 28, 2014 .Dt RESOLVCONF.CONF 5 SMM .Os .Sh NAME @@ -48,6 +48,9 @@ ensure they are quoted and escaped corre After updating this file, you may wish to run .Nm resolvconf -u to apply the new configuration. +.Pp +When a dynmically generated list is appended or prepended to, the whole +is made unique where left-most wins. .Sh RESOLVCONF OPTIONS .Bl -tag -width indent .It Sy resolvconf @@ -91,6 +94,34 @@ Useful for VPN domains. This is equivalent to the .Nm resolvconf -p option. +.It Sy replace +Is a space separated list of replacement keywords. The syntax is this: +.Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement +.Pp +Example, given this resolv.conf: +.D1 domain foo.org +.D1 search foo.org dead.beef +.D1 nameserver 1.2.3.4 +.D1 nameserver 2.3.4.5 +and this configuaration: +.D1 replace=search/foo*/bar.com nameserver/1.2.3.4/5.6.7.8 nameserver/2.3.4.5/ +you would get this resolv.conf instead: +.D1 domain foo.org +.D1 search bar.com +.D1 nameserver 5.6.7.8 +.It Sy replace_sub +Works the same way as +.Sy replace +except it works on each space separated value rather than the whole line, +so it's useful for the replacing a single domain within the search directive. +Using the same example resolv.conf and changing +.Sy replace +to +.Sy replace_sub , +you would get this resolv.conf instead: +.D1 domain foo.org +.D1 search bar.com dead.beef +.D1 nameserver 5.6.7.8 .It Sy state_dir Override the default state directory of .Pa @VARDIR@ . @@ -132,6 +163,14 @@ name server. Set this to NO to also list non-local nameservers. This will give you working DNS even if the local nameserver stops functioning at the expense of duplicated server queries. +.It Sy append_nameservers +Append name servers to the dynamically generated list. +.It Sy prepend_nameservers +Prepend name servers to the dynamically generated list. +.It Sy append_search +Append search domains to the dynamically generated list. +.It Sy prepend_search +Prepend search domains to the dynamically generated list. .El .Sh SUBSCRIBER OPTIONS openresolv ships with subscribers for the name servers
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Tue Oct 28 23:48:04 UTC 2014 Modified Files: src/lib/librumpuser: Makefile Log Message: Don't install rumpuser.h here. It's already installed by the rump kernel build (sys/rump/include/rump) To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/lib/librumpuser/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpuser/Makefile diff -u src/lib/librumpuser/Makefile:1.21 src/lib/librumpuser/Makefile:1.22 --- src/lib/librumpuser/Makefile:1.21 Tue Jul 22 22:41:58 2014 +++ src/lib/librumpuser/Makefile Tue Oct 28 23:48:03 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.21 2014/07/22 22:41:58 justin Exp $ +# $NetBSD: Makefile,v 1.22 2014/10/28 23:48:03 pooka Exp $ # .include bsd.own.mk @@ -50,7 +50,7 @@ SRCS+= rumpuser_errtrans.c rumpuser_sig SRCS+= rumpuser_dl.c rumpuser_daemonize.c INCSDIR= /usr/include/rump -INCS= rumpuser.h rumpuser_component.h rumpuser_port.h +INCS= rumpuser_component.h rumpuser_port.h MAN= rumpuser.3
CVS commit: src/sys/dev/adb
Module Name:src Committed By: macallan Date: Wed Oct 29 00:48:12 UTC 2014 Modified Files: src/sys/dev/adb: adb_ms.c Log Message: actually support EMP ( as in, look for additional motion info bits, not just buttons ) To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/adb/adb_ms.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/adb/adb_ms.c diff -u src/sys/dev/adb/adb_ms.c:1.15 src/sys/dev/adb/adb_ms.c:1.16 --- src/sys/dev/adb/adb_ms.c:1.15 Mon Nov 18 11:02:34 2013 +++ src/sys/dev/adb/adb_ms.c Wed Oct 29 00:48:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: adb_ms.c,v 1.15 2013/11/18 11:02:34 nisimura Exp $ */ +/* $NetBSD: adb_ms.c,v 1.16 2014/10/29 00:48:12 macallan Exp $ */ /* * Copyright (C) 1998 Colin Wood @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: adb_ms.c,v 1.15 2013/11/18 11:02:34 nisimura Exp $); +__KERNEL_RCSID(0, $NetBSD: adb_ms.c,v 1.16 2014/10/29 00:48:12 macallan Exp $); #include sys/param.h #include sys/device.h @@ -564,8 +564,38 @@ adbms_process_event(struct adbms_softc * break; } - dx = ((int)(buffer[1] 0x3f)) - ((buffer[1] 0x40) ? 64 : 0); - dy = ((int)(buffer[0] 0x3f)) - ((buffer[0] 0x40) ? 64 : 0); + if (sc-sc_adbdev-handler_id != ADBMS_EXTENDED) { + dx = ((int)(buffer[1] 0x3f)) - ((buffer[1] 0x40) ? 64 : 0); + dy = ((int)(buffer[0] 0x3f)) - ((buffer[0] 0x40) ? 64 : 0); + } else { + /* EMP crap, additional motion bits */ + int shift = 7, ddx, ddy, sign, smask; + +#ifdef ADBMS_DEBUG + printf(EMP packet:); + for (i = 0; i len; i++) + printf( %02x, buffer[i]); + printf(\n); +#endif + dx = (int)buffer[1] 0x7f; + dy = (int)buffer[0] 0x7f; + for (i = 2; i len; i++) { + ddx = (buffer[i] 0x07); + ddy = (buffer[i] 0x70) 4; + dx |= (ddx shift); + dy |= (ddy shift); + shift += 3; + } + sign = 1 (shift - 1); + smask = 0x shift; + if (dx sign) + dx |= smask; + if (dy sign) + dy |= smask; +#ifdef ADBMS_DEBUG + printf(%d %d %08x %d\n, dx, dy, smask, shift); +#endif + } if (sc-sc_class == MSCLASS_TRACKPAD) {
CVS import: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Wed Oct 29 01:03:55 UTC 2014 Update of /cvsroot/src/external/bsd/dhcpcd/dist In directory ivanova.netbsd.org:/tmp/cvs-serv24798 Log Message: dhcpcd-6.6.0 has been imported with the following changes: * Log the address IPv4LL defends * PREINIT, UNKNOWN and CARRIER are not either up nor down states * ARP code re-written to allow for many ARP states * IPv4LL address is now pseudo random based on HW address instead of really random as per RFC 3927 Section 2.1 * If not doing DHCP or DHCP6, disable the DNS requirement in the RA to fork. * Treat IPv4LL as fallback and start DHCP discovery even if the prior lease was IPv4LL when rebooting. * When we transition from REQUEST to DISCOVER in a reboot, start IPv4LL at the same time as discover to ensure we have an address quicker. Status: Vendor Tag: roy Release Tags: dhcpcd-6-6-0 U src/external/bsd/dhcpcd/dist/common.c U src/external/bsd/dhcpcd/dist/control.c C src/external/bsd/dhcpcd/dist/dhcpcd.c U src/external/bsd/dhcpcd/dist/duid.c U src/external/bsd/dhcpcd/dist/eloop.c U src/external/bsd/dhcpcd/dist/if.c U src/external/bsd/dhcpcd/dist/if-options.c C src/external/bsd/dhcpcd/dist/script.c U src/external/bsd/dhcpcd/dist/dhcp-common.c U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c U src/external/bsd/dhcpcd/dist/if-bsd.c C src/external/bsd/dhcpcd/dist/arp.c C src/external/bsd/dhcpcd/dist/dhcp.c C src/external/bsd/dhcpcd/dist/ipv4.c C src/external/bsd/dhcpcd/dist/ipv4ll.c U src/external/bsd/dhcpcd/dist/ipv6.c C src/external/bsd/dhcpcd/dist/ipv6nd.c U src/external/bsd/dhcpcd/dist/dhcp6.c U src/external/bsd/dhcpcd/dist/auth.c U src/external/bsd/dhcpcd/dist/dhcpcd.conf U src/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c.in U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in U src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in U src/external/bsd/dhcpcd/dist/dhcpcd.8.in C src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in C src/external/bsd/dhcpcd/dist/arp.h U src/external/bsd/dhcpcd/dist/auth.h U src/external/bsd/dhcpcd/dist/bpf-filter.h U src/external/bsd/dhcpcd/dist/common.h U src/external/bsd/dhcpcd/dist/config.h U src/external/bsd/dhcpcd/dist/control.h C src/external/bsd/dhcpcd/dist/defs.h U src/external/bsd/dhcpcd/dist/dev.h U src/external/bsd/dhcpcd/dist/dhcp-common.h C src/external/bsd/dhcpcd/dist/dhcp.h U src/external/bsd/dhcpcd/dist/dhcp6.h U src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h U src/external/bsd/dhcpcd/dist/dhcpcd.h U src/external/bsd/dhcpcd/dist/duid.h U src/external/bsd/dhcpcd/dist/eloop.h C src/external/bsd/dhcpcd/dist/if-options.h U src/external/bsd/dhcpcd/dist/if.h C src/external/bsd/dhcpcd/dist/ipv4.h C src/external/bsd/dhcpcd/dist/ipv4ll.h U src/external/bsd/dhcpcd/dist/ipv6.h U src/external/bsd/dhcpcd/dist/ipv6nd.h U src/external/bsd/dhcpcd/dist/script.h U src/external/bsd/dhcpcd/dist/crypt/hmac_md5.c U src/external/bsd/dhcpcd/dist/crypt/crypt.h U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/02-dump U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/10-wpa_supplicant U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/15-timezone U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/29-lookup-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf U src/external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind 14 conflicts created by this import. Use the following command to help the merge: cvs checkout -jroy:yesterday -jroy src/external/bsd/dhcpcd/dist
CVS commit: src/external/bsd/dhcpcd/dist
Module Name:src Committed By: roy Date: Wed Oct 29 01:08:31 UTC 2014 Modified Files: src/external/bsd/dhcpcd/dist: arp.c arp.h auth.c auth.h bpf-filter.h common.c common.h config.h control.c control.h defs.h dev.h dhcp-common.c dhcp-common.h dhcp.c dhcp.h dhcp6.c dhcp6.h dhcpcd-definitions.conf dhcpcd-embedded.c dhcpcd-embedded.h dhcpcd-run-hooks.8.in dhcpcd-run-hooks.in dhcpcd.8.in dhcpcd.c dhcpcd.conf dhcpcd.conf.5.in dhcpcd.h duid.c duid.h eloop.c eloop.h if-bsd.c if-options.c if-options.h if.c if.h ipv4.c ipv4.h ipv4ll.c ipv4ll.h ipv6.c ipv6.h ipv6nd.c ipv6nd.h script.c script.h Log Message: Sync To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/dhcpcd/dist/arp.c \ src/external/bsd/dhcpcd/dist/arp.h src/external/bsd/dhcpcd/dist/auth.c \ src/external/bsd/dhcpcd/dist/auth.h src/external/bsd/dhcpcd/dist/common.c \ src/external/bsd/dhcpcd/dist/common.h \ src/external/bsd/dhcpcd/dist/config.h \ src/external/bsd/dhcpcd/dist/control.c \ src/external/bsd/dhcpcd/dist/control.h \ src/external/bsd/dhcpcd/dist/defs.h src/external/bsd/dhcpcd/dist/dev.h \ src/external/bsd/dhcpcd/dist/dhcp-common.c \ src/external/bsd/dhcpcd/dist/dhcp-common.h \ src/external/bsd/dhcpcd/dist/dhcp.h src/external/bsd/dhcpcd/dist/dhcp6.c \ src/external/bsd/dhcpcd/dist/dhcp6.h \ src/external/bsd/dhcpcd/dist/dhcpcd-definitions.conf \ src/external/bsd/dhcpcd/dist/dhcpcd-embedded.c \ src/external/bsd/dhcpcd/dist/dhcpcd-embedded.h \ src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in \ src/external/bsd/dhcpcd/dist/dhcpcd.h src/external/bsd/dhcpcd/dist/duid.c \ src/external/bsd/dhcpcd/dist/duid.h src/external/bsd/dhcpcd/dist/eloop.c \ src/external/bsd/dhcpcd/dist/eloop.h \ src/external/bsd/dhcpcd/dist/if-options.h \ src/external/bsd/dhcpcd/dist/if.c src/external/bsd/dhcpcd/dist/if.h \ src/external/bsd/dhcpcd/dist/ipv4.c src/external/bsd/dhcpcd/dist/ipv4.h \ src/external/bsd/dhcpcd/dist/ipv4ll.c \ src/external/bsd/dhcpcd/dist/ipv4ll.h src/external/bsd/dhcpcd/dist/ipv6.c \ src/external/bsd/dhcpcd/dist/ipv6.h src/external/bsd/dhcpcd/dist/ipv6nd.h \ src/external/bsd/dhcpcd/dist/script.h cvs rdiff -u -r1.6 -r1.7 src/external/bsd/dhcpcd/dist/bpf-filter.h cvs rdiff -u -r1.19 -r1.20 src/external/bsd/dhcpcd/dist/dhcp.c cvs rdiff -u -r1.9 -r1.10 src/external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in cvs rdiff -u -r1.33 -r1.34 src/external/bsd/dhcpcd/dist/dhcpcd.8.in cvs rdiff -u -r1.13 -r1.14 src/external/bsd/dhcpcd/dist/dhcpcd.c \ src/external/bsd/dhcpcd/dist/dhcpcd.conf.5.in cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/dhcpcd.conf \ src/external/bsd/dhcpcd/dist/if-bsd.c cvs rdiff -u -r1.14 -r1.15 src/external/bsd/dhcpcd/dist/if-options.c \ src/external/bsd/dhcpcd/dist/ipv6nd.c cvs rdiff -u -r1.11 -r1.12 src/external/bsd/dhcpcd/dist/script.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/dhcpcd/dist/arp.c diff -u src/external/bsd/dhcpcd/dist/arp.c:1.3 src/external/bsd/dhcpcd/dist/arp.c:1.4 --- src/external/bsd/dhcpcd/dist/arp.c:1.3 Fri Oct 17 23:42:24 2014 +++ src/external/bsd/dhcpcd/dist/arp.c Wed Oct 29 01:08:31 2014 @@ -1,5 +1,5 @@ #include sys/cdefs.h - __RCSID($NetBSD: arp.c,v 1.3 2014/10/17 23:42:24 roy Exp $); + __RCSID($NetBSD: arp.c,v 1.4 2014/10/29 01:08:31 roy Exp $); /* * dhcpcd - DHCP client daemon @@ -42,7 +42,7 @@ #include syslog.h #include unistd.h -#define ELOOP_QUEUE 2 +#define ELOOP_QUEUE 5 #include config.h #include arp.h #include ipv4.h @@ -97,31 +97,15 @@ eexit: return -1; } -static void -arp_failure(struct interface *ifp) +void +arp_report_conflicted(const struct arp_state *astate, const struct arp_msg *amsg) { - const struct dhcp_state *state = D_CSTATE(ifp); - - /* If we failed without a magic cookie then we need to try - * and defend our IPv4LL address. */ - if ((state-offer != NULL - state-offer-cookie != htonl(MAGIC_COOKIE)) || - (state-new != NULL - state-new-cookie != htonl(MAGIC_COOKIE))) - { - ipv4ll_handle_failure(ifp); - return; - } + char buf[HWADDR_LEN * 3]; - unlink(state-leasefile); - if (!state-lease.frominfo) - dhcp_decline(ifp); - eloop_timeout_delete(ifp-ctx-eloop, NULL, ifp); - if (state-lease.frominfo) - dhcpcd_startinterface(ifp); - else - eloop_timeout_add_sec(ifp-ctx-eloop, - DHCP_ARP_FAIL, dhcpcd_startinterface, ifp); + syslog(LOG_ERR, %s: hardware address %s claims %s, + astate-iface-name, + hwaddr_ntoa(amsg-sha, astate-iface-hwlen, buf, sizeof(buf)), + inet_ntoa(astate-failed)); } static void @@ -131,19 +115,14 @@ arp_packet(void *arg) const struct interface *ifn; uint8_t arp_buffer[ARP_LEN]; struct arphdr ar; - uint32_t reply_s; - uint32_t reply_t; - uint8_t *hw_s, *hw_t; + struct
CVS commit: src/sys/ufs/ufs
Module Name:src Committed By: christos Date: Wed Oct 29 01:13:28 UTC 2014 Modified Files: src/sys/ufs/ufs: ufs_extern.h ufs_inode.c ufs_vnops.c Log Message: simplify and correct. To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sys/ufs/ufs/ufs_extern.h cvs rdiff -u -r1.91 -r1.92 src/sys/ufs/ufs/ufs_inode.c cvs rdiff -u -r1.223 -r1.224 src/sys/ufs/ufs/ufs_vnops.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/ufs/ufs/ufs_extern.h diff -u src/sys/ufs/ufs/ufs_extern.h:1.76 src/sys/ufs/ufs/ufs_extern.h:1.77 --- src/sys/ufs/ufs/ufs_extern.h:1.76 Tue Oct 21 06:39:26 2014 +++ src/sys/ufs/ufs/ufs_extern.h Tue Oct 28 21:13:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_extern.h,v 1.76 2014/10/21 10:39:26 slp Exp $ */ +/* $NetBSD: ufs_extern.h,v 1.77 2014/10/29 01:13:28 christos Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -111,7 +111,7 @@ int ufs_getlbns(struct vnode *, daddr_t, /* ufs_inode.c */ int ufs_reclaim(struct vnode *); int ufs_balloc_range(struct vnode *, off_t, off_t, kauth_cred_t, int); -int ufs_wapbl_truncate(struct vnode *, uint64_t, uint64_t, uint64_t); +int ufs_truncate(struct vnode *, uint64_t, kauth_cred_t); /* ufs_lookup.c */ void ufs_dirbad(struct inode *, doff_t, const char *); Index: src/sys/ufs/ufs/ufs_inode.c diff -u src/sys/ufs/ufs/ufs_inode.c:1.91 src/sys/ufs/ufs/ufs_inode.c:1.92 --- src/sys/ufs/ufs/ufs_inode.c:1.91 Tue Oct 21 06:39:26 2014 +++ src/sys/ufs/ufs/ufs_inode.c Tue Oct 28 21:13:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_inode.c,v 1.91 2014/10/21 10:39:26 slp Exp $ */ +/* $NetBSD: ufs_inode.c,v 1.92 2014/10/29 01:13:28 christos Exp $ */ /* * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ufs_inode.c,v 1.91 2014/10/21 10:39:26 slp Exp $); +__KERNEL_RCSID(0, $NetBSD: ufs_inode.c,v 1.92 2014/10/29 01:13:28 christos Exp $); #if defined(_KERNEL_OPT) #include opt_ffs.h @@ -87,7 +87,6 @@ ufs_inactive(void *v) struct mount *transmp; mode_t mode; int error = 0; - int logged = 0; UFS_WAPBL_JUNLOCK_ASSERT(vp-v_mount); @@ -102,26 +101,8 @@ ufs_inactive(void *v) #ifdef UFS_EXTATTR ufs_extattr_vnode_inactive(vp, curlwp); #endif - if (ip-i_size != 0) { - uint64_t incr = MNINDIR(ip-i_ump) - vp-v_mount-mnt_fs_bshift; /* Power of 2 */ - uint64_t base = UFS_NDADDR - vp-v_mount-mnt_fs_bshift; - /* - * When journaling, only truncate one indirect block - * at a time - */ - if (vp-v_mount-mnt_wapbl ip-i_size base + incr) { -error = ufs_wapbl_truncate(vp, incr, base, 0); - } - if (!error) { -error = UFS_WAPBL_BEGIN(vp-v_mount); -if (error) - goto out; -logged = 1; -error = UFS_TRUNCATE(vp, (off_t)0, 0, NOCRED); - } - } + if (ip-i_size != 0) + error = ufs_truncate(vp, 0, NOCRED); #if defined(QUOTA) || defined(QUOTA2) (void)chkiq(ip, -1, NOCRED, 0); #endif @@ -137,16 +118,12 @@ ufs_inactive(void *v) } if (ip-i_flag (IN_CHANGE | IN_UPDATE | IN_MODIFIED)) { - if (!logged++) { - int err; - err = UFS_WAPBL_BEGIN(vp-v_mount); - if (err) -goto out; - } + error = UFS_WAPBL_BEGIN(vp-v_mount); + if (error) + goto out; UFS_UPDATE(vp, NULL, NULL, 0); - } - if (logged) UFS_WAPBL_END(vp-v_mount); + } out: /* * If we are done with the inode, reclaim it @@ -295,25 +272,23 @@ ufs_balloc_range(struct vnode *vp, off_t return error; } -int -ufs_wapbl_truncate(struct vnode *vp, uint64_t incr, uint64_t base, -uint64_t newsize) +static int +ufs_wapbl_truncate(struct vnode *vp, uint64_t newsize, kauth_cred_t cred) { struct inode *ip = VTOI(vp); - int error; - - error = UFS_WAPBL_BEGIN(vp-v_mount); - if (error) - return error; + int error = 0; + uint64_t base, incr; - while (ip-i_size base + incr) { + base = UFS_NDADDR vp-v_mount-mnt_fs_bshift; + incr = MNINDIR(ip-i_ump) vp-v_mount-mnt_fs_bshift;/* Power of 2 */ + while (ip-i_size base + incr + (newsize == 0 || ip-i_size newsize + incr)) { /* * round down to next full indirect * block boundary. */ - uint64_t nsize = - base + ((ip-i_size - base - 1) ~(incr - 1)); - error = UFS_TRUNCATE(vp, nsize, 0, NOCRED); + uint64_t nsize = base + ((ip-i_size - base - 1) ~(incr - 1)); + error = UFS_TRUNCATE(vp, nsize, 0, cred); if (error) break; UFS_WAPBL_END(vp-v_mount); @@ -321,6 +296,23 @@ ufs_wapbl_truncate(struct vnode *vp, uin if (error) return error; } + return error; +} + +int +ufs_truncate(struct vnode *vp, uint64_t newsize, kauth_cred_t cred) +{ + int error; + + error = UFS_WAPBL_BEGIN(vp-v_mount); + if (error) + return error; + + if (vp-v_mount-mnt_wapbl) + error = ufs_wapbl_truncate(vp, newsize, cred); + + if (error == 0) + error = UFS_TRUNCATE(vp, newsize, 0, cred); UFS_WAPBL_END(vp-v_mount); return error; Index: src/sys/ufs/ufs/ufs_vnops.c diff -u
CVS commit: src/doc
Module Name:src Committed By: roy Date: Wed Oct 29 01:17:34 UTC 2014 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: Note import of dhcpcd and openresolv. To generate a diff of this commit: cvs rdiff -u -r1.1166 -r1.1167 src/doc/3RDPARTY cvs rdiff -u -r1.2005 -r1.2006 src/doc/CHANGES 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.1166 src/doc/3RDPARTY:1.1167 --- src/doc/3RDPARTY:1.1166 Sat Oct 25 21:02:31 2014 +++ src/doc/3RDPARTY Wed Oct 29 01:17:34 2014 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1166 2014/10/25 21:02:31 christos Exp $ +# $NetBSD: 3RDPARTY,v 1.1167 2014/10/29 01:17:34 roy Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -305,8 +305,8 @@ Notes: Use the dhcp2netbsd script. Package: dhcpcd -Version: 6.5.1 -Current Vers: 6.5.1 +Version: 6.6.0 +Current Vers: 6.6.0 Maintainer: roy Archive Site: ftp://roy.marples.name/pub/dhcpcd/ Home Page: http://roy.marples.name/projects/dhcpcd/ @@ -945,8 +945,8 @@ Location: external/bsd/openpam/dist Notes: Package: openresolv -Version: 3.6.0 -Current Vers: 3.6.0 +Version: 3.6.1 +Current Vers: 3.6.1 Maintainer: roy Archive Site: ftp://roy.marples.name/pub/openresolv/ Home Page: http://roy.marples.name/projects/openresolv/ Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2005 src/doc/CHANGES:1.2006 --- src/doc/CHANGES:1.2005 Sun Oct 26 18:43:18 2014 +++ src/doc/CHANGES Wed Oct 29 01:17:34 2014 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: $Revision: 1.2005 $ +# LIST OF CHANGES FROM LAST RELEASE: $Revision: 1.2006 $ # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -91,3 +91,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0: processed sooner. [tls 20141026] viornd(4): Add driver for VirtIO entropy source available on QEMU, KVM, and Google Compute Engine. From OpenBSD. + dhcpcd(8): Import dhcpcd-6.6.0 [roy 20141029] + resolvconf(8): Import openresolv-3.6.1 [roy 20141029]
CVS commit: src/sys/arch
Module Name:src Committed By: dennis Date: Wed Oct 29 01:33:39 UTC 2014 Modified Files: src/sys/arch/aarch64/include: byte_swap.h src/sys/arch/or1k/include: byte_swap.h Log Message: Correct 32 and 64 bit byte swap inlines To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/include/byte_swap.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/or1k/include/byte_swap.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/aarch64/include/byte_swap.h diff -u src/sys/arch/aarch64/include/byte_swap.h:1.2 src/sys/arch/aarch64/include/byte_swap.h:1.3 --- src/sys/arch/aarch64/include/byte_swap.h:1.2 Mon Aug 11 04:03:59 2014 +++ src/sys/arch/aarch64/include/byte_swap.h Wed Oct 29 01:33:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: byte_swap.h,v 1.2 2014/08/11 04:03:59 matt Exp $ */ +/* $NetBSD: byte_swap.h,v 1.3 2014/10/29 01:33:39 dennis Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -59,9 +59,9 @@ __byte_swap_u64_variable(uint64_t v) } v = ((v 0x00ff) (56 - 0)) | ((v (56 - 0)) 0x00ff) - | ((v 0xff00) (48 - 8)) | ((v (48 - 8)) 0xff00) - | ((v 0x00ff) (40 - 16)) | ((v (40 - 16)) 0x00ff) - | ((v 0xff00) (32 - 24)) | ((v (32 - 24)) 0xff00); + | ((v 0xff00) (48 - 8)) | ((v (48 - 8)) 0xff00) + | ((v 0x00ff) (40 - 16)) | ((v (40 - 16)) 0x00ff) + | ((v 0xff00) (32 - 24)) | ((v (32 - 24)) 0xff00); return v; } @@ -76,7 +76,7 @@ __byte_swap_u32_variable(uint32_t v) } v = ((v 0x00ff) (24 - 0)) | ((v (24 - 0)) 0x00ff) - | ((v 0xff00) (16 - 8)) | ((v (16 - 8)) 0xff00); + | ((v 0xff00) (16 - 8)) | ((v (16 - 8)) 0xff00); return v; } Index: src/sys/arch/or1k/include/byte_swap.h diff -u src/sys/arch/or1k/include/byte_swap.h:1.1 src/sys/arch/or1k/include/byte_swap.h:1.2 --- src/sys/arch/or1k/include/byte_swap.h:1.1 Wed Sep 3 19:34:26 2014 +++ src/sys/arch/or1k/include/byte_swap.h Wed Oct 29 01:33:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: byte_swap.h,v 1.1 2014/09/03 19:34:26 matt Exp $ */ +/* $NetBSD: byte_swap.h,v 1.2 2014/10/29 01:33:39 dennis Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -61,9 +61,9 @@ static __inline uint64_t __byte_swap_u64_variable(uint64_t v) { v = ((v 0x00ff) (56 - 0)) | ((v (56 - 0)) 0x00ff) - | ((v 0xff00) (48 - 8)) | ((v (48 - 8)) 0xff00) - | ((v 0x00ff) (40 - 16)) | ((v (40 - 16)) 0x00ff) - | ((v 0xff00) (32 - 24)) | ((v (32 - 24)) 0xff00); + | ((v 0xff00) (48 - 8)) | ((v (48 - 8)) 0xff00) + | ((v 0x00ff) (40 - 16)) | ((v (40 - 16)) 0x00ff) + | ((v 0xff00) (32 - 24)) | ((v (32 - 24)) 0xff00); return v; } @@ -73,7 +73,7 @@ static __inline uint32_t __byte_swap_u32_variable(uint32_t v) { v = ((v 0x00ff) (24 - 0)) | ((v (24 - 0)) 0x00ff) - | ((v 0xff00) (16 - 8)) | ((v (16 - 8)) 0xff00); + | ((v 0xff00) (16 - 8)) | ((v (16 - 8)) 0xff00); return v; }