CVS commit: src/distrib/sets/lists/modules
Module Name:src Committed By: pooka Date: Mon Feb 7 09:09:48 UTC 2011 Modified Files: src/distrib/sets/lists/modules: md.i386 Log Message: not here yet either (mirror amd64 commit) To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/modules/md.i386 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/modules/md.i386 diff -u src/distrib/sets/lists/modules/md.i386:1.14 src/distrib/sets/lists/modules/md.i386:1.15 --- src/distrib/sets/lists/modules/md.i386:1.14 Sat Feb 5 14:08:13 2011 +++ src/distrib/sets/lists/modules/md.i386 Mon Feb 7 09:09:47 2011 @@ -1,4 +1,4 @@ -# $NetBSD: md.i386,v 1.14 2011/02/05 14:08:13 yamt Exp $ +# $NetBSD: md.i386,v 1.15 2011/02/07 09:09:47 pooka Exp $ ./@MODULEDIR@/acpiacadbase-kernel-modules kmod ./@MODULEDIR@/acpiacad/acpiacad.kmod base-kernel-modules kmod ./@MODULEDIR@/acpibatbase-kernel-modules kmod @@ -59,8 +59,8 @@ ./@MODULEDIR@/pad/pad.kmod base-kernel-modules kmod ./@MODULEDIR@/thinkpadbase-kernel-modules kmod ./@MODULEDIR@/thinkpad/thinkpad.kmod base-kernel-modules kmod -./@MODULEDIR@/tprof_amdpmi base-kernel-modules kmod -./@MODULEDIR@/tprof_amdpmi/tprof_amdpmi.kmod base-kernel-modules kmod +#./@MODULEDIR@/tprof_amdpmi base-kernel-modules kmod +#./@MODULEDIR@/tprof_amdpmi/tprof_amdpmi.kmod base-kernel-modules kmod ./@MODULEDIR@/tprof_pmibase-kernel-modules kmod ./@MODULEDIR@/tprof_pmi/tprof_pmi.kmod base-kernel-modules kmod ./@MODULEDIR@/viadrmbase-kernel-modules kmod
CVS commit: src/sys/arch/powerpc/powerpc
Module Name:src Committed By: matt Date: Mon Feb 7 09:39:49 UTC 2011 Modified Files: src/sys/arch/powerpc/powerpc: sig_machdep.c Log Message: PR port-macppc/43619 Save handler before calling sendsig_reset before it will reset to SIG_DFL is SA_RESETHAND is set. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/powerpc/powerpc/sig_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/powerpc/powerpc/sig_machdep.c diff -u src/sys/arch/powerpc/powerpc/sig_machdep.c:1.38 src/sys/arch/powerpc/powerpc/sig_machdep.c:1.39 --- src/sys/arch/powerpc/powerpc/sig_machdep.c:1.38 Tue Jan 18 01:02:55 2011 +++ src/sys/arch/powerpc/powerpc/sig_machdep.c Mon Feb 7 09:39:48 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: sig_machdep.c,v 1.38 2011/01/18 01:02:55 matt Exp $ */ +/* $NetBSD: sig_machdep.c,v 1.39 2011/02/07 09:39:48 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sig_machdep.c,v 1.38 2011/01/18 01:02:55 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: sig_machdep.c,v 1.39 2011/02/07 09:39:48 matt Exp $); #include opt_ppcarch.h #include opt_altivec.h @@ -58,10 +58,12 @@ { struct lwp * const l = curlwp; struct proc * const p = l-l_proc; - struct trapframe * const tf = trapframe(l); - struct sigaltstack *ss = l-l_sigstk; - const struct sigact_sigdesc *sd = + struct trapframe * const tf = l-l_md.md_utf; + struct sigaltstack * const ss = l-l_sigstk; + const struct sigact_sigdesc * const sd = p-p_sigacts-sa_sigdesc[ksi-ksi_signo]; + /* save handler before sendsig_reset trashes it! */ + const void * const handler = sd-sd_sigact.sa_handler; ucontext_t uc; vaddr_t sp, sip, ucp; int onstack, error; @@ -122,7 +124,7 @@ /* Preserve ucp across call to signal function */ tf-tf_fixreg[30] = (register_t)ucp; tf-tf_lr = (register_t)sd-sd_tramp; - tf-tf_srr0 = (register_t)sd-sd_sigact.sa_handler; + tf-tf_srr0 = (register_t)handler; break; default:
CVS commit: src/tests/kernel
Module Name:src Committed By: matt Date: Mon Feb 7 09:40:52 UTC 2011 Modified Files: src/tests/kernel: t_sigaction.c Log Message: This is no longer broken for macppc. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/kernel/t_sigaction.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/kernel/t_sigaction.c diff -u src/tests/kernel/t_sigaction.c:1.1 src/tests/kernel/t_sigaction.c:1.2 --- src/tests/kernel/t_sigaction.c:1.1 Wed Jul 14 21:47:06 2010 +++ src/tests/kernel/t_sigaction.c Mon Feb 7 09:40:52 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: t_sigaction.c,v 1.1 2010/07/14 21:47:06 jmmv Exp $ */ +/* $NetBSD: t_sigaction.c,v 1.2 2011/02/07 09:40:52 matt Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include sys/cdefs.h __COPYRIGHT(@(#) Copyright (c) 2010\ The NetBSD Foundation, inc. All rights reserved.); -__RCSID($NetBSD: t_sigaction.c,v 1.1 2010/07/14 21:47:06 jmmv Exp $); +__RCSID($NetBSD: t_sigaction.c,v 1.2 2011/02/07 09:40:52 matt Exp $); #include sys/wait.h @@ -110,9 +110,6 @@ else if (pid == 0) sa_resethand_child(SA_RESETHAND); else { - if (strcmp(macppc, atf_config_get(atf_arch)) == 0) - atf_tc_expect_fail(PR port-macppc/43619); - wait_and_check_child(pid, Child process did not exit cleanly; it either failed to process the signal or SA_RESETHAND is broken);
CVS commit: src/lib/librumphijack
Module Name:src Committed By: pooka Date: Mon Feb 7 10:28:18 UTC 2011 Modified Files: src/lib/librumphijack: hijack.c Log Message: call the non-compat pollts() from inside the library To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/lib/librumphijack/hijack.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/librumphijack/hijack.c diff -u src/lib/librumphijack/hijack.c:1.28 src/lib/librumphijack/hijack.c:1.29 --- src/lib/librumphijack/hijack.c:1.28 Sun Feb 6 15:48:20 2011 +++ src/lib/librumphijack/hijack.c Mon Feb 7 10:28:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hijack.c,v 1.28 2011/02/06 15:48:20 pooka Exp $ */ +/* $NetBSD: hijack.c,v 1.29 2011/02/07 10:28:18 pooka Exp $ */ /*- * Copyright (c) 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: hijack.c,v 1.28 2011/02/06 15:48:20 pooka Exp $); +__RCSID($NetBSD: hijack.c,v 1.29 2011/02/07 10:28:18 pooka Exp $); #define __ssp_weak_name(fun) _hijack_ ## fun @@ -79,15 +79,15 @@ * Also, this does not work for compat-using binaries! */ #if !__NetBSD_Prereq__(5,99,7) -#define LIBCSELECT select -#define LIBCPOLLTS pollts +#define REALSELECT select +#define REALPOLLTS pollts #else -#define LIBCSELECT _sys___select50 -#define LIBCPOLLTS _sys___pollts50 +#define REALSELECT _sys___select50 +#define REALPOLLTS _sys___pollts50 #endif -int LIBCSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *); -int LIBCPOLLTS(struct pollfd *, nfds_t, +int REALSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *); +int REALPOLLTS(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); #define S(a) __STRING(a) @@ -118,7 +118,7 @@ { DUALCALL_FCNTL, fcntl, RSYS_NAME(FCNTL) }, { DUALCALL_DUP2, dup2, RSYS_NAME(DUP2) }, { DUALCALL_CLOSE, close, RSYS_NAME(CLOSE) }, - { DUALCALL_POLLTS, S(LIBCPOLLTS), RSYS_NAME(POLLTS) }, + { DUALCALL_POLLTS, S(REALPOLLTS), RSYS_NAME(POLLTS) }, }; #undef S @@ -481,7 +481,7 @@ * select is done by calling poll. */ int -LIBCSELECT(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, +REALSELECT(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { struct pollfd *pfds; @@ -549,7 +549,7 @@ TIMEVAL_TO_TIMESPEC(timeout, ts); tsp = ts; } - rv = pollts(pfds, realnfds, tsp, NULL); + rv = REALPOLLTS(pfds, realnfds, tsp, NULL); if (rv = 0) goto out; @@ -647,7 +647,7 @@ } int -LIBCPOLLTS(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, +REALPOLLTS(struct pollfd *fds, nfds_t nfds, const struct timespec *ts, const sigset_t *sigmask) { int (*op_pollts)(struct pollfd *, nfds_t, const struct timespec *, @@ -798,7 +798,7 @@ tsp = ts; } - return pollts(fds, nfds, tsp, NULL); + return REALPOLLTS(fds, nfds, tsp, NULL); } int
CVS commit: src/lib/librumphijack
Module Name:src Committed By: pooka Date: Mon Feb 7 11:51:02 UTC 2011 Modified Files: src/lib/librumphijack: hijack.c Log Message: Unbreak the ssp lossage from the default -current build by removing it. I still don't have any idea what the ssp stuff is supposed to do and how it's supposed to even begin to work. If someone wants to change this now, run tests/lib/librumphijack before commit so that I can avoid another multihour debugging session! To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/lib/librumphijack/hijack.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/librumphijack/hijack.c diff -u src/lib/librumphijack/hijack.c:1.29 src/lib/librumphijack/hijack.c:1.30 --- src/lib/librumphijack/hijack.c:1.29 Mon Feb 7 10:28:18 2011 +++ src/lib/librumphijack/hijack.c Mon Feb 7 11:51:02 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hijack.c,v 1.29 2011/02/07 10:28:18 pooka Exp $ */ +/* $NetBSD: hijack.c,v 1.30 2011/02/07 11:51:02 pooka Exp $ */ /*- * Copyright (c) 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: hijack.c,v 1.29 2011/02/07 10:28:18 pooka Exp $); +__RCSID($NetBSD: hijack.c,v 1.30 2011/02/07 11:51:02 pooka Exp $); #define __ssp_weak_name(fun) _hijack_ ## fun @@ -912,7 +912,7 @@ #define STUB(fun) fun #endif -FDCALL(ssize_t, STUB(read), DUALCALL_READ,\ +FDCALL(ssize_t, read, DUALCALL_READ, \ (int fd, void *buf, size_t buflen),\ (int, void *, size_t), \ (fd, buf, buflen))
CVS commit: src/sys/arch
Module Name:src Committed By: skrll Date: Mon Feb 7 12:19:35 UTC 2011 Modified Files: src/sys/arch/hp700/hp700: locore.S src/sys/arch/hp700/include: cpu.h src/sys/arch/hppa/hppa: vm_machdep.c Log Message: Fix PR/44500 for hppa. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/arch/hp700/hp700/locore.S cvs rdiff -u -r1.65 -r1.66 src/sys/arch/hp700/include/cpu.h cvs rdiff -u -r1.46 -r1.47 src/sys/arch/hppa/hppa/vm_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/hp700/hp700/locore.S diff -u src/sys/arch/hp700/hp700/locore.S:1.54 src/sys/arch/hp700/hp700/locore.S:1.55 --- src/sys/arch/hp700/hp700/locore.S:1.54 Tue Feb 1 18:33:25 2011 +++ src/sys/arch/hp700/hp700/locore.S Mon Feb 7 12:19:35 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.54 2011/02/01 18:33:25 skrll Exp $ */ +/* $NetBSD: locore.S,v 1.55 2011/02/07 12:19:35 skrll Exp $ */ /* $OpenBSD: locore.S,v 1.158 2008/07/28 19:08:46 miod Exp $ */ /* @@ -1101,7 +1101,6 @@ .import lwp_startup, code CALL(lwp_startup, %r1) -ALTENTRY(setfunc_trampoline) /* get trampoline func (%t3) and arg (%arg0) */ ldw HPPA_FRAME_ARG(3)(%sp), %arg0 ldw HPPA_FRAME_ARG(2)(%sp), %t3 Index: src/sys/arch/hp700/include/cpu.h diff -u src/sys/arch/hp700/include/cpu.h:1.65 src/sys/arch/hp700/include/cpu.h:1.66 --- src/sys/arch/hp700/include/cpu.h:1.65 Mon Jan 31 18:21:33 2011 +++ src/sys/arch/hp700/include/cpu.h Mon Feb 7 12:19:35 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.65 2011/01/31 18:21:33 skrll Exp $ */ +/* $NetBSD: cpu.h,v 1.66 2011/02/07 12:19:35 skrll Exp $ */ /* $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $ */ @@ -379,7 +379,6 @@ size_t *); int copy_on_fault(void); void lwp_trampoline(void); -void setfunc_trampoline(void); int cpu_dumpsize(void); int cpu_dump(void); Index: src/sys/arch/hppa/hppa/vm_machdep.c diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.46 src/sys/arch/hppa/hppa/vm_machdep.c:1.47 --- src/sys/arch/hppa/hppa/vm_machdep.c:1.46 Sun Jan 23 09:44:59 2011 +++ src/sys/arch/hppa/hppa/vm_machdep.c Mon Feb 7 12:19:35 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.46 2011/01/23 09:44:59 skrll Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.47 2011/02/07 12:19:35 skrll Exp $ */ /* $OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $ */ @@ -29,7 +29,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.46 2011/01/23 09:44:59 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.47 2011/02/07 12:19:35 skrll Exp $); #include sys/param.h #include sys/systm.h @@ -205,7 +205,7 @@ *(register_t *)(sp) = 0; /* previous frame pointer */ *(register_t *)(sp + HPPA_FRAME_PSP) = osp; - *(register_t *)(sp + HPPA_FRAME_CRP) = (register_t)setfunc_trampoline; + *(register_t *)(sp + HPPA_FRAME_CRP) = (register_t)lwp_trampoline; *HPPA_FRAME_CARG(2, sp) = KERNMODE(func); *HPPA_FRAME_CARG(3, sp) = (register_t)arg;
CVS commit: src/lib/librumphijack
Module Name:src Committed By: pooka Date: Mon Feb 7 12:23:05 UTC 2011 Modified Files: src/lib/librumphijack: hijack.c Log Message: duh, _sys_read, not read. STAY FIXED, DAMNIT! To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/lib/librumphijack/hijack.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/librumphijack/hijack.c diff -u src/lib/librumphijack/hijack.c:1.30 src/lib/librumphijack/hijack.c:1.31 --- src/lib/librumphijack/hijack.c:1.30 Mon Feb 7 11:51:02 2011 +++ src/lib/librumphijack/hijack.c Mon Feb 7 12:23:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hijack.c,v 1.30 2011/02/07 11:51:02 pooka Exp $ */ +/* $NetBSD: hijack.c,v 1.31 2011/02/07 12:23:05 pooka Exp $ */ /*- * Copyright (c) 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: hijack.c,v 1.30 2011/02/07 11:51:02 pooka Exp $); +__RCSID($NetBSD: hijack.c,v 1.31 2011/02/07 12:23:05 pooka Exp $); #define __ssp_weak_name(fun) _hijack_ ## fun @@ -85,10 +85,12 @@ #define REALSELECT _sys___select50 #define REALPOLLTS _sys___pollts50 #endif +#define REALREAD _sys_read int REALSELECT(int, fd_set *, fd_set *, fd_set *, struct timeval *); int REALPOLLTS(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *); +ssize_t REALREAD(int, void *, size_t); #define S(a) __STRING(a) struct sysnames { @@ -110,7 +112,7 @@ { DUALCALL_GETSOCKOPT, getsockopt, RSYS_NAME(GETSOCKOPT) }, { DUALCALL_SETSOCKOPT, setsockopt, RSYS_NAME(SETSOCKOPT) }, { DUALCALL_SHUTDOWN, shutdown, RSYS_NAME(SHUTDOWN) }, - { DUALCALL_READ, read, RSYS_NAME(READ) }, + { DUALCALL_READ, S(REALREAD), RSYS_NAME(READ) }, { DUALCALL_READV, readv, RSYS_NAME(READV) }, { DUALCALL_WRITE, write, RSYS_NAME(WRITE) }, { DUALCALL_WRITEV, writev, RSYS_NAME(WRITEV) }, @@ -912,7 +914,7 @@ #define STUB(fun) fun #endif -FDCALL(ssize_t, read, DUALCALL_READ, \ +FDCALL(ssize_t, REALREAD, DUALCALL_READ,\ (int fd, void *buf, size_t buflen),\ (int, void *, size_t), \ (fd, buf, buflen))
CVS commit: src/sys/arch/sandpoint/stand/altboot
Module Name:src Committed By: nisimura Date: Mon Feb 7 12:45:21 UTC 2011 Modified Files: src/sys/arch/sandpoint/stand/altboot: brdsetup.c Log Message: add IOMEGA StorCenter fixup codes. Need more change as the satellite microcontroller protocol is defined in 8-byte fixed length sequence. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sandpoint/stand/altboot/brdsetup.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/sandpoint/stand/altboot/brdsetup.c diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.1 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.2 --- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.1 Sun Jan 23 01:05:30 2011 +++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c Mon Feb 7 12:45:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: brdsetup.c,v 1.1 2011/01/23 01:05:30 nisimura Exp $ */ +/* $NetBSD: brdsetup.c,v 1.2 2011/02/07 12:45:21 nisimura Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -52,6 +52,7 @@ BRD_DECL(kuro); BRD_DECL(syno); BRD_DECL(qnap); +BRD_DECL(iomega); static struct brdprop brdlist[] = { { @@ -92,11 +93,11 @@ NULL, NULL, qnappcifix }, { iomega, - IOMEGA Storcenter, + IOMEGA StorCenter, BRD_STORCENTER, 0, eumb, 0x4500, 115200, - NULL, NULL, NULL }, + NULL, iomegabrdfix, iomegapcifix }, { unknown, Unknown board, @@ -693,6 +694,14 @@ } void +synoreset() +{ + + send_sat(C); + /*NOTRECHED*/ +} + +void qnappcifix(struct brdprop *brd) { unsigned ide, nic, usb, val; @@ -724,11 +733,41 @@ } void -synoreset() +iomegabrdfix(struct brdprop *brd) { - send_sat(C); - /*NOTRECHED*/ + init_uart(uart2base, 9600, LCR_8BITS | LCR_PNONE); +} + +void +iomegapcifix(struct brdprop *brd) +{ + unsigned ide, nic, usb, val; + + ide = pcimaketag(0, 13, 0); + val = pcicfgread(ide, 0x3c) 0xff00; + val |= 13; + pcicfgwrite(ide, 0x3c, val); + + usb = pcimaketag(0, 14, 0); + val = pcicfgread(usb, 0x3c) 0xff00; + val |= 14; + pcicfgwrite(usb, 0x3c, val); + + usb = pcimaketag(0, 14, 1); + val = pcicfgread(usb, 0x3c) 0xff00; + val |= 14; + pcicfgwrite(usb, 0x3c, val); + + usb = pcimaketag(0, 14, 2); + val = pcicfgread(usb, 0x3c) 0xff00; + val |= 14; + pcicfgwrite(usb, 0x3c, val); + + nic = pcimaketag(0, 15, 0); + val = pcicfgread(nic, 0x3c) 0xff00; + val |= 15; + pcicfgwrite(nic, 0x3c, val); } void
CVS commit: src/sys/arch/sandpoint/conf
Module Name:src Committed By: nisimura Date: Mon Feb 7 12:51:18 UTC 2011 Modified Files: src/sys/arch/sandpoint/conf: GENERIC Log Message: add Dallas I2C RTC driver for StorCenter, leaving it commented out for now. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/arch/sandpoint/conf/GENERIC 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/sandpoint/conf/GENERIC diff -u src/sys/arch/sandpoint/conf/GENERIC:1.52 src/sys/arch/sandpoint/conf/GENERIC:1.53 --- src/sys/arch/sandpoint/conf/GENERIC:1.52 Sat Jan 15 23:06:07 2011 +++ src/sys/arch/sandpoint/conf/GENERIC Mon Feb 7 12:51:18 2011 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.52 2011/01/15 23:06:07 phx Exp $ +# $NetBSD: GENERIC,v 1.53 2011/02/07 12:51:18 nisimura Exp $ # # machine description file for GENERIC NAS # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident GENERIC-$Revision: 1.52 $ +#ident GENERIC-$Revision: 1.53 $ maxusers 32 @@ -166,6 +166,7 @@ ociic* at eumb? iic* at ociic? rs5c372rtc* at iic? addr 0x32 +#dsrtc* at iic? addr 0x68 # PCI IDE controllers - see pciide(4) for supported hardware. cmdide* at pci? dev ? function ? # CMD tech IDE controllers
CVS commit: src/sys/arch/sandpoint/pci
Module Name:src Committed By: nisimura Date: Mon Feb 7 13:35:21 UTC 2011 Modified Files: src/sys/arch/sandpoint/pci: pci_machdep.c Log Message: add StorCenter heuristic by PCI vendor ID detection. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/sandpoint/pci/pci_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/sandpoint/pci/pci_machdep.c diff -u src/sys/arch/sandpoint/pci/pci_machdep.c:1.20 src/sys/arch/sandpoint/pci/pci_machdep.c:1.21 --- src/sys/arch/sandpoint/pci/pci_machdep.c:1.20 Mon Dec 20 00:25:42 2010 +++ src/sys/arch/sandpoint/pci/pci_machdep.c Mon Feb 7 13:35:21 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.20 2010/12/20 00:25:42 matt Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.21 2011/02/07 13:35:21 nisimura Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -43,7 +43,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.20 2010/12/20 00:25:42 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: pci_machdep.c,v 1.21 2011/02/07 13:35:21 nisimura Exp $); #include opt_pci.h @@ -94,6 +94,7 @@ #define BRD_KUROBOX 100 #define BRD_QNAPTS101 101 #define BRD_SYNOLOGY 102 +#define BRD_STORCENTER 103 #define BRD_UNKNOWN -1 #define PCI_CONFIG_ENABLE 0x8000UL @@ -103,7 +104,7 @@ struct pcibus_attach_args *pba) { pcitag_t tag; - pcireg_t dev11, dev22, dev15; + pcireg_t dev11, dev22, dev15, dev13; tag = pci_make_tag(pba-pba_pc, pba-pba_bus, 11, 0); dev11 = pci_conf_read(pba-pba_pc, tag, PCI_CLASS_REG); @@ -142,6 +143,14 @@ brdtype = BRD_SYNOLOGY; return; } + tag = pci_make_tag(pba-pba_pc, pba-pba_bus, 13, 0); + dev13 = pci_conf_read(pba-pba_pc, tag, PCI_ID_REG); + if (PCI_VENDOR(dev13) == PCI_VENDOR_VIATECH) { + /* VIA 6410 PCIIDE at dev 13 */ + brdtype = BRD_STORCENTER; + return; + } + brdtype = BRD_UNKNOWN; } @@ -327,6 +336,7 @@ /* map line 12,13-15 to EPIC IRQ4,0-2 */ *ihp = (line == 12) ? 4 : line - 13; break; + case BRD_STORCENTER: default: /* map line 12-15 to EPIC IRQ0-3 */ *ihp = line - 12;
CVS commit: src/lib/librumpclient
Module Name:src Committed By: pooka Date: Mon Feb 7 14:49:32 UTC 2011 Modified Files: src/lib/librumpclient: rumpclient.h Log Message: types.h for time_t To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/librumpclient/rumpclient.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librumpclient/rumpclient.h diff -u src/lib/librumpclient/rumpclient.h:1.4 src/lib/librumpclient/rumpclient.h:1.5 --- src/lib/librumpclient/rumpclient.h:1.4 Sun Feb 6 15:43:20 2011 +++ src/lib/librumpclient/rumpclient.h Mon Feb 7 14:49:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpclient.h,v 1.4 2011/02/06 15:43:20 pooka Exp $ */ +/* $NetBSD: rumpclient.h,v 1.5 2011/02/07 14:49:32 pooka Exp $ */ /*- * Copyright (c) 2010 Antti Kantee. All Rights Reserved. @@ -28,6 +28,8 @@ #ifndef _RUMP_RUMPCLIENT_H_ #define _RUMP_RUMPCLIENT_H_ +#include sys/types.h + __BEGIN_DECLS int rumpclient_syscall(int, const void *, size_t, register_t *);
CVS commit: src/lib/librumpclient
Module Name:src Committed By: pooka Date: Mon Feb 7 14:49:53 UTC 2011 Modified Files: src/lib/librumpclient: rumpclient.c Log Message: make sure we don't use fullset before we init it To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/lib/librumpclient/rumpclient.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/librumpclient/rumpclient.c diff -u src/lib/librumpclient/rumpclient.c:1.24 src/lib/librumpclient/rumpclient.c:1.25 --- src/lib/librumpclient/rumpclient.c:1.24 Sun Feb 6 15:43:20 2011 +++ src/lib/librumpclient/rumpclient.c Mon Feb 7 14:49:53 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpclient.c,v 1.24 2011/02/06 15:43:20 pooka Exp $ */ +/* $NetBSD: rumpclient.c,v 1.25 2011/02/07 14:49:53 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -689,6 +689,8 @@ char *p; int error; + sigfillset(fullset); + /* dlsym overrided by rumphijack? */ if (!rumpclient_dlsym) rumpclient_dlsym = dlsym; @@ -744,7 +746,6 @@ return -1; } - sigfillset(fullset); return 0; }
CVS commit: src/lib/librumpclient
Module Name:src Committed By: pooka Date: Mon Feb 7 15:25:41 UTC 2011 Modified Files: src/lib/librumpclient: rumpclient.c Log Message: malloc/free aren't async-signal-safe, so avoid calling them when signals aren't blocked. this bug made tests/rump/rumpkern/t_sp:sigsafe rarely deadlock To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/lib/librumpclient/rumpclient.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/librumpclient/rumpclient.c diff -u src/lib/librumpclient/rumpclient.c:1.25 src/lib/librumpclient/rumpclient.c:1.26 --- src/lib/librumpclient/rumpclient.c:1.25 Mon Feb 7 14:49:53 2011 +++ src/lib/librumpclient/rumpclient.c Mon Feb 7 15:25:41 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpclient.c,v 1.25 2011/02/07 14:49:53 pooka Exp $ */ +/* $NetBSD: rumpclient.c,v 1.26 2011/02/07 15:25:41 pooka Exp $ */ /* * Copyright (c) 2010, 2011 Antti Kantee. All Rights Reserved. @@ -267,12 +267,11 @@ } static int -syscall_req(struct spclient *spc, int sysnum, +syscall_req(struct spclient *spc, sigset_t *omask, int sysnum, const void *data, size_t dlen, void **resp) { struct rsp_hdr rhdr; struct respwait rw; - sigset_t omask; int rv; rhdr.rsp_len = sizeof(rhdr) + dlen; @@ -280,7 +279,6 @@ rhdr.rsp_type = RUMPSP_SYSCALL; rhdr.rsp_sysnum = sysnum; - pthread_sigmask(SIG_SETMASK, fullset, omask); do { putwait(spc, rw, rhdr); if ((rv = send_with_recon(spc, rhdr, sizeof(rhdr))) != 0) { @@ -292,11 +290,10 @@ continue; } - rv = cliwaitresp(spc, rw, omask, false); + rv = cliwaitresp(spc, rw, omask, false); if (rv == ENOTCONN) rv = EAGAIN; } while (rv == EAGAIN); - pthread_sigmask(SIG_SETMASK, omask, NULL); *resp = rw.rw_data; return rv; @@ -346,28 +343,27 @@ else unputwait(spc, rw); if (cancel) { - pthread_sigmask(SIG_SETMASK, omask, NULL); - return rv; + goto out; } } else { rv = cliwaitresp(spc, rw, omask, haslock); } - pthread_sigmask(SIG_SETMASK, omask, NULL); if (rv) - return rv; + goto out; rv = *(int *)rw.rw_data; free(rw.rw_data); + out: + pthread_sigmask(SIG_SETMASK, omask, NULL); return rv; } static int -prefork_req(struct spclient *spc, void **resp) +prefork_req(struct spclient *spc, sigset_t *omask, void **resp) { struct rsp_hdr rhdr; struct respwait rw; - sigset_t omask; int rv; rhdr.rsp_len = sizeof(rhdr); @@ -375,7 +371,6 @@ rhdr.rsp_type = RUMPSP_PREFORK; rhdr.rsp_error = 0; - pthread_sigmask(SIG_SETMASK, fullset, omask); do { putwait(spc, rw, rhdr); rv = send_with_recon(spc, rhdr, sizeof(rhdr)); @@ -384,11 +379,10 @@ continue; } - rv = cliwaitresp(spc, rw, omask, false); + rv = cliwaitresp(spc, rw, omask, false); if (rv == ENOTCONN) rv = EAGAIN; } while (rv == EAGAIN); - pthread_sigmask(SIG_SETMASK, omask, NULL); *resp = rw.rw_data; return rv; @@ -463,15 +457,18 @@ register_t *retval) { struct rsp_sysresp *resp; + sigset_t omask; void *rdata; int rv; + pthread_sigmask(SIG_SETMASK, fullset, omask); + DPRINTF((rumpsp syscall_req: syscall %d with %p/%zu\n, sysnum, data, dlen)); - rv = syscall_req(clispc, sysnum, data, dlen, rdata); + rv = syscall_req(clispc, omask, sysnum, data, dlen, rdata); if (rv) - return rv; + goto out; resp = rdata; DPRINTF((rumpsp syscall_resp: syscall %d error %d, rv: %d/%d\n, @@ -481,6 +478,8 @@ rv = resp-rsys_error; free(rdata); + out: + pthread_sigmask(SIG_SETMASK, omask, NULL); return rv; } @@ -757,22 +756,27 @@ rumpclient_prefork(void) { struct rumpclient_fork *rpf; + sigset_t omask; void *resp; int rv; + pthread_sigmask(SIG_SETMASK, fullset, omask); rpf = malloc(sizeof(*rpf)); if (rpf == NULL) return NULL; - if ((rv = prefork_req(clispc, resp)) != 0) { + if ((rv = prefork_req(clispc, omask, resp)) != 0) { free(rpf); errno = rv; - return NULL; + rpf = NULL; + goto out; } memcpy(rpf-fork_auth, resp, sizeof(rpf-fork_auth)); free(resp); + out: + pthread_sigmask(SIG_SETMASK, omask, NULL); return rpf; }
CVS commit: src/sys/arch/sandpoint
Module Name:src Committed By: nisimura Date: Mon Feb 7 15:58:35 UTC 2011 Modified Files: src/sys/arch/sandpoint: README.NAS Log Message: - add D-Link GSM-G600 info. IP1000A is supposed a member of stge(4). - move StorCenter info as it looks correct. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/sandpoint/README.NAS 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/sandpoint/README.NAS diff -u src/sys/arch/sandpoint/README.NAS:1.8 src/sys/arch/sandpoint/README.NAS:1.9 --- src/sys/arch/sandpoint/README.NAS:1.8 Mon Jan 10 13:45:57 2011 +++ src/sys/arch/sandpoint/README.NAS Mon Feb 7 15:58:35 2011 @@ -1,4 +1,4 @@ -$NetBSD: README.NAS,v 1.8 2011/01/10 13:45:57 phx Exp $ +$NetBSD: README.NAS,v 1.9 2011/02/07 15:58:35 nisimura Exp $ MPC8241/8245 NAS products @@ -22,10 +22,12 @@ Board type BRD_QNAPTS101 wm.15 satalink.13 QNAP TS-100/101 + Board type BRD_STORCENTER +re.15 viaide.13 IOMEGA StorCenter + Not yet recognized, research in progress re.15 satalink.13 QNAP TS-201 -re.15 viaide.13 IOMEGA StorCenter -ste.? acardide.? DLink DSM-G600 +stge.15 acardide.16 D-Link DSM-G600 PCI line/pin and EPIC IRQ assignments @@ -35,6 +37,7 @@ Synology 12, 13, 14, 15 - 4, 0, 1, 2 QNAP 13, 14, 15, 16 - 0, 1, 2, 3 StorCenter 12, 13, 14, 15 - 0, 1, 2, 3 +DLink 13, 14, 15, 16 - 0, 1, 2, 3 - USB EHCI is a multiple function PCI device which has pin assignment A, B and C.
CVS commit: [bouyer-quota2] src/tests/fs/ffs
Module Name:src Committed By: bouyer Date: Mon Feb 7 16:22:50 UTC 2011 Modified Files: src/tests/fs/ffs [bouyer-quota2]: h_quota2_server.c h_quota2_tests.c quotas_common.sh t_getquota.sh t_quotalimit.sh t_setquota.sh Log Message: Add an option to mount the filesystem -o log to rump quota servers. Add some quota tests on a WAPBL-enabled filesystem. To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/tests/fs/ffs/h_quota2_server.c \ src/tests/fs/ffs/h_quota2_tests.c cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/tests/fs/ffs/quotas_common.sh cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/tests/fs/ffs/t_getquota.sh \ src/tests/fs/ffs/t_setquota.sh cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/tests/fs/ffs/t_quotalimit.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/ffs/h_quota2_server.c diff -u src/tests/fs/ffs/h_quota2_server.c:1.1.2.2 src/tests/fs/ffs/h_quota2_server.c:1.1.2.3 --- src/tests/fs/ffs/h_quota2_server.c:1.1.2.2 Sun Jan 30 13:15:14 2011 +++ src/tests/fs/ffs/h_quota2_server.c Mon Feb 7 16:22:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: h_quota2_server.c,v 1.1.2.2 2011/01/30 13:15:14 bouyer Exp $ */ +/* $NetBSD: h_quota2_server.c,v 1.1.2.3 2011/02/07 16:22:50 bouyer Exp $ */ /* * rump server for advanced quota tests @@ -26,7 +26,8 @@ static void usage(void) { - fprintf(stderr, usage: %s [-b] diskimage bindurl\n, getprogname()); + fprintf(stderr, usage: %s [-b] [-l] diskimage bindurl\n, + getprogname()); exit(1); } @@ -58,11 +59,14 @@ int log = 0; int ch; - while ((ch = getopt(argc, argv, b)) != -1) { + while ((ch = getopt(argc, argv, bl)) != -1) { switch(ch) { case 'b': background = 1; break; + case 'l': + log = 1; + break; default: usage(); } Index: src/tests/fs/ffs/h_quota2_tests.c diff -u src/tests/fs/ffs/h_quota2_tests.c:1.1.2.2 src/tests/fs/ffs/h_quota2_tests.c:1.1.2.3 --- src/tests/fs/ffs/h_quota2_tests.c:1.1.2.2 Thu Feb 3 17:36:31 2011 +++ src/tests/fs/ffs/h_quota2_tests.c Mon Feb 7 16:22:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: h_quota2_tests.c,v 1.1.2.2 2011/02/03 17:36:31 bouyer Exp $ */ +/* $NetBSD: h_quota2_tests.c,v 1.1.2.3 2011/02/07 16:22:50 bouyer Exp $ */ /* * rump server for advanced quota tests @@ -204,7 +204,7 @@ static void usage(void) { - fprintf(stderr, usage: %s [-b] test# diskimage bindurl\n, + fprintf(stderr, usage: %s [-b] [-l] test# diskimage bindurl\n, getprogname()); exit(1); } @@ -239,11 +239,14 @@ int log = 0; int ch; - while ((ch = getopt(argc, argv, b)) != -1) { + while ((ch = getopt(argc, argv, bl)) != -1) { switch(ch) { case 'b': background = 1; break; + case 'l': + log = 1; + break; default: usage(); } Index: src/tests/fs/ffs/quotas_common.sh diff -u src/tests/fs/ffs/quotas_common.sh:1.1.2.5 src/tests/fs/ffs/quotas_common.sh:1.1.2.6 --- src/tests/fs/ffs/quotas_common.sh:1.1.2.5 Wed Feb 2 19:17:08 2011 +++ src/tests/fs/ffs/quotas_common.sh Mon Feb 7 16:22:50 2011 @@ -1,4 +1,4 @@ -# $NetBSD: quotas_common.sh,v 1.1.2.5 2011/02/02 19:17:08 bouyer Exp $ +# $NetBSD: quotas_common.sh,v 1.1.2.6 2011/02/07 16:22:50 bouyer Exp $ create_with_quotas() { @@ -17,9 +17,10 @@ create_with_quotas_server() { + local sarg=$1; shift create_with_quotas $* - atf_check -o ignore -e ignore $(atf_get_srcdir)/h_quota2_server -b \ - ${IMG} ${RUMP_SERVER} + atf_check -o ignore -e ignore $(atf_get_srcdir)/h_quota2_server \ + ${sarg} ${IMG} ${RUMP_SERVER} } rump_shutdown() Index: src/tests/fs/ffs/t_getquota.sh diff -u src/tests/fs/ffs/t_getquota.sh:1.1.2.6 src/tests/fs/ffs/t_getquota.sh:1.1.2.7 --- src/tests/fs/ffs/t_getquota.sh:1.1.2.6 Wed Feb 2 19:17:08 2011 +++ src/tests/fs/ffs/t_getquota.sh Mon Feb 7 16:22:50 2011 @@ -1,4 +1,4 @@ -# $NetBSD: t_getquota.sh,v 1.1.2.6 2011/02/02 19:17:08 bouyer Exp $ +# $NetBSD: t_getquota.sh,v 1.1.2.7 2011/02/07 16:22:50 bouyer Exp $ # # Copyright (c) 2011 Manuel Bouyer # All rights reserved. @@ -29,17 +29,17 @@ for v in 1 2; do for q in user group; do test_case get_${e}_${v}_${q} get_quota \ - get quota with ${q} enabled ${e} ${v} ${q} + get quota with ${q} enabled -b ${e} ${v} ${q} done test_case get_${e}_${v}_both get_quota \ - get quota with both enabled ${e} ${v} both + get quota with both enabled -b ${e} ${v} both done done get_quota() { create_with_quotas_server $* - local q=$3 + local q=$4 local expect local fail Index: src/tests/fs/ffs/t_setquota.sh diff -u src/tests/fs/ffs/t_setquota.sh:1.1.2.6 src/tests/fs/ffs/t_setquota.sh:1.1.2.7 --- src/tests/fs/ffs/t_setquota.sh:1.1.2.6 Wed Feb 2 19:17:08 2011 +++ src/tests/fs/ffs/t_setquota.sh Mon Feb 7 16:22:50 2011 @@ -1,4 +1,4 @@ -# $NetBSD: t_setquota.sh,v 1.1.2.6 2011/02/02 19:17:08 bouyer Exp $ +# $NetBSD: t_setquota.sh,v 1.1.2.7 2011/02/07 16:22:50 bouyer Exp $ # # Copyright (c)
CVS commit: [bouyer-quota2] src/sys/ufs/ufs
Module Name:src Committed By: bouyer Date: Mon Feb 7 16:24:13 UTC 2011 Modified Files: src/sys/ufs/ufs [bouyer-quota2]: ufs_quota2.c Log Message: Create a WAPBL transaction when setting quotas. To generate a diff of this commit: cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/ufs/ufs/ufs_quota2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/ufs/ufs/ufs_quota2.c diff -u src/sys/ufs/ufs/ufs_quota2.c:1.1.2.7 src/sys/ufs/ufs/ufs_quota2.c:1.1.2.8 --- src/sys/ufs/ufs/ufs_quota2.c:1.1.2.7 Thu Feb 3 15:56:16 2011 +++ src/sys/ufs/ufs/ufs_quota2.c Mon Feb 7 16:24:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_quota2.c,v 1.1.2.7 2011/02/03 15:56:16 bouyer Exp $ */ +/* $NetBSD: ufs_quota2.c,v 1.1.2.8 2011/02/07 16:24:13 bouyer Exp $ */ /*- * Copyright (c) 2010 Manuel Bouyer * All rights reserved. @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ufs_quota2.c,v 1.1.2.7 2011/02/03 15:56:16 bouyer Exp $); +__KERNEL_RCSID(0, $NetBSD: ufs_quota2.c,v 1.1.2.8 2011/02/07 16:24:13 bouyer Exp $); #include sys/buf.h #include sys/param.h @@ -502,29 +502,33 @@ if (ump-um_quotas[type] == NULLVP) return ENODEV; + error = UFS_WAPBL_BEGIN(ump-um_mountp); + if (error) + return error; + if (defaultq) { mutex_enter(dqlock); error = getq2h(ump, type, bp, q2h, B_MODIFY); if (error) { mutex_exit(dqlock); - return error; + goto out_wapbl; } quota2_ufs_rwq2e(q2h-q2h_defentry, q2e, needswap); error = quota2_dict_update_q2e_limits(data, q2e); if (error) { mutex_exit(dqlock); brelse(bp, 0); - return error; + goto out_wapbl; } quota2_ufs_rwq2e(q2e, q2h-q2h_defentry, needswap); mutex_exit(dqlock); VOP_BWRITE(bp); - return error; + goto out_wapbl; } error = dqget(NULLVP, id, ump, type, dq); if (error) - return error; + goto out_wapbl; if (dq-dq2_lblkno == 0 dq-dq2_blkoff == 0) { /* need to alloc a new on-disk quot */ @@ -537,7 +541,7 @@ } if (error) { dqrele(NULLVP, dq); - return error; + goto out_wapbl; } mutex_enter(dq-dq_interlock); quota2_ufs_rwq2e(q2ep, q2e, needswap); @@ -546,13 +550,15 @@ mutex_exit(dq-dq_interlock); dqrele(NULLVP, dq); brelse(bp, 0); - return error; + goto out_wapbl; } quota2_ufs_rwq2e(q2e, q2ep, needswap); mutex_exit(dq-dq_interlock); dqrele(NULLVP, dq); VOP_BWRITE(bp); - + +out_wapbl: + UFS_WAPBL_END(ump-um_mountp); return error; }
CVS commit: src/sbin/fsck_msdos
Module Name:src Committed By: christos Date: Mon Feb 7 17:36:42 UTC 2011 Modified Files: src/sbin/fsck_msdos: dir.c Log Message: PR/44529: Martin Danielsson: fsck_msdos crashes when verifying corrupt file system. Avoid using the long name index when it is 0. Refactor the code to avoid duplication. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_msdos/dir.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/fsck_msdos/dir.c diff -u src/sbin/fsck_msdos/dir.c:1.23 src/sbin/fsck_msdos/dir.c:1.24 --- src/sbin/fsck_msdos/dir.c:1.23 Sat Apr 11 03:14:50 2009 +++ src/sbin/fsck_msdos/dir.c Mon Feb 7 12:36:42 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.23 2009/04/11 07:14:50 lukem Exp $ */ +/* $NetBSD: dir.c,v 1.24 2011/02/07 17:36:42 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank @@ -30,7 +30,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: dir.c,v 1.23 2009/04/11 07:14:50 lukem Exp $); +__RCSID($NetBSD: dir.c,v 1.24 2011/02/07 17:36:42 christos Exp $); #endif /* not lint */ #include stdio.h @@ -204,6 +204,7 @@ * Global variables temporarily used during a directory scan */ static char longName[DOSLONGNAMELEN] = ; +static char *eLongName = longName + sizeof(longName); static u_char *buffer = NULL; static u_char *delbuf = NULL; @@ -432,6 +433,26 @@ return FSOK; } +static int +procName(int from, int to, char **dst, const u_char *src) +{ + int k; + char *t = *dst; + + for (k = from; k to t eLongName; k += 2) { + if (!src[k] !src[k + 1]) + break; + *t++ = src[k]; + /* + * Warn about those unusable chars in msdosfs here? XXX + */ + if (src[k + 1]) + t[-1] = '?'; + } + *dst = t; + return k; +} + /* * Read a directory and * - resolve long name records @@ -526,6 +547,7 @@ } if (p[11] == ATTR_WIN95) { +u_int lrnomask = *p LRNOMASK; if (*p LRFIRST) { if (shortSum != -1) { if (!invlfn) { @@ -538,7 +560,7 @@ vallfn = p; valcl = cl; } else if (shortSum != p[13] - || lidx != (*p LRNOMASK)) { + || lidx != lrnomask || lrnomask != 0) { if (!invlfn) { invlfn = vallfn; invcl = valcl; @@ -549,52 +571,35 @@ } vallfn = NULL; } -lidx = *p LRNOMASK; -t = longName + --lidx * 13; -for (k = 1; k 11 t longName + sizeof(longName); k += 2) { - if (!p[k] !p[k + 1]) - break; - *t++ = p[k]; - /* - * Warn about those unusable chars in msdosfs here? XXX - */ - if (p[k + 1]) - t[-1] = '?'; -} -if (k = 11) - for (k = 14; k 26 t longName + sizeof(longName); k += 2) { - if (!p[k] !p[k + 1]) - break; - *t++ = p[k]; - if (p[k + 1]) - t[-1] = '?'; - } -if (k = 26) - for (k = 28; k 32 t longName + sizeof(longName); k += 2) { - if (!p[k] !p[k + 1]) - break; - *t++ = p[k]; - if (p[k + 1]) - t[-1] = '?'; - } -if (t = longName + sizeof(longName)) { - pwarn(long filename too long\n); - if (!invlfn) { - invlfn = vallfn; - invcl = valcl; +lidx = lrnomask; +if (lidx != 0) { + t = longName + --lidx * 13; + k = procName(1, 11, t, p); + if (k = 11) + k = procName(14, 26, t, p); + if (k = 26) + k = procName(28, 32, t, p); + if (t = eLongName) { + pwarn( + long filename too long\n); + if (!invlfn) { + invlfn = vallfn; + invcl = valcl; + } + vallfn = NULL; } - vallfn = NULL; } if (p[26] | (p[27] 8)) { - pwarn(long filename record cluster start != 0\n); + pwarn(long filename record cluster + start != 0\n); if (!invlfn) { invlfn = vallfn; invcl = cl; } vallfn = NULL; } -continue; /* long records don't carry further - * information */ +continue; /* long records don't carry + * further information */ } /*
CVS commit: src
Module Name:src Committed By: tsutsui Date: Mon Feb 7 18:11:29 UTC 2011 Modified Files: src/distrib/sets/lists/base: md.hp300 src/distrib/sets/lists/comp: md.hp300 src/distrib/sets/lists/man: mi src/usr.sbin: Makefile Removed Files: src/usr.sbin/grfinfo: Makefile grfinfo.1 grfinfo.c src/usr.sbin/hilinfo: Makefile hilinfo.c Log Message: Retire legacy grfinfo and hilinfo derived from HPBSD since finally hp300 got wscons. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/distrib/sets/lists/base/md.hp300 cvs rdiff -u -r1.59 -r1.60 src/distrib/sets/lists/comp/md.hp300 cvs rdiff -u -r1.1283 -r1.1284 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.250 -r1.251 src/usr.sbin/Makefile cvs rdiff -u -r1.7 -r0 src/usr.sbin/grfinfo/Makefile cvs rdiff -u -r1.10 -r0 src/usr.sbin/grfinfo/grfinfo.1 cvs rdiff -u -r1.9 -r0 src/usr.sbin/grfinfo/grfinfo.c cvs rdiff -u -r1.7 -r0 src/usr.sbin/hilinfo/Makefile cvs rdiff -u -r1.6 -r0 src/usr.sbin/hilinfo/hilinfo.c 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/base/md.hp300 diff -u src/distrib/sets/lists/base/md.hp300:1.40 src/distrib/sets/lists/base/md.hp300:1.41 --- src/distrib/sets/lists/base/md.hp300:1.40 Sat Nov 29 17:57:33 2008 +++ src/distrib/sets/lists/base/md.hp300 Mon Feb 7 18:11:28 2011 @@ -1,4 +1,4 @@ -# $NetBSD: md.hp300,v 1.40 2008/11/29 17:57:33 tsutsui Exp $ +# $NetBSD: md.hp300,v 1.41 2011/02/07 18:11:28 tsutsui Exp $ ./usr/mdec/bootctbase-sysutil-bin ./usr/mdec/bootrdbase-sysutil-bin ./usr/mdec/bootsdbase-sysutil-bin @@ -12,5 +12,5 @@ ./usr/mdec/rdbootbase-sysutil-bin ./usr/mdec/sdbootbase-sysutil-bin ./usr/mdec/uboot.lifbase-sysutil-bin -./usr/sbin/grfinfobase-sysutil-bin -./usr/sbin/hilinfobase-sysutil-bin +./usr/sbin/grfinfobase-obsolete obsolete +./usr/sbin/hilinfobase-obsolete obsolete Index: src/distrib/sets/lists/comp/md.hp300 diff -u src/distrib/sets/lists/comp/md.hp300:1.59 src/distrib/sets/lists/comp/md.hp300:1.60 --- src/distrib/sets/lists/comp/md.hp300:1.59 Tue Mar 16 01:49:34 2010 +++ src/distrib/sets/lists/comp/md.hp300 Mon Feb 7 18:11:28 2011 @@ -1,4 +1,4 @@ -# $NetBSD: md.hp300,v 1.59 2010/03/16 01:49:34 mrg Exp $ +# $NetBSD: md.hp300,v 1.60 2011/02/07 18:11:28 tsutsui Exp $ ./usr/include/hp300comp-c-include ./usr/include/hp300/_G_config.h comp-obsolete obsolete ./usr/include/hp300/ansi.h comp-c-include @@ -54,5 +54,5 @@ ./usr/include/hp300/wchar_limits.h comp-c-include ./usr/include/ieeefp.hcomp-c-include ./usr/libdata/debug/usr/mdec/mkboot.debug comp-sysutil-debug debug -./usr/libdata/debug/usr/sbin/grfinfo.debug comp-sysutil-debug debug -./usr/libdata/debug/usr/sbin/hilinfo.debug comp-sysutil-debug debug +./usr/libdata/debug/usr/sbin/grfinfo.debug comp-obsolete obsolete +./usr/libdata/debug/usr/sbin/hilinfo.debug comp-obsolete obsolete Index: src/distrib/sets/lists/man/mi diff -u src/distrib/sets/lists/man/mi:1.1283 src/distrib/sets/lists/man/mi:1.1284 --- src/distrib/sets/lists/man/mi:1.1283 Wed Jan 26 18:48:11 2011 +++ src/distrib/sets/lists/man/mi Mon Feb 7 18:11:28 2011 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1283 2011/01/26 18:48:11 bouyer Exp $ +# $NetBSD: mi,v 1.1284 2011/02/07 18:11:28 tsutsui Exp $ # # Note: don't delete entries from here - mark them as obsolete instead. # @@ -183,7 +183,7 @@ ./usr/share/man/cat1/history.0 man-util-catman .cat ./usr/share/man/cat1/host.0 man-netutil-catman .cat ./usr/share/man/cat1/hostname.0 man-util-catman .cat -./usr/share/man/cat1/hp300/grfinfo.0 man-sysutil-catman .cat +./usr/share/man/cat1/hp300/grfinfo.0 man-obsolete obsolete ./usr/share/man/cat1/i386 man-obsolete obsolete ./usr/share/man/cat1/i386/cursor.0 man-obsolete obsolete ./usr/share/man/cat1/i386/fed.0 man-obsolete obsolete @@ -3015,7 +3015,7 @@ ./usr/share/man/html1/history.html man-util-htmlman html ./usr/share/man/html1/host.html man-netutil-htmlman html ./usr/share/man/html1/hostname.html man-util-htmlman html -./usr/share/man/html1/hp300/grfinfo.html man-sysutil-htmlman html +./usr/share/man/html1/hp300/grfinfo.html man-obsolete obsolete ./usr/share/man/html1/iconv.html man-util-htmlman html ./usr/share/man/html1/id.html man-util-htmlman html ./usr/share/man/html1/ident.html man-util-htmlman html @@ -5468,7 +5468,7 @@ ./usr/share/man/man1/history.1 man-util-man .man ./usr/share/man/man1/host.1 man-netutil-man .man ./usr/share/man/man1/hostname.1 man-util-man .man -./usr/share/man/man1/hp300/grfinfo.1 man-sysutil-man .man +./usr/share/man/man1/hp300/grfinfo.1 man-obsolete obsolete ./usr/share/man/man1/i386 man-obsolete obsolete ./usr/share/man/man1/i386/cursor.1 man-obsolete obsolete ./usr/share/man/man1/i386/fed.1 man-obsolete obsolete Index: src/usr.sbin/Makefile diff -u src/usr.sbin/Makefile:1.250
CVS commit: src/sys/arch/sandpoint
Module Name:src Committed By: phx Date: Mon Feb 7 19:20:35 UTC 2011 Modified Files: src/sys/arch/sandpoint: README.NAS Log Message: StorCenter models are called 250, 500 and 1T. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sandpoint/README.NAS 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/sandpoint/README.NAS diff -u src/sys/arch/sandpoint/README.NAS:1.9 src/sys/arch/sandpoint/README.NAS:1.10 --- src/sys/arch/sandpoint/README.NAS:1.9 Mon Feb 7 15:58:35 2011 +++ src/sys/arch/sandpoint/README.NAS Mon Feb 7 19:20:35 2011 @@ -1,4 +1,4 @@ -$NetBSD: README.NAS,v 1.9 2011/02/07 15:58:35 nisimura Exp $ +$NetBSD: README.NAS,v 1.10 2011/02/07 19:20:35 phx Exp $ MPC8241/8245 NAS products @@ -23,7 +23,7 @@ wm.15 satalink.13 QNAP TS-100/101 Board type BRD_STORCENTER -re.15 viaide.13 IOMEGA StorCenter +re.15 viaide.13 IOMEGA StorCenter 250/500/1T Not yet recognized, research in progress re.15 satalink.13 QNAP TS-201
CVS commit: src/lib/librumphijack
Module Name:src Committed By: pooka Date: Mon Feb 7 19:34:39 UTC 2011 Modified Files: src/lib/librumphijack: hijack.c Log Message: Force gcc to generate a stack frame for the call to dlsym(RTLD_NEXT). Without this hack at least amd64 -O2 just used jmp and The Wrong Thing happened. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/lib/librumphijack/hijack.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/librumphijack/hijack.c diff -u src/lib/librumphijack/hijack.c:1.31 src/lib/librumphijack/hijack.c:1.32 --- src/lib/librumphijack/hijack.c:1.31 Mon Feb 7 12:23:05 2011 +++ src/lib/librumphijack/hijack.c Mon Feb 7 19:34:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: hijack.c,v 1.31 2011/02/07 12:23:05 pooka Exp $ */ +/* $NetBSD: hijack.c,v 1.32 2011/02/07 19:34:39 pooka Exp $ */ /*- * Copyright (c) 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: hijack.c,v 1.31 2011/02/07 12:23:05 pooka Exp $); +__RCSID($NetBSD: hijack.c,v 1.32 2011/02/07 19:34:39 pooka Exp $); #define __ssp_weak_name(fun) _hijack_ ## fun @@ -174,12 +174,25 @@ /* * This is called from librumpclient in case of LD_PRELOAD. * It ensures correct RTLD_NEXT. + * + * ... except, it's apparently extremely difficult to force + * at least gcc to generate an actual stack frame here. So + * sprinkle some volatile foobar and baz to throw the optimizer + * off the scent and generate a variable assignment with the + * return value. The posterboy for this meltdown is amd64 + * with -O2. At least with gcc 4.1.3 i386 works regardless of + * optimization. */ +volatile int rumphijack_unrope; /* there, unhang yourself */ static void * hijackdlsym(void *handle, const char *symbol) { + void *rv; + + rv = dlsym(handle, symbol); + rumphijack_unrope = *(volatile int *)rv; - return dlsym(handle, symbol); + return (void *)rv; } /* low calorie sockets? */
CVS commit: src/tests/rump/rumpkern/h_client
Module Name:src Committed By: pooka Date: Mon Feb 7 20:05:09 UTC 2011 Modified Files: src/tests/rump/rumpkern/h_client: h_sigcli.c Log Message: Limit test duration based on wall time instead of loops (took a long time on slow platforms). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/rump/rumpkern/h_client/h_sigcli.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/rump/rumpkern/h_client/h_sigcli.c diff -u src/tests/rump/rumpkern/h_client/h_sigcli.c:1.2 src/tests/rump/rumpkern/h_client/h_sigcli.c:1.3 --- src/tests/rump/rumpkern/h_client/h_sigcli.c:1.2 Mon Jan 10 19:30:21 2011 +++ src/tests/rump/rumpkern/h_client/h_sigcli.c Mon Feb 7 20:05:09 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: h_sigcli.c,v 1.2 2011/01/10 19:30:21 pooka Exp $ */ +/* $NetBSD: h_sigcli.c,v 1.3 2011/02/07 20:05:09 pooka Exp $ */ #include sys/types.h #include sys/sysctl.h @@ -35,6 +35,7 @@ main(void) { char buf[128]; + time_t tstart; struct itimerval itv; size_t hnbsize; int i; @@ -57,13 +58,24 @@ if (setitimer(ITIMER_REAL, itv, NULL) == -1) err(1, itimer); - for (i = 0; i 2; i++) { + tstart = time(NULL); + for (i = 0;; i++) { blen = sizeof(buf); if (rump_sys___sysctl(hostnamemib, __arraycount(hostnamemib), buf, blen, NULL, 0) == -1) err(1, sysctl); if (strcmp(buf, hostnamebuf) != 0) errx(1, main hostname); + + /* + * check every 100 cycles to avoid doing + * nothing but gettimeofday() + */ + if (i == 100) { + if (time(NULL) - tstart 5) +break; + i = 0; + } } if (!sigexecs) {
CVS commit: [bouyer-quota2] src/sys/ufs/ufs
Module Name:src Committed By: bouyer Date: Mon Feb 7 20:30:39 UTC 2011 Modified Files: src/sys/ufs/ufs [bouyer-quota2]: ufs_quota.c ufs_quota.h ufs_quota2.c Log Message: Implement clear command (quota2 only), which either free the specified quota2 entry (if both disk and inode usage are 0) or revert its limits to the default quota entry. To generate a diff of this commit: cvs rdiff -u -r1.68.4.7 -r1.68.4.8 src/sys/ufs/ufs/ufs_quota.c cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/ufs/ufs/ufs_quota.h cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/ufs/ufs/ufs_quota2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/ufs/ufs/ufs_quota.c diff -u src/sys/ufs/ufs/ufs_quota.c:1.68.4.7 src/sys/ufs/ufs/ufs_quota.c:1.68.4.8 --- src/sys/ufs/ufs/ufs_quota.c:1.68.4.7 Mon Jan 31 21:09:53 2011 +++ src/sys/ufs/ufs/ufs_quota.c Mon Feb 7 20:30:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_quota.c,v 1.68.4.7 2011/01/31 21:09:53 bouyer Exp $ */ +/* $NetBSD: ufs_quota.c,v 1.68.4.8 2011/02/07 20:30:39 bouyer Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993, 1995 @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ufs_quota.c,v 1.68.4.7 2011/01/31 21:09:53 bouyer Exp $); +__KERNEL_RCSID(0, $NetBSD: ufs_quota.c,v 1.68.4.8 2011/02/07 20:30:39 bouyer Exp $); #if defined(_KERNEL_OPT) #include opt_quota.h @@ -68,6 +68,8 @@ prop_dictionary_t, int, prop_array_t); static int quota_handle_cmd_getall(struct mount *, struct lwp *, prop_dictionary_t, int, prop_array_t); +static int quota_handle_cmd_clear(struct mount *, struct lwp *, +prop_dictionary_t, int, prop_array_t); /* * Initialize the quota fields of an inode. */ @@ -169,6 +171,10 @@ error = quota_handle_cmd_getall(mp, l, cmddict, q2type, datas); goto end; } + if (strcmp(cmd, clear) == 0) { + error = quota_handle_cmd_clear(mp, l, cmddict, q2type, datas); + goto end; + } error = EOPNOTSUPP; end: error = (prop_dictionary_set_int8(cmddict, return, @@ -371,6 +377,69 @@ } static int +quota_handle_cmd_clear(struct mount *mp, struct lwp *l, +prop_dictionary_t cmddict, int type, prop_array_t datas) +{ + prop_array_t replies; + prop_object_iterator_t iter; + prop_dictionary_t data; + uint32_t id; + struct ufsmount *ump = VFSTOUFS(mp); + int error, defaultq = 0; + const char *idstr; + + if ((ump-um_flags UFS_QUOTA2) == 0) + return EOPNOTSUPP; + + replies = prop_array_create(); + if (replies == NULL) + return ENOMEM; + + iter = prop_array_iterator(datas); + if (iter == NULL) { + prop_object_release(replies); + return ENOMEM; + } + while ((data = prop_object_iterator_next(iter)) != NULL) { + if (!prop_dictionary_get_uint32(data, id, id)) { + if (!prop_dictionary_get_cstring_nocopy(data, id, + idstr)) +continue; + if (strcmp(idstr, default)) +continue; + id = 0; + defaultq = 1; + } else { + defaultq = 0; + } + error = kauth_authorize_system(l-l_cred, KAUTH_SYSTEM_FS_QUOTA, + KAUTH_REQ_SYSTEM_FS_QUOTA_MANAGE, mp, KAUTH_ARG(id), NULL); + if (error != 0) { + prop_object_release(replies); + return error; + } +#ifdef QUOTA2 + if (ump-um_flags UFS_QUOTA2) { + error = quota2_handle_cmd_clear(ump, type, id, defaultq, + data); + } else +#endif + panic(quota_handle_cmd_get: no support ?); + + if (error error != ENOENT) { + prop_object_release(replies); + return error; + } + } + if (!prop_dictionary_set_and_rel(cmddict, data, replies)) { + error = ENOMEM; + } else { + error = 0; + } + return error; +} + +static int quota_handle_cmd_getall(struct mount *mp, struct lwp *l, prop_dictionary_t cmddict, int type, prop_array_t datas) { Index: src/sys/ufs/ufs/ufs_quota.h diff -u src/sys/ufs/ufs/ufs_quota.h:1.1.2.4 src/sys/ufs/ufs/ufs_quota.h:1.1.2.5 --- src/sys/ufs/ufs/ufs_quota.h:1.1.2.4 Mon Jan 31 15:24:10 2011 +++ src/sys/ufs/ufs/ufs_quota.h Mon Feb 7 20:30:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_quota.h,v 1.1.2.4 2011/01/31 15:24:10 bouyer Exp $ */ +/* $NetBSD: ufs_quota.h,v 1.1.2.5 2011/02/07 20:30:39 bouyer Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993, 1995 @@ -129,6 +129,7 @@ int chkiq2(struct inode *, int32_t, kauth_cred_t, int); int quota2_handle_cmd_get(struct ufsmount *, int, int, int, prop_array_t); int quota2_handle_cmd_set(struct ufsmount *, int, int, int, prop_dictionary_t); +int quota2_handle_cmd_clear(struct ufsmount *, int, int, int, prop_dictionary_t); int quota2_handle_cmd_getall(struct ufsmount *, int, prop_array_t); int q2sync(struct mount *); int dq2get(struct vnode *, u_long, struct ufsmount *, int, struct dquot *); Index: src/sys/ufs/ufs/ufs_quota2.c diff -u src/sys/ufs/ufs/ufs_quota2.c:1.1.2.8 src/sys/ufs/ufs/ufs_quota2.c:1.1.2.9 --- src/sys/ufs/ufs/ufs_quota2.c:1.1.2.8 Mon Feb 7 16:24:13 2011 +++ src/sys/ufs/ufs/ufs_quota2.c Mon Feb 7 20:30:39 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_quota2.c,v 1.1.2.8
CVS commit: [bouyer-quota2] src/usr.sbin/edquota
Module Name:src Committed By: bouyer Date: Mon Feb 7 20:31:21 UTC 2011 Modified Files: src/usr.sbin/edquota [bouyer-quota2]: edquota.8 edquota.c Log Message: Add -c option, which clears quota entries for the specified users/groups To generate a diff of this commit: cvs rdiff -u -r1.12.50.1 -r1.12.50.2 src/usr.sbin/edquota/edquota.8 cvs rdiff -u -r1.29.16.9 -r1.29.16.10 src/usr.sbin/edquota/edquota.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/edquota/edquota.8 diff -u src/usr.sbin/edquota/edquota.8:1.12.50.1 src/usr.sbin/edquota/edquota.8:1.12.50.2 --- src/usr.sbin/edquota/edquota.8:1.12.50.1 Sun Feb 6 22:18:38 2011 +++ src/usr.sbin/edquota/edquota.8 Mon Feb 7 20:31:20 2011 @@ -29,7 +29,7 @@ .\ SUCH DAMAGE. .\ .\ from: @(#)edquota.8 8.2 (Berkeley) 4/27/95 -.\ $NetBSD: edquota.8,v 1.12.50.1 2011/02/06 22:18:38 bouyer Exp $ +.\ $NetBSD: edquota.8,v 1.12.50.2 2011/02/07 20:31:20 bouyer Exp $ .\ .Dd February 6, 2011 .Dt EDQUOTA 8 @@ -74,6 +74,20 @@ .Op Fl t Ar block grace time/inode grace time .Ar -d | .Ar groupname ... +.Nm +.Op Fl D +.Op Fl H +.Op Fl u +.Fl c +.Op Fl f Ar filesystem +.Ar username ... +.Nm +.Op Fl D +.Op Fl H +.Fl g +.Fl c +.Op Fl f Ar filesystem +.Ar groupname ... .Sh DESCRIPTION .Nm is a quota editor. @@ -165,6 +179,12 @@ per-user/group grace time. To edit the filesystem-wide grace time, use .Fl d . .Pp +On quota2-enabled filesystems, the +.Fl c +flag cause edquota to clear quota entries for the specified users or groups. +If disk or inode usages is not 0, limits are reverted to the default quota. +If disk and inode usages are 0, the existing quota entries are freed. +.Pp The .Fl D flag cause edquota to print to the standard error property lists sent to Index: src/usr.sbin/edquota/edquota.c diff -u src/usr.sbin/edquota/edquota.c:1.29.16.9 src/usr.sbin/edquota/edquota.c:1.29.16.10 --- src/usr.sbin/edquota/edquota.c:1.29.16.9 Sun Feb 6 22:18:38 2011 +++ src/usr.sbin/edquota/edquota.c Mon Feb 7 20:31:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: edquota.c,v 1.29.16.9 2011/02/06 22:18:38 bouyer Exp $ */ +/* $NetBSD: edquota.c,v 1.29.16.10 2011/02/07 20:31:20 bouyer Exp $ */ /* * Copyright (c) 1980, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = from: @(#)edquota.c 8.3 (Berkeley) 4/27/95; #else -__RCSID($NetBSD: edquota.c,v 1.29.16.9 2011/02/06 22:18:38 bouyer Exp $); +__RCSID($NetBSD: edquota.c,v 1.29.16.10 2011/02/07 20:31:20 bouyer Exp $); #endif #endif /* not lint */ @@ -113,6 +113,7 @@ void freeprivs(struct quotause *); int alldigits(const char *); int hasquota(struct fstab *, int, char **); +static void clearpriv(int, char **, const char *, int); int Hflag = 0; int Dflag = 0; @@ -131,6 +132,7 @@ char *fs = NULL; int ch; int pflag = 0; + int cflag = 0; if (argc 2) usage(); @@ -138,7 +140,7 @@ errx(1, permission denied); protoname = NULL; quotatype = USRQUOTA; - while ((ch = getopt(argc, argv, DHdugp:s:h:t:f:)) != -1) { + while ((ch = getopt(argc, argv, DHcdugp:s:h:t:f:)) != -1) { switch(ch) { case 'D': Dflag++; @@ -146,6 +148,9 @@ case 'H': Hflag++; break; + case 'c': + cflag++; + break; case 'd': dflag++; break; @@ -179,7 +184,7 @@ argv += optind; if (pflag) { - if (soft || hard || grace || dflag) + if (soft || hard || grace || dflag || cflag) usage(); if ((protoid = getentry(protoname, quotatype)) == -1) exit(1); @@ -200,6 +205,9 @@ u_int64_t softb, hardb, softi, hardi; time_t graceb, gracei; char *str; + + if (cflag) + usage(); if (soft) { str = strsep(soft, /); if (str[0] == '\0' || soft == NULL || soft[0] == '\0') @@ -283,6 +291,12 @@ } exit(0); } + if (cflag) { + if (dflag) + usage(); + clearpriv(argc, argv, fs, quotatype); + exit(0); + } tmpfd = mkstemp(tmpfil); fchown(tmpfd, getuid(), getgid()); if (dflag) { @@ -316,6 +330,8 @@ edquota [-D] [-H] -g [-p groupname] [-f filesystem] -d | groupname ...\n edquota [-D] [-u] [-f filesystem] [-s b#/i#] [-h b#/i#] [-t t#/t#] \\\n\t-d | username ...\n edquota [-D] -g [-f filesystem] [-s b#/i#] [-h b#/i#] [-t t#/t#] \\\n\t-d | groupname ...\n + edquota [-D] [-H] [-u] -c [-f filesystem] username ...\n + edquota [-D] [-H] -g -c [-f filesystem] groupname ...\n ); exit(1); } @@ -1060,3 +1076,97 @@ qfextension[type]); return (1); } + +static void +clearpriv(int argc, char **argv, const char *filesys, int quotatype) +{ + prop_array_t cmds, datas; + prop_dictionary_t protodict, dict, data, cmd; + struct plistref pref; + bool ret; + struct statvfs *fst; + int nfst, i, error; + int8_t error8; + int id; + + /* build a generic command */ + protodict = quota2_prop_create(); + cmds = prop_array_create(); + datas =
CVS commit: [bouyer-quota2] src/tests/fs/ffs
Module Name:src Committed By: bouyer Date: Mon Feb 7 20:31:46 UTC 2011 Modified Files: src/tests/fs/ffs [bouyer-quota2]: Makefile Added Files: src/tests/fs/ffs [bouyer-quota2]: t_clearquota.sh Log Message: Test clearing of quota entries To generate a diff of this commit: cvs rdiff -u -r1.14.2.4 -r1.14.2.5 src/tests/fs/ffs/Makefile cvs rdiff -u -r0 -r1.1.2.1 src/tests/fs/ffs/t_clearquota.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/ffs/Makefile diff -u src/tests/fs/ffs/Makefile:1.14.2.4 src/tests/fs/ffs/Makefile:1.14.2.5 --- src/tests/fs/ffs/Makefile:1.14.2.4 Wed Feb 2 19:17:08 2011 +++ src/tests/fs/ffs/Makefile Mon Feb 7 20:31:46 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14.2.4 2011/02/02 19:17:08 bouyer Exp $ +# $NetBSD: Makefile,v 1.14.2.5 2011/02/07 20:31:46 bouyer Exp $ # .include bsd.own.mk @@ -17,7 +17,7 @@ MAN.h_quota2_tests= # empty BINDIR.h_quota2_tests= ${TESTSDIR} -.for name in t_getquota t_setquota t_quotalimit +.for name in t_getquota t_setquota t_quotalimit t_clearquota TESTS_SH+= ${name} TESTS_SH_SRC_${name}= quotas_common.sh ${name}.sh .endfor Added files: Index: src/tests/fs/ffs/t_clearquota.sh diff -u /dev/null src/tests/fs/ffs/t_clearquota.sh:1.1.2.1 --- /dev/null Mon Feb 7 20:31:47 2011 +++ src/tests/fs/ffs/t_clearquota.sh Mon Feb 7 20:31:46 2011 @@ -0,0 +1,91 @@ +# $NetBSD: t_clearquota.sh,v 1.1.2.1 2011/02/07 20:31:46 bouyer Exp $ +# +# Copyright (c) 2011 Manuel Bouyer +# 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +for e in le be; do + for v in 1 2; do +for q in user group; do + test_case_root clear_${e}_${v}_${q} clear_quota \ + clear quota with ${q} enabled -b ${e} ${v} ${q} +done +test_case_root clear_${e}_${v}_both clear_quota \ + clear quota with both enabled -b ${e} ${v} both +test_case_root clear_${e}_${v}_both_log clear_quota \ + clear quota for new id with both enabled, WAPBL -bl ${e} ${v} both + done +done + +clear_quota() +{ + create_with_quotas_server $* + local q=$4 + local expect + local fail + local id=1 + + case ${q} in + user) + expect=u + fail=g + ;; + group) + expect=g + fail=u + ;; + both) + expect=u g + fail= + ;; + *) + atf_fail wrong quota type + ;; + esac + +#set and check the expected quota + for q in ${expect} ; do + atf_check -s exit:0 \ + $(atf_get_srcdir)/rump_edquota -$q -s10k/20 -h40M/50k \ + -t 2W/3D ${id} + atf_check -s exit:0 \ +-o match:/mnt0 1040960 2weeks 0 20 51200 3days \ +-o match:Disk quotas for .*: $ \ + $(atf_get_srcdir)/rump_quota -${q} -v ${id} + done +#now clear the quotas + for q in ${expect} ; do + atf_check -s exit:0 \ + $(atf_get_srcdir)/rump_edquota -$q -c ${id} + done; + +#check that we do not get positive reply for any quota type + for q in u g ; do + atf_check -s exit:0 -o not-match:/mnt \ + -o not-match:Disk quotas for .*: $ \ + -o match:Disk quotas for .*: none$ \ + $(atf_get_srcdir)/rump_quota -${q} -v ${id} + done + rump_shutdown +}
CVS commit: src/share/mk
Module Name:src Committed By: mrg Date: Mon Feb 7 21:23:47 UTC 2011 Modified Files: src/share/mk: bsd.own.mk Log Message: add missing SRCDIR for synaptics. To generate a diff of this commit: cvs rdiff -u -r1.651 -r1.652 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.651 src/share/mk/bsd.own.mk:1.652 --- src/share/mk/bsd.own.mk:1.651 Sun Feb 6 01:14:10 2011 +++ src/share/mk/bsd.own.mk Mon Feb 7 21:23:47 2011 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.651 2011/02/06 01:14:10 joerg Exp $ +# $NetBSD: bsd.own.mk,v 1.652 2011/02/07 21:23:47 mrg Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -982,7 +982,7 @@ .endfor .for _i in \ - elographics keyboard mouse vmmouse void ws + elographics keyboard mouse synaptics vmmouse void ws X11SRCDIR.xf86-input-${_i}?= ${X11SRCDIRMIT}/xf86-input-${_i}/dist .endfor
CVS commit: src/lib/libc/gen
Module Name:src Committed By: joerg Date: Mon Feb 7 21:39:47 UTC 2011 Modified Files: src/lib/libc/gen: getcap.c Log Message: Don't define weak aliases in the SMALL case. They conflict with the real function name since SMALL doesn't use the normal rename logic. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/lib/libc/gen/getcap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/getcap.c diff -u src/lib/libc/gen/getcap.c:1.48 src/lib/libc/gen/getcap.c:1.49 --- src/lib/libc/gen/getcap.c:1.48 Sat Feb 2 20:56:46 2008 +++ src/lib/libc/gen/getcap.c Mon Feb 7 21:39:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: getcap.c,v 1.48 2008/02/02 20:56:46 christos Exp $ */ +/* $NetBSD: getcap.c,v 1.49 2011/02/07 21:39:47 joerg Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = @(#)getcap.c 8.3 (Berkeley) 3/25/94; #else -__RCSID($NetBSD: getcap.c,v 1.48 2008/02/02 20:56:46 christos Exp $); +__RCSID($NetBSD: getcap.c,v 1.49 2011/02/07 21:39:47 joerg Exp $); #endif #endif /* LIBC_SCCS and not lint */ @@ -64,7 +64,7 @@ #include string.h #include unistd.h -#ifdef __weak_alias +#if defined(__weak_alias) !defined(SMALL) __weak_alias(cgetcap,_cgetcap) __weak_alias(cgetclose,_cgetclose) __weak_alias(cgetent,_cgetent)
CVS commit: src/lib/librump
Module Name:src Committed By: pooka Date: Mon Feb 7 22:04:36 UTC 2011 Modified Files: src/lib/librump: rump_sp.7 Log Message: add some notes on access control To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/librump/rump_sp.7 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/librump/rump_sp.7 diff -u src/lib/librump/rump_sp.7:1.3 src/lib/librump/rump_sp.7:1.4 --- src/lib/librump/rump_sp.7:1.3 Tue Jan 25 14:05:43 2011 +++ src/lib/librump/rump_sp.7 Mon Feb 7 22:04:36 2011 @@ -1,4 +1,4 @@ -.\ $NetBSD: rump_sp.7,v 1.3 2011/01/25 14:05:43 pooka Exp $ +.\ $NetBSD: rump_sp.7,v 1.4 2011/02/07 22:04:36 pooka Exp $ .\ .\ Copyright (c) 2010 Antti Kantee. All rights reserved. .\ @@ -23,7 +23,7 @@ .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\ SUCH DAMAGE. .\ -.Dd December 16, 2010 +.Dd February 7, 2011 .Dt RUMP_SP 7 .Os .Sh NAME @@ -79,6 +79,16 @@ modifying the shell prompt is recommended -- this is analoguous to the visual clue you have when you login from one machine to another. +.Ss Client credentials and access control +The current scheme gives all connecting clients root credentials. +It is recommended to take precautions which prevent unauthorized +access. +For a unix domain socket it is enough to prevent access to the +socket using file system permissions. +For TCP/IP sockets the only available means is to prevent network +access to the socket with the use of firewalls. +More fine-grained access control based on cryptographic credentials +may be implemented at a future date. .Sh EXAMPLES Get a list of file systems supported by a rump kernel server (in case that particular server does not support file systems,
CVS commit: src/sys/arch/arm/omap
Module Name:src Committed By: ahoka Date: Mon Feb 7 23:22:18 UTC 2011 Modified Files: src/sys/arch/arm/omap: omap2_gpmcreg.h Log Message: Add some macros to access GPMC config registers easily. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/omap/omap2_gpmcreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/omap/omap2_gpmcreg.h diff -u src/sys/arch/arm/omap/omap2_gpmcreg.h:1.4 src/sys/arch/arm/omap/omap2_gpmcreg.h:1.5 --- src/sys/arch/arm/omap/omap2_gpmcreg.h:1.4 Sat Aug 28 04:03:51 2010 +++ src/sys/arch/arm/omap/omap2_gpmcreg.h Mon Feb 7 23:22:18 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: omap2_gpmcreg.h,v 1.4 2010/08/28 04:03:51 kiyohara Exp $ */ +/* $NetBSD: omap2_gpmcreg.h,v 1.5 2011/02/07 23:22:18 ahoka Exp $ */ /* * Copyright (c) 2007 Microsoft * All rights reserved. @@ -185,6 +185,19 @@ #define GPMC_NCS 8 /* # Chip Selects */ #define GPMC_CS_SIZE (GPMC_CONFIG1_1 - GPMC_CONFIG1_0) +#define GPMC_CS_CONFIG_BASE(cs) \ + (GPMC_BASE + GPMC_CONFIG1_0 + (cs) * GPMC_CS_SIZE) +#define GPMC_CS_CONFIG(cs) \ + (GPMC_CONFIG1_0 + (cs) * GPMC_CS_SIZE) + +#define GPMC_CONFIG1_i (GPMC_CONFIG1_0 - GPMC_CONFIG1_0) +#define GPMC_CONFIG2_i (GPMC_CONFIG2_0 - GPMC_CONFIG1_0) +#define GPMC_CONFIG3_i (GPMC_CONFIG3_0 - GPMC_CONFIG1_0) +#define GPMC_CONFIG4_i (GPMC_CONFIG4_0 - GPMC_CONFIG1_0) +#define GPMC_CONFIG5_i (GPMC_CONFIG5_0 - GPMC_CONFIG1_0) +#define GPMC_CONFIG6_i (GPMC_CONFIG6_0 - GPMC_CONFIG1_0) +#define GPMC_CONFIG7_i (GPMC_CONFIG7_0 - GPMC_CONFIG1_0) + /* * GPMC OMAP2430_GPMC_REVISION */
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: christos Date: Mon Feb 7 23:56:18 UTC 2011 Modified Files: src/usr.bin/xlint/lint1: mkops Log Message: weprovidedarracount()sothatwedon'tneedtosqueezethespacesout. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.bin/xlint/lint1/mkops 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/xlint/lint1/mkops diff -u src/usr.bin/xlint/lint1/mkops:1.7 src/usr.bin/xlint/lint1/mkops:1.8 --- src/usr.bin/xlint/lint1/mkops:1.7 Sun Feb 6 19:26:27 2011 +++ src/usr.bin/xlint/lint1/mkops Mon Feb 7 18:56:18 2011 @@ -1,5 +1,5 @@ #!/bin/sh - -# $NetBSD: mkops,v 1.7 2011/02/07 00:26:27 christos Exp $ +# $NetBSD: mkops,v 1.8 2011/02/07 23:56:18 christos Exp $ # # Copyright (c) 2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -122,7 +122,7 @@ printf({\n); printf(\tsize_t i;\n); printf(\n); - printf(\tfor (i=0; isizeof(imods)/sizeof(imods[0]); i++)\n); + printf(\tfor (i = 0; i __arraycount(imods); i++)\n); printf(\t\tif (imods[i].ok)\n); printf(\t\t\tSTRUCT_ASSIGN(modtab[i], imods[i].m);\n); printf(}\n);
CVS commit: src/sys/arch/sandpoint/stand/altboot
Module Name:src Committed By: nisimura Date: Tue Feb 8 00:33:05 UTC 2011 Modified Files: src/sys/arch/sandpoint/stand/altboot: brdsetup.c globals.h pciide.c Log Message: - add preliminary code to support D-Link DSM-G600 rev.B NAS. - it features 9600bps console, Moto MCU on the 2nd DUART channel, ACARD ATP865 PCIIDE and IP Plus IP1000A GbE. It has MiniPCI slot. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/sandpoint/stand/altboot/brdsetup.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sandpoint/stand/altboot/globals.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/sandpoint/stand/altboot/pciide.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/sandpoint/stand/altboot/brdsetup.c diff -u src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.2 src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.3 --- src/sys/arch/sandpoint/stand/altboot/brdsetup.c:1.2 Mon Feb 7 12:45:21 2011 +++ src/sys/arch/sandpoint/stand/altboot/brdsetup.c Tue Feb 8 00:33:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: brdsetup.c,v 1.2 2011/02/07 12:45:21 nisimura Exp $ */ +/* $NetBSD: brdsetup.c,v 1.3 2011/02/08 00:33:05 nisimura Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -53,6 +53,7 @@ BRD_DECL(syno); BRD_DECL(qnap); BRD_DECL(iomega); +BRD_DECL(dlink); static struct brdprop brdlist[] = { { @@ -99,6 +100,13 @@ eumb, 0x4500, 115200, NULL, iomegabrdfix, iomegapcifix }, { + dlink, + D-Link GSM-G600, + BRD_DLINKGSM, + 0, + eumb, 0x4500, 9600, + NULL, dlinkbrdfix, dlinkpcifix }, +{ unknown, Unknown board, BRD_UNKNOWN, @@ -205,6 +213,10 @@ 0x1106) {/* PCI_VENDOR_VIA */ brdtype = BRD_STORCENTER; } + else if (PCI_VENDOR(pcicfgread(pcimaketag(0, 16, 0), PCI_ID_REG)) == + 0x1191) {/* PCI_VENDOR_ACARD */ + brdtype = BRD_DLINKGSM; + } brdprop = brd_lookup(brdtype); @@ -771,6 +783,44 @@ } void +dlinkbrdfix(struct brdprop *brd) +{ + + init_uart(uart2base, 9600, LCR_8BITS | LCR_PNONE); +} + +void +dlinkpcifix(struct brdprop *brd) +{ + unsigned usb, nic, ide, val; + + usb = pcimaketag(0, 14, 0); + val = pcicfgread(usb, 0x3c) 0xff00; + val |= 14; + pcicfgwrite(usb, 0x3c, val); + + usb = pcimaketag(0, 14, 1); + val = pcicfgread(usb, 0x3c) 0xff00; + val |= 14; + pcicfgwrite(usb, 0x3c, val); + + usb = pcimaketag(0, 14, 2); + val = pcicfgread(usb, 0x3c) 0xff00; + val |= 14; + pcicfgwrite(usb, 0x3c, val); + + nic = pcimaketag(0, 15, 0); + val = pcicfgread(nic, 0x3c) 0xff00; + val |= 15; + pcicfgwrite(nic, 0x3c, val); + + ide = pcimaketag(0, 16, 0); + val = pcicfgread(ide, 0x3c) 0xff00; + val |= 16; + pcicfgwrite(ide, 0x3c, val); +} + +void _rtt(void) { Index: src/sys/arch/sandpoint/stand/altboot/globals.h diff -u src/sys/arch/sandpoint/stand/altboot/globals.h:1.3 src/sys/arch/sandpoint/stand/altboot/globals.h:1.4 --- src/sys/arch/sandpoint/stand/altboot/globals.h:1.3 Thu Jan 27 17:38:04 2011 +++ src/sys/arch/sandpoint/stand/altboot/globals.h Tue Feb 8 00:33:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: globals.h,v 1.3 2011/01/27 17:38:04 phx Exp $ */ +/* $NetBSD: globals.h,v 1.4 2011/02/08 00:33:05 nisimura Exp $ */ #ifdef DEBUG #define DPRINTF(x) printf x @@ -20,6 +20,7 @@ #define BRD_QNAPTS101 101 #define BRD_SYNOLOGY 102 #define BRD_STORCENTER 103 +#define BRD_DLINKGSM 104 #define BRD_UNKNOWN -1 struct brdprop { Index: src/sys/arch/sandpoint/stand/altboot/pciide.c diff -u src/sys/arch/sandpoint/stand/altboot/pciide.c:1.1 src/sys/arch/sandpoint/stand/altboot/pciide.c:1.2 --- src/sys/arch/sandpoint/stand/altboot/pciide.c:1.1 Sun Jan 23 01:05:30 2011 +++ src/sys/arch/sandpoint/stand/altboot/pciide.c Tue Feb 8 00:33:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pciide.c,v 1.1 2011/01/23 01:05:30 nisimura Exp $ */ +/* $NetBSD: pciide.c,v 1.2 2011/02/08 00:33:05 nisimura Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ }; static int cmdidefix(struct dkdev_ata *); static struct myops cmdideops = { cmdidefix, NULL }; -static struct myops *myops = cmdideops; +static struct myops *myops; int pciide_match(unsigned, void *); void *pciide_init(unsigned, void *); @@ -56,10 +56,13 @@ v = pcicfgread(tag, PCI_ID_REG); switch (v) { case PCI_DEVICE(0x1095, 0x0680): /* SiI 0680 IDE */ + myops = cmdideops; + return 1; case PCI_DEVICE(0x1283, 0x8211): /* ITE 8211 IDE */ case PCI_DEVICE(0x1106, 0x1571): /* VIA 82C586 IDE */ case PCI_DEVICE(0x10ad, 0x0105): /* Symphony Labs 82C105 IDE */ case PCI_DEVICE(0x10b8, 0x5229): /* ALi IDE */ + case PCI_DEVICE(0x1191, 0x0008): /* ACARD ATP865 */ return 1; } return 0;
CVS commit: src/lib/csu/arch/powerpc
Module Name:src Committed By: matt Date: Tue Feb 8 02:02:26 UTC 2011 Added Files: src/lib/csu/arch/powerpc: Makefile.inc crt0.S crtbegin.S crtend.S crti.S crtn.S Log Message: First pass at new crtstuff for powerpc. Doesn't quite work yet (obj parameter to ___start seems to get corrupted sometimes) To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/lib/csu/arch/powerpc/Makefile.inc \ src/lib/csu/arch/powerpc/crt0.S src/lib/csu/arch/powerpc/crtbegin.S \ src/lib/csu/arch/powerpc/crtend.S src/lib/csu/arch/powerpc/crti.S \ src/lib/csu/arch/powerpc/crtn.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/lib/csu/arch/powerpc/Makefile.inc diff -u /dev/null src/lib/csu/arch/powerpc/Makefile.inc:1.1 --- /dev/null Tue Feb 8 02:02:26 2011 +++ src/lib/csu/arch/powerpc/Makefile.inc Tue Feb 8 02:02:25 2011 @@ -0,0 +1,5 @@ +# $NetBSD: Makefile.inc,v 1.1 2011/02/08 02:02:25 matt Exp $ + +CPPFLAGS+= -DELFSIZE=32 + + Index: src/lib/csu/arch/powerpc/crt0.S diff -u /dev/null src/lib/csu/arch/powerpc/crt0.S:1.1 --- /dev/null Tue Feb 8 02:02:26 2011 +++ src/lib/csu/arch/powerpc/crt0.S Tue Feb 8 02:02:25 2011 @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include powerpc/asm.h + +RCSID($NetBSD: crt0.S,v 1.1 2011/02/08 02:02:25 matt Exp $) + +STRONG_ALIAS(_start,__start) + + .weak _SDA_BASE_ + .weak _SDA_BASE2_ + +ENTRY_NOPROFILE(__start) + /* SVR4 ABI says small data is in r13 */ + lis %r13,_SDA_BASE_@ha + addi %r13,%r13,_SDA_BASE_@l + + /* E[mbedded] ABI says small data is in r2 */ + lis %r2,_SDA_BASE2_@ha + addi %r2,%r2,_SDA_BASE2_@l + + b ___start +END(__start) Index: src/lib/csu/arch/powerpc/crtbegin.S diff -u /dev/null src/lib/csu/arch/powerpc/crtbegin.S:1.1 --- /dev/null Tue Feb 8 02:02:26 2011 +++ src/lib/csu/arch/powerpc/crtbegin.S Tue Feb 8 02:02:25 2011 @@ -0,0 +1,268 @@ +/* $NetBSD: crtbegin.S,v 1.1 2011/02/08 02:02:25 matt Exp $ */ +/*- + * Copyright (c) 2011 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of 3am Software Foundry. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS
CVS commit: src/lib/csu/common
Module Name:src Committed By: matt Date: Tue Feb 8 02:03:13 UTC 2011 Modified Files: src/lib/csu/common: crt0-common.c Log Message: Distinguish between a corrupt obj pointer and a null obj pointer. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/csu/common/crt0-common.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/csu/common/crt0-common.c diff -u src/lib/csu/common/crt0-common.c:1.1 src/lib/csu/common/crt0-common.c:1.2 --- src/lib/csu/common/crt0-common.c:1.1 Sat Aug 7 18:01:33 2010 +++ src/lib/csu/common/crt0-common.c Tue Feb 8 02:03:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: crt0-common.c,v 1.1 2010/08/07 18:01:33 joerg Exp $ */ +/* $NetBSD: crt0-common.c,v 1.2 2011/02/08 02:03:13 matt Exp $ */ /* * Copyright (c) 1998 Christos Zoulas @@ -36,7 +36,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: crt0-common.c,v 1.1 2010/08/07 18:01:33 joerg Exp $); +__RCSID($NetBSD: crt0-common.c,v 1.2 2011/02/08 02:03:13 matt Exp $); #include sys/types.h #include sys/syscall.h @@ -105,7 +105,9 @@ __ps_strings = ps_strings; if (_DYNAMIC != NULL) { - if ((obj == NULL) || (obj-magic != RTLD_MAGIC)) + if (obj == NULL) + _FATAL(NULL Obj_Entry pointer in GOT\n); + if (obj-magic != RTLD_MAGIC) _FATAL(Corrupt Obj_Entry pointer in GOT\n); if (obj-version != RTLD_VERSION) _FATAL(Dynamic linker version mismatch\n);
CVS commit: src/external/gpl2/lvm2
Module Name:src Committed By: haad Date: Tue Feb 8 03:26:13 UTC 2011 Modified Files: src/external/gpl2/lvm2/dist/libdm/ioctl: libdm-nbsd-iface.c libdm_netbsd.c src/external/gpl2/lvm2/lib/libdevmapper: libdm-netbsd.h src/external/gpl2/lvm2/sbin/dmsetup: Makefile src/external/gpl2/lvm2/sbin/lvm: Makefile Log Message: Switch libdevmapper library to use libdm as it;s backend lib and do not communicate with device-mapper directly. Our lvm stack now looks like this lvm-libdevmapper-libdm-dm where only libdm knows how our dm protocol looks like. No objections on tech-userlevel@. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 \ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c cvs rdiff -u -r1.6 -r1.7 \ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm_netbsd.c cvs rdiff -u -r1.1 -r1.2 \ src/external/gpl2/lvm2/lib/libdevmapper/libdm-netbsd.h cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/lvm2/sbin/dmsetup/Makefile cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/lvm2/sbin/lvm/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c diff -u src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10 src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.11 --- src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c:1.10 Wed Jan 12 08:16:23 2011 +++ src/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c Tue Feb 8 03:26:12 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: libdm-nbsd-iface.c,v 1.10 2011/01/12 08:16:23 haad Exp $*/ +/* $NetBSD: libdm-nbsd-iface.c,v 1.11 2011/02/08 03:26:12 haad Exp $*/ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. @@ -28,6 +28,7 @@ #include dirent.h #include limits.h +#include dm.h #include dev/dm/netbsd-dm.h #include dm-ioctl.h @@ -38,8 +39,8 @@ #endif /* - * Ensure build compatibility. - * The hard-coded versions here are the highest present + * Ensure build compatibility. + * The hard-coded versions here are the highest present * in the _cmd_data arrays. */ @@ -104,9 +105,9 @@ { nbsd_get_dm_major(major, DM_CHAR_MAJOR); - + *minor = 0; - + return 1; } @@ -185,7 +186,7 @@ uint32_t dm_major; nbsd_get_dm_major(dm_major, DM_BLOCK_MAJOR); - + if (major == dm_major) return 1; @@ -201,7 +202,7 @@ if (_control_fd != -1) return 1; -#ifdef RUMP_ACTION +#ifdef RUMP_ACTION rump_init(); #endif snprintf(control, sizeof(control), %s/control, dm_dir()); @@ -297,7 +298,7 @@ } /* - * Find out device-mapper's major version number the first time + * Find out device-mapper's major version number the first time * this is called and whether or not we support it. */ int dm_check_version(void) @@ -422,14 +423,14 @@ dev_t dev; size_t val_len,i; struct kinfo_drivers *kd; - + mode = 0; - + nbsd_get_dm_major(dm_major, DM_BLOCK_MAJOR); if (bufsize 8) return 0; - + if (sysctlbyname(kern.drivers,NULL,val_len,NULL,0) 0) { printf(sysctlbyname failed); return 0; @@ -451,7 +452,7 @@ break; } } - + dev = MKDEV(major,dev_minor); mode |= S_IFBLK; @@ -489,10 +490,10 @@ info-target_count = dmt-dmi.v4-target_count; info-open_count = dmt-dmi.v4-open_count; info-event_nr = dmt-dmi.v4-event_nr; - + nbsd_get_dm_major(info-major, DM_BLOCK_MAJOR); /* get netbsd dm device major number */ info-minor = MINOR(dmt-dmi.v4-dev); - + return 1; } @@ -657,44 +658,39 @@ } /* Parse given dm task structure to proplib dictionary. */ -static int _flatten(struct dm_task *dmt, prop_dictionary_t dm_dict) +static int _flatten(struct dm_task *dmt, libdm_task_t task) { - prop_array_t cmd_array; - prop_dictionary_t target_spec; - + libdm_cmd_t cmd; + libdm_table_t table; + struct target *t; - + size_t len; char type[DM_MAX_TYPE_NAME]; - + uint32_t major, flags; int count = 0; - const int (*version)[3]; - + flags = 0; - version = _cmd_data_v4[dmt-type].version; - cmd_array = prop_array_create(); + cmd = libdm_cmd_create(); for (t = dmt-head; t; t = t-next) { - target_spec = prop_dictionary_create(); - - prop_dictionary_set_uint64(target_spec,DM_TABLE_START,t-start); - prop_dictionary_set_uint64(target_spec,DM_TABLE_LENGTH,t-length); - strlcpy(type,t-type,DM_MAX_TYPE_NAME); - prop_dictionary_set_cstring(target_spec,DM_TABLE_TYPE,type); - prop_dictionary_set_cstring(target_spec,DM_TABLE_PARAMS,t-params); + table = libdm_table_create(); + + libdm_table_set_start(t-start, table); + libdm_table_set_length(t-length, table); + libdm_table_set_target(type, table); + libdm_table_set_params(t-params, table); + libdm_cmd_set_table(table, cmd); - prop_array_set(cmd_array,count,target_spec); + libdm_table_destroy(table); - prop_object_release(target_spec); - count++; } - if (count
CVS commit: src/usr.bin/make
Module Name:src Committed By: sjg Date: Tue Feb 8 05:29:13 UTC 2011 Modified Files: src/usr.bin/make: meta.c Log Message: tmplen should be static To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/meta.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/make/meta.c diff -u src/usr.bin/make/meta.c:1.6 src/usr.bin/make/meta.c:1.7 --- src/usr.bin/make/meta.c:1.6 Wed Dec 15 23:03:35 2010 +++ src/usr.bin/make/meta.c Tue Feb 8 05:29:13 2011 @@ -713,7 +713,7 @@ char *p; char *cp; size_t cwdlen; -size_t tmplen = 0; +static size_t tmplen = 0; FILE *fp; Boolean ignoreOODATE = FALSE; @@ -781,6 +781,10 @@ /* Delimit the record type. */ p = buf; +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, %s: %d: %s\n, fname, lineno, buf); +#endif strsep(p, ); if (f) { /* @@ -840,6 +844,10 @@ /* Skip past the pid. */ if (strsep(p, ) == NULL) continue; +#ifdef DEBUG_META_MODE + if (DEBUG(META)) + fprintf(debug_file, %s: %d: cwd=%s ldir=%s\n, fname, lineno, cwd, latestdir); +#endif break; } @@ -876,7 +884,7 @@ * they are _expected_ to change. */ if (strncmp(p, /tmp/, 5) == 0 || - strncmp(p, tmpdir, tmplen) == 0) + (tmplen 0 strncmp(p, tmpdir, tmplen) == 0)) break; if (strncmp(p, /var/, 5) == 0) @@ -919,12 +927,20 @@ sdirs[sdx++] = NULL; for (sdp = sdirs; *sdp !found; sdp++) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) +fprintf(debug_file, %s: %d: looking for: %s\n, fname, lineno, *sdp); +#endif if (stat(*sdp, fs) == 0) { found = 1; p = *sdp; } } if (found) { +#ifdef DEBUG_META_MODE + if (DEBUG(META)) +fprintf(debug_file, %s: %d: found: %s\n, fname, lineno, p); +#endif if (!S_ISDIR(fs.st_mode) fs.st_mtime gn-mtime) { if (DEBUG(META))
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: cliff Date: Tue Feb 8 06:01:09 UTC 2011 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: cpu.h Log Message: - re-define cpu_number() to now mean ci_index instead of ci_cpuid - re-define CPU_IS_PRIMARY() to use CPUF_PRIMARY instead of ci_cpuid To generate a diff of this commit: cvs rdiff -u -r1.90.16.33 -r1.90.16.34 src/sys/arch/mips/include/cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/cpu.h diff -u src/sys/arch/mips/include/cpu.h:1.90.16.33 src/sys/arch/mips/include/cpu.h:1.90.16.34 --- src/sys/arch/mips/include/cpu.h:1.90.16.33 Sat Feb 5 06:04:07 2011 +++ src/sys/arch/mips/include/cpu.h Tue Feb 8 06:01:08 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.90.16.33 2011/02/05 06:04:07 cliff Exp $ */ +/* $NetBSD: cpu.h,v 1.90.16.34 2011/02/08 06:01:08 cliff Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -199,8 +199,8 @@ #define curcpu() (curlwp-l_cpu) #define curpcb (curlwp-l_addr-u_pcb) #ifdef MULTIPROCESSOR -#define cpu_number() (curcpu()-ci_cpuid) -#define CPU_IS_PRIMARY(ci) ((ci)-ci_cpuid == 0) +#define cpu_number() (curcpu()-ci_index) +#define CPU_IS_PRIMARY(ci) ((ci)-ci_flags CPUF_PRIMARY) #else #define cpu_number() (0L) #endif
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Tue Feb 8 06:01:47 UTC 2011 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_subr.c Log Message: - add cpuid column to table displayed by cpu_debug_dump() To generate a diff of this commit: cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/sys/arch/mips/mips/cpu_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/arch/mips/mips/cpu_subr.c diff -u src/sys/arch/mips/mips/cpu_subr.c:1.1.2.14 src/sys/arch/mips/mips/cpu_subr.c:1.1.2.15 --- src/sys/arch/mips/mips/cpu_subr.c:1.1.2.14 Sat Feb 5 06:06:11 2011 +++ src/sys/arch/mips/mips/cpu_subr.c Tue Feb 8 06:01:47 2011 @@ -33,7 +33,7 @@ #include opt_multiprocessor.h #include opt_sa.h -__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.1.2.14 2011/02/05 06:06:11 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: cpu_subr.c,v 1.1.2.15 2011/02/08 06:01:47 cliff Exp $); #include sys/param.h #include sys/cpu.h @@ -816,17 +816,17 @@ struct cpu_info *ci; char running, hatched, paused, resumed, halted; - db_printf(CPU STATE CPUINFOCPL INT MTX IPIS\n); + db_printf(CPU CPUID STATE CPUINFOCPL INT MTX IPIS\n); for (CPU_INFO_FOREACH(cii, ci)) { hatched = (CPUSET_HAS(cpus_hatched, cpu_index(ci)) ? 'H' : '-'); running = (CPUSET_HAS(cpus_running, cpu_index(ci)) ? 'R' : '-'); paused = (CPUSET_HAS(cpus_paused, cpu_index(ci)) ? 'P' : '-'); resumed = (CPUSET_HAS(cpus_resumed, cpu_index(ci)) ? 'r' : '-'); halted = (CPUSET_HAS(cpus_halted, cpu_index(ci)) ? 'h' : '-'); - db_printf(%3d %c%c%c%c%c %p + db_printf(%3d 0x%03lx %c%c%c%c%c %p %3d %3d %3d 0x%02 PRIx64 /0x%02 PRIx64 \n, - cpu_index(ci), + cpu_index(ci), ci-ci_cpuid, running, hatched, paused, resumed, halted, ci, ci-ci_cpl, ci-ci_idepth, ci-ci_mtx_count, ci-ci_active_ipis, ci-ci_request_ipis);
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Feb 8 06:03:01 UTC 2011 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpu.c Log Message: - renamed cpu_rmixl_attach_once() to cpu_rmixl_attach_primary() (more clear) - cpu_rmixl_attach_primary() obtains ci_cpuid from COP0 EBASE reg instead of assuming always cpuid==0 - in cpu_rmixl_attach(), first call of the function determines we are attaching primary cpu, instead of asuming core0 thread0 is always the primary cpu - cpu_fmn_intr() uses CPU_IS_PRIMARY() instead of asuming cpu_number()==0 always indicates the primary cpu - debug function rmixl_cpuinfo_print() argument is now a cpu index, not cpuid To generate a diff of this commit: cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/sys/arch/mips/rmi/rmixl_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/mips/rmi/rmixl_cpu.c diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.17 src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.18 --- src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.17 Sat Feb 5 06:10:29 2011 +++ src/sys/arch/mips/rmi/rmixl_cpu.c Tue Feb 8 06:03:01 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_cpu.c,v 1.1.2.17 2011/02/05 06:10:29 cliff Exp $ */ +/* $NetBSD: rmixl_cpu.c,v 1.1.2.18 2011/02/08 06:03:01 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -38,7 +38,7 @@ #include locators.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.1.2.17 2011/02/05 06:10:29 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.1.2.18 2011/02/08 06:03:01 cliff Exp $); #include opt_multiprocessor.h #include opt_ddb.h @@ -70,7 +70,7 @@ static int cpu_rmixl_match(device_t, cfdata_t, void *); static void cpu_rmixl_attach(device_t, device_t, void *); -static void cpu_rmixl_attach_once(struct rmixl_cpu_softc * const); +static void cpu_rmixl_attach_primary(struct rmixl_cpu_softc * const); #ifdef NOTYET static int cpu_fmn_intr(void *, rmixl_fmn_rxmsg_t *); #endif @@ -87,7 +87,7 @@ #ifdef DEBUG void rmixl_cpu_data_print(struct cpu_data *); struct cpu_info * - rmixl_cpuinfo_print(cpuid_t); + rmixl_cpuinfo_print(u_int); #endif /* DEBUG */ CFATTACH_DECL_NEW(cpu_rmixl, sizeof(struct rmixl_cpu_softc), @@ -170,16 +170,19 @@ struct rmixl_cpu_softc * const sc = device_private(self); struct cpucore_attach_args *ca = aux; struct cpu_info *ci = NULL; + static bool once = false; extern void rmixl_spl_init_cpu(void); - - if (ca-ca_thread == 0 ca-ca_core == 0) { + + if (once == false) { + /* first attach is the primary cpu */ + once = true; ci = curcpu(); sc-sc_dev = self; sc-sc_ci = ci; ci-ci_softc = (void *)sc; rmixl_spl_init_cpu(); /* spl initialization for CPU#0 */ - cpu_rmixl_attach_once(sc); + cpu_rmixl_attach_primary(sc); #ifdef MULTIPROCESSOR mips_locoresw.lsw_cpu_init = cpu_rmixl_hatch; @@ -232,15 +235,22 @@ cpu_attach_common(self, ci); } +/* + * attach the primary processor + */ static void -cpu_rmixl_attach_once(struct rmixl_cpu_softc * const sc) +cpu_rmixl_attach_primary(struct rmixl_cpu_softc * const sc) { - static bool once = false; + struct cpu_info *ci = sc-sc_ci; + uint32_t ebase; + + KASSERT(CPU_IS_PRIMARY(ci)); - KASSERT(once != true); - if (once == true) - return; - once = true; + /* + * obtain and set cpuid of the primary processor + */ + asm volatile(dmfc0 %0, $15, 1; : =r(ebase)); + ci-ci_cpuid = ebase __BITS(9,0); #if defined(DDB) defined(MIPS_DDB_WATCH) cpu_rmixl_db_watch_init(); @@ -268,8 +278,8 @@ static int cpu_fmn_intr(void *arg, rmixl_fmn_rxmsg_t *rxmsg) { - if (cpu_number() == 0) { - printf(%s: cpu %ld: rxsid=%#x, code=%d, size=%d\n, + if (CPU_IS_PRIMARY(curcpu())) { + printf(%s: cpu%ld: rxsid=%#x, code=%d, size=%d\n, __func__, cpu_number(), rxmsg-rxsid, rxmsg-code, rxmsg-size); for (int i=0; i rxmsg-size; i++) @@ -426,9 +436,9 @@ } struct cpu_info * -rmixl_cpuinfo_print(cpuid_t cpuid) +rmixl_cpuinfo_print(u_int cpuindex) { - struct cpu_info * const ci = cpu_lookup(cpuid); + struct cpu_info * const ci = cpu_lookup(cpuindex); if (ci != NULL) { rmixl_cpu_data_print(ci-ci_data);
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Feb 8 06:03:56 UTC 2011 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_fmn.c Log Message: - eliminate assumptions that cpuid 0 is primary - distinguish between cpuid and cpu index. To generate a diff of this commit: cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/rmi/rmixl_fmn.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/mips/rmi/rmixl_fmn.c diff -u src/sys/arch/mips/rmi/rmixl_fmn.c:1.1.2.5 src/sys/arch/mips/rmi/rmixl_fmn.c:1.1.2.6 --- src/sys/arch/mips/rmi/rmixl_fmn.c:1.1.2.5 Sat Feb 5 06:11:16 2011 +++ src/sys/arch/mips/rmi/rmixl_fmn.c Tue Feb 8 06:03:56 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_fmn.c,v 1.1.2.5 2011/02/05 06:11:16 cliff Exp $ */ +/* $NetBSD: rmixl_fmn.c,v 1.1.2.6 2011/02/08 06:03:56 cliff Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. * All rights reserved. @@ -32,6 +32,7 @@ #include sys/cdefs.h #include sys/param.h +#include sys/systm.h #include sys/cpu.h #include mips/cpuregs.h #include mips/rmi/rmixlreg.h @@ -404,8 +405,9 @@ fmn_t *fmnp; static bool once=false; - KASSERT(cpu_number() == 0); - fmnp = fmn_lookup(cpu_number()); + KASSERTMSG((CPU_IS_PRIMARY(curcpu())), (ci=%p, index=%d\n, + curcpu(), cpu_index(curcpu(; + fmnp = fmn_lookup(curcpu()-ci_cpuid); if (once == true) panic(%s: call only once!, __func__); @@ -480,10 +482,10 @@ fmn_t *fmnp; kmutex_t *lk; - fmnp = fmn_lookup(cpu_number()); + fmnp = fmn_lookup(curcpu()-ci_cpuid); KASSERT(fmnp != NULL); - KASSERT(fmnp-fmn_core == RMIXL_CPU_CORE(cpu_number())); - KASSERT(fmnp-fmn_thread == RMIXL_CPU_THREAD(cpu_number())); + KASSERT(fmnp-fmn_core == RMIXL_CPU_CORE(curcpu()-ci_cpuid)); + KASSERT(fmnp-fmn_thread == RMIXL_CPU_THREAD(curcpu()-ci_cpuid)); lk = mutex_obj_alloc(MUTEX_DEFAULT, RMIXL_FMN_INTR_IPL); if (lk == NULL) @@ -633,7 +635,7 @@ { fmn_t *fmnp; - fmnp = fmn_lookup(cpu_number()); + fmnp = fmn_lookup(curcpu()-ci_cpuid); mutex_enter(fmnp-fmn_lock); for (int i=0; i fmnp-fmn_nstid; i++) @@ -665,7 +667,7 @@ fmn_t *fmnp; fmn_intrhand_t *ih; - fmnp = fmn_lookup(cpu_number()); + fmnp = fmn_lookup(curcpu()-ci_cpuid); mutex_enter(fmnp-fmn_lock); @@ -692,7 +694,7 @@ fmn_t *fmnp; fmn_intrhand_t *ih = cookie; - fmnp = fmn_lookup(cpu_number()); + fmnp = fmn_lookup(curcpu()-ci_cpuid); mutex_enter(fmnp-fmn_lock); if (ih-ih_func != NULL) { @@ -786,7 +788,7 @@ KASSERT(code = 0xff); KASSERT(dest_id = 0xff); - fmnp = fmn_lookup(cpu_number()); + fmnp = fmn_lookup(curcpu()-ci_cpuid); mutex_enter(fmnp-fmn_lock); cp0_status = rmixl_cp2_enable(); @@ -821,13 +823,13 @@ goto send; DELAY(10); /* XXX ??? */ } - DIAG_PRF((%s: cpu=%ld, msg %p, dst_id=%d, sts=%#x: can't send\n, + DIAG_PRF((%s: cpu%d, msg %p, dst_id=%d, sts=%#x: can't send\n, __func__, cpu_number(), msg, dest_id, msg_status)); rv = -1; goto out; send: desc = RMIXL_MSGSND_DESC(size, code, dest_id); - DPRINTF((%s: cpu %ld, desc %#x\n, __func__, cpu_number(), desc)); + DPRINTF((%s: cpu%d, desc %#x\n, __func__, cpu_number(), desc)); for (int try=16; try--; ) { rmixl_msgsnd(desc); RMIXL_MFC2(RMIXL_COP_2_MSG_STS, 0, msg_status); @@ -853,7 +855,7 @@ RMIXL_MTC2(RMIXL_COP_2_MSG_STS, 1, msg_status1); } DIAG_PRF((%s: src=%ld, dst=%d, sts=%#x, %#x: send error, try %d\n, - __func__, cpu_number(), dest_id, msg_status, msg_status1, try)); + __func__, curcpu()-ci_cpuid, dest_id, msg_status, msg_status1, try)); DELAY(10); } rv = -1; @@ -876,7 +878,7 @@ fmn_t *fmnp; int rv; - fmnp = fmn_lookup(cpu_number()); + fmnp = fmn_lookup(curcpu()-ci_cpuid); mutex_enter(fmnp-fmn_lock); rv = rmixl_fmn_msg_recv_subr(bucket, rxmsg); mutex_exit(fmnp-fmn_lock); @@ -897,7 +899,7 @@ uint32_t msg_status; int rv; - fmnp = fmn_lookup(cpu_number()); + fmnp = fmn_lookup(curcpu()-ci_cpuid); KASSERT(mutex_owned(fmnp-fmn_lock) != 0); for (int try=16; try--; ) { @@ -905,14 +907,14 @@ if ((msg_status (RMIXL_MSG_STS0_LPF)) == 0) goto recv; } - DIAG_PRF((%s: cpu=%ld, bucket=%d, sts=%#x: Load Pending Fail\n, + DIAG_PRF((%s: cpu%d, bucket=%d, sts=%#x: Load Pending Fail\n, __func__, cpu_number(), bucket, msg_status)); rv = -1; goto out; recv: rmixl_msgld(bucket); RMIXL_MFC2(RMIXL_COP_2_MSG_STS, 0, msg_status); - DPRINTF((%s: cpu=%ld, bucket=%d, sts=%#x\n, + DPRINTF((%s: cpu%d, bucket=%d, sts=%#x\n, __func__, cpu_number(), bucket, msg_status)); rv = msg_status (RMIXL_MSG_STS0_LEF|RMIXL_MSG_STS0_LPF); if (rv == 0) { @@ -1146,7 +1148,7 @@ FMN_CP2_4SEL_READ(RMIXL_COP_2_CREDITS+3, 0, cc[3][0]); FMN_CP2_4SEL_READ(RMIXL_COP_2_CREDITS+3, 4, cc[3][4]); - printf(%s: cpu %ld\n, __func__, cpu_number()); + printf(%s: cpu%d\n, __func__, cpu_number()); for (int i=0; i 4; i++) { for (int j=0; j 8; j++) printf( %#x,, cc[i][j]);
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Feb 8 06:04:20 UTC 2011 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c Log Message: - distinguish between cpuid and cpu index. To generate a diff of this commit: cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/sys/arch/mips/rmi/rmixl_intr.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/mips/rmi/rmixl_intr.c diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.25 src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.26 --- src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.25 Sat Feb 5 06:11:47 2011 +++ src/sys/arch/mips/rmi/rmixl_intr.c Tue Feb 8 06:04:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_intr.c,v 1.1.2.25 2011/02/05 06:11:47 cliff Exp $ */ +/* $NetBSD: rmixl_intr.c,v 1.1.2.26 2011/02/08 06:04:20 cliff Exp $ */ /*- * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.25 2011/02/05 06:11:47 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.26 2011/02/08 06:04:20 cliff Exp $); #include opt_multiprocessor.h #include opt_ddb.h @@ -508,8 +508,8 @@ device_xname(sc-sc_dev), rmixl_intr_string(vec)); - KASSERT(ci-ci_cpuid (sizeof(cpu_present_mask) * 8)); - atomic_or_32((volatile uint32_t *)cpu_present_mask, 1 ci-ci_cpuid); + KASSERT(cpu_index(ci) (sizeof(cpu_present_mask) * 8)); + atomic_or_32((volatile uint32_t *)cpu_present_mask, 1 cpu_index(ci)); } /* @@ -955,9 +955,9 @@ static int rmixl_send_ipi(struct cpu_info *ci, int tag) { - const cpuid_t cpu = ci-ci_cpuid; - uint32_t core = (uint32_t)(cpu 2); - uint32_t thread = (uint32_t)(cpu __BITS(1,0)); + const cpuid_t cpuid = ci-ci_cpuid; + uint32_t core = (uint32_t)(cpuid 2); + uint32_t thread = (uint32_t)(cpuid __BITS(1,0)); uint64_t req = 1 tag; uint32_t r; extern volatile mips_cpuset_t cpus_running;
CVS commit: [matt-nb5-mips64] src/sys/kern
Module Name:src Committed By: cliff Date: Tue Feb 8 06:05:00 UTC 2011 Modified Files: src/sys/kern [matt-nb5-mips64]: subr_autoconf.c Log Message: - add config_queues_lock to serialize access to deferred_config_queue and interrupt_config_queue for adds, deletes and (those DIAGNOSTIC) searches - add dc_funcs_lock to serialize dispatch of deferred config functions many (all?) of which may not be MP safe. To generate a diff of this commit: cvs rdiff -u -r1.163.4.2.4.1 -r1.163.4.2.4.2 src/sys/kern/subr_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/kern/subr_autoconf.c diff -u src/sys/kern/subr_autoconf.c:1.163.4.2.4.1 src/sys/kern/subr_autoconf.c:1.163.4.2.4.2 --- src/sys/kern/subr_autoconf.c:1.163.4.2.4.1 Sat Feb 5 06:00:14 2011 +++ src/sys/kern/subr_autoconf.c Tue Feb 8 06:04:59 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_autoconf.c,v 1.163.4.2.4.1 2011/02/05 06:00:14 cliff Exp $ */ +/* $NetBSD: subr_autoconf.c,v 1.163.4.2.4.2 2011/02/08 06:04:59 cliff Exp $ */ /* * Copyright (c) 1996, 2000 Christopher G. Demetriou @@ -77,7 +77,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_autoconf.c,v 1.163.4.2.4.1 2011/02/05 06:00:14 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_autoconf.c,v 1.163.4.2.4.2 2011/02/08 06:04:59 cliff Exp $); #include opt_multiprocessor.h #include opt_ddb.h @@ -198,6 +198,21 @@ TAILQ_HEAD(deferred_config_head, deferred_config); +/* + * config_queues_lock protects MP access to + * - deferred_config_queue + * - interrupt_config_queue + * is held for short durations, and is initialized to spin + */ +static kmutex_t config_queues_lock; + +/* + * dc_funcs_lock ensures the driver dc_func's are not called concurrently + * many (most?) are not MP safe + * is held for unknown durations, and is initialized to sleep + */ +static kmutex_t dc_funcs_lock; + struct deferred_config_head deferred_config_queue = TAILQ_HEAD_INITIALIZER(deferred_config_queue); struct deferred_config_head interrupt_config_queue = @@ -361,6 +376,10 @@ mutex_init(config_misc_lock, MUTEX_DEFAULT, IPL_NONE); cv_init(config_misc_cv, cfgmisc); + mutex_init(dc_funcs_lock, MUTEX_DEFAULT, IPL_SOFTNET); + + mutex_init(config_queues_lock, MUTEX_DEFAULT, IPL_VM); + /* allcfdrivers is statically initialized. */ for (i = 0; cfdriver_list_initial[i] != NULL; i++) { if (config_cfdriver_attach(cfdriver_list_initial[i]) != 0) @@ -397,12 +416,19 @@ { struct deferred_config *dc; + mutex_enter(config_queues_lock); while ((dc = TAILQ_FIRST(interrupt_config_queue)) != NULL) { TAILQ_REMOVE(interrupt_config_queue, dc, dc_queue); + mutex_exit(config_queues_lock); + mutex_enter(dc_funcs_lock); (*dc-dc_func)(dc-dc_dev); + mutex_exit(dc_funcs_lock); kmem_free(dc, sizeof(*dc)); config_pending_decr(); + mutex_enter(config_queues_lock); } + mutex_exit(config_queues_lock); + kthread_exit(0); } @@ -1651,11 +1677,13 @@ panic(config_defer: can't defer config of a root device); #ifdef DIAGNOSTIC + mutex_enter(config_queues_lock); for (dc = TAILQ_FIRST(deferred_config_queue); dc != NULL; dc = TAILQ_NEXT(dc, dc_queue)) { if (dc-dc_dev == dev) panic(config_defer: deferred twice); } + mutex_exit(config_queues_lock); #endif dc = kmem_alloc(sizeof(*dc), kmflags); @@ -1664,7 +1692,11 @@ dc-dc_dev = dev; dc-dc_func = func; + + mutex_enter(config_queues_lock); TAILQ_INSERT_TAIL(deferred_config_queue, dc, dc_queue); + mutex_exit(config_queues_lock); + config_pending_incr(); } @@ -1687,11 +1719,13 @@ } #ifdef DIAGNOSTIC + mutex_enter(config_queues_lock); for (dc = TAILQ_FIRST(interrupt_config_queue); dc != NULL; dc = TAILQ_NEXT(dc, dc_queue)) { if (dc-dc_dev == dev) panic(config_interrupts: deferred twice); } + mutex_exit(config_queues_lock); #endif dc = kmem_alloc(sizeof(*dc), kmflags); @@ -1700,7 +1734,9 @@ dc-dc_dev = dev; dc-dc_func = func; + mutex_enter(config_queues_lock); TAILQ_INSERT_TAIL(interrupt_config_queue, dc, dc_queue); + mutex_exit(config_queues_lock); config_pending_incr(); } @@ -1713,15 +1749,21 @@ { struct deferred_config *dc, *ndc; + mutex_enter(config_queues_lock); for (dc = TAILQ_FIRST(queue); dc != NULL; dc = ndc) { ndc = TAILQ_NEXT(dc, dc_queue); if (parent == NULL || dc-dc_dev-dv_parent == parent) { TAILQ_REMOVE(queue, dc, dc_queue); + mutex_exit(config_queues_lock); + mutex_enter(dc_funcs_lock); (*dc-dc_func)(dc-dc_dev); + mutex_exit(dc_funcs_lock); kmem_free(dc, sizeof(*dc)); config_pending_decr(); + mutex_enter(config_queues_lock); } } + mutex_exit(config_queues_lock); } /*
CVS commit: src/sys/arch/powerpc
Module Name:src Committed By: matt Date: Tue Feb 8 06:14:50 UTC 2011 Modified Files: src/sys/arch/powerpc/oea: altivec.c src/sys/arch/powerpc/powerpc: fpu.c Log Message: Powerpc send_ipi use ci_cpuid, not cpu_index To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/powerpc/oea/altivec.c cvs rdiff -u -r1.27 -r1.28 src/sys/arch/powerpc/powerpc/fpu.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/powerpc/oea/altivec.c diff -u src/sys/arch/powerpc/oea/altivec.c:1.20 src/sys/arch/powerpc/oea/altivec.c:1.21 --- src/sys/arch/powerpc/oea/altivec.c:1.20 Sun Jan 23 17:36:09 2011 +++ src/sys/arch/powerpc/oea/altivec.c Tue Feb 8 06:14:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: altivec.c,v 1.20 2011/01/23 17:36:09 matt Exp $ */ +/* $NetBSD: altivec.c,v 1.21 2011/02/08 06:14:50 matt Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: altivec.c,v 1.20 2011/01/23 17:36:09 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: altivec.c,v 1.21 2011/02/08 06:14:50 matt Exp $); #include opt_multiprocessor.h @@ -177,7 +177,7 @@ if ((l-l_md.md_flags MDLWP_OWNVEC) == 0) return; - ppc_send_ipi(l-l_md.md_veccpu-ci_index, PPC_IPI_FLUSH_VEC); + ppc_send_ipi(l-l_md.md_veccpu-ci_cpuid, PPC_IPI_FLUSH_VEC); /* Wait for flush. */ for (u_int i = 0; i 0x3fff; i++) { Index: src/sys/arch/powerpc/powerpc/fpu.c diff -u src/sys/arch/powerpc/powerpc/fpu.c:1.27 src/sys/arch/powerpc/powerpc/fpu.c:1.28 --- src/sys/arch/powerpc/powerpc/fpu.c:1.27 Sun Jan 23 17:36:09 2011 +++ src/sys/arch/powerpc/powerpc/fpu.c Tue Feb 8 06:14:50 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.27 2011/01/23 17:36:09 matt Exp $ */ +/* $NetBSD: fpu.c,v 1.28 2011/02/08 06:14:50 matt Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.27 2011/01/23 17:36:09 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.28 2011/02/08 06:14:50 matt Exp $); #include opt_multiprocessor.h @@ -139,7 +139,7 @@ if (fpucpu == NULL) return; - ppc_send_ipi(fpucpu-ci_index, PPC_IPI_FLUSH_FPU); + ppc_send_ipi(fpucpu-ci_cpuid, PPC_IPI_FLUSH_FPU); /* Wait for flush. */ for (u_int i = 0; i 0x3fff; i++) {
CVS commit: src/sys/arch/powerpc/include/booke
Module Name:src Committed By: matt Date: Tue Feb 8 06:16:59 UTC 2011 Modified Files: src/sys/arch/powerpc/include/booke: e500reg.h Log Message: Add some P2020 / MPC856x definitions. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/booke/e500reg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/include/booke/e500reg.h diff -u src/sys/arch/powerpc/include/booke/e500reg.h:1.2 src/sys/arch/powerpc/include/booke/e500reg.h:1.3 --- src/sys/arch/powerpc/include/booke/e500reg.h:1.2 Tue Jan 18 01:02:54 2011 +++ src/sys/arch/powerpc/include/booke/e500reg.h Tue Feb 8 06:16:59 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: e500reg.h,v 1.2 2011/01/18 01:02:54 matt Exp $ */ +/* $NetBSD: e500reg.h,v 1.3 2011/02/08 06:16:59 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -77,8 +77,8 @@ #endif /* GPIO_PRIVATE */ #define PCIE1_BASE 0x0a000 -#define PCIE2_MPC8572_BASE 0x09000 -#define PCIE3_MPC8572_BASE 0x08000 +#define PCIE2_MPC8572_BASE 0x09000 /* P2020 too */ +#define PCIE3_MPC8572_BASE 0x08000 /* P2020 too */ #define PCIX1_MPC8548_BASE 0x08000 #define PCIX2_MPC8548_BASE 0x09000 #define PCIE2_MPC8544_BASE 0x09000 /* MPC8536 too */ @@ -292,6 +292,8 @@ /* Power-On Reset Configuration Values */ #define PORPLLSR 0x000 /* POR PLL ratio status register */ +#define E500_RATIO2 __PPCBITS(2,7) +#define E500_RATIO2_GET(n) __SHIFTOUT(n, E500_RATIO2) #define E500_RATIO __PPCBITS(10,15) #define E500_RATIO_GET(n) __SHIFTOUT(n, E500_RATIO) #define PCI1_CLK_SEL __PPCBIT(16) @@ -299,6 +301,7 @@ #define PLAT_RATIO __PPCBITS(26,30) #define PLAT_RATIO_GET(n) __SHIFTOUT(n, PLAT_RATIO) #define PORBMSR 0x004 /* POR boot mode status register */ +#define PORBMSR_BCFG __PPCBITS(0,1) #define PORBMSR_HA __PPCBITS(13,15) #define PORBMSR_HA_GET(n) __SHIFTOUT(m, PORBMSR_HA) #define PORBMSR_HA_PEXSRIO_AGENT 0 /* PCI Express SRIO agent mode */ @@ -349,6 +352,13 @@ #define IOSEL_MPC8572_SRIO3125 13 #define IOSEL_MPC8572_SRIO1250 14 #define IOSEL_MPC8572_PCIE1_X8 15 +#define IOSEL_P20x0_PCIE1_X1 0 +#define IOSEL_P20x0_PCIE12_X1_3_X2 2 +#define IOSEL_P20x0_PCIE13_X2 4 +#define IOSEL_P20x0_PCIE1_X4 6 +#define IOSEL_P20x0_PCIE1_X1_SRIO12500_1X 13 +#define IOSEL_P20x0_PCIE12_X1_SGMII23 14 +#define IOSEL_P20x0_PCIE1_X2_SGMII23 15 #define PORDEVSR_PCI2_ARB __PPCBIT(13) #define PORDEVSR_PCI1_ARB __PPCBIT(14) #define PORDEVSR_PCI32 __PPCBIT(15) @@ -411,16 +421,18 @@ #define DEVDISR_TLU1 __PPCBIT(9) #define DEVDISR_USB2 __PPCBIT(9) /* MPC8536 */ #define DEVDISR_TLU2 __PPCBIT(10) +#define DEVDISR_ESDHC_10 __PPCBIT(10) #define DEVDISR_USB3 __PPCBIT(10) /* MPC8536 */ #define DEVDISR_L2 __PPCBIT(11) /* MPC8536 */ #define DEVDISR_SRIO __PPCBIT(12) -#define DEVDISR_ESDHC __PPCBIT(12) /* MPC8536 */ +#define DEVDISR_ESDHC_12 __PPCBIT(12) /* MPC8536 */ #define DEVDISR_RMSG __PPCBIT(13) #define DEVDISR_SATA1 __PPCBIT(13) /* MPC8536 */ -#define DEVDISR_DDR2 __PPCBIT(14) -#define DEVDISR_DDR __PPCBIT(15) -#define DEVDISR_SPI __PPCBIT(15) /* MPC8536 */ +#define DEVDISR_DDR2_14 __PPCBIT(14) +#define DEVDISR_DDR_15 __PPCBIT(15) +#define DEVDISR_SPI_15 __PPCBIT(15) /* MPC8536 */ #define DEVDISR_E500 __PPCBIT(16) +#define DEVDISR_DDR_16 __PPCBIT(16) /* MPC8536 */ #define DEVDISR_TB __PPCBIT(17) #define DEVDISR_E500_1 __PPCBIT(18) #define DEVDISR_TB_1 __PPCBIT(19) @@ -433,6 +445,7 @@ #define DEVDISR_TSEC3 __PPCBIT(26) #define DEVDISR_TSEC4 __PPCBIT(27) #define DEVDISR_FEC __PPCBIT(28) +#define DEVDISR_SPI_28 __PPCBIT(28) /* P2020 */ #define DEVDISR_I2C __PPCBIT(29) #define DEVDISR_DUART __PPCBIT(30) #define DEVDISR_SRDS1 __PPCBIT(31) /* MPC8536 */
CVS commit: src/sys/arch/powerpc/include/booke
Module Name:src Committed By: matt Date: Tue Feb 8 06:18:05 UTC 2011 Modified Files: src/sys/arch/powerpc/include/booke: spr.h Log Message: Add more MPC85xx SVRs. Fix/add debug register definitions. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/include/booke/spr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/include/booke/spr.h diff -u src/sys/arch/powerpc/include/booke/spr.h:1.3 src/sys/arch/powerpc/include/booke/spr.h:1.4 --- src/sys/arch/powerpc/include/booke/spr.h:1.3 Tue Jan 18 01:02:54 2011 +++ src/sys/arch/powerpc/include/booke/spr.h Tue Feb 8 06:18:04 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: spr.h,v 1.3 2011/01/18 01:02:54 matt Exp $ */ +/* $NetBSD: spr.h,v 1.4 2011/02/08 06:18:04 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -39,13 +39,14 @@ #define PVR_MPCe500 0x8020 #define PVR_MPCe500v2 0x8021 + #define SVR_MPC8548v1 0x80310010 -#define SVR_MPC8543v1 0x80320010 #define SVR_MPC8548v1plus 0x80310011 -#define SVR_MPC8543v1plus 0x80320011 #define SVR_MPC8548v2 0x80310020 #define SVR_MPC8547v2 0x80310120 #define SVR_MPC8545v2 0x80310220 +#define SVR_MPC8543v1 0x80320010 +#define SVR_MPC8543v1plus 0x80320011 #define SVR_MPC8543v2 0x80320020 #define SVR_MPC8544v1 0x80340110 @@ -56,7 +57,14 @@ #define SVR_MPC8555v1 0x80710110 #define SVR_MPC8541v1 0x80720111 -#define SVR_MPC8572 0x80e00011 +#define SVR_MPC8567v1 0x80750111 +#define SVR_MPC8568v1 0x80750011 + +#define SVR_MPC8572v1 0x80e00011 + +#define SVR_P2020v2 0x80e20020 +#define SVR_P2010v2 0x80e30020 + #define SVR_SECURITY_P(svr) (((svr) 0x0008) != 0) /* @@ -109,8 +117,12 @@ #define DBSR_BRT 0x0400 /* 5: Branch Taken debug event */ #define DBSR_IRPT 0x0200 /* 6: Interrupt Taken debug event */ #define DBSR_TRAP 0x0100 /* 7: Trap Instruction debug event */ +#define DBSR_IAC 0x00f0 /* 8-11: IAC debug event */ #define DBSR_IAC1 0x0080 /* 8: IAC1 debug event */ #define DBSR_IAC2 0x0040 /* 9: IAC2 debug event */ +#define DBSR_IAC3 0x0020 /* 10: IAC3 debug event */ +#define DBSR_IAC4 0x0010 /* 11: IAC4 debug event */ +#define DBSR_DAC 0x000f /* 12-15: DAC debug event */ #define DBSR_DAC1R 0x0008 /* 12: DAC1 Read debug event */ #define DBSR_DAC1W 0x0004 /* 13: DAC1 Write debug event */ #define DBSR_DAC2R 0x0002 /* 14: DAC2 Read debug event */ @@ -124,49 +136,114 @@ #define DBCR0_RST_CORE 0x1000 /* Core reset */ #define DBCR0_RST_CHIP 0x2000 /* Chip reset */ #define DBCR0_RST_SYSTEM 0x3000 /* System reset */ -#define DBCR0_IC 0x0800 /* 4: Instruction Completion debug event */ -#define DBCR0_BT 0x0400 /* 5: Branch Taken debug event */ -#define DBCR0_EDE 0x0200 /* 6: Exception Debug Event */ -#define DBCR0_TDE 0x0100 /* 7: Trap Debug Event */ +#define DBCR0_ICMP 0x0800 /* 4: Instruction Completion debug event */ +#define DBCR0_BRT 0x0400 /* 5: Branch Taken debug event */ +#define DBCR0_IRPT 0x0200 /* 6: Interrupt Taken debug event */ +#define DBCR0_TRAP 0x0100 /* 7: Trap Instruction Debug Event */ #define DBCR0_IA1 0x0080 /* 8: IAC (Instruction Address Compare) 1 debug event */ #define DBCR0_IA2 0x0040 /* 9: IAC 2 debug event */ -#define DBCR0_IA12 0x0020 /* 10: Instruction Address Range Compare 1-2 */ -#define DBCR0_IA12X 0x0010 /* 11: IA12 eXclusive */ -#define DBCR0_IA3 0x0008 /* 12: IAC 3 debug event */ -#define DBCR0_DAC1_LOAD 0x0008 /* 12: DAC (Data Address Compare) 1 load event (e500) */ -#define DBCR0_IA4 0x0004 /* 13: IAC 4 debug event */ -#define DBCR0_DAC1_STORE 0x0004 /* 13: DAC (Data Address Compare) 1 store event (e500) */ -#define DBCR0_IA34 0x0002 /* 14: Instruction Address Range Compare 3-4 */ -#define DBCR0_DAC2_LOAD 0x0002 /* 14: DAC 2 load event (e500) */ -#define DBCR0_IA34X 0x0001 /* 15: IA34 eXclusive */ -#define DBCR0_DAC2_STORE 0x0001 /* 15: DAC 2 store event (e500) */ -#define DBCR0_IA12T 0x8000 /* 16: Instruction Address Range Compare 1-2 range Toggle */ -#define DBCR0_RET 0x8000 /* 16: Return debug event (e500) */ -#define DBCR0_IA34T 0x4000 /* 17: Instruction Address Range Compare 3-4 range Toggle */ +#define DBCR0_IA3 0x0020 /* 10: IAC 3 debug event */ +#define DBCR0_IA4 0x0010 /* 11: IAC 4 debug event */ +#define DBCR0_DAC1_LOAD 0x0008 /* 12: DAC (Data Address Compare) 1 load event */ +#define DBCR0_DAC1_STORE 0x0004 /* 13: DAC (Data Address Compare) 1 store event */ +#define DBCR0_DAC2_LOAD 0x0002 /* 14: DAC 2 load event */
CVS commit: src/sys/arch/powerpc/booke/pci
Module Name:src Committed By: matt Date: Tue Feb 8 06:19:13 UTC 2011 Modified Files: src/sys/arch/powerpc/booke/pci: pq3pci.c Log Message: Add P2020/P2010 truth table definition. Remove trailing whitespace. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/booke/pci/pq3pci.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/powerpc/booke/pci/pq3pci.c diff -u src/sys/arch/powerpc/booke/pci/pq3pci.c:1.2 src/sys/arch/powerpc/booke/pci/pq3pci.c:1.3 --- src/sys/arch/powerpc/booke/pci/pq3pci.c:1.2 Tue Jan 18 01:02:53 2011 +++ src/sys/arch/powerpc/booke/pci/pq3pci.c Tue Feb 8 06:19:13 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pq3pci.c,v 1.2 2011/01/18 01:02:53 matt Exp $ */ +/* $NetBSD: pq3pci.c,v 1.3 2011/02/08 06:19:13 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -44,7 +44,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pq3pci.c,v 1.2 2011/01/18 01:02:53 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: pq3pci.c,v 1.3 2011/02/08 06:19:13 matt Exp $); #include sys/param.h #include sys/device.h @@ -69,91 +69,111 @@ #define PORDEVSR_MPC8536_TRUTH_ENCODE(inst, field, value, result) \ TRUTH_ENCODE(SVR_MPC8536v1, inst, PORDEVSR_##field, \ - __SHIFTIN(field##_##MPC8536##_##value, PORDEVSR_##field), result) + __SHIFTIN(field##_##MPC8536##_##value, PORDEVSR_##field), result) #define PORDEVSR_MPC8544_TRUTH_ENCODE(inst, field, value, result) \ TRUTH_ENCODE(SVR_MPC8544v1, inst, PORDEVSR_##field, \ - __SHIFTIN(field##_##MPC8544##_##value, PORDEVSR_##field), result) + __SHIFTIN(field##_##MPC8544##_##value, PORDEVSR_##field), result) #define PORDEVSR_MPC8548_TRUTH_ENCODE(inst, field, value, result) \ TRUTH_ENCODE(SVR_MPC8548v1, inst, PORDEVSR_##field, \ - __SHIFTIN(field##_##MPC8548##_##value, PORDEVSR_##field), result) + __SHIFTIN(field##_##MPC8548##_##value, PORDEVSR_##field), result) #define PORDEVSR_MPC8555_TRUTH_ENCODE(inst, field, value, result) \ TRUTH_ENCODE(SVR_MPC8555v1, inst, PORDEVSR_##field, \ - __SHIFTIN(field##_##MPC8555##_##value, PORDEVSR_##field), result) + __SHIFTIN(field##_##MPC8555##_##value, PORDEVSR_##field), result) #define PORDEVSR_MPC8572_TRUTH_ENCODE(inst, field, value, result) \ TRUTH_ENCODE(SVR_MPC8572v1, inst, PORDEVSR_##field, \ - __SHIFTIN(field##_##MPC8572##_##value, PORDEVSR_##field), result) - + __SHIFTIN(field##_##MPC8572##_##value, PORDEVSR_##field), result) +#define PORDEVSR_P20x0_TRUTH_ENCODE(inst, field, value, result) \ +TRUTH_ENCODE(SVR_P2020, inst, PORDEVSR_##field, \ + __SHIFTIN(field##_##P20x0##_##value, PORDEVSR_##field), result), \ +TRUTH_ENCODE(SVR_P2010, inst, PORDEVSR_##field, \ + __SHIFTIN(field##_##P20x0##_##value, PORDEVSR_##field), result) #define PORDEVSR_TRUTH_ENCODE(svr, inst, field, value, result) \ TRUTH_ENCODE(svr, inst, PORDEVSR_##field, \ - __SHIFTIN(field##_##value, PORDEVSR_##field), result) + __SHIFTIN(field##_##value, PORDEVSR_##field), result) const struct e500_truthtab pq3pci_pcie_lanes[] = { #ifdef MPC8548 -PORDEVSR_MPC8548_TRUTH_ENCODE(0, IOSEL, SRIO2500_PCIE1_X4, 4), -PORDEVSR_MPC8548_TRUTH_ENCODE(0, IOSEL, SRIO1250_PCIE1_X4, 4), -PORDEVSR_MPC8548_TRUTH_ENCODE(0, IOSEL, PCIE1_X8, 8), +PORDEVSR_MPC8548_TRUTH_ENCODE(0, IOSEL, SRIO2500_PCIE1_X4, 4), +PORDEVSR_MPC8548_TRUTH_ENCODE(0, IOSEL, SRIO1250_PCIE1_X4, 4), +PORDEVSR_MPC8548_TRUTH_ENCODE(0, IOSEL, PCIE1_X8, 8), #endif #ifdef MPC8544 -PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE1_ON, 4), -PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE1_SGMII_ON, 4), -PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE12_ON, 4), -PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE12_SGMII_ON, 4), +PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE1_ON, 4), +PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE1_SGMII_ON, 4), +PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE12_ON, 4), +PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE12_SGMII_ON, 4), PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE123_ON, 4), PORDEVSR_MPC8544_TRUTH_ENCODE(1, IOSEL, PCIE123_SGMII_ON, 4), -PORDEVSR_MPC8544_TRUTH_ENCODE(2, IOSEL, PCIE12_ON, 4), -PORDEVSR_MPC8544_TRUTH_ENCODE(2, IOSEL, PCIE12_SGMII_ON, 4), +PORDEVSR_MPC8544_TRUTH_ENCODE(2, IOSEL, PCIE12_ON, 4), +PORDEVSR_MPC8544_TRUTH_ENCODE(2, IOSEL, PCIE12_SGMII_ON, 4), PORDEVSR_MPC8544_TRUTH_ENCODE(2, IOSEL, PCIE123_ON, 4), PORDEVSR_MPC8544_TRUTH_ENCODE(2, IOSEL, PCIE123_SGMII_ON, 4), -PORDEVSR_MPC8544_TRUTH_ENCODE(3, IOSEL, PCIE123_ON, 1), +PORDEVSR_MPC8544_TRUTH_ENCODE(3, IOSEL, PCIE123_ON, 1), PORDEVSR_MPC8544_TRUTH_ENCODE(3, IOSEL, PCIE123_SGMII_ON, 1), #endif #ifdef MPC8536 -PORDEVSR_MPC8536_TRUTH_ENCODE(1, IOSEL, PCIE1_X4, 4), -PORDEVSR_MPC8536_TRUTH_ENCODE(1, IOSEL, PCIE1_X8, 8), +PORDEVSR_MPC8536_TRUTH_ENCODE(1,
CVS commit: src/sys/arch/powerpc
Module Name:src Committed By: matt Date: Tue Feb 8 06:21:03 UTC 2011 Modified Files: src/sys/arch/powerpc/booke/dev: cpunode.c src/sys/arch/powerpc/include/booke: cpuvar.h Log Message: Allow code to allow inclusive/exclusive locators for subdevices. (uses on mpc85xx to match on SVRs or not match on SVRs). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/booke/dev/cpunode.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/booke/cpuvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/booke/dev/cpunode.c diff -u src/sys/arch/powerpc/booke/dev/cpunode.c:1.2 src/sys/arch/powerpc/booke/dev/cpunode.c:1.3 --- src/sys/arch/powerpc/booke/dev/cpunode.c:1.2 Tue Jan 18 01:02:53 2011 +++ src/sys/arch/powerpc/booke/dev/cpunode.c Tue Feb 8 06:21:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpunode.c,v 1.2 2011/01/18 01:02:53 matt Exp $ */ +/* $NetBSD: cpunode.c,v 1.3 2011/02/08 06:21:03 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,7 +36,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: cpunode.c,v 1.2 2011/01/18 01:02:53 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: cpunode.c,v 1.3 2011/02/08 06:21:03 matt Exp $); #include sys/param.h #include sys/device.h @@ -105,7 +105,35 @@ nodes |= 1 ma-ma_node; - for (u_int childmask = 1; cnl-cnl_name != NULL; cnl++, childmask = 1) { + const uint16_t my_id = board_info_get_number(my-id); + + for (u_int childmask = 1; cnl-cnl_name != NULL; cnl++) { + bool inclusive = true; + bool found = (cnl-cnl_ids[0] == 0); + for (u_int i = 0; + !found + i __arraycount(cnl-cnl_ids) + cnl-cnl_ids[i] != 0; + i++) { + if (cnl-cnl_ids[i] == 0x) { +inclusive = false; +continue; + } + found = (cnl-cnl_ids[i] == my_id); + } + /* + * found inclusive == match + * !found !inclusive == match + * found !inclusive == no match + * !found inclusive == no match + * therefore + * found ^ inclusive = no match + * so + * !(found ^ inclusive) = match + */ + if (found ^ inclusive) + continue; + cna.cna_busname = cpunode; cna.cna_memt = ma-ma_memt; cna.cna_dmat = ma-ma_dmat; @@ -125,6 +153,7 @@ #endif (void)config_found_sm_loc(self, cpunode, NULL, cna, cpunode_print, NULL); + childmask = 1; } /* * Anything MD left to do? Index: src/sys/arch/powerpc/include/booke/cpuvar.h diff -u src/sys/arch/powerpc/include/booke/cpuvar.h:1.2 src/sys/arch/powerpc/include/booke/cpuvar.h:1.3 --- src/sys/arch/powerpc/include/booke/cpuvar.h:1.2 Tue Jan 18 01:02:54 2011 +++ src/sys/arch/powerpc/include/booke/cpuvar.h Tue Feb 8 06:21:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.2 2011/01/18 01:02:54 matt Exp $ */ +/* $NetBSD: cpuvar.h,v 1.3 2011/02/08 06:21:03 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -69,6 +69,7 @@ uint8_t cnl_nintr; uint8_t cnl_intrs[4]; uint32_t cnl_flags; + uint16_t cnl_ids[6]; }; struct cpunode_attach_args {
CVS commit: src/sys/arch/evbppc
Module Name:src Committed By: matt Date: Tue Feb 8 06:22:29 UTC 2011 Modified Files: src/sys/arch/evbppc/conf: files.mpc85xx src/sys/arch/evbppc/mpc85xx: machdep.c Log Message: Add MPC85xx variants. Move to having a common kernel for all MPC85xx variants (CADMUS/PIXIS still remain a problem). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/conf/files.mpc85xx cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbppc/mpc85xx/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/evbppc/conf/files.mpc85xx diff -u src/sys/arch/evbppc/conf/files.mpc85xx:1.2 src/sys/arch/evbppc/conf/files.mpc85xx:1.3 --- src/sys/arch/evbppc/conf/files.mpc85xx:1.2 Tue Jan 18 01:10:25 2011 +++ src/sys/arch/evbppc/conf/files.mpc85xx Tue Feb 8 06:22:29 2011 @@ -1,8 +1,9 @@ -# $NetBSD: files.mpc85xx,v 1.2 2011/01/18 01:10:25 matt Exp $ +# $NetBSD: files.mpc85xx,v 1.3 2011/02/08 06:22:29 matt Exp $ # # mpc85xx-specific configuration info -defflag opt_mpc85xx.h MPC8536 MPC8544 MPC8548 MPC8572 CADMUS PIXIS +defflag opt_mpc85xx.h MPC8536 MPC8544 MPC8548 MPC8555 MPC8568 MPC8572 + P2020 CADMUS PIXIS defparam opt_mpc85xx.h SYS_CLK file arch/evbppc/mpc85xx/autoconf.c Index: src/sys/arch/evbppc/mpc85xx/machdep.c diff -u src/sys/arch/evbppc/mpc85xx/machdep.c:1.2 src/sys/arch/evbppc/mpc85xx/machdep.c:1.3 --- src/sys/arch/evbppc/mpc85xx/machdep.c:1.2 Tue Jan 18 01:10:25 2011 +++ src/sys/arch/evbppc/mpc85xx/machdep.c Tue Feb 8 06:22:29 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.2 2011/01/18 01:10:25 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.3 2011/02/08 06:22:29 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -168,91 +168,156 @@ static const struct cpunode_locators mpc8548_cpunode_locs[] = { { cpu }, /* not a real device */ { wdog }, /* not a real device */ - { duart, DUART1_BASE, 2*DUART_SIZE, 0, 1, - { ISOURCE_DUART }, + { duart, DUART1_BASE, 2*DUART_SIZE, 0, + 1, { ISOURCE_DUART }, 1 + ilog2(DEVDISR_DUART) }, -#if defined(MPC8548) || defined(MPC8572) - { tsec, ETSEC1_BASE, ETSEC_SIZE, 1, 3, - { ISOURCE_ETSEC1_TX, ISOURCE_ETSEC1_RX, ISOURCE_ETSEC1_ERR }, + { tsec, ETSEC1_BASE, ETSEC_SIZE, 1, + 3, { ISOURCE_ETSEC1_TX, ISOURCE_ETSEC1_RX, ISOURCE_ETSEC1_ERR }, 1 + ilog2(DEVDISR_TSEC1) }, - { tsec, ETSEC2_BASE, ETSEC_SIZE, 2, 3, - { ISOURCE_ETSEC2_TX, ISOURCE_ETSEC2_RX, ISOURCE_ETSEC2_ERR }, - 1 + ilog2(DEVDISR_TSEC2) }, - { tsec, ETSEC3_BASE, ETSEC_SIZE, 3, 3, - { ISOURCE_ETSEC3_TX, ISOURCE_ETSEC3_RX, ISOURCE_ETSEC3_ERR }, - 1 + ilog2(DEVDISR_TSEC3) }, - { tsec, ETSEC4_BASE, ETSEC_SIZE, 4, 3, - { ISOURCE_ETSEC4_TX, ISOURCE_ETSEC4_RX, ISOURCE_ETSEC4_ERR }, - 1 + ilog2(DEVDISR_TSEC4) }, +#if defined(MPC8548) || defined(MPC8555) || defined(MPC8572) || defined(P2020) + { tsec, ETSEC2_BASE, ETSEC_SIZE, 2, + 3, { ISOURCE_ETSEC2_TX, ISOURCE_ETSEC2_RX, ISOURCE_ETSEC2_ERR }, + 1 + ilog2(DEVDISR_TSEC2), + { SVR_MPC8548v1 16, SVR_MPC8555v1 16, + SVR_MPC8572v1 16, SVR_P2020v2 16 } }, #endif #if defined(MPC8544) || defined(MPC8536) - { tsec, ETSEC1_BASE, ETSEC_SIZE, 1, 3, - { ISOURCE_ETSEC1_TX, ISOURCE_ETSEC1_RX, ISOURCE_ETSEC1_ERR }, - 1 + ilog2(DEVDISR_TSEC1) }, - { tsec, ETSEC3_BASE, ETSEC_SIZE, 2, 3, - { ISOURCE_ETSEC3_TX, ISOURCE_ETSEC3_RX, ISOURCE_ETSEC3_ERR }, - 1 + ilog2(DEVDISR_TSEC2) }, -#endif - { diic, I2C1_BASE, 2*I2C_SIZE, 0, 1, - { ISOURCE_I2C }, - 1 + ilog2(DEVDISR_TSEC2) }, -#ifndef MPC8572 + { tsec, ETSEC3_BASE, ETSEC_SIZE, 2, + 3, { ISOURCE_ETSEC3_TX, ISOURCE_ETSEC3_RX, ISOURCE_ETSEC3_ERR }, + 1 + ilog2(DEVDISR_TSEC3), + { SVR_MPC8536v1 16, SVR_MPC8544v1 16 } }, +#endif +#if defined(MPC8548) || defined(MPC8572) || defined(P2020) + { tsec, ETSEC3_BASE, ETSEC_SIZE, 3, + 3, { ISOURCE_ETSEC3_TX, ISOURCE_ETSEC3_RX, ISOURCE_ETSEC3_ERR }, + 1 + ilog2(DEVDISR_TSEC3), + { SVR_MPC8548v1 16, SVR_MPC8572v1 16, + SVR_P2020v2 16 } }, +#endif +#if defined(MPC8548) || defined(MPC8572) + { tsec, ETSEC4_BASE, ETSEC_SIZE, 4, + 3, { ISOURCE_ETSEC4_TX, ISOURCE_ETSEC4_RX, ISOURCE_ETSEC4_ERR }, + 1 + ilog2(DEVDISR_TSEC4), + { SVR_MPC8548v1 16, SVR_MPC8572v1 16 } }, +#endif + { diic, I2C1_BASE, 2*I2C_SIZE, 0, + 1, { ISOURCE_I2C }, + 1 + ilog2(DEVDISR_I2C) }, /* MPC8572 doesn't have any GPIO */ - { gpio, GLOBAL_BASE, GLOBAL_SIZE, 0, 0 }, + { gpio, GLOBAL_BASE, GLOBAL_SIZE, 0, + 1, { ISOURCE_GPIO }, + 0, + { 0x, SVR_MPC8572v1 16 } }, + { ddrc, DDRC1_BASE, DDRC_SIZE, 0, + 1, { ISOURCE_DDR }, + 1 + ilog2(DEVDISR_DDR_15), + { 0x, SVR_MPC8572v1 16, SVR_MPC8536v1 16 } }, +#if defined(MPC8536) + { ddrc, DDRC1_BASE, DDRC_SIZE, 0, + 1, { ISOURCE_DDR }, + 1 + ilog2(DEVDISR_DDR_16), + { SVR_MPC8536v1 16 } }, +#endif +#if defined(MPC8572) + { ddrc, DDRC1_BASE, DDRC_SIZE, 1, + 1, { ISOURCE_DDR }, + 1 + ilog2(DEVDISR_DDR_15), + { SVR_MPC8572v1 16 } }, + { ddrc,
CVS commit: src/sys/arch/powerpc/include/booke
Module Name:src Committed By: matt Date: Tue Feb 8 06:28:57 UTC 2011 Modified Files: src/sys/arch/powerpc/include/booke: intr.h Log Message: Add IPI/cpu_send_ipi to intrsw. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/powerpc/include/booke/intr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/powerpc/include/booke/intr.h diff -u src/sys/arch/powerpc/include/booke/intr.h:1.2 src/sys/arch/powerpc/include/booke/intr.h:1.3 --- src/sys/arch/powerpc/include/booke/intr.h:1.2 Tue Jan 18 01:02:54 2011 +++ src/sys/arch/powerpc/include/booke/intr.h Tue Feb 8 06:28:56 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.2 2011/01/18 01:02:54 matt Exp $ */ +/* $NetBSD: intr.h,v 1.3 2011/02/08 06:28:56 matt Exp $ */ /*- * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -64,6 +64,9 @@ #define IST_MAX (NIPL+10) #endif +#define IPI_DST_ALL -2 +#define IPI_DST_NOTME -1 + #define __HAVE_FAST_SOFTINTS 1 #ifndef _LOCORE @@ -75,6 +78,8 @@ const char * intr_string(int, int); +void cpu_send_ipi(cpuid_t, uintptr_t); + void spl0(void); int splraise(int); void splx(int); @@ -109,6 +114,7 @@ void (*intrsw_spl0)(void); void (*intrsw_splx)(int); const char *(*intrsw_string)(int, int); + void (*intrsw_send_ipi)(cpuid_t, uintptr_t); #ifdef __HAVE_FAST_SOFTINTS void (*intrsw_softint_init_md)(struct lwp *, u_int, uintptr_t *); void (*intrsw_softint_trigger)(uintptr_t);
CVS commit: src/sys/dev/pckbport
Module Name:src Committed By: cegger Date: Tue Feb 8 07:32:47 UTC 2011 Modified Files: src/sys/dev/pckbport: pmsreg.h Log Message: add PS/2 registers from synaptics spec: PMS_RESET_WRAP_MODE, PMS_SET_WRAP_MODE, PMS_ACK, PMS_ERROR and PMS_RESEND while here use #definetab consistently. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pckbport/pmsreg.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/pckbport/pmsreg.h diff -u src/sys/dev/pckbport/pmsreg.h:1.2 src/sys/dev/pckbport/pmsreg.h:1.3 --- src/sys/dev/pckbport/pmsreg.h:1.2 Sun Dec 11 12:23:22 2005 +++ src/sys/dev/pckbport/pmsreg.h Tue Feb 8 07:32:47 2011 @@ -1,19 +1,24 @@ -/* $NetBSD: pmsreg.h,v 1.2 2005/12/11 12:23:22 christos Exp $ */ +/* $NetBSD: pmsreg.h,v 1.3 2011/02/08 07:32:47 cegger Exp $ */ /* mouse commands */ -#define PMS_SET_SCALE11 0xe6 /* set scaling 1:1 */ -#define PMS_SET_SCALE21 0xe7 /* set scaling 2:1 */ -#define PMS_SET_RES 0xe8 /* set resolution (0..3) */ -#define PMS_GET_SCALE 0xe9 /* get scaling factor */ -#define PMS_SEND_DEV_STATUS 0xe9 -#define PMS_SET_STREAM 0xea /* set streaming mode */ -#define PMS_SEND_DEV_DATA 0xeb -#define PMS_SET_REMOTE_MODE 0xf0 -#define PMS_SEND_DEV_ID 0xf2 -#define PMS_SET_SAMPLE 0xf3 /* set sampling rate */ -#define PMS_DEV_ENABLE 0xf4 /* mouse on */ -#define PMS_DEV_DISABLE 0xf5 /* mouse off */ -#define PMS_SET_DEFAULTS 0xf6 -#define PMS_RESET 0xff /* reset */ +#define PMS_SET_SCALE11 0xe6 /* set scaling 1:1 */ +#define PMS_SET_SCALE21 0xe7 /* set scaling 2:1 */ +#define PMS_SET_RES 0xe8 /* set resolution (0..3) */ +#define PMS_GET_SCALE 0xe9 /* get scaling factor */ +#define PMS_SEND_DEV_STATUS 0xe9 /* status request */ +#define PMS_SET_STREAM 0xea /* set streaming mode */ +#define PMS_SEND_DEV_DATA 0xeb /* read data */ +#define PMS_RESET_WRAP_MODE 0xec +#define PMS_SET_WRAP_MODE 0xed +#define PMS_SET_REMOTE_MODE 0xf0 +#define PMS_SEND_DEV_ID 0xf2 /* read device type */ +#define PMS_SET_SAMPLE 0xf3 /* set sampling rate */ +#define PMS_DEV_ENABLE 0xf4 /* mouse on */ +#define PMS_DEV_DISABLE 0xf5 /* mouse off */ +#define PMS_SET_DEFAULTS 0xf6 +#define PMS_ACK 0xfa +#define PMS_ERROR 0xfc +#define PMS_RESEND 0xfe +#define PMS_RESET 0xff /* reset */ -#define PMS_RSTDONE 0xaa +#define PMS_RSTDONE 0xaa