CVS commit: src/sys/dev/ofw
Module Name:src Committed By: jmcneill Date: Sun Dec 13 11:00:02 UTC 2015 Modified Files: src/sys/dev/ofw: ofw_subr.c Log Message: OF properties are stored in big endian, but the host might not be. Swap the value of the "reg" property where appropriate. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ofw/ofw_subr.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/ofw/ofw_subr.c diff -u src/sys/dev/ofw/ofw_subr.c:1.24 src/sys/dev/ofw/ofw_subr.c:1.25 --- src/sys/dev/ofw/ofw_subr.c:1.24 Sat Dec 12 22:22:51 2015 +++ src/sys/dev/ofw/ofw_subr.c Sun Dec 13 11:00:01 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.24 2015/12/12 22:22:51 jmcneill Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.24 2015/12/12 22:22:51 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $"); #include #include @@ -396,7 +396,7 @@ of_enter_i2c_devs(prop_dictionary_t prop if (OF_getprop(node, "reg", , sizeof(reg64)) < sizeof(reg64)) continue; - addr = reg64; + addr = be64toh(reg64); /* * The i2c bus number (0 or 1) is encoded in bit 33 * of the register, but we encode it in bit 8 of @@ -408,7 +408,7 @@ of_enter_i2c_devs(prop_dictionary_t prop if (OF_getprop(node, "reg", , sizeof(reg32)) < sizeof(reg32)) continue; - addr = reg32; + addr = be32toh(reg32); } else { continue; }
CVS commit: src/sys/dev/ofw
Module Name:src Committed By: jmcneill Date: Sun Dec 13 11:51:13 UTC 2015 Modified Files: src/sys/dev/ofw: ofw_subr.c openfirm.h Log Message: add an addr_shift parameter to of_enter_i2c_devs To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ofw/ofw_subr.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ofw/openfirm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ofw/ofw_subr.c diff -u src/sys/dev/ofw/ofw_subr.c:1.25 src/sys/dev/ofw/ofw_subr.c:1.26 --- src/sys/dev/ofw/ofw_subr.c:1.25 Sun Dec 13 11:00:01 2015 +++ src/sys/dev/ofw/ofw_subr.c Sun Dec 13 11:51:13 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.26 2015/12/13 11:51:13 jmcneill Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.25 2015/12/13 11:00:01 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.26 2015/12/13 11:51:13 jmcneill Exp $"); #include #include @@ -377,7 +377,8 @@ of_get_mode_string(char *buffer, int len * This is used by the i2c bus attach code to do direct configuration. */ void -of_enter_i2c_devs(prop_dictionary_t props, int ofnode, size_t cell_size) +of_enter_i2c_devs(prop_dictionary_t props, int ofnode, size_t cell_size, +int addr_shift) { int node, len; char name[32], compatible[32]; @@ -412,7 +413,7 @@ of_enter_i2c_devs(prop_dictionary_t prop } else { continue; } - addr >>= 1; + addr >>= addr_shift; if (addr == 0) continue; if (array == NULL) Index: src/sys/dev/ofw/openfirm.h diff -u src/sys/dev/ofw/openfirm.h:1.31 src/sys/dev/ofw/openfirm.h:1.32 --- src/sys/dev/ofw/openfirm.h:1.31 Sat Dec 12 22:22:51 2015 +++ src/sys/dev/ofw/openfirm.h Sun Dec 13 11:51:13 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.h,v 1.31 2015/12/12 22:22:51 jmcneill Exp $ */ +/* $NetBSD: openfirm.h,v 1.32 2015/12/13 11:51:13 jmcneill Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -118,6 +118,6 @@ boolean_t of_to_dataprop(prop_dictionary int *of_network_decode_media(int, int *, int *); char *of_get_mode_string(char *, int); -void of_enter_i2c_devs(prop_dictionary_t, int, size_t); +void of_enter_i2c_devs(prop_dictionary_t, int, size_t, int); #endif /*_OPENFIRM_H_*/
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: jmcneill Date: Sun Dec 13 11:51:37 UTC 2015 Modified Files: src/sys/arch/sparc64/sparc64: autoconf.c Log Message: pass addr_shift 1 to of_enter_i2c_devs To generate a diff of this commit: cvs rdiff -u -r1.205 -r1.206 src/sys/arch/sparc64/sparc64/autoconf.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/autoconf.c diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.205 src/sys/arch/sparc64/sparc64/autoconf.c:1.206 --- src/sys/arch/sparc64/sparc64/autoconf.c:1.205 Sun Sep 6 16:45:09 2015 +++ src/sys/arch/sparc64/sparc64/autoconf.c Sun Dec 13 11:51:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.205 2015/09/06 16:45:09 martin Exp $ */ +/* $NetBSD: autoconf.c,v 1.206 2015/12/13 11:51:37 jmcneill Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.205 2015/09/06 16:45:09 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.206 2015/12/13 11:51:37 jmcneill Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -1114,7 +1114,7 @@ noether: } of_enter_i2c_devs(props, busnode, -sizeof(cell_t)); +sizeof(cell_t), 1); } }
CVS commit: src/usr.bin/pmap
Module Name:src Committed By: christos Date: Mon Dec 14 03:15:10 UTC 2015 Modified Files: src/usr.bin/pmap: Makefile main.c pmap.c Log Message: use ecalloc To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.bin/pmap/Makefile cvs rdiff -u -r1.25 -r1.26 src/usr.bin/pmap/main.c cvs rdiff -u -r1.51 -r1.52 src/usr.bin/pmap/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/pmap/Makefile diff -u src/usr.bin/pmap/Makefile:1.5 src/usr.bin/pmap/Makefile:1.6 --- src/usr.bin/pmap/Makefile:1.5 Thu May 26 08:56:33 2011 +++ src/usr.bin/pmap/Makefile Sun Dec 13 22:15:10 2015 @@ -1,12 +1,12 @@ -# $NetBSD: Makefile,v 1.5 2011/05/26 12:56:33 joerg Exp $ +# $NetBSD: Makefile,v 1.6 2015/12/14 03:15:10 christos Exp $ USE_FORT?= yes # setgid PROG= pmap SRCS= main.c pmap.c BINGRP= kmem BINMODE= 2555 -LDADD= -lkvm -DPADD= ${LIBKVM} +LDADD= -lutil -lkvm +DPADD= ${LIBUTIL} ${LIBKVM} CWARNFLAGS.clang+= -Wno-format-extra-args Index: src/usr.bin/pmap/main.c diff -u src/usr.bin/pmap/main.c:1.25 src/usr.bin/pmap/main.c:1.26 --- src/usr.bin/pmap/main.c:1.25 Sun Dec 13 13:09:00 2015 +++ src/usr.bin/pmap/main.c Sun Dec 13 22:15:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.25 2015/12/13 18:09:00 christos Exp $ */ +/* $NetBSD: main.c,v 1.26 2015/12/14 03:15:10 christos Exp $ */ /* * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.25 2015/12/13 18:09:00 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.26 2015/12/14 03:15:10 christos Exp $"); #endif #include @@ -48,6 +48,7 @@ __RCSID("$NetBSD: main.c,v 1.25 2015/12/ #include #include #include +#include #include "pmap.h" #include "main.h" @@ -475,7 +476,7 @@ load_name_cache(kvm_t *kd) _KDEREF(kd, nchash_addr, , sizeof(lnchash)); nchash = (size_t)lnchash + 1; - nchashtbl = malloc(nchash * sizeof(*nchashtbl)); + nchashtbl = ecalloc(nchash, sizeof(*nchashtbl)); _KDEREF(kd, nchashtbl_addr, nchashtbl, sizeof(*nchashtbl) * nchash); ncpp = &_ncpp; @@ -512,7 +513,7 @@ cache_enter(u_long i, struct namecache * i, ncp->nc_vp, ncp->nc_dvp, ncp->nc_nlen, ncp->nc_nlen, ncp->nc_name); - ce = malloc(sizeof(struct cache_entry)); + ce = emalloc(sizeof(struct cache_entry)); ce->ce_vp = ncp->nc_vp; ce->ce_pvp = ncp->nc_dvp; Index: src/usr.bin/pmap/pmap.c diff -u src/usr.bin/pmap/pmap.c:1.51 src/usr.bin/pmap/pmap.c:1.52 --- src/usr.bin/pmap/pmap.c:1.51 Mon Oct 29 12:25:25 2012 +++ src/usr.bin/pmap/pmap.c Sun Dec 13 22:15:10 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.51 2012/10/29 16:25:25 para Exp $ */ +/* $NetBSD: pmap.c,v 1.52 2015/12/14 03:15:10 christos Exp $ */ /* * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -31,10 +31,11 @@ #include #ifndef lint -__RCSID("$NetBSD: pmap.c,v 1.51 2012/10/29 16:25:25 para Exp $"); +__RCSID("$NetBSD: pmap.c,v 1.52 2015/12/14 03:15:10 christos Exp $"); #endif #include +#include #include "pmap.h" #include "main.h" @@ -565,22 +566,23 @@ dump_amap(kvm_t *kd, struct kbit *amap) * Assume that sizeof(struct vm_anon *) >= sizeof(size_t) and * allocate that amount of space. */ - l = sizeof(struct vm_anon *) * D(amap, amap)->am_maxslot; - am_anon = malloc(l); + am_anon = ecalloc(D(amap, amap)->am_maxslot, sizeof(*am_anon)); + l = D(amap, amap)->am_maxslot * sizeof(*am_anon); _KDEREF(kd, (u_long)D(amap, amap)->am_anon, am_anon, l); - l = sizeof(int) * D(amap, amap)->am_maxslot; - am_bckptr = malloc(l); + l = D(amap, amap)->am_maxslot * sizeof(*am_bckptr); + am_bckptr = ecalloc(D(amap, amap)->am_maxslot, sizeof(*am_bckptr)); _KDEREF(kd, (u_long)D(amap, amap)->am_bckptr, am_bckptr, l); - l = sizeof(int) * D(amap, amap)->am_maxslot; - am_slots = malloc(l); + l = D(amap, amap)->am_maxslot * sizeof(*am_slots); + am_slots = ecalloc(D(amap, amap)->am_maxslot, sizeof(*am_slots)); _KDEREF(kd, (u_long)D(amap, amap)->am_slots, am_slots, l); if (D(amap, amap)->am_ppref != NULL && D(amap, amap)->am_ppref != PPREF_NONE) { - l = sizeof(int) * D(amap, amap)->am_maxslot; - am_ppref = malloc(l); + am_ppref = ecalloc( + D(amap, amap)->am_maxslot, sizeof(*am_ppref)); + l = D(amap, amap)->am_maxslot * sizeof(*am_ppref); _KDEREF(kd, (u_long)D(amap, amap)->am_ppref, am_ppref, l); } else { am_ppref = NULL;
CVS commit: src/usr.bin/ftp
Module Name:src Committed By: tron Date: Sun Dec 13 14:06:13 UTC 2015 Modified Files: src/usr.bin/ftp: fetch.c ftp.c Log Message: (Hopefully) fix build without IPv6 support To generate a diff of this commit: cvs rdiff -u -r1.208 -r1.209 src/usr.bin/ftp/fetch.c cvs rdiff -u -r1.165 -r1.166 src/usr.bin/ftp/ftp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/ftp/fetch.c diff -u src/usr.bin/ftp/fetch.c:1.208 src/usr.bin/ftp/fetch.c:1.209 --- src/usr.bin/ftp/fetch.c:1.208 Fri Dec 11 08:37:31 2015 +++ src/usr.bin/ftp/fetch.c Sun Dec 13 14:06:13 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fetch.c,v 1.208 2015/12/11 08:37:31 tron Exp $ */ +/* $NetBSD: fetch.c,v 1.209 2015/12/13 14:06:13 tron Exp $ */ /*- * Copyright (c) 1997-2015 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fetch.c,v 1.208 2015/12/11 08:37:31 tron Exp $"); +__RCSID("$NetBSD: fetch.c,v 1.209 2015/12/13 14:06:13 tron Exp $"); #endif /* not lint */ /* @@ -763,13 +763,17 @@ fetch_url(const char *url, const char *p } if (verbose && res0->ai_next) { +#ifdef INET6 if(res->ai_family == AF_INET6) { fprintf(ttyout, "Trying [%s]:%s ...\n", hname, sname); } else { +#endif fprintf(ttyout, "Trying %s:%s ...\n", hname, sname); +#ifdef INET6 } +#endif } s = socket(res->ai_family, SOCK_STREAM, Index: src/usr.bin/ftp/ftp.c diff -u src/usr.bin/ftp/ftp.c:1.165 src/usr.bin/ftp/ftp.c:1.166 --- src/usr.bin/ftp/ftp.c:1.165 Fri Dec 11 08:37:31 2015 +++ src/usr.bin/ftp/ftp.c Sun Dec 13 14:06:13 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.165 2015/12/11 08:37:31 tron Exp $ */ +/* $NetBSD: ftp.c,v 1.166 2015/12/13 14:06:13 tron Exp $ */ /*- * Copyright (c) 1996-2009 The NetBSD Foundation, Inc. @@ -92,7 +92,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.165 2015/12/11 08:37:31 tron Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.166 2015/12/13 14:06:13 tron Exp $"); #endif #endif /* not lint */ @@ -200,13 +200,17 @@ hookup(const char *host, const char *por } if (verbose && res0->ai_next) { /* if we have multiple possibilities */ +#ifdef INET6 if(res->ai_family == AF_INET6) { fprintf(ttyout, "Trying [%s]:%s ...\n", hname, sname); } else { +#endif fprintf(ttyout, "Trying %s:%s ...\n", hname, sname); +#ifdef INET6 } +#endif } s = socket(res->ai_family, SOCK_STREAM, res->ai_protocol); if (s < 0) {
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: christos Date: Sun Dec 13 16:11:14 UTC 2015 Modified Files: src/sys/arch/xen/x86: cpu.c Log Message: need definition To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/sys/arch/xen/x86/cpu.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/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.102 src/sys/arch/xen/x86/cpu.c:1.103 --- src/sys/arch/xen/x86/cpu.c:1.102 Sun Dec 13 10:22:31 2015 +++ src/sys/arch/xen/x86/cpu.c Sun Dec 13 11:11:14 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.102 2015/12/13 15:22:31 christos Exp $ */ +/* $NetBSD: cpu.c,v 1.103 2015/12/13 16:11:14 christos Exp $ */ /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ /*- @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.102 2015/12/13 15:22:31 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.103 2015/12/13 16:11:14 christos Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -172,7 +172,7 @@ struct cpu_info phycpu_info_primary __al struct cpu_info *cpu_info_list = _info_primary; struct cpu_info *phycpu_info_list = _info_primary; -extern uint32_t cpu_feature[]; /* X86 CPUID feature bits +uint32_t cpu_feature[7]; /* X86 CPUID feature bits * [0] basic features %edx * [1] basic features %ecx * [2] extended features %edx
CVS commit: src/sys/external/bsd/libfdt/dist
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:06:14 UTC 2015 Modified Files: src/sys/external/bsd/libfdt/dist: libfdt_env.h Log Message: Fix build To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/external/bsd/libfdt/dist/libfdt_env.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/external/bsd/libfdt/dist/libfdt_env.h diff -u src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.1.1.1 src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.2 --- src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.1.1.1 Sun Dec 13 16:45:07 2015 +++ src/sys/external/bsd/libfdt/dist/libfdt_env.h Sun Dec 13 17:06:14 2015 @@ -52,9 +52,14 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if defined(_KERNEL) +#include +#include +#else #include #include #include +#endif #ifdef __CHECKER__ #define __force __attribute__((force))
CVS commit: src/share/man/man7
Module Name:src Committed By: wiz Date: Sun Dec 13 15:13:03 UTC 2015 Modified Files: src/share/man/man7: sysctl.7 Log Message: Fix typo. To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/share/man/man7/sysctl.7 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man7/sysctl.7 diff -u src/share/man/man7/sysctl.7:1.96 src/share/man/man7/sysctl.7:1.97 --- src/share/man/man7/sysctl.7:1.96 Sun Dec 13 14:28:12 2015 +++ src/share/man/man7/sysctl.7 Sun Dec 13 15:13:03 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: sysctl.7,v 1.96 2015/12/13 14:28:12 christos Exp $ +.\" $NetBSD: sysctl.7,v 1.97 2015/12/13 15:13:03 wiz Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" -.Dd Decemver 13, 2015 +.Dd December 13, 2015 .Dt SYSCTL 7 .Os .Sh NAME
CVS commit: src/sys/external/bsd/libfdt/conf
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:07:13 UTC 2015 Added Files: src/sys/external/bsd/libfdt/conf: files.libfdt Log Message: Add build glue. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/libfdt/conf/files.libfdt Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/external/bsd/libfdt/conf/files.libfdt diff -u /dev/null src/sys/external/bsd/libfdt/conf/files.libfdt:1.1 --- /dev/null Sun Dec 13 17:07:13 2015 +++ src/sys/external/bsd/libfdt/conf/files.libfdt Sun Dec 13 17:07:13 2015 @@ -0,0 +1,11 @@ +define libfdt +makeoptions libfdt CPPFLAGS+="-I$S/external/bsd/libfdt/dist" + +file external/bsd/libfdt/dist/fdt.c libfdt +file external/bsd/libfdt/dist/fdt_addresses.c libfdt +file external/bsd/libfdt/dist/fdt_empty_tree.c libfdt +file external/bsd/libfdt/dist/fdt_ro.c libfdt +file external/bsd/libfdt/dist/fdt_rw.c libfdt +file external/bsd/libfdt/dist/fdt_strerror.c libfdt +file external/bsd/libfdt/dist/fdt_sw.c libfdt +file external/bsd/libfdt/dist/fdt_wip.c libfdt
CVS commit: src/sys/arch/x86
Module Name:src Committed By: maxv Date: Sun Dec 13 15:02:20 UTC 2015 Modified Files: src/sys/arch/x86/include: cpu.h cpuvar.h src/sys/arch/x86/x86: cpu.c identcpu.c Log Message: Retrieve cpuid7 (Structured Extended Features) into ci_feat_val. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.46 -r1.47 src/sys/arch/x86/include/cpuvar.h cvs rdiff -u -r1.116 -r1.117 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.48 -r1.49 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/include/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.66 src/sys/arch/x86/include/cpu.h:1.67 --- src/sys/arch/x86/include/cpu.h:1.66 Sun Feb 23 22:38:40 2014 +++ src/sys/arch/x86/include/cpu.h Sun Dec 13 15:02:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.66 2014/02/23 22:38:40 dsl Exp $ */ +/* $NetBSD: cpu.h,v 1.67 2015/12/13 15:02:19 maxv Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -157,12 +157,14 @@ struct cpu_info { uint32_t ci_max_ext_cpuid; /* cpuid.8000:%eax */ volatile uint32_t ci_lapic_counter; - uint32_t ci_feat_val[5]; /* X86 CPUID feature bits */ + uint32_t ci_feat_val[7]; /* X86 CPUID feature bits */ /* [0] basic features cpuid.1:%edx * [1] basic features cpuid.1:%ecx (CPUID2_xxx bits) * [2] extended features cpuid:8001:%edx * [3] extended features cpuid:8001:%ecx * [4] VIA padlock features + * [5] structured extended features cpuid.7:%ebx + * [6] structured extended features cpuid.7:%ecx */ const struct cpu_functions *ci_func; /* start/stop functions */ Index: src/sys/arch/x86/include/cpuvar.h diff -u src/sys/arch/x86/include/cpuvar.h:1.46 src/sys/arch/x86/include/cpuvar.h:1.47 --- src/sys/arch/x86/include/cpuvar.h:1.46 Fri Apr 20 22:23:24 2012 +++ src/sys/arch/x86/include/cpuvar.h Sun Dec 13 15:02:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.46 2012/04/20 22:23:24 rmind Exp $ */ +/* $NetBSD: cpuvar.h,v 1.47 2015/12/13 15:02:19 maxv Exp $ */ /*- * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc. @@ -125,7 +125,7 @@ void pat_init(struct cpu_info *); extern int cpu_vendor; extern bool x86_mp_online; -extern uint32_t cpu_feature[5]; +extern uint32_t cpu_feature[7]; #endif /* _KERNEL */ Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.116 src/sys/arch/x86/x86/cpu.c:1.117 --- src/sys/arch/x86/x86/cpu.c:1.116 Thu Sep 17 23:48:01 2015 +++ src/sys/arch/x86/x86/cpu.c Sun Dec 13 15:02:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.116 2015/09/17 23:48:01 nat Exp $ */ +/* $NetBSD: cpu.c,v 1.117 2015/12/13 15:02:19 maxv Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.116 2015/09/17 23:48:01 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.117 2015/12/13 15:02:19 maxv Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -177,13 +177,15 @@ static void tss_init(struct i386tss *, v static void cpu_init_idle_lwp(struct cpu_info *); -uint32_t cpu_feature[5]; /* X86 CPUID feature bits - * [0] basic features %edx - * [1] basic features %ecx - * [2] extended features %edx - * [3] extended features %ecx - * [4] VIA padlock features - */ +uint32_t cpu_feature[7]; /* X86 CPUID feature bits */ + /* [0] basic features cpuid.1:%edx + * [1] basic features cpuid.1:%ecx (CPUID2_xxx bits) + * [2] extended features cpuid:8001:%edx + * [3] extended features cpuid:8001:%ecx + * [4] VIA padlock features + * [5] structured extended features cpuid.7:%ebx + * [6] structured extended features cpuid.7:%ecx + */ extern char x86_64_doubleflt_stack[]; @@ -783,7 +785,7 @@ cpu_boot_secondary(struct cpu_info *ci) } /* - * The CPU ends up here when its ready to run + * The CPU ends up here when it's ready to run. * This is called from code in mptramp.s; at this point, we are running * in the idle pcb/idle stack of the new CPU. When this function returns, * this processor will enter the idle loop and start looking for work. Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.48 src/sys/arch/x86/x86/identcpu.c:1.49 --- src/sys/arch/x86/x86/identcpu.c:1.48 Mon Dec 8 15:22:47 2014 +++ src/sys/arch/x86/x86/identcpu.c Sun Dec 13 15:02:19 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.48 2014/12/08 15:22:47 msaitoh Exp $ */ +/* $NetBSD: identcpu.c,v 1.49 2015/12/13 15:02:19 maxv Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.48 2014/12/08 15:22:47 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.49 2015/12/13 15:02:19 maxv Exp $");
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: christos Date: Sun Dec 13 15:22:31 UTC 2015 Modified Files: src/sys/arch/xen/x86: cpu.c Log Message: fix the build. To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sys/arch/xen/x86/cpu.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/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.101 src/sys/arch/xen/x86/cpu.c:1.102 --- src/sys/arch/xen/x86/cpu.c:1.101 Mon Dec 8 10:22:47 2014 +++ src/sys/arch/xen/x86/cpu.c Sun Dec 13 10:22:31 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.101 2014/12/08 15:22:47 msaitoh Exp $ */ +/* $NetBSD: cpu.c,v 1.102 2015/12/13 15:22:31 christos Exp $ */ /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ /*- @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.101 2014/12/08 15:22:47 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.102 2015/12/13 15:22:31 christos Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -172,12 +172,14 @@ struct cpu_info phycpu_info_primary __al struct cpu_info *cpu_info_list = _info_primary; struct cpu_info *phycpu_info_list = _info_primary; -uint32_t cpu_feature[5]; /* X86 CPUID feature bits +extern uint32_t cpu_feature[]; /* X86 CPUID feature bits * [0] basic features %edx * [1] basic features %ecx * [2] extended features %edx * [3] extended features %ecx * [4] VIA padlock features + * [5] structured extended features cpuid.7:%ebx + * [6] structured extended features cpuid.7:%ecx */ bool x86_mp_online;
CVS commit: src/sbin/sysctl
Module Name:src Committed By: christos Date: Sun Dec 13 14:24:48 UTC 2015 Modified Files: src/sbin/sysctl: sysctl.c Log Message: mention ip6addrctl To generate a diff of this commit: cvs rdiff -u -r1.156 -r1.157 src/sbin/sysctl/sysctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/sysctl/sysctl.c diff -u src/sbin/sysctl/sysctl.c:1.156 src/sbin/sysctl/sysctl.c:1.157 --- src/sbin/sysctl/sysctl.c:1.156 Mon Aug 17 02:42:46 2015 +++ src/sbin/sysctl/sysctl.c Sun Dec 13 09:24:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sysctl.c,v 1.156 2015/08/17 06:42:46 knakahara Exp $ */ +/* $NetBSD: sysctl.c,v 1.157 2015/12/13 14:24:47 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\ #if 0 static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: sysctl.c,v 1.156 2015/08/17 06:42:46 knakahara Exp $"); +__RCSID("$NetBSD: sysctl.c,v 1.157 2015/12/13 14:24:47 christos Exp $"); #endif #endif /* not lint */ @@ -212,6 +212,8 @@ static const struct handlespec { { "/net/inet6?/tcp6?/ident", printother, NULL, "identd" }, { "/net/inet6/icmp6/nd6_[dp]rlist", printother, NULL, "ndp" }, + { "/net/inet6/ip6/addctlpolicy", printother, NULL, + "ip6addrctl" }, { "/net/key/dumps[ap]", printother, NULL, "setkey" }, { "/net/[^/]+/[^/]+/pcblist", printother, NULL, "netstat' or 'sockstat" },
CVS commit: othersrc/usr.bin/tnftp/src
Module Name:othersrc Committed By: tron Date: Sun Dec 13 14:08:09 UTC 2015 Modified Files: othersrc/usr.bin/tnftp/src: fetch.c ftp.c Log Message: (Hopefully) fix build without IPv6 support To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 othersrc/usr.bin/tnftp/src/fetch.c cvs rdiff -u -r1.20 -r1.21 othersrc/usr.bin/tnftp/src/ftp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/usr.bin/tnftp/src/fetch.c diff -u othersrc/usr.bin/tnftp/src/fetch.c:1.22 othersrc/usr.bin/tnftp/src/fetch.c:1.23 --- othersrc/usr.bin/tnftp/src/fetch.c:1.22 Fri Dec 11 08:47:52 2015 +++ othersrc/usr.bin/tnftp/src/fetch.c Sun Dec 13 14:08:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: fetch.c,v 1.22 2015/12/11 08:47:52 tron Exp $ */ +/* $NetBSD: fetch.c,v 1.23 2015/12/13 14:08:09 tron Exp $ */ /* from NetBSD: fetch.c,v 1.207 2015/09/12 19:38:42 wiz Exp */ /*- @@ -770,13 +770,17 @@ fetch_url(const char *url, const char *p } if (verbose && res0->ai_next) { +#ifdef INET6 if(res->ai_family == AF_INET6) { fprintf(ttyout, "Trying [%s]:%s ...\n", hname, sname); } else { +#endif fprintf(ttyout, "Trying %s:%s ...\n", hname, sname); +#ifdef INET6 } +#endif } s = socket(res->ai_family, SOCK_STREAM, Index: othersrc/usr.bin/tnftp/src/ftp.c diff -u othersrc/usr.bin/tnftp/src/ftp.c:1.20 othersrc/usr.bin/tnftp/src/ftp.c:1.21 --- othersrc/usr.bin/tnftp/src/ftp.c:1.20 Fri Dec 11 08:47:52 2015 +++ othersrc/usr.bin/tnftp/src/ftp.c Sun Dec 13 14:08:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.20 2015/12/11 08:47:52 tron Exp $ */ +/* $NetBSD: ftp.c,v 1.21 2015/12/13 14:08:09 tron Exp $ */ /* from NetBSD: ftp.c,v 1.164 2012/07/04 06:09:37 is Exp */ /*- @@ -208,13 +208,17 @@ hookup(const char *host, const char *por } if (verbose && res0->ai_next) { /* if we have multiple possibilities */ +#ifdef INET6 if(res->ai_family == AF_INET6) { fprintf(ttyout, "Trying [%s]:%s ...\n", hname, sname); } else { +#endif fprintf(ttyout, "Trying %s:%s ...\n", hname, sname); +#ifdef INET6 } +#endif } s = socket(res->ai_family, SOCK_STREAM, res->ai_protocol); if (s < 0) {
CVS commit: src/share/man/man7
Module Name:src Committed By: christos Date: Sun Dec 13 14:28:12 UTC 2015 Modified Files: src/share/man/man7: sysctl.7 Log Message: add addrctlpolicy To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/share/man/man7/sysctl.7 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man7/sysctl.7 diff -u src/share/man/man7/sysctl.7:1.95 src/share/man/man7/sysctl.7:1.96 --- src/share/man/man7/sysctl.7:1.95 Mon Nov 23 18:23:25 2015 +++ src/share/man/man7/sysctl.7 Sun Dec 13 09:28:12 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: sysctl.7,v 1.95 2015/11/23 23:23:25 pgoyette Exp $ +.\" $NetBSD: sysctl.7,v 1.96 2015/12/13 14:28:12 christos Exp $ .\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" -.Dd November 24, 2015 +.Dd Decemver 13, 2015 .Dt SYSCTL 7 .Os .Sh NAME @@ -1619,6 +1619,7 @@ The currently defined protocols and name .It icmp6 rediraccept integer yes .It icmp6 redirtimeout integer yes .It ip6 accept_rtadv integer yes +.It ip6 addctlpolicy struct in6_addrpolicy no .It ip6 anonportalgo.selected string yes .It ip6 anonportalgo.available string yes .It ip6 anonportalgo.reserve struct yes
CVS commit: src/lib/libc/net
Module Name:src Committed By: christos Date: Sun Dec 13 14:54:17 UTC 2015 Modified Files: src/lib/libc/net: getaddrinfo.3 Log Message: mention ip6addrctl To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/lib/libc/net/getaddrinfo.3 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/net/getaddrinfo.3 diff -u src/lib/libc/net/getaddrinfo.3:1.57 src/lib/libc/net/getaddrinfo.3:1.58 --- src/lib/libc/net/getaddrinfo.3:1.57 Fri May 3 17:13:34 2013 +++ src/lib/libc/net/getaddrinfo.3 Sun Dec 13 09:54:17 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: getaddrinfo.3,v 1.57 2013/05/03 21:13:34 wiz Exp $ +.\" $NetBSD: getaddrinfo.3,v 1.58 2015/12/13 14:54:17 christos Exp $ .\" $KAME: getaddrinfo.3,v 1.36 2005/01/05 03:23:05 itojun Exp $ .\" $OpenBSD: getaddrinfo.3,v 1.35 2004/12/21 03:40:31 jaredy Exp $ .\" @@ -17,7 +17,7 @@ .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR .\" PERFORMANCE OF THIS SOFTWARE. .\" -.Dd April 30, 2013 +.Dd December 13, 2015 .Dt GETADDRINFO 3 .Os .Sh NAME @@ -251,6 +251,10 @@ structure in the list, the member points to a filled-in socket address structure of length .Fa ai_addrlen . .Pp +By default IPv6 address entries are ordered before IPv4 ones, but +the order of the entries in the list can be controlled using +.Xr ip6addrctl 8 . +.Pp This implementation of .Fn getaddrinfo allows numeric IPv6 address notation with scope identifier, @@ -450,6 +454,7 @@ freeaddrinfo(res0); .Xr resolv.conf 5 , .Xr services 5 , .Xr hostname 7 , +.Xr ip6addrctl 8 , .Xr named 8 .Rs .%A R. Gilligan
CVS commit: src/sys/arch
Module Name:src Committed By: maxv Date: Sun Dec 13 15:53:06 UTC 2015 Modified Files: src/sys/arch/amd64/amd64: trap.c src/sys/arch/x86/x86: cpu.c Log Message: Implement amd64 support for SMEP - Supervisor Mode Execution Protection. Now, on CPUs that support this feature, if the kernel tries to execute an instruction located in userland, the CPU will trigger a page fault. Tested on amd64 (Intel Core i5). To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/arch/amd64/amd64/trap.c cvs rdiff -u -r1.117 -r1.118 src/sys/arch/x86/x86/cpu.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/amd64/amd64/trap.c diff -u src/sys/arch/amd64/amd64/trap.c:1.82 src/sys/arch/amd64/amd64/trap.c:1.83 --- src/sys/arch/amd64/amd64/trap.c:1.82 Sat Nov 28 15:06:55 2015 +++ src/sys/arch/amd64/amd64/trap.c Sun Dec 13 15:53:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.82 2015/11/28 15:06:55 dholland Exp $ */ +/* $NetBSD: trap.c,v 1.83 2015/12/13 15:53:05 maxv Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.82 2015/11/28 15:06:55 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.83 2015/12/13 15:53:05 maxv Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -515,6 +515,14 @@ kernelfault: } cr2 = rcr2(); + + if (frame->tf_err & PGEX_X) { + /* SMEP might have brought us here */ + if (cr2 > VM_MIN_ADDRESS && cr2 <= VM_MAXUSER_ADDRESS) +panic("prevented execution of %p (SMEP)", +(void *)cr2); + } + goto faultcommon; case T_PAGEFLT|T_USER: { /* page fault */ Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.117 src/sys/arch/x86/x86/cpu.c:1.118 --- src/sys/arch/x86/x86/cpu.c:1.117 Sun Dec 13 15:02:19 2015 +++ src/sys/arch/x86/x86/cpu.c Sun Dec 13 15:53:06 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.117 2015/12/13 15:02:19 maxv Exp $ */ +/* $NetBSD: cpu.c,v 1.118 2015/12/13 15:53:06 maxv Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.117 2015/12/13 15:02:19 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.118 2015/12/13 15:53:06 maxv Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -581,6 +581,12 @@ cpu_init(struct cpu_info *ci) if (cpu_feature[1] & CPUID2_XSAVE) cr4 |= CR4_OSXSAVE; +#ifdef __x86_64__ + /* If SMEP is supported, enable it */ + if (cpu_feature[5] & CPUID_SEF_SMEP) + cr4 |= CR4_SMEP; +#endif + if (cr4) { cr4 |= rcr4(); lcr4(cr4);
CVS import: src/sys/external/bsd/libfdt/dist
Module Name:src Committed By: macallan Date: Sun Dec 13 16:45:07 UTC 2015 Update of /cvsroot/src/sys/external/bsd/libfdt/dist In directory ivanova.netbsd.org:/tmp/cvs-serv7231 Log Message: re-import libfdt for kernel use Status: Vendor Tag: DTC Release Tags: libfdt-1-2 N src/sys/external/bsd/libfdt/dist/Makefile.libfdt N src/sys/external/bsd/libfdt/dist/TODO N src/sys/external/bsd/libfdt/dist/fdt.c N src/sys/external/bsd/libfdt/dist/fdt.h N src/sys/external/bsd/libfdt/dist/fdt_addresses.c N src/sys/external/bsd/libfdt/dist/fdt_empty_tree.c N src/sys/external/bsd/libfdt/dist/fdt_ro.c N src/sys/external/bsd/libfdt/dist/fdt_rw.c N src/sys/external/bsd/libfdt/dist/fdt_strerror.c N src/sys/external/bsd/libfdt/dist/fdt_sw.c N src/sys/external/bsd/libfdt/dist/fdt_wip.c N src/sys/external/bsd/libfdt/dist/libfdt.h N src/sys/external/bsd/libfdt/dist/libfdt_env.h N src/sys/external/bsd/libfdt/dist/libfdt_internal.h N src/sys/external/bsd/libfdt/dist/version.lds No conflicts created by this import
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:15:06 UTC 2015 Modified Files: src/sys/dev/i2c: as3722.c at24cxx.c titemp.c Log Message: Support direct config. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/as3722.c cvs rdiff -u -r1.20 -r1.21 src/sys/dev/i2c/at24cxx.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/titemp.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/i2c/as3722.c diff -u src/sys/dev/i2c/as3722.c:1.3 src/sys/dev/i2c/as3722.c:1.4 --- src/sys/dev/i2c/as3722.c:1.3 Sat Nov 21 12:19:47 2015 +++ src/sys/dev/i2c/as3722.c Sun Dec 13 17:15:06 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: as3722.c,v 1.3 2015/11/21 12:19:47 jmcneill Exp $ */ +/* $NetBSD: as3722.c,v 1.4 2015/12/13 17:15:06 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill@@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.3 2015/11/21 12:19:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.4 2015/12/13 17:15:06 jmcneill Exp $"); #include #include @@ -93,6 +93,11 @@ static int as3722_set_clear(struct as372 CFATTACH_DECL_NEW(as3722pmic, sizeof(struct as3722_softc), as3722_match, as3722_attach, NULL, NULL); +static const char * as3722_compats[] = { + "ams,as3722", + NULL +}; + static int as3722_match(device_t parent, cfdata_t match, void *aux) { @@ -100,16 +105,20 @@ as3722_match(device_t parent, cfdata_t m uint8_t reg, id1; int error; - iic_acquire_bus(ia->ia_tag, I2C_F_POLL); - reg = AS3722_ASIC_ID1_REG; - error = iic_exec(ia->ia_tag, I2C_OP_READ_WITH_STOP, ia->ia_addr, - , 1, , 1, I2C_F_POLL); - iic_release_bus(ia->ia_tag, I2C_F_POLL); - - if (error == 0 && id1 == 0x0c) - return 1; - - return 0; + if (ia->ia_name == NULL) { + iic_acquire_bus(ia->ia_tag, I2C_F_POLL); + reg = AS3722_ASIC_ID1_REG; + error = iic_exec(ia->ia_tag, I2C_OP_READ_WITH_STOP, ia->ia_addr, + , 1, , 1, I2C_F_POLL); + iic_release_bus(ia->ia_tag, I2C_F_POLL); + + if (error == 0 && id1 == 0x0c) + return 1; + + return 0; + } else { + return iic_compat_match(ia, as3722_compats); + } } static void Index: src/sys/dev/i2c/at24cxx.c diff -u src/sys/dev/i2c/at24cxx.c:1.20 src/sys/dev/i2c/at24cxx.c:1.21 --- src/sys/dev/i2c/at24cxx.c:1.20 Sun Sep 27 13:02:21 2015 +++ src/sys/dev/i2c/at24cxx.c Sun Dec 13 17:15:06 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: at24cxx.c,v 1.20 2015/09/27 13:02:21 phx Exp $ */ +/* $NetBSD: at24cxx.c,v 1.21 2015/12/13 17:15:06 jmcneill Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.20 2015/09/27 13:02:21 phx Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.21 2015/12/13 17:15:06 jmcneill Exp $"); #include #include @@ -113,9 +113,17 @@ static int seeprom_wait_idle(struct seep static const char * seeprom_compats[] = { "i2c-at24c64", "i2c-at34c02", + "atmel,24c02", NULL }; +static const struct seeprom_size { + const char *name; + int size; +} seeprom_sizes[] = { + { "atmel,24c02", 256 }, +}; + static int seeprom_match(device_t parent, cfdata_t cf, void *aux) { @@ -142,6 +150,7 @@ seeprom_attach(device_t parent, device_t { struct seeprom_softc *sc = device_private(self); struct i2c_attach_args *ia = aux; + u_int n; sc->sc_tag = ia->ia_tag; sc->sc_address = ia->ia_addr; @@ -173,6 +182,16 @@ seeprom_attach(device_t parent, device_t sc->sc_size = (device_cfdata(self)->cf_flags << 7); else sc->sc_size = ia->ia_size; + + if (sc->sc_size == 0 && ia->ia_ncompat > 0) { + for (n = 0; n < __arraycount(seeprom_sizes); n++) { + if (!strcmp(seeprom_sizes[n].name, ia->ia_compat[n])) { +sc->sc_size = seeprom_sizes[n].size; +break; + } + } + } + switch (sc->sc_size) { case 128: /* 1Kbit */ case 256: /* 2Kbit */ Index: src/sys/dev/i2c/titemp.c diff -u src/sys/dev/i2c/titemp.c:1.1 src/sys/dev/i2c/titemp.c:1.2 --- src/sys/dev/i2c/titemp.c:1.1 Tue May 12 20:54:08 2015 +++ src/sys/dev/i2c/titemp.c Sun Dec 13 17:15:06 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: titemp.c,v 1.1 2015/05/12 20:54:08 jmcneill Exp $ */ +/* $NetBSD: titemp.c,v 1.2 2015/12/13 17:15:06 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: titemp.c,v 1.1 2015/05/12 20:54:08 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: titemp.c,v 1.2 2015/12/13 17:15:06 jmcneill Exp $"); #include #include @@ -84,6 +84,11 @@ static int titemp_read(struct titemp_sof CFATTACH_DECL_NEW(titemp, sizeof(struct titemp_softc), titemp_match, titemp_attach, NULL, NULL); +static const char * titemp_compats[] = { + "ti,tmp451", + NULL +}; + static int titemp_match(device_t parent, cfdata_t match, void *aux) { @@ -91,16 +96,20 @@ titemp_match(device_t parent, cfdata_t m uint8_t mfid; int error; - if
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:14:56 UTC 2015 Modified Files: src/sys/dev/i2c: i2c.c i2cvar.h Log Message: allow child devices to be passed in attach args instead of device dictionary To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/i2c/i2c.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/i2cvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/i2c.c diff -u src/sys/dev/i2c/i2c.c:1.50 src/sys/dev/i2c/i2c.c:1.51 --- src/sys/dev/i2c/i2c.c:1.50 Thu Dec 10 05:33:28 2015 +++ src/sys/dev/i2c/i2c.c Sun Dec 13 17:14:56 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.50 2015/12/10 05:33:28 pgoyette Exp $ */ +/* $NetBSD: i2c.c,v 1.51 2015/12/13 17:14:56 jmcneill Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.50 2015/12/10 05:33:28 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.51 2015/12/13 17:14:56 jmcneill Exp $"); #include #include @@ -217,11 +217,17 @@ iic_attach(device_t parent, device_t sel if (!pmf_device_register(self, NULL, NULL)) aprint_error_dev(self, "couldn't establish power handler\n"); - props = device_properties(parent); - if (!prop_dictionary_get_bool(props, "i2c-indirect-config", - _config)) - indirect_config = true; - child_devices = prop_dictionary_get(props, "i2c-child-devices"); + if (iba->iba_child_devices) { + child_devices = iba->iba_child_devices; + indirect_config = false; + } else { + props = device_properties(parent); + if (!prop_dictionary_get_bool(props, "i2c-indirect-config", + _config)) + indirect_config = true; + child_devices = prop_dictionary_get(props, "i2c-child-devices"); + } + if (child_devices) { unsigned int i, count; prop_dictionary_t dev; Index: src/sys/dev/i2c/i2cvar.h diff -u src/sys/dev/i2c/i2cvar.h:1.8 src/sys/dev/i2c/i2cvar.h:1.9 --- src/sys/dev/i2c/i2cvar.h:1.8 Sun Feb 28 15:33:21 2010 +++ src/sys/dev/i2c/i2cvar.h Sun Dec 13 17:14:56 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: i2cvar.h,v 1.8 2010/02/28 15:33:21 snj Exp $ */ +/* $NetBSD: i2cvar.h,v 1.9 2015/12/13 17:14:56 jmcneill Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -39,6 +39,7 @@ #define _DEV_I2C_I2CVAR_H_ #include +#include /* Flags passed to i2c routines. */ #define I2C_F_WRITE 0x00 /* new transfer is a write */ @@ -110,6 +111,7 @@ typedef struct i2c_controller { struct i2cbus_attach_args { i2c_tag_t iba_tag; /* the controller */ int iba_type; /* bus type */ + prop_array_t iba_child_devices; /* child devices (direct config) */ }; /* Used to attach devices on the i2c bus. */
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:30:40 UTC 2015 Added Files: src/sys/dev/fdt: fdt_openfirm.c fdt_openfirm.h fdt_subr.c fdtbus.c fdtvar.h files.fdt fixedregulator.c simplebus.c Log Message: Add a framework for enumerating devices using a Flattened Device Tree (FDT). To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_openfirm.c \ src/sys/dev/fdt/fdt_openfirm.h src/sys/dev/fdt/fdt_subr.c \ src/sys/dev/fdt/fdtbus.c src/sys/dev/fdt/fdtvar.h \ src/sys/dev/fdt/files.fdt src/sys/dev/fdt/fixedregulator.c \ src/sys/dev/fdt/simplebus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/dev/fdt/fdt_openfirm.c diff -u /dev/null src/sys/dev/fdt/fdt_openfirm.c:1.1 --- /dev/null Sun Dec 13 17:30:40 2015 +++ src/sys/dev/fdt/fdt_openfirm.c Sun Dec 13 17:30:40 2015 @@ -0,0 +1,359 @@ +/* $NetBSD: fdt_openfirm.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $ */ + +/*- + * Copyright (c) 2015 Jared D. McNeill+ * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 +__KERNEL_RCSID(0, "$NetBSD: fdt_openfirm.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $"); + +#include + +#include +#include +#include + +static const void *fdt_data; + +bool +fdt_openfirm_set_data(const void *data) +{ + KASSERT(fdt_data == NULL); + if (fdt_check_header(data) != 0) { + return false; + } + fdt_data = data; + return true; +} + +const void * +fdt_openfirm_get_data(void) +{ + return fdt_data; +} + +int +fdt_openfirm_get_phandle(int offset) +{ + if (offset < 0) + return 0; + + return offset + fdt_off_dt_struct(fdt_data); +} + +int +fdt_openfirm_get_offset(int phandle) +{ + const int dtoff = fdt_off_dt_struct(fdt_data); + + if (phandle == -1) + phandle = dtoff; + + if (phandle < dtoff) + return -1; + + return phandle - dtoff; +} + +int +OF_peer(int phandle) +{ + int off, depth; + + if (fdt_data == NULL) { + return -1; + } + + if (phandle == 0) { + return fdt_openfirm_get_phandle(0); + } + + off = fdt_openfirm_get_offset(phandle); + if (off < 0) { + return 0; + } + + depth = 1; + for (off = fdt_next_node(fdt_data, off, ); + off >= 0 && depth >= 0; + off = fdt_next_node(fdt_data, off, )) { + if (depth == 1) { + return fdt_openfirm_get_phandle(off); + } + } + + return 0; +} + +int +OF_child(int phandle) +{ + int off, depth; + + if (fdt_data == NULL) { + return -1; + } + + off = fdt_openfirm_get_offset(phandle); + if (off < 0) { + return 0; + } + + depth = 0; + for (off = fdt_next_node(fdt_data, off, ); + off >= 0 && depth > 0; + off = fdt_next_node(fdt_data, off, )) { + if (depth == 1) { + return fdt_openfirm_get_phandle(off); + } + } + + return 0; +} + +int +OF_parent(int phandle) +{ + int off; + + if (fdt_data == NULL) { + return -1; + } + + off = fdt_openfirm_get_offset(phandle); + if (off < 0) { + return -1; + } + + off = fdt_parent_offset(fdt_data, off); + if (off < 0) { + return -1; + } + + return fdt_openfirm_get_phandle(off); +} + +int +OF_nextprop(int phandle, const char *prop, void *nextprop) +{ + const char *name; + const void *val; + int off, len; + + if (fdt_data == NULL) { + return -1; + } + + off = fdt_openfirm_get_offset(phandle); + if (off < 0) { + return -1; + } + + if (*prop == '\0') { + name = "name"; + } else { + off = fdt_first_property_offset(fdt_data, off); + if (off < 0) { + return 0; + } + if (strcmp(prop, "name") != 0) { + while (off >= 0) { +val = fdt_getprop_by_offset(fdt_data, off, +, ); +if (val == NULL) { + return -1; +} +off = fdt_next_property_offset(fdt_data, off); +if (off < 0) { + return
CVS commit: src/sys/dev/sysmon
Module Name:src Committed By: jdc Date: Sun Dec 13 17:41:48 UTC 2015 Modified Files: src/sys/dev/sysmon: sysmon_envsys.c Log Message: Note the sensor number in the error output. Useful for drivers adding multiple sensors. To generate a diff of this commit: cvs rdiff -u -r1.137 -r1.138 src/sys/dev/sysmon/sysmon_envsys.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/sysmon/sysmon_envsys.c diff -u src/sys/dev/sysmon/sysmon_envsys.c:1.137 src/sys/dev/sysmon/sysmon_envsys.c:1.138 --- src/sys/dev/sysmon/sysmon_envsys.c:1.137 Sat Apr 25 23:40:09 2015 +++ src/sys/dev/sysmon/sysmon_envsys.c Sun Dec 13 17:41:48 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_envsys.c,v 1.137 2015/04/25 23:40:09 pgoyette Exp $ */ +/* $NetBSD: sysmon_envsys.c,v 1.138 2015/12/13 17:41:48 jdc Exp $ */ /*- * Copyright (c) 2007, 2008 Juan Romero Pardines. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.137 2015/04/25 23:40:09 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.138 2015/12/13 17:41:48 jdc Exp $"); #include #include @@ -1656,8 +1656,8 @@ sme_update_sensor_dictionary(prop_object sdt = sme_find_table_entry(SME_DESC_STATES, edata->state); if (sdt == NULL) { - printf("sme_update_sensor_dictionary: can not update sensor " - "state %d unknown\n", edata->state); + printf("sme_update_sensor_dictionary: cannot update sensor %d " + "state %d unknown\n", edata->sensor, edata->state); return EINVAL; }
CVS commit: src/sys/arch/evbarm/stand/boot2440
Module Name:src Committed By: christos Date: Sun Dec 13 19:18:32 UTC 2015 Modified Files: src/sys/arch/evbarm/stand/boot2440: s3csdi.c Log Message: PR/50526: David Binderman: Fix incorrect test To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/stand/boot2440/s3csdi.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/evbarm/stand/boot2440/s3csdi.c diff -u src/sys/arch/evbarm/stand/boot2440/s3csdi.c:1.3 src/sys/arch/evbarm/stand/boot2440/s3csdi.c:1.4 --- src/sys/arch/evbarm/stand/boot2440/s3csdi.c:1.3 Sat Oct 27 13:17:49 2012 +++ src/sys/arch/evbarm/stand/boot2440/s3csdi.c Sun Dec 13 14:18:32 2015 @@ -90,7 +90,7 @@ s3csd_init(unsigned int tag, uint32_t *c /* Check if a card is present */ data = *(volatile uint32_t*)(S3C2440_GPIO_BASE+GPIO_PGDAT); - if ( (data & (1<<8)) == 1) { + if ( (data & (1<<8)) == (1<<8)) { printf("No card detected\n"); /* Pin 8 is low when no card is inserted */ return 0;
CVS commit: src/sys/arch/arm/nvidia
Module Name:src Committed By: jmcneill Date: Sun Dec 13 21:24:06 UTC 2015 Modified Files: src/sys/arch/arm/nvidia: files.tegra Log Message: remove tegraio To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/arm/nvidia/files.tegra 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/nvidia/files.tegra diff -u src/sys/arch/arm/nvidia/files.tegra:1.25 src/sys/arch/arm/nvidia/files.tegra:1.26 --- src/sys/arch/arm/nvidia/files.tegra:1.25 Sun Dec 13 17:39:19 2015 +++ src/sys/arch/arm/nvidia/files.tegra Sun Dec 13 21:24:06 2015 @@ -1,4 +1,4 @@ -# $NetBSD: files.tegra,v 1.25 2015/12/13 17:39:19 jmcneill Exp $ +# $NetBSD: files.tegra,v 1.26 2015/12/13 21:24:06 jmcneill Exp $ # # Configuration info for NVIDIA Tegra ARM Peripherals # @@ -18,10 +18,6 @@ file arch/arm/nvidia/tegra_cpufreq.c file arch/arm/nvidia/soc_tegra124.c soc_tegra124 # On-board I/O -device tegraio { [port=-1] } : bus_space_generic -attach tegraio at mainbus with tegra_io -file arch/arm/nvidia/tegra_io.c tegra_io - device tegrafdt : bus_space_generic, fdtbus attach tegrafdt at mainbus with tegra_fdt file arch/arm/nvidia/tegra_fdt.c tegra_fdt @@ -136,7 +132,7 @@ attach tegrafb at tegrafbbus with tegra_ file arch/arm/nvidia/tegra_fb.c tegra_fb # GPU -attach nouveau at tegraio with tegra_nouveau +attach nouveau at fdt with tegra_nouveau file arch/arm/nvidia/tegra_nouveau.c tegra_nouveau # Console parameters
CVS commit: src/sys/arch/emips/stand/common
Module Name:src Committed By: christos Date: Sun Dec 13 18:24:50 UTC 2015 Modified Files: src/sys/arch/emips/stand/common: boot.c Log Message: PR/50537: David Binderman: fix bad sizeof To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/emips/stand/common/boot.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/emips/stand/common/boot.c diff -u src/sys/arch/emips/stand/common/boot.c:1.3 src/sys/arch/emips/stand/common/boot.c:1.4 --- src/sys/arch/emips/stand/common/boot.c:1.3 Wed Mar 26 12:10:20 2014 +++ src/sys/arch/emips/stand/common/boot.c Sun Dec 13 13:24:50 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.3 2014/03/26 16:10:20 christos Exp $ */ +/* $NetBSD: boot.c,v 1.4 2015/12/13 18:24:50 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -64,10 +64,10 @@ static int devcanon(char *); #define OPT_MAX PATH_MAX /* way overkill */ -static int loadit(char *name, u_long marks[MARK_MAX]) +static int loadit(char *name, u_long *marks) { printf("Loading: %s\n", name); - memset(marks, 0, sizeof marks); + memset(marks, 0, sizeof(*marks) * MARK_MAX); return (loadfile(name, marks, LOAD_ALL)); }
CVS commit: src/sys/arch/alpha/stand/standtest
Module Name:src Committed By: christos Date: Sun Dec 13 18:51:14 UTC 2015 Modified Files: src/sys/arch/alpha/stand/standtest: test.c Log Message: PR/50530: David Binderman: Add missing printf args To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/alpha/stand/standtest/test.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/alpha/stand/standtest/test.c diff -u src/sys/arch/alpha/stand/standtest/test.c:1.5 src/sys/arch/alpha/stand/standtest/test.c:1.6 --- src/sys/arch/alpha/stand/standtest/test.c:1.5 Sat Jan 22 14:19:15 2011 +++ src/sys/arch/alpha/stand/standtest/test.c Sun Dec 13 13:51:14 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: test.c,v 1.5 2011/01/22 19:19:15 joerg Exp $ */ +/* $NetBSD: test.c,v 1.6 2015/12/13 18:51:14 christos Exp $ */ /* * Copyright (c) 1999 Christopher G. Demetriou. All rights reserved. @@ -275,7 +275,7 @@ toplevel_dpb(const char *buf) } buf = cvt_number(buf, ); if (*buf != '\0' && !isspace(*buf)) { - printf("bad character '%c' in starting address\n"); + printf("bad character '%c' in starting address\n", *buf); return; } @@ -283,7 +283,7 @@ toplevel_dpb(const char *buf) if (buf != NULL) { buf = cvt_number(buf, ); if (*buf != '\0' && !isspace(*buf)) { - printf("bad character '%c' in count\n"); + printf("bad character '%c' in count\n", *buf); return; } buf = advance_past_space(buf);
CVS commit: src/sys/netinet
Module Name:src Committed By: christos Date: Sun Dec 13 18:58:13 UTC 2015 Modified Files: src/sys/netinet: sctp_usrreq.c Log Message: PR/50529: David Binderman: Remove double sizeof To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/sctp_usrreq.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/netinet/sctp_usrreq.c diff -u src/sys/netinet/sctp_usrreq.c:1.1 src/sys/netinet/sctp_usrreq.c:1.2 --- src/sys/netinet/sctp_usrreq.c:1.1 Tue Oct 13 17:28:35 2015 +++ src/sys/netinet/sctp_usrreq.c Sun Dec 13 13:58:13 2015 @@ -1,5 +1,5 @@ /* $KAME: sctp_usrreq.c,v 1.50 2005/06/16 20:45:29 jinmei Exp $ */ -/* $NetBSD: sctp_usrreq.c,v 1.1 2015/10/13 21:28:35 rjs Exp $ */ +/* $NetBSD: sctp_usrreq.c,v 1.2 2015/12/13 18:58:13 christos Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc. @@ -33,7 +33,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: sctp_usrreq.c,v 1.1 2015/10/13 21:28:35 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctp_usrreq.c,v 1.2 2015/12/13 18:58:13 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -980,7 +980,7 @@ sctp_fill_up_addresses(struct sctp_inpcb in6_sin_2_v4mapsin6(sin, (struct sockaddr_in6 *)sas); ((struct sockaddr_in6 *)sas)->sin6_port = inp->sctp_lport; sas = (struct sockaddr_storage *)((vaddr_t)sas + sizeof(struct sockaddr_in6)); - actual += sizeof(sizeof(struct sockaddr_in6)); + actual += sizeof(struct sockaddr_in6); } else { memcpy(sas, sin, sizeof(*sin)); ((struct sockaddr_in *)sas)->sin_port = inp->sctp_lport;
CVS commit: src/sys/arch/bebox/bebox
Module Name:src Committed By: christos Date: Sun Dec 13 19:38:09 UTC 2015 Modified Files: src/sys/arch/bebox/bebox: autoconf.c Log Message: PR/50524: David Binderman: Fix incorrect test To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/bebox/bebox/autoconf.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/bebox/bebox/autoconf.c diff -u src/sys/arch/bebox/bebox/autoconf.c:1.26 src/sys/arch/bebox/bebox/autoconf.c:1.27 --- src/sys/arch/bebox/bebox/autoconf.c:1.26 Wed Dec 19 08:53:47 2012 +++ src/sys/arch/bebox/bebox/autoconf.c Sun Dec 13 14:38:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.26 2012/12/19 13:53:47 kiyohara Exp $ */ +/* $NetBSD: autoconf.c,v 1.27 2015/12/13 19:38:09 christos Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.26 2012/12/19 13:53:47 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.27 2015/12/13 19:38:09 christos Exp $"); #include #include @@ -162,7 +162,7 @@ findroot(void) return; p += 2; part = (*p++) - '0'; - if (p != '\0') + if (*p != '\0') return; booted_partition = part;
CVS commit: src/sys/arch/emips/ebus
Module Name:src Committed By: christos Date: Sun Dec 13 19:36:40 UTC 2015 Modified Files: src/sys/arch/emips/ebus: flash_ebus.c Log Message: PR/50525: David Binderman: Fix incorrect test. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/emips/ebus/flash_ebus.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/emips/ebus/flash_ebus.c diff -u src/sys/arch/emips/ebus/flash_ebus.c:1.17 src/sys/arch/emips/ebus/flash_ebus.c:1.18 --- src/sys/arch/emips/ebus/flash_ebus.c:1.17 Sun Apr 26 11:15:19 2015 +++ src/sys/arch/emips/ebus/flash_ebus.c Sun Dec 13 14:36:40 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: flash_ebus.c,v 1.17 2015/04/26 15:15:19 mlelstv Exp $ */ +/* $NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.17 2015/04/26 15:15:19 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: flash_ebus.c,v 1.18 2015/12/13 19:36:40 christos Exp $"); /* Driver for the Intel 28F320/640/128 (J3A150) StrataFlash memory device * Extended to include the Intel JS28F256P30T95. @@ -603,7 +603,7 @@ static int IsIrresponsive(struct eflash if (Status & ST_READY) return FALSE; -if ((Status & ST_ERASE_MASK) == +if ((Status & ST_MASK) == (ST_LOCK_BIT_ERROR|ST_ERASE_SUSPENDED|ST_ERASE_ERROR)) { /* yes, looks that way */ return TRUE;
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Sun Dec 13 19:51:53 UTC 2015 Modified Files: src/sys/arch/i386/stand/lib: dosfile.c Log Message: better than returning random errors. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/stand/lib/dosfile.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/i386/stand/lib/dosfile.c diff -u src/sys/arch/i386/stand/lib/dosfile.c:1.17 src/sys/arch/i386/stand/lib/dosfile.c:1.18 --- src/sys/arch/i386/stand/lib/dosfile.c:1.17 Fri Dec 11 03:04:20 2015 +++ src/sys/arch/i386/stand/lib/dosfile.c Sun Dec 13 14:51:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: dosfile.c,v 1.17 2015/12/11 08:04:20 mlelstv Exp $ */ +/* $NetBSD: dosfile.c,v 1.18 2015/12/13 19:51:53 christos Exp $ */ /* * Copyright (c) 1996 @@ -70,6 +70,7 @@ dos2errno(void) err = EPERM; break; case 6: /* invalid handle */ + default: err = EINVAL; break; }
CVS commit: src/distrib/sets/lists/man
Module Name:src Committed By: rjs Date: Sun Dec 13 21:09:01 UTC 2015 Modified Files: src/distrib/sets/lists/man: mi Log Message: mount_psshfs and mount_sysctlfs don't depend on rump anymore. To generate a diff of this commit: cvs rdiff -u -r1.1513 -r1.1514 src/distrib/sets/lists/man/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1513 src/distrib/sets/lists/man/mi:1.1514 --- src/distrib/sets/lists/man/mi:1.1513 Sat Dec 12 23:42:43 2015 +++ src/distrib/sets/lists/man/mi Sun Dec 13 21:09:01 2015 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1513 2015/12/12 23:42:43 christos Exp $ +# $NetBSD: mi,v 1.1514 2015/12/13 21:09:01 rjs Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -5556,11 +5556,11 @@ ./usr/share/man/html8/mount_overlay.html man-miscfs-htmlman html ./usr/share/man/html8/mount_portal.html man-miscfs-htmlman html ./usr/share/man/html8/mount_procfs.html man-sysutil-htmlman html -./usr/share/man/html8/mount_psshfs.html man-puffs-htmlman html,rump +./usr/share/man/html8/mount_psshfs.html man-puffs-htmlman html ./usr/share/man/html8/mount_ptyfs.html man-sysutil-htmlman html ./usr/share/man/html8/mount_puffs.html man-sysutil-htmlman html ./usr/share/man/html8/mount_smbfs.html man-smbfs-htmlman html -./usr/share/man/html8/mount_sysctlfs.html man-puffs-htmlman html,rump +./usr/share/man/html8/mount_sysctlfs.html man-puffs-htmlman html ./usr/share/man/html8/mount_sysvbfs.html man-sysutil-htmlman html ./usr/share/man/html8/mount_tmpfs.html man-sysutil-htmlman html ./usr/share/man/html8/mount_udf.html man-sysutil-htmlman html
CVS commit: src/share/man/man9
Module Name:src Committed By: plunky Date: Sun Dec 13 21:53:03 UTC 2015 Modified Files: src/share/man/man9: SET.9 Log Message: Clarify the meaning of this. These macros do not operate on bit numbers as is implied.. the macros are defined as #define SET(t, f) ((t) |= (f)) #define ISSET(t, f) ((t) & (f)) #define CLR(t, f) ((t) &= ~(f)) When the rationale is to provide clarity in the source code, then it is good to have manual pages that are correct. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man9/SET.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/SET.9 diff -u src/share/man/man9/SET.9:1.3 src/share/man/man9/SET.9:1.4 --- src/share/man/man9/SET.9:1.3 Wed Mar 12 16:37:01 2014 +++ src/share/man/man9/SET.9 Sun Dec 13 21:53:02 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: SET.9,v 1.3 2014/03/12 16:37:01 jruoho Exp $ +.\" $NetBSD: SET.9,v 1.4 2015/12/13 21:53:02 plunky Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 12, 2014 +.Dd December 13, 2015 .Dt SET 9 .Os .Sh NAME @@ -42,26 +42,26 @@ .Ft void .Fn CLR "val" "x" .Sh DESCRIPTION -These macros define three standard bit-operations: +These macros define three standard bit operations: .Bl -enum -offset indent .It .Fn SET -sets the bit +the set bits from .Fa x in .Fa val ; .It .Fn CLR -clears the bit +clears the set bits from .Fa x in .Fa val ; and .It .Fn ISSET -returns 1 if the bit +returns true if any of the set bits from .Fa x -is set in +are set in .Fa val . .El .Sh SEE ALSO
CVS commit: src/sys/arch/arm/nvidia
Module Name:src Committed By: jmcneill Date: Sun Dec 13 22:05:52 UTC 2015 Modified Files: src/sys/arch/arm/nvidia: tegra_nouveau.c Log Message: attach nouveau to fdt To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_nouveau.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/nvidia/tegra_nouveau.c diff -u src/sys/arch/arm/nvidia/tegra_nouveau.c:1.7 src/sys/arch/arm/nvidia/tegra_nouveau.c:1.8 --- src/sys/arch/arm/nvidia/tegra_nouveau.c:1.7 Tue Oct 27 13:21:19 2015 +++ src/sys/arch/arm/nvidia/tegra_nouveau.c Sun Dec 13 22:05:52 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_nouveau.c,v 1.7 2015/10/27 13:21:19 riastradh Exp $ */ +/* $NetBSD: tegra_nouveau.c,v 1.8 2015/12/13 22:05:52 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill@@ -26,10 +26,8 @@ * SUCH DAMAGE. */ -#include "locators.h" - #include -__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.7 2015/10/27 13:21:19 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.8 2015/12/13 22:05:52 jmcneill Exp $"); #include #include @@ -42,6 +40,8 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_nouvea #include #include +#include + #include #include @@ -54,7 +54,9 @@ static void tegra_nouveau_attach(device_ struct tegra_nouveau_softc { device_t sc_dev; + bus_space_tag_t sc_bst; bus_dma_tag_t sc_dmat; + int sc_phandle; struct drm_device *sc_drm_dev; struct platform_device sc_platform_dev; struct nouveau_device *sc_nv_dev; @@ -88,22 +90,24 @@ CFATTACH_DECL_NEW(tegra_nouveau, sizeof( static int tegra_nouveau_match(device_t parent, cfdata_t cf, void *aux) { - return 1; + const char * const compatible[] = { "nvidia,gk20a", NULL }; + struct fdt_attach_args * const faa = aux; + + return of_match_compatible(faa->faa_phandle, compatible); } static void tegra_nouveau_attach(device_t parent, device_t self, void *aux) { struct tegra_nouveau_softc * const sc = device_private(self); - struct tegraio_attach_args * const tio = aux; -#if notyet - const struct tegra_locators * const loc = >tio_loc; -#endif + struct fdt_attach_args * const faa = aux; prop_dictionary_t prop = device_properties(self); int error; sc->sc_dev = self; - sc->sc_dmat = tio->tio_dmat; + sc->sc_bst = faa->faa_bst; + sc->sc_dmat = faa->faa_dmat; + sc->sc_phandle = faa->faa_phandle; aprint_naive("\n"); aprint_normal(": GPU\n"); @@ -131,9 +135,15 @@ tegra_nouveau_init(device_t self) struct tegra_nouveau_softc * const sc = device_private(self); struct drm_driver * const driver = nouveau_drm_driver; struct drm_device *dev; - bus_space_tag_t bst = _generic_bs_tag; + bus_addr_t addr[2], size[2]; int error; + if (fdtbus_get_reg(sc->sc_phandle, 0, [0], [0]) != 0 || + fdtbus_get_reg(sc->sc_phandle, 1, [1], [1]) != 0) { + aprint_error(": couldn't get registers\n"); + return; + } + driver->kdriver.platform_device = >sc_platform_dev; driver->bus = _tegra_nouveau_bus; @@ -142,7 +152,7 @@ tegra_nouveau_init(device_t self) aprint_error_dev(self, "couldn't allocate DRM device\n"); return; } - dev->bst = bst; + dev->bst = sc->sc_bst; dev->bus_dmat = sc->sc_dmat; dev->dmat = dev->bus_dmat; dev->dmat_subregion_p = false; @@ -152,13 +162,12 @@ tegra_nouveau_init(device_t self) dev->platformdev->pd_dev = sc->sc_dev; dev->platformdev->dmat = sc->sc_dmat; dev->platformdev->nresource = 2; - dev->platformdev->resource[0].tag = bst; - dev->platformdev->resource[0].start = TEGRA_GPU_BASE; - dev->platformdev->resource[0].len = 0x0100; - dev->platformdev->resource[1].tag = bst; - dev->platformdev->resource[1].start = TEGRA_GPU_BASE + - dev->platformdev->resource[0].len; - dev->platformdev->resource[1].len = 0x0100; + dev->platformdev->resource[0].tag = sc->sc_bst; + dev->platformdev->resource[0].start = addr[0]; + dev->platformdev->resource[0].len = size[0]; + dev->platformdev->resource[1].tag = sc->sc_bst; + dev->platformdev->resource[1].start = addr[1]; + dev->platformdev->resource[1].len = size[1]; error = -drm_dev_register(dev, 0); if (error) { @@ -206,18 +215,58 @@ tegra_nouveau_irq_install(struct drm_dev irqreturn_t (*handler)(void *), int flags, const char *name, void *arg, struct drm_bus_irq_cookie **cookiep) { + struct tegra_nouveau_softc * const sc = device_private(dev->dev); + char intrstr[128]; + char *inames, *p; + u_int index; void *ih; - int irq = TEGRA_INTR_GPU; + int len, resid; + + len = OF_getproplen(sc->sc_phandle, "interrupt-names"); + if (len <= 0) { + aprint_error_dev(dev->dev, "no interrupt-names property\n"); + return -EIO; + } - ih = intr_establish(irq, IPL_DRM, IST_LEVEL, handler, arg); + inames = kmem_alloc(len, KM_SLEEP); + if (OF_getprop(sc->sc_phandle, "interrupt-names", inames, len) != len) { + aprint_error_dev(dev->dev, "failed to get interrupt-names\n");
CVS commit: src/sys/arch/hppa/stand/xxboot
Module Name:src Committed By: christos Date: Sun Dec 13 18:38:23 UTC 2015 Modified Files: src/sys/arch/hppa/stand/xxboot: iplsum.c Log Message: PR/50532: David Binderman: Add missing fclose. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/stand/xxboot/iplsum.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/hppa/stand/xxboot/iplsum.c diff -u src/sys/arch/hppa/stand/xxboot/iplsum.c:1.1 src/sys/arch/hppa/stand/xxboot/iplsum.c:1.2 --- src/sys/arch/hppa/stand/xxboot/iplsum.c:1.1 Mon Feb 24 02:23:43 2014 +++ src/sys/arch/hppa/stand/xxboot/iplsum.c Sun Dec 13 13:38:23 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: iplsum.c,v 1.1 2014/02/24 07:23:43 skrll Exp $ */ +/* $NetBSD: iplsum.c,v 1.2 2015/12/13 18:38:23 christos Exp $ */ /* * Calculate 32bit checksum of IPL and store in a certain location @@ -54,9 +54,11 @@ main(int argc, char *argv[]) return 1; } if ((len = fread(bootblk, 1, sizeof bootblk, fp)) <= IPLOFF) { + fclose(fp); fprintf(stderr, "%s: too short\n", argv[1]); return 1; } else if (len > BOOTSIZE) { + fclose(fp); fprintf(stderr, "%s: too long (%d vs %d)\n", argv[1], len, BOOTSIZE); return 1; }
CVS commit: src/usr.sbin/sup/source
Module Name:src Committed By: christos Date: Sun Dec 13 18:14:13 UTC 2015 Modified Files: src/usr.sbin/sup/source: expand.c Log Message: PR/50547: David Binderman: fix bad sizeof To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/sup/source/expand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sup/source/expand.c diff -u src/usr.sbin/sup/source/expand.c:1.18 src/usr.sbin/sup/source/expand.c:1.19 --- src/usr.sbin/sup/source/expand.c:1.18 Sat Oct 17 18:26:13 2009 +++ src/usr.sbin/sup/source/expand.c Sun Dec 13 13:14:13 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: expand.c,v 1.18 2009/10/17 22:26:13 christos Exp $ */ +/* $NetBSD: expand.c,v 1.19 2015/12/13 18:14:13 christos Exp $ */ /* * Copyright (c) 1991 Carnegie Mellon University @@ -78,6 +78,7 @@ static jmp_buf sjbuf; static char pathbuf[MAXPATHLEN]; +static size_t maxpathlen; static char *path, *pathp, *lastpathp; static const char globchars[] = "{[*?";/* meta characters */ @@ -104,7 +105,8 @@ expand(char *spec, char **buffer, int bu { pathp = path = pathbuf; *pathp = 0; - lastpathp = [MAXPATHLEN - 2]; + maxpathlen = sizeof(pathbuf) - 1; + lastpathp = [maxpathlen]; BUFFER = buffer; BUFSIZE = bufsize; bufcnt = 0; @@ -131,12 +133,11 @@ glob(char *as) if (!*cs || *cs == '/') { if (pathp != path + 1) { *pathp = 0; -if (gethdir(path + 1, sizeof path - 1)) +if (gethdir(path + 1, maxpathlen)) goto endit; -strncpy(path, path + 1, sizeof path - 1); +strlcpy(path, path + 1, maxpathlen); } else -strncpy(path, (char *) getenv("HOME"), sizeof path - 1); - path[sizeof path - 1] = '\0'; +strlcpy(path, getenv("HOME"), maxpathlen); pathp = path + strlen(path); } } @@ -398,7 +399,6 @@ gethdir(char *home, size_t homelen) if (pp == 0) return (1); - strncpy(home, pp->pw_dir, homelen - 1); - home[homelen - 1] = '\0'; + strlcpy(home, pp->pw_dir, homelen); return (0); }
CVS commit: src/sys/dev/marvell
Module Name:src Committed By: christos Date: Sun Dec 13 18:35:26 UTC 2015 Modified Files: src/sys/dev/marvell: mvspi.c Log Message: PR/50533: David Binderman: Fix incorrect logic To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/marvell/mvspi.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/marvell/mvspi.c diff -u src/sys/dev/marvell/mvspi.c:1.2 src/sys/dev/marvell/mvspi.c:1.3 --- src/sys/dev/marvell/mvspi.c:1.2 Mon May 6 19:09:34 2013 +++ src/sys/dev/marvell/mvspi.c Sun Dec 13 13:35:26 2015 @@ -265,7 +265,7 @@ mvspi_assert(struct mvspi_softc *sc) { int ctl; - if (sc->sc_transfer->st_slave < 0 && sc->sc_transfer->st_slave > 7) { + if (sc->sc_transfer->st_slave < 0 || sc->sc_transfer->st_slave > 7) { printf("%s ERROR: Slave number %d not valid!\n", __func__, sc->sc_transfer->st_slave); return; } else
CVS commit: src/sys/dev/pci
Module Name:src Committed By: christos Date: Sun Dec 13 19:06:43 UTC 2015 Modified Files: src/sys/dev/pci: if_wm.c Log Message: PR/50527: David Binderman: Fix impossible code. Odd offsets need special treatment. To generate a diff of this commit: cvs rdiff -u -r1.381 -r1.382 src/sys/dev/pci/if_wm.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_wm.c diff -u src/sys/dev/pci/if_wm.c:1.381 src/sys/dev/pci/if_wm.c:1.382 --- src/sys/dev/pci/if_wm.c:1.381 Fri Oct 30 15:22:01 2015 +++ src/sys/dev/pci/if_wm.c Sun Dec 13 14:06:43 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_wm.c,v 1.381 2015/10/30 19:22:01 msaitoh Exp $ */ +/* $NetBSD: if_wm.c,v 1.382 2015/12/13 19:06:43 christos Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. @@ -83,7 +83,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.381 2015/10/30 19:22:01 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.382 2015/12/13 19:06:43 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_net_mpsafe.h" @@ -3105,7 +3105,7 @@ wm_set_filter(struct wm_softc *sc) hash |= 1U << bit; /* XXX Hardware bug?? */ - if (sc->sc_type == WM_T_82544 && (reg & 0xe) == 1) { + if (sc->sc_type == WM_T_82544 && (reg & 1) != 0) { bit = CSR_READ(sc, mta_reg + ((reg - 1) << 2)); CSR_WRITE(sc, mta_reg + (reg << 2), hash); CSR_WRITE(sc, mta_reg + ((reg - 1) << 2), bit);
CVS commit: src/sys/arch/acorn32/podulebus
Module Name:src Committed By: christos Date: Sun Dec 13 19:53:02 UTC 2015 Modified Files: src/sys/arch/acorn32/podulebus: esc.c Log Message: PR/50514: David Binderman: Add missing break To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/acorn32/podulebus/esc.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/acorn32/podulebus/esc.c diff -u src/sys/arch/acorn32/podulebus/esc.c:1.29 src/sys/arch/acorn32/podulebus/esc.c:1.30 --- src/sys/arch/acorn32/podulebus/esc.c:1.29 Sat Oct 25 06:58:12 2014 +++ src/sys/arch/acorn32/podulebus/esc.c Sun Dec 13 14:53:02 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: esc.c,v 1.29 2014/10/25 10:58:12 skrll Exp $ */ +/* $NetBSD: esc.c,v 1.30 2015/12/13 19:53:02 christos Exp $ */ /* * Copyright (c) 1990 The Regents of the University of California. @@ -86,7 +86,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: esc.c,v 1.29 2014/10/25 10:58:12 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esc.c,v 1.30 2015/12/13 19:53:02 christos Exp $"); #include #include @@ -1445,6 +1445,7 @@ esc_postaction(struct esc_softc *dev, es switch(dev->sc_msg_in[0]) { case 0x00: /* COMMAND COMPLETE */ nexus->state = ESC_NS_DONE; +break; case 0x04: /* DISCONNECT */ nexus->state = ESC_NS_DISCONNECTING; break;
CVS commit: src/usr.bin/pmap
Module Name:src Committed By: christos Date: Sun Dec 13 18:09:00 UTC 2015 Modified Files: src/usr.bin/pmap: main.c Log Message: PR/50546: David Binderman: Fix bad sizeof To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/usr.bin/pmap/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/pmap/main.c diff -u src/usr.bin/pmap/main.c:1.24 src/usr.bin/pmap/main.c:1.25 --- src/usr.bin/pmap/main.c:1.24 Tue Oct 25 19:45:19 2011 +++ src/usr.bin/pmap/main.c Sun Dec 13 13:09:00 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.24 2011/10/25 23:45:19 jym Exp $ */ +/* $NetBSD: main.c,v 1.25 2015/12/13 18:09:00 christos Exp $ */ /* * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: main.c,v 1.24 2011/10/25 23:45:19 jym Exp $"); +__RCSID("$NetBSD: main.c,v 1.25 2015/12/13 18:09:00 christos Exp $"); #endif #include @@ -468,18 +468,19 @@ load_name_cache(kvm_t *kd) { struct namecache _ncp, *ncp, *oncp; struct nchashhead _ncpp, *ncpp; - u_long nchash, i; + u_long lnchash; + size_t nchash, i; LIST_INIT(); - _KDEREF(kd, nchash_addr, , sizeof(nchash)); - nchashtbl = malloc(sizeof(nchashtbl) * (int)(nchash + 1)); - _KDEREF(kd, nchashtbl_addr, nchashtbl, - sizeof(nchashtbl) * (int)(nchash + 1)); + _KDEREF(kd, nchash_addr, , sizeof(lnchash)); + nchash = (size_t)lnchash + 1; + nchashtbl = malloc(nchash * sizeof(*nchashtbl)); + _KDEREF(kd, nchashtbl_addr, nchashtbl, sizeof(*nchashtbl) * nchash); ncpp = &_ncpp; - for (i = 0; i <= nchash; i++) { + for (i = 0; i < nchash; i++) { ncpp = [i]; oncp = NULL; LIST_FOREACH(ncp, ncpp, nc_hash) {
CVS commit: src/sys/fs/nfs/nlm
Module Name:src Committed By: christos Date: Sun Dec 13 18:31:09 UTC 2015 Modified Files: src/sys/fs/nfs/nlm: nlm_prot_impl.c Log Message: PR/50535: David Binderman: Fix nonsense strcmp To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/fs/nfs/nlm/nlm_prot_impl.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/fs/nfs/nlm/nlm_prot_impl.c diff -u src/sys/fs/nfs/nlm/nlm_prot_impl.c:1.1.1.1 src/sys/fs/nfs/nlm/nlm_prot_impl.c:1.2 --- src/sys/fs/nfs/nlm/nlm_prot_impl.c:1.1.1.1 Mon Sep 30 03:19:45 2013 +++ src/sys/fs/nfs/nlm/nlm_prot_impl.c Sun Dec 13 13:31:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: nlm_prot_impl.c,v 1.1.1.1 2013/09/30 07:19:45 dholland Exp $ */ +/* $NetBSD: nlm_prot_impl.c,v 1.2 2015/12/13 18:31:09 christos Exp $ */ /*- * Copyright (c) 2008 Isilon Inc http://www.isilon.com/ * Authors: Doug Rabson@@ -30,7 +30,7 @@ #include /* __FBSDID("FreeBSD: head/sys/nlm/nlm_prot_impl.c 255333 2013-09-06 23:14:31Z rmacklem "); */ -__RCSID("$NetBSD: nlm_prot_impl.c,v 1.1.1.1 2013/09/30 07:19:45 dholland Exp $"); +__RCSID("$NetBSD: nlm_prot_impl.c,v 1.2 2015/12/13 18:31:09 christos Exp $"); #include #include @@ -1074,7 +1074,7 @@ nlm_find_host_by_addr(const struct socka break; #endif default: - strcmp(tmp, ""); + strcpy(tmp, ""); }
CVS commit: src/sys/dev/pci/n8/common/api
Module Name:src Committed By: christos Date: Sun Dec 13 18:29:00 UTC 2015 Modified Files: src/sys/dev/pci/n8/common/api: n8_key_works.c Log Message: PR/50536: David Binderman: fix incorrect sizeof To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/n8/common/api/n8_key_works.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/n8/common/api/n8_key_works.c diff -u src/sys/dev/pci/n8/common/api/n8_key_works.c:1.1 src/sys/dev/pci/n8/common/api/n8_key_works.c:1.2 --- src/sys/dev/pci/n8/common/api/n8_key_works.c:1.1 Thu Oct 30 08:02:14 2008 +++ src/sys/dev/pci/n8/common/api/n8_key_works.c Sun Dec 13 13:29:00 2015 @@ -32,7 +32,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -static char const n8_id[] = "$Id: n8_key_works.c,v 1.1 2008/10/30 12:02:14 darran Exp $"; +static char const n8_id[] = "$Id: n8_key_works.c,v 1.2 2015/12/13 18:29:00 christos Exp $"; /*/ /** @file n8_key_works.c * @brief Contains key operations @@ -139,7 +139,7 @@ N8_Boolean_t checkKeyForWeakness (key_cb for (i=0; i < NUM_WEAK_KEY; i++) { - if (memcmp(weak_keys[i], key_p, sizeof(key_p)) == 0) + if (memcmp(weak_keys[i], key_p, sizeof(*key_p)) == 0) { ret = N8_TRUE; break;
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: christos Date: Sun Dec 13 18:41:09 UTC 2015 Modified Files: src/sys/arch/sparc64/sparc64: clock.c Log Message: PR/50531: David Binderman: Add missing printf args To generate a diff of this commit: cvs rdiff -u -r1.117 -r1.118 src/sys/arch/sparc64/sparc64/clock.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/clock.c diff -u src/sys/arch/sparc64/sparc64/clock.c:1.117 src/sys/arch/sparc64/sparc64/clock.c:1.118 --- src/sys/arch/sparc64/sparc64/clock.c:1.117 Fri Jul 25 13:54:50 2014 +++ src/sys/arch/sparc64/sparc64/clock.c Sun Dec 13 13:41:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.117 2014/07/25 17:54:50 nakayama Exp $ */ +/* $NetBSD: clock.c,v 1.118 2015/12/13 18:41:09 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.117 2014/07/25 17:54:50 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.118 2015/12/13 18:41:09 christos Exp $"); #include "opt_multiprocessor.h" @@ -723,7 +723,8 @@ statintr(void *cap) #ifdef NOT_DEBUG printf("statclock: count %x:%x, limit %x:%x\n", - timerreg_4u.t_timer[1].t_count, timerreg_4u.t_timer[1].t_limit); + timerreg_4u.t_timer[0].t_count, timerreg_4u.t_timer[1].t_count, + timerreg_4u.t_timer[0].t_limit, timerreg_4u.t_timer[1].t_limit); #endif #ifdef NOT_DEBUG prom_printf("!");
CVS commit: src/sys/netinet
Module Name:src Committed By: christos Date: Sun Dec 13 18:53:57 UTC 2015 Modified Files: src/sys/netinet: sctp_indata.c Log Message: PR/50528: David Binderman: remove sizeof(sizeof(x)) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/sctp_indata.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/netinet/sctp_indata.c diff -u src/sys/netinet/sctp_indata.c:1.1 src/sys/netinet/sctp_indata.c:1.2 --- src/sys/netinet/sctp_indata.c:1.1 Tue Oct 13 17:28:35 2015 +++ src/sys/netinet/sctp_indata.c Sun Dec 13 13:53:57 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sctp_indata.c,v 1.1 2015/10/13 21:28:35 rjs Exp $ */ +/* $NetBSD: sctp_indata.c,v 1.2 2015/12/13 18:53:57 christos Exp $ */ /* $KAME: sctp_indata.c,v 1.36 2005/03/06 16:04:17 itojun Exp $ */ /* @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sctp_indata.c,v 1.1 2015/10/13 21:28:35 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctp_indata.c,v 1.2 2015/12/13 18:53:57 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_ipsec.h" @@ -3756,7 +3756,7 @@ sctp_handle_sack(struct sctp_sack_chunk /* always set this up to cum-ack */ asoc->this_sack_highest_gap = last_tsn; - if (((num_seg * sizeof (sizeof(struct sctp_gap_ack_block))) + sizeof(struct sctp_sack_chunk)) > sack_length) { + if (num_seg * sizeof(struct sctp_gap_ack_block) + sizeof(struct sctp_sack_chunk) > sack_length) { /* skip corrupt segments */ strike_enabled = 0; goto skip_segments;
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: christos Date: Sun Dec 13 19:43:27 UTC 2015 Modified Files: src/sys/arch/alpha/alpha: dec_kn300.c Log Message: PR/50523: David Binderman: Fix incorrect shifts. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/alpha/alpha/dec_kn300.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/alpha/alpha/dec_kn300.c diff -u src/sys/arch/alpha/alpha/dec_kn300.c:1.40 src/sys/arch/alpha/alpha/dec_kn300.c:1.41 --- src/sys/arch/alpha/alpha/dec_kn300.c:1.40 Sat Oct 13 13:58:54 2012 +++ src/sys/arch/alpha/alpha/dec_kn300.c Sun Dec 13 14:43:27 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: dec_kn300.c,v 1.40 2012/10/13 17:58:54 jdc Exp $ */ +/* $NetBSD: dec_kn300.c,v 1.41 2015/12/13 19:43:27 christos Exp $ */ /* * Copyright (c) 1998 by Matthew Jacob @@ -34,7 +34,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.40 2012/10/13 17:58:54 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.41 2015/12/13 19:43:27 christos Exp $"); #include #include @@ -415,6 +415,9 @@ typedef struct { } mc_soft300; #define CAP_ERR_CRDX 204 +static const char * +corr_type(unsigned long code) + static void kn300_softerr(unsigned long mces, unsigned long type, unsigned long logout, struct trapframe *framep) { @@ -431,8 +434,8 @@ kn300_softerr(unsigned long mces, unsign printf("kn300: CPU ID %d %s correctable error corrected by %s\n", whami, (type == ALPHA_SYS_ERROR)? sys : proc, - ((hdr->mcheck_code & 0xff00) == (EV5_CORRECTED << 16))? proc : - (((hdr->mcheck_code & 0xff00) == (CAP_ERR_CRDX << 16)) ? + ((hdr->mcheck_code & 0xff00) == (EV5_CORRECTED << 8))? proc : + (((hdr->mcheck_code & 0xff00) == (CAP_ERR_CRDX << 8)) ? "I/O Bridge Module" : sys)); printf("Machine Check Code 0x%lx\n", hdr->mcheck_code);
CVS commit: src/sys/arch/sparc/sparc
Module Name:src Committed By: christos Date: Sun Dec 13 19:49:34 UTC 2015 Modified Files: src/sys/arch/sparc/sparc: trap.c Log Message: PR/50516: David Binderman: Add missing breaks To generate a diff of this commit: cvs rdiff -u -r1.194 -r1.195 src/sys/arch/sparc/sparc/trap.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/sparc/sparc/trap.c diff -u src/sys/arch/sparc/sparc/trap.c:1.194 src/sys/arch/sparc/sparc/trap.c:1.195 --- src/sys/arch/sparc/sparc/trap.c:1.194 Fri Dec 11 03:08:01 2015 +++ src/sys/arch/sparc/sparc/trap.c Sun Dec 13 14:49:34 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.194 2015/12/11 08:08:01 mlelstv Exp $ */ +/* $NetBSD: trap.c,v 1.195 2015/12/13 19:49:34 christos Exp $ */ /* * Copyright (c) 1996 @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.194 2015/12/11 08:08:01 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.195 2015/12/13 19:49:34 christos Exp $"); #include "opt_ddb.h" #include "opt_compat_svr4.h" @@ -960,9 +960,11 @@ kfault: case EINVAL: ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_ADRERR; + break; case EACCES: ksi.ksi_signo = SIGSEGV; ksi.ksi_code = SEGV_ACCERR; + break; default: ksi.ksi_signo = SIGSEGV; ksi.ksi_code = SEGV_MAPERR;
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Sun Dec 13 21:03:31 UTC 2015 Modified Files: src/sys/arch/i386/stand/lib: dosfile.c Log Message: one default is better than two To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/lib/dosfile.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/i386/stand/lib/dosfile.c diff -u src/sys/arch/i386/stand/lib/dosfile.c:1.18 src/sys/arch/i386/stand/lib/dosfile.c:1.19 --- src/sys/arch/i386/stand/lib/dosfile.c:1.18 Sun Dec 13 14:51:53 2015 +++ src/sys/arch/i386/stand/lib/dosfile.c Sun Dec 13 16:03:31 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: dosfile.c,v 1.18 2015/12/13 19:51:53 christos Exp $ */ +/* $NetBSD: dosfile.c,v 1.19 2015/12/13 21:03:31 christos Exp $ */ /* * Copyright (c) 1996 @@ -70,7 +70,6 @@ dos2errno(void) err = EPERM; break; case 6: /* invalid handle */ - default: err = EINVAL; break; }
CVS commit: src/sys/arch
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:39:20 UTC 2015 Modified Files: src/sys/arch/arm/nvidia: files.tegra tegra_ahcisata.c tegra_car.c tegra_cec.c tegra_com.c tegra_drm.c tegra_drm.h tegra_drm_mode.c tegra_ehci.c tegra_fuse.c tegra_gpio.c tegra_hdaudio.c tegra_i2c.c tegra_mc.c tegra_mpio.c tegra_pcie.c tegra_pmc.c tegra_rtc.c tegra_sdhc.c tegra_soctherm.c tegra_timer.c tegra_usbphy.c tegra_xusbpad.c src/sys/arch/evbarm/conf: JETSONTK1 files.tegra mk.tegra src/sys/arch/evbarm/tegra: tegra_machdep.c tegra_start.S Added Files: src/sys/arch/arm/nvidia: tegra_fdt.c tegra_lic.c Removed Files: src/sys/arch/arm/nvidia: tegra_host1x.c tegra_io.c Log Message: Use fdt for device enumeration. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/nvidia/files.tegra cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/nvidia/tegra_ahcisata.c \ src/sys/arch/arm/nvidia/tegra_pmc.c cvs rdiff -u -r1.30 -r1.31 src/sys/arch/arm/nvidia/tegra_car.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nvidia/tegra_cec.c \ src/sys/arch/arm/nvidia/tegra_rtc.c \ src/sys/arch/arm/nvidia/tegra_soctherm.c \ src/sys/arch/arm/nvidia/tegra_timer.c \ src/sys/arch/arm/nvidia/tegra_xusbpad.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/nvidia/tegra_com.c \ src/sys/arch/arm/nvidia/tegra_fuse.c src/sys/arch/arm/nvidia/tegra_mpio.c \ src/sys/arch/arm/nvidia/tegra_usbphy.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_drm.c \ src/sys/arch/arm/nvidia/tegra_gpio.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/nvidia/tegra_drm.h \ src/sys/arch/arm/nvidia/tegra_hdaudio.c \ src/sys/arch/arm/nvidia/tegra_mc.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra_drm_mode.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/nvidia/tegra_ehci.c cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/nvidia/tegra_fdt.c \ src/sys/arch/arm/nvidia/tegra_lic.c cvs rdiff -u -r1.1 -r0 src/sys/arch/arm/nvidia/tegra_host1x.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/nvidia/tegra_i2c.c cvs rdiff -u -r1.21 -r0 src/sys/arch/arm/nvidia/tegra_io.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/nvidia/tegra_pcie.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/nvidia/tegra_sdhc.c cvs rdiff -u -r1.41 -r1.42 src/sys/arch/evbarm/conf/JETSONTK1 cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/files.tegra cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/conf/mk.tegra cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/tegra/tegra_machdep.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/tegra/tegra_start.S 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/nvidia/files.tegra diff -u src/sys/arch/arm/nvidia/files.tegra:1.24 src/sys/arch/arm/nvidia/files.tegra:1.25 --- src/sys/arch/arm/nvidia/files.tegra:1.24 Sat Nov 21 22:55:32 2015 +++ src/sys/arch/arm/nvidia/files.tegra Sun Dec 13 17:39:19 2015 @@ -1,4 +1,4 @@ -# $NetBSD: files.tegra,v 1.24 2015/11/21 22:55:32 jmcneill Exp $ +# $NetBSD: files.tegra,v 1.25 2015/12/13 17:39:19 jmcneill Exp $ # # Configuration info for NVIDIA Tegra ARM Peripherals # @@ -22,107 +22,109 @@ device tegraio { [port=-1] } : bus_space attach tegraio at mainbus with tegra_io file arch/arm/nvidia/tegra_io.c tegra_io +device tegrafdt : bus_space_generic, fdtbus +attach tegrafdt at mainbus with tegra_fdt +file arch/arm/nvidia/tegra_fdt.c tegra_fdt + +# Interrupt controller +device tegralic +attach tegralic at fdt with tegra_lic +file arch/arm/nvidia/tegra_lic.c tegra_lic + # Memory controller device tegramc -attach tegramc at tegraio with tegra_mc +attach tegramc at fdt with tegra_mc file arch/arm/nvidia/tegra_mc.c tegra_mc # Power management controller device tegrapmc -attach tegrapmc at tegraio with tegra_pmc +attach tegrapmc at fdt with tegra_pmc file arch/arm/nvidia/tegra_pmc.c tegra_pmc # eFUSE device tegrafuse -attach tegrafuse at tegraio with tegra_fuse +attach tegrafuse at fdt with tegra_fuse file arch/arm/nvidia/tegra_fuse.c tegra_fuse # Clock and Reset controller device tegracar -attach tegracar at tegraio with tegra_car +attach tegracar at fdt with tegra_car file arch/arm/nvidia/tegra_car.c tegra_car # GPIO controller device tegragpio: gpiobus -attach tegragpio at tegraio with tegra_gpio +attach tegragpio at fdt with tegra_gpio file arch/arm/nvidia/tegra_gpio.c tegra_gpio # Timers device tegratimer: sysmon_wdog -attach tegratimer at tegraio with tegra_timer +attach tegratimer at fdt with tegra_timer file arch/arm/nvidia/tegra_timer.c tegra_timer # MPIO / Pinmux device tegrampio -attach tegrampio at tegraio with tegra_mpio +attach tegrampio at fdt with tegra_mpio file arch/arm/nvidia/tegra_mpio.c tegra_mpio # XUSB PADCTL device tegraxusbpad -attach tegraxusbpad at tegraio with tegra_xusbpad +attach tegraxusbpad at fdt with tegra_xusbpad
CVS commit: src/sys/arch/arm/fdt
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:45:37 UTC 2015 Added Files: src/sys/arch/arm/fdt: files.fdt gic_fdt.c Log Message: fdt glue for gic To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/files.fdt \ src/sys/arch/arm/fdt/gic_fdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/arm/fdt/files.fdt diff -u /dev/null src/sys/arch/arm/fdt/files.fdt:1.1 --- /dev/null Sun Dec 13 17:45:37 2015 +++ src/sys/arch/arm/fdt/files.fdt Sun Dec 13 17:45:37 2015 @@ -0,0 +1,5 @@ +# $NetBSD: files.fdt,v 1.1 2015/12/13 17:45:37 jmcneill Exp $ + +device gic +attach gic at fdt with gic_fdt +filearch/arm/fdt/gic_fdt.c gic_fdt Index: src/sys/arch/arm/fdt/gic_fdt.c diff -u /dev/null src/sys/arch/arm/fdt/gic_fdt.c:1.1 --- /dev/null Sun Dec 13 17:45:37 2015 +++ src/sys/arch/arm/fdt/gic_fdt.c Sun Dec 13 17:45:37 2015 @@ -0,0 +1,202 @@ +/* $NetBSD: gic_fdt.c,v 1.1 2015/12/13 17:45:37 jmcneill Exp $ */ + +/*- + * Copyright (c) 2015 Jared D. McNeill+ * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 +__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.1 2015/12/13 17:45:37 jmcneill Exp $"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +static int gic_fdt_match(device_t, cfdata_t, void *); +static void gic_fdt_attach(device_t, device_t, void *); + +static void * gic_fdt_establish(device_t, int, u_int, int, int, + int (*)(void *), void *); +static void gic_fdt_disestablish(device_t, void *); +static bool gic_fdt_intrstr(device_t, int, u_int, char *, size_t); + +struct fdtbus_interrupt_controller_func gic_fdt_funcs = { + .establish = gic_fdt_establish, + .disestablish = gic_fdt_disestablish, + .intrstr = gic_fdt_intrstr +}; + +struct gic_fdt_softc { + device_t sc_dev; + int sc_phandle; +}; + +CFATTACH_DECL_NEW(gic_fdt, sizeof(struct gic_fdt_softc), + gic_fdt_match, gic_fdt_attach, NULL, NULL); + +static int +gic_fdt_match(device_t parent, cfdata_t cf, void *aux) +{ + const char * const compatible[] = { + "arm,gic-400", + "arm,cortex-a15-gic", + "arm,cortex-a9-gic", + "arm,cortex-a7-gic", + NULL + }; + struct fdt_attach_args * const faa = aux; + + return of_compatible(faa->faa_phandle, compatible) >= 0; +} + +static void +gic_fdt_attach(device_t parent, device_t self, void *aux) +{ + struct gic_fdt_softc * const sc = device_private(self); + struct fdt_attach_args * const faa = aux; + int error; + + sc->sc_dev = self; + sc->sc_phandle = faa->faa_phandle; + + error = fdtbus_register_interrupt_controller(self, faa->faa_phandle, + _fdt_funcs); + if (error) { + aprint_error(": couldn't register with fdtbus: %d\n", error); + return; + } + + aprint_naive("\n"); + aprint_normal(": GIC\n"); +} + +static void * +gic_fdt_establish(device_t dev, int phandle, u_int index, int ipl, int flags, +int (*func)(void *), void *arg) +{ + struct gic_fdt_softc * const sc = device_private(dev); + int iflags = (flags & FDT_INTR_MPSAFE) ? IST_MPSAFE : 0; + u_int *interrupts; + int interrupt_cells, len; + + len = OF_getprop(sc->sc_phandle, "#interrupt-cells", _cells, + sizeof(interrupt_cells)); + if (len != sizeof(interrupt_cells) || interrupt_cells <= 0) + return NULL; + interrupt_cells = be32toh(interrupt_cells); + + len = OF_getproplen(phandle, "interrupts"); + if (len <= 0) + return NULL; + + const u_int clen = interrupt_cells * 4; + const u_int nintr = len / interrupt_cells; + + if (index >= nintr) + return NULL; + + interrupts = kmem_alloc(len, KM_SLEEP); + + if (OF_getprop(phandle, "interrupts", interrupts, len) != len)
CVS commit: src/sys/compat/svr4
Module Name:src Committed By: christos Date: Sun Dec 13 19:47:08 UTC 2015 Modified Files: src/sys/compat/svr4: svr4_termios.c Log Message: PR/50520: David Binderman: Fix missing breaks. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/compat/svr4/svr4_termios.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/compat/svr4/svr4_termios.c diff -u src/sys/compat/svr4/svr4_termios.c:1.28 src/sys/compat/svr4/svr4_termios.c:1.29 --- src/sys/compat/svr4/svr4_termios.c:1.28 Sun Nov 9 13:16:55 2014 +++ src/sys/compat/svr4/svr4_termios.c Sun Dec 13 14:47:08 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_termios.c,v 1.28 2014/11/09 18:16:55 maxv Exp $ */ +/* $NetBSD: svr4_termios.c,v 1.29 2015/12/13 19:47:08 christos Exp $ */ /*- * Copyright (c) 1994, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: svr4_termios.c,v 1.28 2014/11/09 18:16:55 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: svr4_termios.c,v 1.29 2015/12/13 19:47:08 christos Exp $"); #include #include @@ -182,7 +182,7 @@ bsd_to_svr4_speed(u_long sp, u_long mask { switch (sp) { #undef getval -#define getval(a,b) case __CONCAT(a,b): sp = __CONCAT3(SVR4_,a,b) +#define getval(a,b) case __CONCAT(a,b): sp = __CONCAT3(SVR4_,a,b); break getval(B,0); getval(B,50); getval(B,75);
CVS commit: src/sys/dev/bluetooth
Module Name:src Committed By: plunky Date: Sun Dec 13 21:13:00 UTC 2015 Modified Files: src/sys/dev/bluetooth: btmagic.c Log Message: STRENGHT -> STRENGTH and misc spelling/whitespace. no functional change To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/dev/bluetooth/btmagic.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/bluetooth/btmagic.c diff -u src/sys/dev/bluetooth/btmagic.c:1.14 src/sys/dev/bluetooth/btmagic.c:1.15 --- src/sys/dev/bluetooth/btmagic.c:1.14 Fri Jul 3 14:18:18 2015 +++ src/sys/dev/bluetooth/btmagic.c Sun Dec 13 21:13:00 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: btmagic.c,v 1.14 2015/07/03 14:18:18 bouyer Exp $ */ +/* $NetBSD: btmagic.c,v 1.15 2015/12/13 21:13:00 plunky Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -85,7 +85,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.14 2015/07/03 14:18:18 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.15 2015/12/13 21:13:00 plunky Exp $"); #include #include @@ -163,7 +163,7 @@ struct btmagic_softc { int sc_rw; /* previous touches */ - uint32_t sc_smask; /* active(s) IDs */ + uint32_t sc_smask; /* active IDs */ int sc_nfingers; /* number of active IDs */ int sc_ax[16]; int sc_ay[16]; @@ -234,7 +234,7 @@ static void btmagic_tapcallout(void *); #define TRACKPAD_REPORT_ID 0x28 #define MOUSE_REPORT_ID 0x29 #define BATT_STAT_REPORT_ID 0x30 -#define BATT_STRENGHT_REPORT_ID 0x47 +#define BATT_STRENGTH_REPORT_ID 0x47 #define SURFACE_REPORT_ID 0x61 static const struct btproto btmagic_ctl_proto = { @@ -1114,6 +1114,7 @@ btmagic_input(void *arg, struct mbuf *m) case TRACKPAD_REPORT_ID: /* Magic trackpad (input) */ btmagic_input_magict(sc, data + 2, len - 2); break; + case MOUSE_REPORT_ID: /* Magic touch (input) */ btmagic_input_magicm(sc, data + 2, len - 2); break; @@ -1131,7 +1132,7 @@ btmagic_input(void *arg, struct mbuf *m) } break; - case BATT_STRENGHT_REPORT_ID: /* Battery strength (feature) */ + case BATT_STRENGTH_REPORT_ID: /* Battery strength (feature) */ if (len != 3) break; @@ -1529,7 +1530,7 @@ btmagic_input_magict(struct btmagic_soft ay = hid_get_data(data, ); DPRINTF(sc, - "btmagic_input_magicm: id %d ax %d ay %d phase %ld %s\n", + "btmagic_input_magict: id %d ax %d ay %d phase %ld %s\n", id, ax, ay, hid_get_udata(data, ), bpress ? "button pressed" : "");
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sun Dec 13 23:32:52 UTC 2015 Modified Files: src/share/man/man9: SET.9 Log Message: Add missing verb. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/share/man/man9/SET.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man9/SET.9 diff -u src/share/man/man9/SET.9:1.4 src/share/man/man9/SET.9:1.5 --- src/share/man/man9/SET.9:1.4 Sun Dec 13 21:53:02 2015 +++ src/share/man/man9/SET.9 Sun Dec 13 23:32:52 2015 @@ -1,4 +1,4 @@ -.\" $NetBSD: SET.9,v 1.4 2015/12/13 21:53:02 plunky Exp $ +.\" $NetBSD: SET.9,v 1.5 2015/12/13 23:32:52 wiz Exp $ .\" .\" Copyright (c) 2010 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -46,7 +46,7 @@ These macros define three standard bit o .Bl -enum -offset indent .It .Fn SET -the set bits from +sets the set bits from .Fa x in .Fa val ;
CVS commit: src/sys/arch
Module Name:src Committed By: marty Date: Sun Dec 13 22:28:10 UTC 2015 Modified Files: src/sys/arch/arm/samsung: exynos_wdt.c src/sys/arch/evbarm/exynos: exynos_machdep.c Log Message: undo 'typo' fix and restore 'frequency' to dictionary Oops. The 'typo' was elsewhere and I accidently removed setting the frequency. Fix that. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/samsung/exynos_wdt.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/exynos/exynos_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/arm/samsung/exynos_wdt.c diff -u src/sys/arch/arm/samsung/exynos_wdt.c:1.6 src/sys/arch/arm/samsung/exynos_wdt.c:1.7 --- src/sys/arch/arm/samsung/exynos_wdt.c:1.6 Thu Dec 10 21:56:04 2015 +++ src/sys/arch/arm/samsung/exynos_wdt.c Sun Dec 13 22:28:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_wdt.c,v 1.6 2015/12/10 21:56:04 marty Exp $ */ +/* $NetBSD: exynos_wdt.c,v 1.7 2015/12/13 22:28:09 marty Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "exynos_wdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: exynos_wdt.c,v 1.6 2015/12/10 21:56:04 marty Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_wdt.c,v 1.7 2015/12/13 22:28:09 marty Exp $"); #include #include @@ -54,10 +54,10 @@ static int exynos_wdt_match(device_t, cf static void exynos_wdt_attach(device_t, device_t, void *); struct exynos_wdt_softc { - struct sysmon_wdog sc_smw; device_t sc_dev; bus_space_tag_t sc_bst; bus_space_handle_t sc_wdog_bsh; + struct sysmon_wdog sc_smw; u_int sc_wdog_period; u_int sc_wdog_clock_select; u_int sc_wdog_prescaler; @@ -68,7 +68,7 @@ struct exynos_wdt_softc { }; #ifndef EXYNOS_WDT_PERIOD_DEFAULT -#define EXYNOS_WDT_PERIOD_DEFAULT 12 +#define EXYNOS_WDT_PERIOD_DEFAULT 60 #endif CFATTACH_DECL_NEW(exynos_wdt, sizeof(struct exynos_wdt_softc), @@ -189,13 +189,12 @@ exynos_wdt_attach(device_t parent, devic * This runs at the Exynos Pclk. */ prop_dictionary_get_uint32(dict, "frequency", >sc_freq); - sc->sc_wdog_wtcon = exynos_wdt_wdog_read(sc, EXYNOS_WDT_WTCON); sc->sc_wdog_armed = (sc->sc_wdog_wtcon & WTCON_ENABLE) && (sc->sc_wdog_wtcon & WTCON_RESET_ENABLE); if (sc->sc_wdog_armed) { sc->sc_wdog_prescaler = - __SHIFTOUT(sc->sc_wdog_wtcon, WTCON_PRESCALER) + 1; + __SHIFTOUT(sc->sc_wdog_wtcon, WTCON_PRESCALER); sc->sc_wdog_clock_select = __SHIFTOUT(sc->sc_wdog_wtcon, WTCON_CLOCK_SELECT); sc->sc_freq /= sc->sc_wdog_prescaler; @@ -203,7 +202,7 @@ exynos_wdt_attach(device_t parent, devic sc->sc_wdog_wtdat = exynos_wdt_wdog_read(sc, EXYNOS_WDT_WTDAT); sc->sc_wdog_period = (sc->sc_wdog_wtdat + 1) / sc->sc_freq; } else { - sc->sc_wdog_period = EXYNOS_WDT_DEFAULT_PERIOD; + sc->sc_wdog_period = EXYNOS_WDT_PERIOD_DEFAULT; sc->sc_wdog_prescaler = 1; /* * Let's see what clock select we should use. Index: src/sys/arch/evbarm/exynos/exynos_machdep.c diff -u src/sys/arch/evbarm/exynos/exynos_machdep.c:1.2 src/sys/arch/evbarm/exynos/exynos_machdep.c:1.3 --- src/sys/arch/evbarm/exynos/exynos_machdep.c:1.2 Fri Dec 11 04:12:21 2015 +++ src/sys/arch/evbarm/exynos/exynos_machdep.c Sun Dec 13 22:28:09 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_machdep.c,v 1.2 2015/12/11 04:12:21 marty Exp $ */ +/* $NetBSD: exynos_machdep.c,v 1.3 2015/12/13 22:28:09 marty Exp $ */ /* * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exynos_machdep.c,v 1.2 2015/12/11 04:12:21 marty Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_machdep.c,v 1.3 2015/12/13 22:28:09 marty Exp $"); #include "opt_evbarm_boardtype.h" #include "opt_exynos.h" @@ -515,6 +515,9 @@ odroid_device_register(device_t self, vo exynos_device_register(self, aux); if (device_is_a(self, "exyogpio")) { init_gpio_dictionary(gpio_pin_entries, dict); + } else if (device_is_a(self, "exyowdt")) { + prop_dictionary_set_uint32(dict, "frequency", + EXYNOS_F_IN_FREQ); } }
CVS commit: src
Module Name:src Committed By: jmcneill Date: Sun Dec 13 23:02:56 UTC 2015 Modified Files: src/distrib/utils/embedded/conf: armv7.conf src/etc/etc.evbarm: Makefile.inc Added Files: src/sys/arch/evbarm/conf: TEGRA TEGRA_INSTALL Removed Files: src/sys/arch/evbarm/conf: JETSONTK1 JETSONTK1_INSTALL NYAN-BIG Log Message: Remove JETSONTK1 and NYAN-BIG kernels, add a new unified kernel named TEGRA. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/embedded/conf/armv7.conf cvs rdiff -u -r1.78 -r1.79 src/etc/etc.evbarm/Makefile.inc cvs rdiff -u -r1.42 -r0 src/sys/arch/evbarm/conf/JETSONTK1 cvs rdiff -u -r1.1 -r0 src/sys/arch/evbarm/conf/JETSONTK1_INSTALL cvs rdiff -u -r1.3 -r0 src/sys/arch/evbarm/conf/NYAN-BIG cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/TEGRA \ src/sys/arch/evbarm/conf/TEGRA_INSTALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/embedded/conf/armv7.conf diff -u src/distrib/utils/embedded/conf/armv7.conf:1.8 src/distrib/utils/embedded/conf/armv7.conf:1.9 --- src/distrib/utils/embedded/conf/armv7.conf:1.8 Fri Aug 21 17:08:11 2015 +++ src/distrib/utils/embedded/conf/armv7.conf Sun Dec 13 23:02:56 2015 @@ -1,4 +1,4 @@ -# $NetBSD: armv7.conf,v 1.8 2015/08/21 17:08:11 jmcneill Exp $ +# $NetBSD: armv7.conf,v 1.9 2015/12/13 23:02:56 jmcneill Exp $ # ARMv7 customization script used by mkimage # board=armv7 @@ -11,7 +11,7 @@ kernels_beagle="BEAGLEBOARD BEAGLEBONE" kernels_awin="BPI CUBIEBOARD CUBIETRUCK HUMMINGBIRD_A31" kernels_rpi="RPI2" kernels_amlogic="ODROID-C1" -kernels_tegra="JETSONTK1" +kernels_tegra="TEGRA" make_label() { make_label_evbarm @@ -89,15 +89,17 @@ EOF } populate_tegra() { - jetsontk1_kernelimg=netbsd-JETSONTK1.ub + tegra_kernelimg=netbsd-TEGRA.ub - # Create a boot.scr for Jetson TK1 U-Boot - cat > "${mnt}/boot/boot-JETSONTK1.txt" << EOF + # Create a boot.scr for Tegra U-Boot + cat > "${mnt}/boot/boot-TEGRA.txt" << EOF setenv bootargs root=ld1a -fatload mmc 1:1 0x9000 ${jetsontk1_kernelimg} -bootm 0x9000 +fatload mmc 1:1 \${kernel_addr_r} ${tegra_kernelimg} +fatload mmc 1:1 \${fdt_addr_r} tegra124-\${board}.dtb +fdt addr \${fdt_addr_r} +bootm \${kernel_addr_r} - \${fdt_addr_r} EOF - "${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-JETSONTK1.txt" "${mnt}/boot/boot.scr" + "${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-TEGRA.txt" "${mnt}/boot/boot.scr" } populate() { Index: src/etc/etc.evbarm/Makefile.inc diff -u src/etc/etc.evbarm/Makefile.inc:1.78 src/etc/etc.evbarm/Makefile.inc:1.79 --- src/etc/etc.evbarm/Makefile.inc:1.78 Sat Jul 18 00:57:35 2015 +++ src/etc/etc.evbarm/Makefile.inc Sun Dec 13 23:02:56 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.78 2015/07/18 00:57:35 matt Exp $ +# $NetBSD: Makefile.inc,v 1.79 2015/12/13 23:02:56 jmcneill Exp $ # # etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets # @@ -103,8 +103,8 @@ EVBARM_BOARDS.armv7hf+= CUBOX-I EVBARM_BOARDS.armv7+= HUMMINGBIRD_A31 EVBARM_BOARDS.armv7hf+= HUMMINGBIRD_A31 #EVBARM_BOARDS.armv7+= IGEPV2 -EVBARM_BOARDS.armv7+= JETSONTK1 -EVBARM_BOARDS.armv7hf+= JETSONTK1 +EVBARM_BOARDS.armv7+= TEGRA +EVBARM_BOARDS.armv7hf+= TEGRA EVBARM_BOARDS.armv7+= KOBO EVBARM_BOARDS.armv7hf+= KOBO EVBARM_BOARDS.armv7+= MIRABOX Added files: Index: src/sys/arch/evbarm/conf/TEGRA diff -u /dev/null src/sys/arch/evbarm/conf/TEGRA:1.1 --- /dev/null Sun Dec 13 23:02:56 2015 +++ src/sys/arch/evbarm/conf/TEGRA Sun Dec 13 23:02:56 2015 @@ -0,0 +1,165 @@ +# +# $NetBSD: TEGRA,v 1.1 2015/12/13 23:02:56 jmcneill Exp $ +# +# NVIDIA Tegra K1 (T124) +# + +include "arch/evbarm/conf/std.tegra" +include "arch/evbarm/conf/GENERIC.common" + +options CPU_CORTEXA15 +options SOC_TEGRA124 +options MULTIPROCESSOR + +options FDT # Flattened Device Tree support +pseudo-device openfirm # /dev/openfirm + +options DIAGNOSTIC # internal consistency checks +#options DEBUG +#options LOCKDEBUG +#options PMAP_DEBUG # Enable pmap_debug_level code +#options IPKDB # remote kernel debugging +#options VERBOSE_INIT_ARM # verbose bootstraping messages +makeoptions DEBUG="-g" # compile full symbol table +makeoptions COPY_SYMTAB=1 + +config netbsd root on ? type ? + +mainbus0 at root +cpu* at mainbus? + +# A15 core devices +armperiph0 at mainbus? +armgic0 at armperiph?# Interrupt Controller +armgtmr0 at armperiph?# ARM Generic Timer + +# On-board I/O +tegrafdt0 at mainbus? +fdt0 at tegrafdt0 +simplebus* at fdt? +fdt* at simplebus? + +fregulator* at fdt? + +# Interrupt controller +tegralic* at fdt? # LIC +gic* at fdt? # GIC + +# Memory controller +tegramc* at fdt? # MC + +# FUSE controller +tegrafuse* at fdt? # FUSE + +# Power management controller +tegrapmc* at fdt? # PMC + +# Clock and Reset
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: marty Date: Mon Dec 14 00:00:22 UTC 2015 Modified Files: src/sys/arch/evbarm/conf: ODROID-XU4 Log Message: enable the watch dog This will work only if the patch to sysmon_wdog.c to convert it to MODULE_CLASS_DRIVER is installed. Symptom of failure is a crash in lockdebug because of an uninitialized mutex. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/conf/ODROID-XU4 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/evbarm/conf/ODROID-XU4 diff -u src/sys/arch/evbarm/conf/ODROID-XU4:1.3 src/sys/arch/evbarm/conf/ODROID-XU4:1.4 --- src/sys/arch/evbarm/conf/ODROID-XU4:1.3 Sun Dec 6 00:31:24 2015 +++ src/sys/arch/evbarm/conf/ODROID-XU4 Mon Dec 14 00:00:22 2015 @@ -1,5 +1,5 @@ # -# $NetBSD: ODROID-XU4,v 1.3 2015/12/06 00:31:24 marty Exp $ +# $NetBSD: ODROID-XU4,v 1.4 2015/12/14 00:00:22 marty Exp $ # # ODROID-XU -- ODROID-XU4 Exynos5422 based kernel # @@ -207,7 +207,7 @@ exy5422clk0 at exyo0 # Exynos5422 cloc sscom2 at exyo0 port 2 # UART2 # Exynos Watchdog Timer -#exyowdt0 at exyo0 # watchdog +exyowdt0 at exyo0 # watchdog # GPIO exyogpio0 at exyo0
CVS commit: src/sys/arch
Module Name:src Committed By: jmcneill Date: Sun Dec 13 22:55:05 UTC 2015 Modified Files: src/sys/arch/arm/nvidia: files.tegra src/sys/arch/evbarm/tegra: tegra_machdep.c tegra_start.S Log Message: Get rid of board-specific options. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/nvidia/files.tegra cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/tegra/tegra_machdep.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/tegra/tegra_start.S 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/nvidia/files.tegra diff -u src/sys/arch/arm/nvidia/files.tegra:1.26 src/sys/arch/arm/nvidia/files.tegra:1.27 --- src/sys/arch/arm/nvidia/files.tegra:1.26 Sun Dec 13 21:24:06 2015 +++ src/sys/arch/arm/nvidia/files.tegra Sun Dec 13 22:55:05 2015 @@ -1,4 +1,4 @@ -# $NetBSD: files.tegra,v 1.26 2015/12/13 21:24:06 jmcneill Exp $ +# $NetBSD: files.tegra,v 1.27 2015/12/13 22:55:05 jmcneill Exp $ # # Configuration info for NVIDIA Tegra ARM Peripherals # @@ -146,8 +146,3 @@ defparam opt_tegra.h MEMSIZE # SOC parameters defflag opt_tegra.h SOC_TEGRAK1 defflag opt_tegra.h SOC_TEGRA124: SOC_TEGRAK1 - -# Board parameters -defflag opt_tegra.h TEGRA_UBOOT -defflag opt_tegra.h BOARD_JETSONTK1: TEGRA_UBOOT -defflag opt_tegra.h BOARD_NYAN_BIG Index: src/sys/arch/evbarm/tegra/tegra_machdep.c diff -u src/sys/arch/evbarm/tegra/tegra_machdep.c:1.34 src/sys/arch/evbarm/tegra/tegra_machdep.c:1.35 --- src/sys/arch/evbarm/tegra/tegra_machdep.c:1.34 Sun Dec 13 17:39:19 2015 +++ src/sys/arch/evbarm/tegra/tegra_machdep.c Sun Dec 13 22:55:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_machdep.c,v 1.34 2015/12/13 17:39:19 jmcneill Exp $ */ +/* $NetBSD: tegra_machdep.c,v 1.35 2015/12/13 22:55:05 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill@@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.34 2015/12/13 17:39:19 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.35 2015/12/13 22:55:05 jmcneill Exp $"); #include "opt_tegra.h" #include "opt_machdep.h" @@ -101,9 +101,7 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_machde BootConfig bootconfig; char bootargs[TEGRA_MAX_BOOT_STRING] = ""; char *boot_args = NULL; -#ifdef TEGRA_UBOOT u_int uboot_args[4] = { 0 }; /* filled in by tegra_start.S (not in bss) */ -#endif #include #include @@ -247,10 +245,8 @@ initarm(void *arg) DPRINTF(" ok\n"); -#ifdef TEGRA_UBOOT DPRINTF("uboot: args %#x, %#x, %#x, %#x\n", uboot_args[0], uboot_args[1], uboot_args[2], uboot_args[3]); -#endif cpu_reset_address = tegra_reset; cpu_powerdown_address = tegra_powerdown; Index: src/sys/arch/evbarm/tegra/tegra_start.S diff -u src/sys/arch/evbarm/tegra/tegra_start.S:1.8 src/sys/arch/evbarm/tegra/tegra_start.S:1.9 --- src/sys/arch/evbarm/tegra/tegra_start.S:1.8 Sun Dec 13 17:39:19 2015 +++ src/sys/arch/evbarm/tegra/tegra_start.S Sun Dec 13 22:55:05 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_start.S,v 1.8 2015/12/13 17:39:19 jmcneill Exp $ */ +/* $NetBSD: tegra_start.S,v 1.9 2015/12/13 22:55:05 jmcneill Exp $ */ /*- * Copyright (c) 2014, 2015 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ #include #include -RCSID("$NetBSD: tegra_start.S,v 1.8 2015/12/13 17:39:19 jmcneill Exp $") +RCSID("$NetBSD: tegra_start.S,v 1.9 2015/12/13 22:55:05 jmcneill Exp $") #if defined(VERBOSE_INIT_ARM) #define XPUTC(n) mov r0, n; bl xputc @@ -92,7 +92,6 @@ _C_LABEL(tegra_start): /* Move into supervisor mode and disable IRQs/FIQs. */ cpsid if, #PSR_SVC32_MODE -#ifdef TEGRA_UBOOT /* * Save any arguments passed to us. */ @@ -101,7 +100,6 @@ _C_LABEL(tegra_start): sub r4, r4, #KERNEL_BASE_VOFFSET stmia r4, {r0-r3} // Save the arguments -#endif /* * Turn on the SMP bit
CVS commit: src/sys/dev/sysmon
Module Name:src Committed By: pgoyette Date: Mon Dec 14 01:08:47 UTC 2015 Modified Files: src/sys/dev/sysmon: sysmon_envsys.c sysmon_power.c sysmon_wdog.c Log Message: sysmon's components need to be MODULE_CLASS_DRIVER so they will get initialized before we configure/initialize any devices that interact with them. Thanks, marty! To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/dev/sysmon/sysmon_envsys.c cvs rdiff -u -r1.56 -r1.57 src/sys/dev/sysmon/sysmon_power.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sysmon/sysmon_wdog.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/sysmon/sysmon_envsys.c diff -u src/sys/dev/sysmon/sysmon_envsys.c:1.138 src/sys/dev/sysmon/sysmon_envsys.c:1.139 --- src/sys/dev/sysmon/sysmon_envsys.c:1.138 Sun Dec 13 17:41:48 2015 +++ src/sys/dev/sysmon/sysmon_envsys.c Mon Dec 14 01:08:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_envsys.c,v 1.138 2015/12/13 17:41:48 jdc Exp $ */ +/* $NetBSD: sysmon_envsys.c,v 1.139 2015/12/14 01:08:47 pgoyette Exp $ */ /*- * Copyright (c) 2007, 2008 Juan Romero Pardines. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.138 2015/12/13 17:41:48 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.139 2015/12/14 01:08:47 pgoyette Exp $"); #include #include @@ -103,7 +103,7 @@ static void sme_initial_refresh(void *); static uint32_t sme_get_max_value(struct sysmon_envsys *, bool (*)(const envsys_data_t*), bool); -MODULE(MODULE_CLASS_MISC, sysmon_envsys, "sysmon,sysmon_taskq,sysmon_power"); +MODULE(MODULE_CLASS_DRIVER, sysmon_envsys, "sysmon,sysmon_taskq,sysmon_power"); static struct sysmon_opvec sysmon_envsys_opvec = { sysmonopen_envsys, sysmonclose_envsys, sysmonioctl_envsys, Index: src/sys/dev/sysmon/sysmon_power.c diff -u src/sys/dev/sysmon/sysmon_power.c:1.56 src/sys/dev/sysmon/sysmon_power.c:1.57 --- src/sys/dev/sysmon/sysmon_power.c:1.56 Mon Aug 24 22:50:33 2015 +++ src/sys/dev/sysmon/sysmon_power.c Mon Dec 14 01:08:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_power.c,v 1.56 2015/08/24 22:50:33 pooka Exp $ */ +/* $NetBSD: sysmon_power.c,v 1.57 2015/12/14 01:08:47 pgoyette Exp $ */ /*- * Copyright (c) 2007 Juan Romero Pardines. @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.56 2015/08/24 22:50:33 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.57 2015/12/14 01:08:47 pgoyette Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -93,7 +93,7 @@ __KERNEL_RCSID(0, "$NetBSD: sysmon_power #include #include -MODULE(MODULE_CLASS_MISC, sysmon_power, "sysmon"); +MODULE(MODULE_CLASS_DRIVER, sysmon_power, "sysmon"); /* * Singly linked list for dictionaries to be stored/sent. Index: src/sys/dev/sysmon/sysmon_wdog.c diff -u src/sys/dev/sysmon/sysmon_wdog.c:1.28 src/sys/dev/sysmon/sysmon_wdog.c:1.29 --- src/sys/dev/sysmon/sysmon_wdog.c:1.28 Fri Jun 5 00:53:47 2015 +++ src/sys/dev/sysmon/sysmon_wdog.c Mon Dec 14 01:08:47 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_wdog.c,v 1.28 2015/06/05 00:53:47 matt Exp $ */ +/* $NetBSD: sysmon_wdog.c,v 1.29 2015/12/14 01:08:47 pgoyette Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.28 2015/06/05 00:53:47 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.29 2015/12/14 01:08:47 pgoyette Exp $"); #include #include @@ -81,7 +81,7 @@ static struct sysmon_opvec sysmon_wdog_o NULL, NULL, NULL }; -MODULE(MODULE_CLASS_MISC, sysmon_wdog, "sysmon"); +MODULE(MODULE_CLASS_DRIVER, sysmon_wdog, "sysmon"); ONCE_DECL(once_wdog);
CVS commit: src/lib/libc/net
Module Name:src Committed By: ozaki-r Date: Mon Dec 14 03:49:54 UTC 2015 Modified Files: src/lib/libc/net: inet6_scopeid.c Log Message: KNF To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/net/inet6_scopeid.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/net/inet6_scopeid.c diff -u src/lib/libc/net/inet6_scopeid.c:1.2 src/lib/libc/net/inet6_scopeid.c:1.3 --- src/lib/libc/net/inet6_scopeid.c:1.2 Sat Oct 19 15:47:02 2013 +++ src/lib/libc/net/inet6_scopeid.c Mon Dec 14 03:49:54 2015 @@ -34,7 +34,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: inet6_scopeid.c,v 1.2 2013/10/19 15:47:02 christos Exp $"); +__RCSID("$NetBSD: inet6_scopeid.c,v 1.3 2015/12/14 03:49:54 ozaki-r Exp $"); #include #include @@ -71,7 +71,7 @@ inet6_putscopeid(struct sockaddr_in6 *si (flags & INET6_IS_ADDR_MC_LINKLOCAL)) || (IN6_IS_ADDR_SITELOCAL(>sin6_addr) && (flags & INET6_IS_ADDR_SITELOCAL))) { - uint16_t scope = htons(sin6->sin6_scope_id); + uint16_t scope = htons(sin6->sin6_scope_id); memcpy(>sin6_addr.s6_addr[2], , sizeof(scope)); sin6->sin6_scope_id = 0; }
CVS commit: src/sys/arch/evbarm/exynos
Module Name:src Committed By: marty Date: Mon Dec 14 05:13:01 UTC 2015 Modified Files: src/sys/arch/evbarm/exynos: exynos_start.S Log Message: FDT XU4 fix uboot support remove some code I thought I'd previously removed which causes data aborts if uboot is invoked with 'bootm ADDR - ADDR'. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/exynos/exynos_start.S 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/evbarm/exynos/exynos_start.S diff -u src/sys/arch/evbarm/exynos/exynos_start.S:1.1 src/sys/arch/evbarm/exynos/exynos_start.S:1.2 --- src/sys/arch/evbarm/exynos/exynos_start.S:1.1 Sun Dec 6 00:33:44 2015 +++ src/sys/arch/evbarm/exynos/exynos_start.S Mon Dec 14 05:13:01 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_start.S,v 1.1 2015/12/06 00:33:44 marty Exp $ */ +/* $NetBSD: exynos_start.S,v 1.2 2015/12/14 05:13:01 marty Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ #include -RCSID("$NetBSD: exynos_start.S,v 1.1 2015/12/06 00:33:44 marty Exp $") +RCSID("$NetBSD: exynos_start.S,v 1.2 2015/12/14 05:13:01 marty Exp $") #if defined(VERBOSE_INIT_ARM) @@ -118,22 +118,6 @@ _C_LABEL(exynos_start): #endif stmia r4, {r0-r3} // Save the arguments - movw r4, #:lower16:bootargs - movt r4, #:upper16:bootargs -#if KERNEL_BASE_VOFFSET != 0 - sub r4, r4, #KERNEL_BASE_VOFFSET -#endif - - cmp r3, #0 - beq 1f -2: - ldrb r0, [r3], #1 - strb r0, [r4], #1 - teq r0, #0 - bne 2b - -1: - /* * For easy and early SoC / PoP dependency, retrieve the IDs */
CVS commit: src/usr.sbin/ndp
Module Name:src Committed By: ozaki-r Date: Mon Dec 14 06:17:05 UTC 2015 Modified Files: src/usr.sbin/ndp: Makefile Log Message: Add getaddrinfo.c to RUMPSRCS for link-local addresses To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/ndp/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/ndp/Makefile diff -u src/usr.sbin/ndp/Makefile:1.11 src/usr.sbin/ndp/Makefile:1.12 --- src/usr.sbin/ndp/Makefile:1.11 Tue Sep 1 09:54:34 2015 +++ src/usr.sbin/ndp/Makefile Mon Dec 14 06:17:05 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.11 2015/09/01 09:54:34 ozaki-r Exp $ +# $NetBSD: Makefile,v 1.12 2015/12/14 06:17:05 ozaki-r Exp $ .include @@ -15,7 +15,8 @@ CPPFLAGS+= -DINET6 CPPFLAGS+= -I. -I${TCPDUMP} .PATH: ${.CURDIR}/../../lib/libc/net -RUMPSRCS= getifaddrs.c getnameinfo.c if_indextoname.c if_nametoindex.c +RUMPSRCS= getaddrinfo.c getifaddrs.c getnameinfo.c +RUMPSRCS+= if_indextoname.c if_nametoindex.c .if (${MKRUMP} != "no") CPPFLAGS+= -DRUMP_ACTION .endif