CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sun Sep 13 06:19:43 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32_fs.c netbsd32_netbsd.c Log Message: Move netbsd32___mount50 from netbsd32_netbsd.c to netbsd32_fs.c To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.55.14.1 src/sys/compat/netbsd32/netbsd32_fs.c cvs rdiff -u -r1.145.4.2.4.1 -r1.145.4.2.4.2 \ src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_fs.c diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.55 src/sys/compat/netbsd32/netbsd32_fs.c:1.55.14.1 --- src/sys/compat/netbsd32/netbsd32_fs.c:1.55 Tue Jun 24 11:18:15 2008 +++ src/sys/compat/netbsd32/netbsd32_fs.c Sun Sep 13 06:19:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_fs.c,v 1.55 2008/06/24 11:18:15 ad Exp $ */ +/* $NetBSD: netbsd32_fs.c,v 1.55.14.1 2009/09/13 06:19:43 matt Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.55 2008/06/24 11:18:15 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.55.14.1 2009/09/13 06:19:43 matt Exp $); #include sys/param.h #include sys/systm.h @@ -50,6 +50,9 @@ #include sys/kauth.h #include sys/vfs_syscalls.h +#include fs/cd9660/cd9660_mount.h +#include ufs/ufs/ufsmount.h + #include compat/netbsd32/netbsd32.h #include compat/netbsd32/netbsd32_syscallargs.h #include compat/netbsd32/netbsd32_conv.h @@ -754,3 +757,132 @@ free(path, M_TEMP); return error; } + +int +netbsd32___mount50(struct lwp *l, const struct netbsd32___mount50_args *uap, + register_t *retval) +{ + /* { + syscallarg(netbsd32_charp) type; + syscallarg(netbsd32_charp) path; + syscallarg(int) flags; + syscallarg(netbsd32_voidp) data; + syscallarg(netbsd32_size_t) data_len; + } */ + char mtype[MNAMELEN]; + union { + struct netbsd32_ufs_args ufs_args; + struct netbsd32_mfs_args mfs_args; + struct netbsd32_iso_args iso_args; + } fs_args32; + union { + struct ufs_args ufs_args; + struct mfs_args mfs_args; + struct iso_args iso_args; + } fs_args; + const char *type = SCARG_P32(uap, type); + const char *path = SCARG_P32(uap, path); + int flags = SCARG(uap, flags); + void *data = SCARG_P32(uap, data); + size_t data_len = SCARG(uap, data_len); + enum uio_seg data_seg; + size_t len; + int error; + + error = copyinstr(type, mtype, sizeof(mtype), len); + if (error) + return error; + if (strcmp(mtype, MOUNT_MFS) == 0) { + if (data_len != sizeof(fs_args32.mfs_args)) + return EINVAL; + if ((flags MNT_GETARGS) == 0) { + error = copyin(data, fs_args32.mfs_args, + sizeof(fs_args32.mfs_args)); + if (error) +return error; + fs_args.mfs_args.fspec = + NETBSD32PTR64(fs_args32.mfs_args.fspec); + memset(fs_args.mfs_args._pad1, 0, + sizeof(fs_args.mfs_args._pad1)); + fs_args.mfs_args.base = + NETBSD32PTR64(fs_args32.mfs_args.base); + fs_args.mfs_args.size = fs_args32.mfs_args.size; + } + data_seg = UIO_SYSSPACE; + data = fs_args.mfs_args; + data_len = sizeof(fs_args.mfs_args); + } else if (strcmp(mtype, MOUNT_UFS) == 0) { + if (data_len sizeof(fs_args32.ufs_args)) + return EINVAL; + if ((flags MNT_GETARGS) == 0) { + error = copyin(data, fs_args32.ufs_args, + sizeof(fs_args32.ufs_args)); + if (error) +return error; + fs_args.ufs_args.fspec = + NETBSD32PTR64(fs_args32.ufs_args.fspec); + } + data_seg = UIO_SYSSPACE; + data = fs_args.ufs_args; + data_len = sizeof(fs_args.ufs_args); + } else if (strcmp(mtype, MOUNT_CD9660) == 0) { + if (data_len != sizeof(fs_args32.iso_args)) + return EINVAL; + if ((flags MNT_GETARGS) == 0) { + error = copyin(data, fs_args32.iso_args, + sizeof(fs_args32.iso_args)); + if (error) +return error; + fs_args.iso_args.fspec = + NETBSD32PTR64(fs_args32.iso_args.fspec); + memset(fs_args.iso_args._pad1, 0, + sizeof(fs_args.iso_args._pad1)); + fs_args.iso_args.flags = fs_args32.iso_args.flags; + } + data_seg = UIO_SYSSPACE; + data = fs_args.iso_args; + data_len = sizeof(fs_args.iso_args); + } else { + data_seg = UIO_USERSPACE; + } + error = do_sys_mount(l, NULL, type, path, flags, data, data_seg, + data_len, retval); + if (error) { + printf(do_sys_mount(%s): %p, %p, %#x, %p, %d, %zu, %p: failed: error %d\n, mtype, type, path, flags, data, data_seg, data_len, retval, error); + return error; + } + if (flags MNT_GETARGS) { + data_len = *retval; + if (strcmp(mtype, MOUNT_MFS) == 0) { + if (data_len != sizeof(fs_args.mfs_args)) +return EINVAL; + NETBSD32PTR32(fs_args32.mfs_args.fspec, + fs_args.mfs_args.fspec); + memset(fs_args32.mfs_args._pad1, 0, + sizeof(fs_args32.mfs_args._pad1)); + NETBSD32PTR32(fs_args32.mfs_args.base, + fs_args.mfs_args.base); +
CVS commit: [matt-nb5-mips64] src/sys/arch
Module Name:src Committed By: cliff Date: Sun Sep 13 07:00:31 UTC 2009 Modified Files: src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c rmixl_obio_space.c rmixl_obiovar.h rmixlvar.h Log Message: improve how some config data are managed To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/evbmips/rmixl/machdep.c cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_com.c \ src/sys/arch/mips/rmi/rmixl_obio_space.c \ src/sys/arch/mips/rmi/rmixl_obiovar.h src/sys/arch/mips/rmi/rmixlvar.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/evbmips/rmixl/machdep.c diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.1 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.2 --- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/evbmips/rmixl/machdep.c Sun Sep 13 07:00:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $NetBSD: machdep.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $); #include opt_ddb.h #include opt_com.h @@ -264,7 +264,7 @@ physmem = btoc(memsize); rcp = rmixl_configuration; - rcp-rc_io_base = rmixlfw_info.io_base; + rcp-rc_io_pbase = MIPS_KSEG1_TO_PHYS(rmixlfw_info.io_base); rmixl_bus_mem_init(rcp-rc_memt, rcp); #ifdef NOTYET rmixl_bus_io_init(rcp-rc_iot, rcp); @@ -392,7 +392,7 @@ goto found; } - rmixl_putchar_init(rmixlfw_info.io_base); + rmixl_putchar_init(MIPS_KSEG1_TO_PHYS(rmixlfw_info.io_base)); rmixl_puts(\r\nWARNING: untested psb_version: ); rmixl_puthex64(rmixlfw_info.psb_version); rmixl_puts(\r\n); Index: src/sys/arch/mips/rmi/rmixl_com.c diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.2 --- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/mips/rmi/rmixl_com.c Sun Sep 13 07:00:30 2009 @@ -1,4 +1,4 @@ -/* $Id: rmixl_com.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $Id: rmixl_com.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. * Copyright (c) 2006 Garrett D'Amore. @@ -101,7 +101,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -144,10 +144,9 @@ MIPS_PHYS_TO_KSEG1(RMIXL_IO_DEV_PBASE + RMIXL_IO_DEV_UART_1); void -rmixl_putchar_init(uint64_t io_base) +rmixl_putchar_init(uint64_t io_pbase) { - com0addr = (uint32_t *) - MIPS_PHYS_TO_KSEG1(io_base + RMIXL_IO_DEV_UART_1); + com0addr = (uint32_t *)MIPS_PHYS_TO_KSEG1(io_pbase + RMIXL_IO_DEV_UART_1); } void Index: src/sys/arch/mips/rmi/rmixl_obio_space.c diff -u src/sys/arch/mips/rmi/rmixl_obio_space.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_obio_space.c:1.1.2.2 --- src/sys/arch/mips/rmi/rmixl_obio_space.c:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/mips/rmi/rmixl_obio_space.c Sun Sep 13 07:00:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_obio_space.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $NetBSD: rmixl_obio_space.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -34,8 +34,9 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_obio_space.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_obio_space.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $); +#include sys/types.h #include sys/param.h #include machine/bus.h @@ -50,32 +51,34 @@ /* MEM region 1 */ #define CHIP_W1_BUS_START(v) 0 #define CHIP_W1_BUS_END(v) (RMIXL_IO_DEV_SIZE - 1) -#define CHIP_W1_SYS_START(v) (((struct rmixl_config *)(v))-rc_io_base) +#define CHIP_W1_SYS_START(v) (((struct rmixl_config *)(v))-rc_io_pbase) #define CHIP_W1_SYS_END(v) (CHIP_W1_SYS_START(v) + RMIXL_IO_DEV_SIZE - 1) -struct mips_bus_space rmixl_bus_memt; -struct mips_bus_dma_tag rmixl_bus_dmat; - void rmixl_obio_bus_init(void) { static int done = 0; + if (done) return; done = 1; - - rmixl_bus_mem_init(rmixl_bus_memt, rmixl_configuration); + rmixl_bus_mem_init(rmixl_configuration.rc_memt, rmixl_configuration); #ifdef NOTYET - rmixl_dma_init(NULL, rmixl_bus_dmat); + rmixl_dma_init(rmixl_configuration.rc_pci_dmat); #endif } -/* this primarily exists so we can get to the console... */ bus_space_tag_t rmixl_obio_get_bus_space_tag(void) { - rmixl_obio_bus_init(); - return (bus_space_tag_t)rmixl_bus_memt; + return
CVS commit: src/usr.bin/netstat
Module Name:src Committed By: wiz Date: Sun Sep 13 09:17:26 UTC 2009 Modified Files: src/usr.bin/netstat: netstat.1 Log Message: Fix section for sysctl xref (it is 3, not 2). To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/usr.bin/netstat/netstat.1 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/netstat/netstat.1 diff -u src/usr.bin/netstat/netstat.1:1.53 src/usr.bin/netstat/netstat.1:1.54 --- src/usr.bin/netstat/netstat.1:1.53 Sun Sep 13 02:53:17 2009 +++ src/usr.bin/netstat/netstat.1 Sun Sep 13 09:17:26 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: netstat.1,v 1.53 2009/09/13 02:53:17 elad Exp $ +.\ $NetBSD: netstat.1,v 1.54 2009/09/13 09:17:26 wiz Exp $ .\ .\ Copyright (c) 1983, 1990, 1992, 1993 .\ The Regents of the University of California. All rights reserved. @@ -266,12 +266,12 @@ seconds. .It Fl X Force use of -.Xr sysctl 2 +.Xr sysctl 3 when retrieving information. Some features of .Nm may not be (fully) supported when using -.Xr sysctl 2 . +.Xr sysctl 3 . This flag forces the use of the latter regardless, and emits a message if a not yet fully supported feature is used in conjunction with it. This flag might be removed at any time; do not rely on its presence.
CVS commit: src
Module Name:src Committed By: bouyer Date: Sun Sep 13 14:13:24 UTC 2009 Modified Files: src/sbin/tunefs: tunefs.c src/sys/ufs/ffs: ffs_wapbl.c Log Message: Allow tunefs to clear any type of WAPBL log, not only in-filesystem ones. Discussed in http://mail-index.netbsd.org/tech-kern/2009/08/17/msg005896.html and followups. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sbin/tunefs/tunefs.c cvs rdiff -u -r1.12 -r1.13 src/sys/ufs/ffs/ffs_wapbl.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/tunefs/tunefs.c diff -u src/sbin/tunefs/tunefs.c:1.40 src/sbin/tunefs/tunefs.c:1.41 --- src/sbin/tunefs/tunefs.c:1.40 Mon Aug 17 21:28:24 2009 +++ src/sbin/tunefs/tunefs.c Sun Sep 13 14:13:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tunefs.c,v 1.40 2009/08/17 21:28:24 bouyer Exp $ */ +/* $NetBSD: tunefs.c,v 1.41 2009/09/13 14:13:23 bouyer Exp $ */ /* * Copyright (c) 1983, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)tunefs.c 8.3 (Berkeley) 5/3/95; #else -__RCSID($NetBSD: tunefs.c,v 1.40 2009/08/17 21:28:24 bouyer Exp $); +__RCSID($NetBSD: tunefs.c,v 1.41 2009/09/13 14:13:23 bouyer Exp $); #endif #endif /* not lint */ @@ -353,15 +353,6 @@ break; } - if (!in_fs_log) - errx(1, Can't change size of non-in-filesystem log); - - if (logfilesize 0 old_size == (uint64_t)logfilesize) { - /* no action */ - warnx(log file size remains unchanged at %lld, logfilesize); - return; - } - if (logfilesize == 0) { /* * Don't clear out the locators - the kernel might need @@ -374,6 +365,15 @@ return; } + if (!in_fs_log logfilesize 0 old_size 0) + errx(1, Can't change size of non-in-filesystem log); + + if (old_size == logfilesize logfilesize 0) { + /* no action */ + warnx(log file size remains unchanged at %lld, logfilesize); + return; + } + if (old_size == 0) { /* create new log of desired size next mount */ sblock.fs_journal_location = UFS_WAPBL_JOURNALLOC_IN_FILESYSTEM; Index: src/sys/ufs/ffs/ffs_wapbl.c diff -u src/sys/ufs/ffs/ffs_wapbl.c:1.12 src/sys/ufs/ffs/ffs_wapbl.c:1.13 --- src/sys/ufs/ffs/ffs_wapbl.c:1.12 Sun Feb 22 20:28:06 2009 +++ src/sys/ufs/ffs/ffs_wapbl.c Sun Sep 13 14:13:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_wapbl.c,v 1.12 2009/02/22 20:28:06 ad Exp $ */ +/* $NetBSD: ffs_wapbl.c,v 1.13 2009/09/13 14:13:23 bouyer Exp $ */ /*- * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ffs_wapbl.c,v 1.12 2009/02/22 20:28:06 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: ffs_wapbl.c,v 1.13 2009/09/13 14:13:23 bouyer Exp $); #define WAPBL_INTERNAL @@ -275,7 +275,7 @@ default: printf(ffs_wapbl: unknown journal type %d\n, fs-fs_journal_location); - return EINVAL; + break; }
CVS commit: src/sys/ufs/ffs
Module Name:src Committed By: bouyer Date: Sun Sep 13 14:30:21 UTC 2009 Modified Files: src/sys/ufs/ffs: ffs_vfsops.c Log Message: If the WAPBL journal can't be read (ffs_wapbl_replay_start() fails), mount the filesystem anyway if MNT_FORCE is present. This allows to still boot single-user a system with a corrupted WAPBL on /, and so get a chance to run fsck to fix it. http://mail-index.netbsd.org/tech-kern/2009/08/17/msg005896.html and followups. To generate a diff of this commit: cvs rdiff -u -r1.251 -r1.252 src/sys/ufs/ffs/ffs_vfsops.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/ffs/ffs_vfsops.c diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.251 src/sys/ufs/ffs/ffs_vfsops.c:1.252 --- src/sys/ufs/ffs/ffs_vfsops.c:1.251 Sun Sep 13 05:17:36 2009 +++ src/sys/ufs/ffs/ffs_vfsops.c Sun Sep 13 14:30:21 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ffs_vfsops.c,v 1.251 2009/09/13 05:17:36 tsutsui Exp $ */ +/* $NetBSD: ffs_vfsops.c,v 1.252 2009/09/13 14:30:21 bouyer Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.251 2009/09/13 05:17:36 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: ffs_vfsops.c,v 1.252 2009/09/13 14:30:21 bouyer Exp $); #if defined(_KERNEL_OPT) #include opt_ffs.h @@ -959,28 +959,32 @@ #ifdef WAPBL if ((mp-mnt_wapbl_replay == 0) (fs-fs_flags FS_DOWAPBL)) { error = ffs_wapbl_replay_start(mp, fs, devvp); - if (error) + if (error (mp-mnt_flag MNT_FORCE) == 0) goto out; + if (!error) { + if (!ronly) { +/* XXX fsmnt may be stale. */ +printf(%s: replaying log to disk\n, +fs-fs_fsmnt); +error = wapbl_replay_write(mp-mnt_wapbl_replay, +devvp); +if (error) + goto out; +wapbl_replay_stop(mp-mnt_wapbl_replay); +fs-fs_clean = FS_WASCLEAN; + } else { +/* XXX fsmnt may be stale */ +printf(%s: replaying log to memory\n, +fs-fs_fsmnt); + } - if (!ronly) { - /* XXX fsmnt may be stale. */ - printf(%s: replaying log to disk\n, fs-fs_fsmnt); - error = wapbl_replay_write(mp-mnt_wapbl_replay, devvp); - if (error) -goto out; - wapbl_replay_stop(mp-mnt_wapbl_replay); - fs-fs_clean = FS_WASCLEAN; - } else { - /* XXX fsmnt may be stale */ - printf(%s: replaying log to memory\n, fs-fs_fsmnt); + /* Force a re-read of the superblock */ + brelse(bp, BC_INVAL); + bp = NULL; + free(fs, M_UFSMNT); + fs = NULL; + goto sbagain; } - - /* Force a re-read of the superblock */ - brelse(bp, BC_INVAL); - bp = NULL; - free(fs, M_UFSMNT); - fs = NULL; - goto sbagain; } #else /* !WAPBL */ if ((fs-fs_flags FS_DOWAPBL) (mp-mnt_flag MNT_FORCE) == 0) {
CVS commit: src/sys/kern
Module Name:src Committed By: bouyer Date: Sun Sep 13 14:38:20 UTC 2009 Modified Files: src/sys/kern: kern_turnstile.c Log Message: PR kern/41923: assertion cur != owner failed In the for(;;) loop of turnstile_block(), the lock owner can change while cur's lock is released (cur's lock is also the tschain_t's mutex). Remove the KASSERT about owner being invariant and try to deal with the fact that the owner can change instead. http://mail-index.netbsd.org/tech-kern/2009/08/24/msg005957.html and followups. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/kern/kern_turnstile.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/kern_turnstile.c diff -u src/sys/kern/kern_turnstile.c:1.24 src/sys/kern/kern_turnstile.c:1.25 --- src/sys/kern/kern_turnstile.c:1.24 Sat Mar 21 13:11:14 2009 +++ src/sys/kern/kern_turnstile.c Sun Sep 13 14:38:20 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_turnstile.c,v 1.24 2009/03/21 13:11:14 ad Exp $ */ +/* $NetBSD: kern_turnstile.c,v 1.25 2009/09/13 14:38:20 bouyer Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2009 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_turnstile.c,v 1.24 2009/03/21 13:11:14 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_turnstile.c,v 1.25 2009/09/13 14:38:20 bouyer Exp $); #include sys/param.h #include sys/lockdebug.h @@ -253,6 +253,7 @@ sq = ts-ts_sleepq[q]; ts-ts_waiters[q]++; sleepq_enter(sq, l, tc-tc_mutex); + /* now tc-tc_mutex is also cur-l_mutex and l-l_mutex */ LOCKDEBUG_BARRIER(tc-tc_mutex, 1); l-l_kpriority = true; obase = l-l_kpribase; @@ -275,6 +276,7 @@ * compiling a kernel with LOCKDEBUG to pinpoint the problem. */ prio = lwp_eprio(l); + for (;;) { bool dolock; @@ -285,9 +287,24 @@ if (owner == NULL) break; - KASSERT(l != owner); - KASSERT(cur != owner); + /* The owner may have changed as we have dropped the tc lock */ + if (cur == owner) { + /* + * we own the lock: stop here, sleepq_block() + * should wake up immediatly + */ + break; + } + if (l == owner) { + /* owner has changed, restart from curlwp */ + lwp_unlock(l); + l = cur; + lwp_lock(l); + prio = lwp_eprio(l); + continue; + } + if (l-l_mutex != owner-l_mutex) dolock = true; else @@ -295,6 +312,10 @@ if (dolock !lwp_trylock(owner)) { /* * restart from curlwp. + * Note that there may be a livelock here: + * the owner may try grabing cur's lock (which is + * the tc lock) while we're trying to grab + * the owner's lock. */ lwp_unlock(l); l = cur;
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: jmcneill Date: Sun Sep 13 18:13:37 UTC 2009 Modified Files: src/sys/arch/i386/stand/lib: exec.c Log Message: kmod improvements - unless otherwise specified, modules are now loaded from the same device as the kernel ('load miniroot' now implies 'load tftp:miniroot' if the boot command is 'boot tftp:netbsd') - the module name - path expansion now works when a device prefix: is specified ('load tftp:miniroot' now works) - if the module name has been expanded to a path, print that path when loading the module rather than the symbolic name - only print an error in module_open if both the expanded path and the raw path fail to open To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/stand/lib/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.40 src/sys/arch/i386/stand/lib/exec.c:1.41 --- src/sys/arch/i386/stand/lib/exec.c:1.40 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/lib/exec.c Sun Sep 13 18:13:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.40 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: exec.c,v 1.41 2009/09/13 18:13:37 jmcneill Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -124,6 +124,8 @@ #define PAGE_SIZE 4096 #endif +#define MODULE_WARNING_DELAY 500 + extern struct btinfo_console btinfo_console; boot_module_t *boot_modules; @@ -138,7 +140,7 @@ static char module_base[64] = /; static int howto; -static void module_init(void); +static void module_init(const char *); void framebuffer_configure(struct btinfo_framebuffer *fb) @@ -304,7 +306,7 @@ /* pull in any modules if necessary */ if (boot_modules_enabled) { - module_init(); + module_init(file); if (btinfo_modulelist) { BI_ADD(btinfo_modulelist, BTINFO_MODULELIST, btinfo_modulelist_size); @@ -333,12 +335,26 @@ return -1; } +static void +extract_device(const char *path, char *buf, size_t buflen) +{ + int i; + + if (strchr(path, ':') != NULL) { + for (i = 0; i buflen - 2 path[i] != ':'; i++) + buf[i] = path[i]; + buf[i++] = ':'; + buf[i] = '\0'; + } else + buf[0] = '\0'; +} + static const char * -module_path(boot_module_t *bm) +module_path(boot_module_t *bm, const char *kdev) { static char buf[256]; - char name_buf[256]; - const char *name, *name2; + char name_buf[256], dev_buf[64]; + const char *name, *name2, *p; name = bm-bm_path; for (name2 = name; *name2; ++name2) { @@ -350,45 +366,69 @@ break; } } - if (name[0] == '/') - snprintf(buf, sizeof(buf), %s, name); - else - snprintf(buf, sizeof(buf), %s/%s/%s.kmod, - module_base, name, name); + if ((p = strchr(name, ':')) != NULL) { + /* device specified, use it */ + if (p[1] == '/') + snprintf(buf, sizeof(buf), %s, name); + else { + p++; + extract_device(name, dev_buf, sizeof(dev_buf)); + snprintf(buf, sizeof(buf), %s%s/%s/%s.kmod, + dev_buf, module_base, p, p); + } + } else { + /* device not specified; load from kernel device if known */ + if (name[0] == '/') + snprintf(buf, sizeof(buf), %s%s, kdev, name); + else + snprintf(buf, sizeof(buf), %s%s/%s/%s.kmod, + kdev, module_base, name, name); + } return buf; } static int -module_open(boot_module_t *bm, int mode) +module_open(boot_module_t *bm, int mode, const char *kdev, bool doload) { int fd; const char *path; /* check the expanded path first */ - path = module_path(bm); + path = module_path(bm, kdev); fd = open(path, mode); - if (fd == -1) { - printf(WARNING: couldn't open %s\n, path); + if (fd != -1) { + if ((howto AB_SILENT) == 0 doload) + printf(Loading %s , path); + } else { /* now attempt the raw path provided */ fd = open(bm-bm_path, mode); - if (fd == -1) - printf(WARNING: couldn't open %s\n, bm-bm_path); + if (fd != -1 (howto AB_SILENT) == 0 doload) + printf(Loading %s , bm-bm_path); + } + if (!doload fd == -1) { + printf(WARNING: couldn't open %s, bm-bm_path); + if (strcmp(bm-bm_path, path) != 0) + printf( (%s), path); + printf(\n); } return fd; } static void -module_init(void) +module_init(const char *kernel_path) { struct bi_modulelist_entry *bi; struct stat st; const char *machine; + char kdev[64]; char *buf; boot_module_t *bm; size_t len; off_t off; - int err, fd; + int err, fd, nfail = 0; + + extract_device(kernel_path, kdev, sizeof(kdev)); switch (netbsd_elf_class) { case ELFCLASS32: @@ -419,9 +459,10 @@ /* First, see which modules are valid and calculate btinfo size */ len = sizeof(struct btinfo_modulelist); for (bm = boot_modules; bm; bm = bm-bm_next) { - fd = module_open(bm, 0); + fd = module_open(bm, 0, kdev, false); if (fd == -1) { bm-bm_len = -1; + ++nfail; continue; } err = fstat(fd, st); @@ -429,6 +470,7
CVS commit: src/sbin/tunefs
Module Name:src Committed By: bouyer Date: Sun Sep 13 18:30:30 UTC 2009 Modified Files: src/sbin/tunefs: tunefs.c Log Message: Restore change from 1.39 after previous commit. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sbin/tunefs/tunefs.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/tunefs/tunefs.c diff -u src/sbin/tunefs/tunefs.c:1.41 src/sbin/tunefs/tunefs.c:1.42 --- src/sbin/tunefs/tunefs.c:1.41 Sun Sep 13 14:13:23 2009 +++ src/sbin/tunefs/tunefs.c Sun Sep 13 18:30:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tunefs.c,v 1.41 2009/09/13 14:13:23 bouyer Exp $ */ +/* $NetBSD: tunefs.c,v 1.42 2009/09/13 18:30:30 bouyer Exp $ */ /* * Copyright (c) 1983, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = @(#)tunefs.c 8.3 (Berkeley) 5/3/95; #else -__RCSID($NetBSD: tunefs.c,v 1.41 2009/09/13 14:13:23 bouyer Exp $); +__RCSID($NetBSD: tunefs.c,v 1.42 2009/09/13 18:30:30 bouyer Exp $); #endif #endif /* not lint */ @@ -368,7 +368,7 @@ if (!in_fs_log logfilesize 0 old_size 0) errx(1, Can't change size of non-in-filesystem log); - if (old_size == logfilesize logfilesize 0) { + if (old_size == (uint64_t)logfilesize logfilesize 0) { /* no action */ warnx(log file size remains unchanged at %lld, logfilesize); return;
CVS commit: src/share/man/man5
Module Name:src Committed By: jmcneill Date: Sun Sep 13 18:39:20 UTC 2009 Modified Files: src/share/man/man5: boot.cfg.5 Log Message: PR# port-i386/39463: boot.cfg(8) does not mention about relative path for the 'load' option Document the search behaviour of the 'load' directive when an absolute path is not specified. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/share/man/man5/boot.cfg.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man5/boot.cfg.5 diff -u src/share/man/man5/boot.cfg.5:1.16 src/share/man/man5/boot.cfg.5:1.17 --- src/share/man/man5/boot.cfg.5:1.16 Fri Sep 4 10:34:16 2009 +++ src/share/man/man5/boot.cfg.5 Sun Sep 13 18:39:20 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: boot.cfg.5,v 1.16 2009/09/04 10:34:16 wiz Exp $ +.\ $NetBSD: boot.cfg.5,v 1.17 2009/09/13 18:39:20 jmcneill Exp $ .\ .\ Copyright (c) 2007 Stephen Borrill .\ All rights reserved. @@ -25,7 +25,7 @@ .\ INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\ -.Dd September 4, 2009 +.Dd September 13, 2009 .Dt BOOT.CFG 5 .Os .Sh NAME @@ -93,7 +93,13 @@ .It Sy load Used to load kernel modules, which will be passed on to the kernel for initialization during early boot. -The argument is the complete path and file name of the module to be loaded. +The argument is either the complete path and file name of the module to be +loaded, or a symbolic module name. +When the argument is not an absolute path, the boot loader will first +attempt to load +.Pa /stand/machine/kernel_version/modules/name/name.kmod . +If that file does not exist, it will then attempt to load +.Pa /name . May be used as many times as needed. .It Sy menu (may be present multiple times)
CVS commit: src
Module Name:src Committed By: pooka Date: Sun Sep 13 18:45:12 UTC 2009 Modified Files: src/common/include/prop: proplib.h src/common/lib/libprop: prop_kern.c prop_object_impl.h src/sys/compat/sa: compat_sa.c src/sys/dev: rnd.c src/sys/dev/ata: ata.c src/sys/kern: init_main.c kern_lwp.c kern_malloc.c kern_malloc_debug.c kern_time.c subr_pool.c src/sys/netbt: bt_proto.c l2cap.h l2cap_misc.c rfcomm.h rfcomm_session.c src/sys/netinet: igmp.c src/sys/sys: malloc.h pool.h savar.h src/sys/uvm: uvm_aobj.c uvm_swap.c Log Message: Wipe out the last vestiges of POOL_INIT with one swift stroke. In most cases, use a proper constructor. For proplib, give a local equivalent of POOL_INIT for the kernel object implementation. This way the code structure can be preserved, and a local link set is not hazardous anyway (unless proplib is split to several modules, but that'll be the day). tested by booting a kernel in qemu and compile-testing i386/ALL To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/common/include/prop/proplib.h cvs rdiff -u -r1.9 -r1.10 src/common/lib/libprop/prop_kern.c cvs rdiff -u -r1.29 -r1.30 src/common/lib/libprop/prop_object_impl.h cvs rdiff -u -r1.10 -r1.11 src/sys/compat/sa/compat_sa.c cvs rdiff -u -r1.74 -r1.75 src/sys/dev/rnd.c cvs rdiff -u -r1.106 -r1.107 src/sys/dev/ata/ata.c cvs rdiff -u -r1.398 -r1.399 src/sys/kern/init_main.c cvs rdiff -u -r1.132 -r1.133 src/sys/kern/kern_lwp.c cvs rdiff -u -r1.126 -r1.127 src/sys/kern/kern_malloc.c cvs rdiff -u -r1.20 -r1.21 src/sys/kern/kern_malloc_debug.c cvs rdiff -u -r1.160 -r1.161 src/sys/kern/kern_time.c cvs rdiff -u -r1.173 -r1.174 src/sys/kern/subr_pool.c cvs rdiff -u -r1.11 -r1.12 src/sys/netbt/bt_proto.c cvs rdiff -u -r1.8 -r1.9 src/sys/netbt/l2cap.h src/sys/netbt/rfcomm.h cvs rdiff -u -r1.6 -r1.7 src/sys/netbt/l2cap_misc.c cvs rdiff -u -r1.14 -r1.15 src/sys/netbt/rfcomm_session.c cvs rdiff -u -r1.49 -r1.50 src/sys/netinet/igmp.c cvs rdiff -u -r1.104 -r1.105 src/sys/sys/malloc.h cvs rdiff -u -r1.64 -r1.65 src/sys/sys/pool.h cvs rdiff -u -r1.28 -r1.29 src/sys/sys/savar.h cvs rdiff -u -r1.106 -r1.107 src/sys/uvm/uvm_aobj.c cvs rdiff -u -r1.145 -r1.146 src/sys/uvm/uvm_swap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/include/prop/proplib.h diff -u src/common/include/prop/proplib.h:1.6 src/common/include/prop/proplib.h:1.7 --- src/common/include/prop/proplib.h:1.6 Mon Apr 28 20:22:51 2008 +++ src/common/include/prop/proplib.h Sun Sep 13 18:45:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: proplib.h,v 1.6 2008/04/28 20:22:51 martin Exp $ */ +/* $NetBSD: proplib.h,v 1.7 2009/09/13 18:45:10 pooka Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -43,4 +43,8 @@ #include prop/plistref.h +#ifdef _KERNEL +void prop_kern_init(void); +#endif + #endif /* _PROPLIB_PROPLIB_H_ */ Index: src/common/lib/libprop/prop_kern.c diff -u src/common/lib/libprop/prop_kern.c:1.9 src/common/lib/libprop/prop_kern.c:1.10 --- src/common/lib/libprop/prop_kern.c:1.9 Mon Apr 28 20:22:53 2008 +++ src/common/lib/libprop/prop_kern.c Sun Sep 13 18:45:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_kern.c,v 1.9 2008/04/28 20:22:53 martin Exp $ */ +/* $NetBSD: prop_kern.c,v 1.10 2009/09/13 18:45:10 pooka Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -224,12 +224,27 @@ #include sys/systm.h #include sys/proc.h #include sys/resource.h +#include sys/pool.h #include uvm/uvm.h +#include prop_object_impl.h + /* Arbitrary limit ioctl input to 64KB */ unsigned int prop_object_copyin_limit = 65536; +/* initialize proplib for use in the kernel */ +void +prop_kern_init(void) +{ + __link_set_decl(prop_linkpools, struct prop_pool_init); + struct prop_pool_init * const *pi; + + __link_set_foreach(pi, prop_linkpools) + pool_init((*pi)-pp, (*pi)-size, 0, 0, 0, (*pi)-wchan, + pool_allocator_nointr, IPL_NONE); +} + static int _prop_object_copyin_ioctl(const struct plistref *pref, const prop_type_t type, const u_long cmd, prop_object_t *objp) Index: src/common/lib/libprop/prop_object_impl.h diff -u src/common/lib/libprop/prop_object_impl.h:1.29 src/common/lib/libprop/prop_object_impl.h:1.30 --- src/common/lib/libprop/prop_object_impl.h:1.29 Sat Jan 3 18:31:34 2009 +++ src/common/lib/libprop/prop_object_impl.h Sun Sep 13 18:45:10 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: prop_object_impl.h,v 1.29 2009/01/03 18:31:34 pooka Exp $ */ +/* $NetBSD: prop_object_impl.h,v 1.30 2009/09/13 18:45:10 pooka Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -263,8 +263,17 @@ #define _PROP_POOL_GET(p) pool_get((p), PR_WAITOK) #define _PROP_POOL_PUT(p, v) pool_put((p), (v)) -#define _PROP_POOL_INIT(p, s, d) \ - POOL_INIT(p, s, 0, 0, 0, d, pool_allocator_nointr, IPL_NONE); +struct prop_pool_init { +
CVS commit: src/share/man/man5
Module Name:src Committed By: snj Date: Sun Sep 13 18:57:37 UTC 2009 Modified Files: src/share/man/man5: boot.cfg.5 Log Message: Use \*[Lt] and \*[Gt] instead of and . To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/share/man/man5/boot.cfg.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man5/boot.cfg.5 diff -u src/share/man/man5/boot.cfg.5:1.17 src/share/man/man5/boot.cfg.5:1.18 --- src/share/man/man5/boot.cfg.5:1.17 Sun Sep 13 18:39:20 2009 +++ src/share/man/man5/boot.cfg.5 Sun Sep 13 18:57:36 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: boot.cfg.5,v 1.17 2009/09/13 18:39:20 jmcneill Exp $ +.\ $NetBSD: boot.cfg.5,v 1.18 2009/09/13 18:57:36 snj Exp $ .\ .\ Copyright (c) 2007 Stephen Borrill .\ All rights reserved. @@ -97,9 +97,9 @@ loaded, or a symbolic module name. When the argument is not an absolute path, the boot loader will first attempt to load -.Pa /stand/machine/kernel_version/modules/name/name.kmod . +.Pa /stand/\*[Lt]machine\*[Gt]/\*[Lt]kernel_version\*[Gt]/modules/\*[Lt]name\*[Gt]/\*[Lt]name\*[Gt].kmod . If that file does not exist, it will then attempt to load -.Pa /name . +.Pa /\*[Lt]name\*[Gt] . May be used as many times as needed. .It Sy menu (may be present multiple times)
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Sep 13 19:07:19 UTC 2009 Modified Files: src/sys/rump/librump/rumpkern: pool.c Log Message: remove pool link set attach code To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/rump/librump/rumpkern/pool.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/rump/librump/rumpkern/pool.c diff -u src/sys/rump/librump/rumpkern/pool.c:1.14 src/sys/rump/librump/rumpkern/pool.c:1.15 --- src/sys/rump/librump/rumpkern/pool.c:1.14 Wed Jun 3 16:07:21 2009 +++ src/sys/rump/librump/rumpkern/pool.c Sun Sep 13 19:07:18 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pool.c,v 1.14 2009/06/03 16:07:21 pooka Exp $ */ +/* $NetBSD: pool.c,v 1.15 2009/09/13 19:07:18 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pool.c,v 1.14 2009/06/03 16:07:21 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: pool.c,v 1.15 2009/09/13 19:07:18 pooka Exp $); #ifndef RUMP_USE_REAL_ALLOCATORS @@ -45,15 +45,8 @@ void pool_subsystem_init() { - __link_set_decl(pools, struct link_pool_init); - struct link_pool_init *const *pi; -#define _pi(name) (*pi)-name - __link_set_foreach(pi, pools) { - pool_init(_pi(pp), _pi(size), _pi(align), _pi(align_offset), - _pi(flags), _pi(wchan), _pi(palloc), _pi(ipl)); - } -#undef _pi + /* nada */ } void
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Sep 13 19:09:13 UTC 2009 Modified Files: src/sys/rump/librump/rumpkern: rump.c Log Message: call prop_kern_init() To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 src/sys/rump/librump/rumpkern/rump.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/rump/librump/rumpkern/rump.c diff -u src/sys/rump/librump/rumpkern/rump.c:1.113 src/sys/rump/librump/rumpkern/rump.c:1.114 --- src/sys/rump/librump/rumpkern/rump.c:1.113 Tue Sep 8 20:10:44 2009 +++ src/sys/rump/librump/rumpkern/rump.c Sun Sep 13 19:09:13 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rump.c,v 1.113 2009/09/08 20:10:44 pooka Exp $ */ +/* $NetBSD: rump.c,v 1.114 2009/09/13 19:09:13 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.113 2009/09/08 20:10:44 pooka Exp $); +__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.114 2009/09/13 19:09:13 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -62,6 +62,8 @@ #include secmodel/secmodel.h +#include prop/proplib.h + #include rump_private.h #include rump_net_private.h #include rump_vfs_private.h @@ -207,6 +209,7 @@ evcnt_init(); once_init(); + prop_kern_init(); rump_sleepers_init();
CVS commit: src/usr.bin/netstat
Module Name:src Committed By: elad Date: Sun Sep 13 19:04:29 UTC 2009 Modified Files: src/usr.bin/netstat: if.c Log Message: Put some unsigned long long casts (as was in the original printing code). Should fix build breakage noticed by pgoyette@ on current-users@: http://mail-index.netbsd.org/current-users/2009/09/13/msg010554.html (sorry, don't have an amd64 anymore!) To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.65 src/usr.bin/netstat/if.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/netstat/if.c diff -u src/usr.bin/netstat/if.c:1.64 src/usr.bin/netstat/if.c:1.65 --- src/usr.bin/netstat/if.c:1.64 Sun Sep 13 02:53:17 2009 +++ src/usr.bin/netstat/if.c Sun Sep 13 19:04:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.64 2009/09/13 02:53:17 elad Exp $ */ +/* $NetBSD: if.c,v 1.65 2009/09/13 19:04:29 elad Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = from: @(#)if.c 8.2 (Berkeley) 2/21/94; #else -__RCSID($NetBSD: if.c,v 1.64 2009/09/13 02:53:17 elad Exp $); +__RCSID($NetBSD: if.c,v 1.65 2009/09/13 19:04:29 elad Exp $); #endif #endif /* not lint */ @@ -590,15 +590,15 @@ { if (bflag) printf(%10llu %8.8s %10llu %5.5s, - cur-ift_ib - old-ift_ib, , - cur-ift_ob - old-ift_ob, ); + (unsigned long long)(cur-ift_ib - old-ift_ib), , + (unsigned long long)(cur-ift_ob - old-ift_ob), ); else printf(%8llu %5llu %8llu %5llu %5llu, - cur-ift_ip - old-ift_ip, - cur-ift_ie - old-ift_ie, - cur-ift_op - old-ift_op, - cur-ift_oe - old-ift_oe, - cur-ift_co - old-ift_co); + (unsigned long long)(cur-ift_ip - old-ift_ip), + (unsigned long long)(cur-ift_ie - old-ift_ie), + (unsigned long long)(cur-ift_op - old-ift_op), + (unsigned long long)(cur-ift_oe - old-ift_oe), + (unsigned long long)(cur-ift_co - old-ift_co)); if (dflag) printf( %5llu, /* XXX ifnet.if_snd.ifq_drops - ip-ift_dr); */ @@ -610,15 +610,15 @@ { if (bflag) printf( %10llu %8.8s %10llu %5.5s, - cur-ift_ib - old-ift_ib, , - cur-ift_ob - old-ift_ob, ); + (unsigned long long)(cur-ift_ib - old-ift_ib), , + (unsigned long long)(cur-ift_ob - old-ift_ob), ); else printf( %8llu %5llu %8llu %5llu %5llu, - cur-ift_ip - old-ift_ip, - cur-ift_ie - old-ift_ie, - cur-ift_op - old-ift_op, - cur-ift_oe - old-ift_oe, - cur-ift_co - old-ift_co); + (unsigned long long)(cur-ift_ip - old-ift_ip), + (unsigned long long)(cur-ift_ie - old-ift_ie), + (unsigned long long)(cur-ift_op - old-ift_op), + (unsigned long long)(cur-ift_oe - old-ift_oe), + (unsigned long long)(cur-ift_co - old-ift_co)); if (dflag) printf( %5llu, (unsigned long long)(cur-ift_dr - old-ift_dr));
CVS commit: [matt-nb5-mips64] src/compat
Module Name:src Committed By: matt Date: Sun Sep 13 21:21:17 UTC 2009 Modified Files: src/compat [matt-nb5-mips64]: Makefile Makefile.compat src/compat/lib/csu [matt-nb5-mips64]: Makefile src/compat/libexec/ld.elf_so [matt-nb5-mips64]: Makefile Added Files: src/compat/lib/csu/mips [matt-nb5-mips64]: Makefile crt0.c Log Message: Add mips64 support (making n64 libraries) to compat To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.8.1 src/compat/Makefile cvs rdiff -u -r1.3 -r1.3.8.1 src/compat/Makefile.compat cvs rdiff -u -r1.3 -r1.3.8.1 src/compat/lib/csu/Makefile cvs rdiff -u -r0 -r1.1.2.1 src/compat/lib/csu/mips/Makefile \ src/compat/lib/csu/mips/crt0.c cvs rdiff -u -r1.1.2.1 -r1.1.2.1.4.1 src/compat/libexec/ld.elf_so/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/compat/Makefile diff -u src/compat/Makefile:1.1 src/compat/Makefile:1.1.8.1 --- src/compat/Makefile:1.1 Sun Oct 26 07:38:27 2008 +++ src/compat/Makefile Sun Sep 13 21:21:16 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2008/10/26 07:38:27 mrg Exp $ +# $NetBSD: Makefile,v 1.1.8.1 2009/09/13 21:21:16 matt Exp $ # Build 32-bit compat versions of: # src/gnu/lib/libgcc4 into ${DESTDIR}/usr/lib/32arch @@ -10,7 +10,8 @@ .include bsd.own.mk .if ${MKCOMPAT} != no \ -(${MACHINE} == sparc64 || ${MACHINE} == amd64) +(${MACHINE} == sparc64 || ${MACHINE} == amd64) || \ +(${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el) .if !make(includes) SUBDIR= gnu/lib/crtstuff4 .WAIT \ Index: src/compat/Makefile.compat diff -u src/compat/Makefile.compat:1.3 src/compat/Makefile.compat:1.3.8.1 --- src/compat/Makefile.compat:1.3 Tue Oct 28 22:58:23 2008 +++ src/compat/Makefile.compat Sun Sep 13 21:21:16 2009 @@ -1,17 +1,36 @@ -# $NetBSD: Makefile.compat,v 1.3 2008/10/28 22:58:23 mrg Exp $ +# $NetBSD: Makefile.compat,v 1.3.8.1 2009/09/13 21:21:16 matt Exp $ +# XXX ugly +.if ${MACHINE} == sparc64 +LD+= -m elf32_sparc +LDFLAGS+= -m32 +LD32DIR= sparc +ARCH32DIR= sparc COPTS+= -m32 CPUFLAGS+= -m32 LDADD+= -m32 MKDEPFLAGS+= -m32 -# XXX ugly -.if ${MACHINE} == sparc64 -LD+= -m elf32_sparc -LD32DIR= sparc .elif ${MACHINE} == amd64 LD+= -m elf_i386 +LDFLAGS+= -m32 LD32DIR= i386 +ARCH32DIR= i386 +COPTS+= -m32 +CPUFLAGS+= -m32 +LDADD+= -m32 +MKDEPFLAGS+= -m32 + +.elif ${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el +LD+= -m elf64${MACHINE_ARCH:S/mips64e//}tsmip +LDFLAGS+= -mabi=64 +LD32DIR= lib64 +ARCH32DIR= ${MACHINE_ARCH} +COPTS+= -mabi=64 +CPUFLAGS+= -mabi=64 +LDADD+= -mabi=64 +MKDEPFLAGS+= -mabi=64 + .endif LIBDIR= /usr/lib/${LD32DIR} Index: src/compat/lib/csu/Makefile diff -u src/compat/lib/csu/Makefile:1.3 src/compat/lib/csu/Makefile:1.3.8.1 --- src/compat/lib/csu/Makefile:1.3 Mon Oct 27 07:42:55 2008 +++ src/compat/lib/csu/Makefile Sun Sep 13 21:21:16 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2008/10/27 07:42:55 mrg Exp $ +# $NetBSD: Makefile,v 1.3.8.1 2009/09/13 21:21:16 matt Exp $ # XXX .include bsd.own.mk @@ -11,6 +11,8 @@ SUBDIR= i386_elf .elif ${MACHINE_ARCH} == sparc64 SUBDIR= sparc_elf +.elif ${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el +SUBDIR= mips .endif .include bsd.subdir.mk Index: src/compat/libexec/ld.elf_so/Makefile diff -u src/compat/libexec/ld.elf_so/Makefile:1.1.2.1 src/compat/libexec/ld.elf_so/Makefile:1.1.2.1.4.1 --- src/compat/libexec/ld.elf_so/Makefile:1.1.2.1 Thu Nov 6 23:51:26 2008 +++ src/compat/libexec/ld.elf_so/Makefile Sun Sep 13 21:21:17 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1.2.1 2008/11/06 23:51:26 snj Exp $ +# $NetBSD: Makefile,v 1.1.2.1.4.1 2009/09/13 21:21:17 matt Exp $ NOMAN= # defined @@ -9,8 +9,6 @@ SHLINKINSTALLDIR= /usr/libexec -LDFLAGS+= -m32 - #CPPFLAGS+= -DDEBUG #CPPFLAGS+= -DRTLD_DEBUG #CPPFLAGS+= -DRTLD_DEBUG_RELOC @@ -28,6 +26,10 @@ .elif ${MACHINE} == amd64 PROG= ld.elf_so-i386 ARCHSUBDIR= i386 +.elif ${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el +PROG= ld.elf_so-64 +ARCHSUBDIR= mips +ABI64= -mabi=64 .endif # XXX why do i need this? Added files: Index: src/compat/lib/csu/mips/Makefile diff -u /dev/null src/compat/lib/csu/mips/Makefile:1.1.2.1 --- /dev/null Sun Sep 13 21:21:17 2009 +++ src/compat/lib/csu/mips/Makefile Sun Sep 13 21:21:17 2009 @@ -0,0 +1,34 @@ +# $NetBSD: Makefile,v 1.1.2.1 2009/09/13 21:21:17 matt Exp $ + +NOLINT= # defined +NOMAN= # defined +NONLS= # defined +NOINFO= # defined +NOSHARE= # defined + +NOCHECKVER= # defined + +.include bsd.obj.mk + +# Resolve pathnames in variables. +_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD LDADD LIBDPLIBS LIB_ROOT_DIR +.for var in ${_RESOLVE_VARS} +${var}:=${${var}} +.endfor + +_CURDIR:= ${.CURDIR} + +.PATH: ${NETBSDSRCDIR}/lib/csu/mips +.CURDIR:=${NETBSDSRCDIR}/lib/csu/mips + +.include ${NETBSDSRCDIR}/compat/Makefile.compat +.include
CVS commit: src/sys/dev/ic
Module Name:src Committed By: dyoung Date: Sun Sep 13 21:24:58 UTC 2009 Modified Files: src/sys/dev/ic: mfi.c Log Message: Delete whitespace at ends of lines. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/mfi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ic/mfi.c diff -u src/sys/dev/ic/mfi.c:1.29 src/sys/dev/ic/mfi.c:1.30 --- src/sys/dev/ic/mfi.c:1.29 Thu Aug 27 09:40:39 2009 +++ src/sys/dev/ic/mfi.c Sun Sep 13 21:24:58 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mfi.c,v 1.29 2009/08/27 09:40:39 bouyer Exp $ */ +/* $NetBSD: mfi.c,v 1.30 2009/09/13 21:24:58 dyoung Exp $ */ /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */ /* * Copyright (c) 2006 Marco Peereboom ma...@peereboom.us @@ -17,7 +17,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: mfi.c,v 1.29 2009/08/27 09:40:39 bouyer Exp $); +__KERNEL_RCSID(0, $NetBSD: mfi.c,v 1.30 2009/09/13 21:24:58 dyoung Exp $); #include bio.h @@ -114,7 +114,7 @@ static void mfi_xscale_intr_dis(struct mfi_softc *sc); static int mfi_xscale_intr(struct mfi_softc *sc); static void mfi_xscale_post(struct mfi_softc *sc, struct mfi_ccb *ccb); - + static const struct mfi_iop_ops mfi_iop_xscale = { mfi_xscale_fw_state, mfi_xscale_intr_dis, @@ -122,13 +122,13 @@ mfi_xscale_intr, mfi_xscale_post }; - + static uint32_t mfi_ppc_fw_state(struct mfi_softc *sc); static void mfi_ppc_intr_ena(struct mfi_softc *sc); static void mfi_ppc_intr_dis(struct mfi_softc *sc); static int mfi_ppc_intr(struct mfi_softc *sc); static void mfi_ppc_post(struct mfi_softc *sc, struct mfi_ccb *ccb); - + static const struct mfi_iop_ops mfi_iop_ppc = { mfi_ppc_fw_state, mfi_ppc_intr_dis, @@ -136,7 +136,7 @@ mfi_ppc_intr, mfi_ppc_post }; - + #define mfi_fw_state(_s) ((_s)-sc_iop-mio_fw_state(_s)) #define mfi_intr_enable(_s) ((_s)-sc_iop-mio_intr_ena(_s)) #define mfi_intr_disable(_s) ((_s)-sc_iop-mio_intr_dis(_s)) @@ -312,7 +312,7 @@ if (bus_dmamap_create(sc-sc_dmat, size, 1, size, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, mm-am_map) != 0) - goto amfree; + goto amfree; if (bus_dmamem_alloc(sc-sc_dmat, size, PAGE_SIZE, 0, mm-am_seg, 1, nsegs, BUS_DMA_NOWAIT) != 0) @@ -882,7 +882,7 @@ ccb-ccb_flags |= MFI_CCB_F_ERR; return 1; } - + return 0; } @@ -1402,7 +1402,7 @@ } mfi_put_ccb(ccb); scsipi_done(xs); - } else + } else wakeup(ccb); } @@ -2079,7 +2079,7 @@ { return mfi_read(sc, MFI_OMSG0); } - + static void mfi_xscale_intr_dis(struct mfi_softc *sc) { @@ -2091,7 +2091,7 @@ { mfi_write(sc, MFI_OMSK, MFI_ENABLE_INTR); } - + static int mfi_xscale_intr(struct mfi_softc *sc) { @@ -2105,7 +2105,7 @@ mfi_write(sc, MFI_OSTS, status); return 1; } - + static void mfi_xscale_post(struct mfi_softc *sc, struct mfi_ccb *ccb) { @@ -2119,13 +2119,13 @@ mfi_write(sc, MFI_IQP, (ccb-ccb_pframe 3) | ccb-ccb_extra_frames); } - + static uint32_t mfi_ppc_fw_state(struct mfi_softc *sc) { return mfi_read(sc, MFI_OSP); } - + static void mfi_ppc_intr_dis(struct mfi_softc *sc) { @@ -2140,21 +2140,21 @@ mfi_write(sc, MFI_ODC, 0x); mfi_write(sc, MFI_OMSK, ~0x8004); } - + static int mfi_ppc_intr(struct mfi_softc *sc) { uint32_t status; - + status = mfi_read(sc, MFI_OSTS); if (!ISSET(status, MFI_OSTS_PPC_INTR_VALID)) return 0; - + /* write status back to acknowledge interrupt */ mfi_write(sc, MFI_ODC, status); return 1; } - + static void mfi_ppc_post(struct mfi_softc *sc, struct mfi_ccb *ccb) {
CVS commit: src/usr.bin/netstat
Module Name:src Committed By: pgoyette Date: Sun Sep 13 21:46:23 UTC 2009 Modified Files: src/usr.bin/netstat: if.c Log Message: Use PRIu64 for printf'ing stuff. Fixes build breakage on part-amd64 introduced in rev 1.64 (and reverts a partial fix provided in rev 1.65) To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/usr.bin/netstat/if.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/netstat/if.c diff -u src/usr.bin/netstat/if.c:1.65 src/usr.bin/netstat/if.c:1.66 --- src/usr.bin/netstat/if.c:1.65 Sun Sep 13 19:04:29 2009 +++ src/usr.bin/netstat/if.c Sun Sep 13 21:46:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.65 2009/09/13 19:04:29 elad Exp $ */ +/* $NetBSD: if.c,v 1.66 2009/09/13 21:46:23 pgoyette Exp $ */ /* * Copyright (c) 1983, 1988, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = from: @(#)if.c 8.2 (Berkeley) 2/21/94; #else -__RCSID($NetBSD: if.c,v 1.65 2009/09/13 19:04:29 elad Exp $); +__RCSID($NetBSD: if.c,v 1.66 2009/09/13 21:46:23 pgoyette Exp $); #endif #endif /* not lint */ @@ -216,7 +216,7 @@ continue; } - printf(%-5s %-5qu , name, ifd-ifi_mtu); + printf(%-5s %-5 PRIu64, name, ifd-ifi_mtu); print_addr(rti_info[RTAX_IFP], rti_info, ifd); break; @@ -234,7 +234,7 @@ get_rtaddrs(ifam-ifam_addrs, sa, rti_info); - printf(%-5s %-5qu , name, ifd-ifi_mtu); + printf(%-5s %-5 PRIu64, name, ifd-ifi_mtu); print_addr(rti_info[RTAX_IFA], rti_info, ifd); break; } @@ -589,16 +589,16 @@ iftot_print(struct iftot *cur, struct iftot *old) { if (bflag) - printf(%10llu %8.8s %10llu %5.5s, - (unsigned long long)(cur-ift_ib - old-ift_ib), , - (unsigned long long)(cur-ift_ob - old-ift_ob), ); + printf(%10 PRIu64 %8.8s %10 PRIu64 %5.5s, + cur-ift_ib - old-ift_ib, , + cur-ift_ob - old-ift_ob, ); else - printf(%8llu %5llu %8llu %5llu %5llu, - (unsigned long long)(cur-ift_ip - old-ift_ip), - (unsigned long long)(cur-ift_ie - old-ift_ie), - (unsigned long long)(cur-ift_op - old-ift_op), - (unsigned long long)(cur-ift_oe - old-ift_oe), - (unsigned long long)(cur-ift_co - old-ift_co)); + printf(%8 PRIu64 %5 PRIu64 %8 PRIu64 %5 PRIu64 %5 PRIu64, + cur-ift_ip - old-ift_ip, + cur-ift_ie - old-ift_ie, + cur-ift_op - old-ift_op, + cur-ift_oe - old-ift_oe, + cur-ift_co - old-ift_co); if (dflag) printf( %5llu, /* XXX ifnet.if_snd.ifq_drops - ip-ift_dr); */ @@ -609,16 +609,16 @@ iftot_print_sum(struct iftot *cur, struct iftot *old) { if (bflag) - printf( %10llu %8.8s %10llu %5.5s, - (unsigned long long)(cur-ift_ib - old-ift_ib), , - (unsigned long long)(cur-ift_ob - old-ift_ob), ); + printf( %10 PRIu64 %8.8s %10 PRIu64 %5.5s, + cur-ift_ib - old-ift_ib, , + cur-ift_ob - old-ift_ob, ); else - printf( %8llu %5llu %8llu %5llu %5llu, - (unsigned long long)(cur-ift_ip - old-ift_ip), - (unsigned long long)(cur-ift_ie - old-ift_ie), - (unsigned long long)(cur-ift_op - old-ift_op), - (unsigned long long)(cur-ift_oe - old-ift_oe), - (unsigned long long)(cur-ift_co - old-ift_co)); + printf( %8 PRIu64 %5 PRIu64 %8 PRIu64 %5 PRIu64 %5 PRIu64, + cur-ift_ip - old-ift_ip, + cur-ift_ie - old-ift_ie, + cur-ift_op - old-ift_op, + cur-ift_oe - old-ift_oe, + cur-ift_co - old-ift_co); if (dflag) printf( %5llu, (unsigned long long)(cur-ift_dr - old-ift_dr));
CVS commit: [netbsd-5] src/sys/dev/pckbport
Module Name:src Committed By: snj Date: Sun Sep 13 22:07:47 UTC 2009 Modified Files: src/sys/dev/pckbport [netbsd-5]: files.pckbport pms.c pmsvar.h Added Files: src/sys/dev/pckbport [netbsd-5]: elantech.c elantechreg.h elantechvar.h Log Message: Pull up following revision(s) (requested by jmcneill in ticket #943): sys/dev/pckbport/files.pckbport: revision 1.7 sys/dev/pckbport/elantech.c: revision 1.1 sys/dev/pckbport/elantechreg.h: revision 1.1 sys/dev/pckbport/elantechvar.h: revision 1.1 sys/dev/pckbport/pms.c: revision 1.27 sys/dev/pckbport/pmsvar.h: revision 1.8 Add Elantech multi-touch driver. To generate a diff of this commit: cvs rdiff -u -r0 -r1.3.10.2 src/sys/dev/pckbport/elantech.c cvs rdiff -u -r0 -r1.1.10.2 src/sys/dev/pckbport/elantechreg.h \ src/sys/dev/pckbport/elantechvar.h cvs rdiff -u -r1.6 -r1.6.20.1 src/sys/dev/pckbport/files.pckbport cvs rdiff -u -r1.26 -r1.26.14.1 src/sys/dev/pckbport/pms.c cvs rdiff -u -r1.7 -r1.7.14.1 src/sys/dev/pckbport/pmsvar.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/files.pckbport diff -u src/sys/dev/pckbport/files.pckbport:1.6 src/sys/dev/pckbport/files.pckbport:1.6.20.1 --- src/sys/dev/pckbport/files.pckbport:1.6 Sun Jan 6 19:42:33 2008 +++ src/sys/dev/pckbport/files.pckbport Sun Sep 13 22:07:47 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.pckbport,v 1.6 2008/01/06 19:42:33 christos Exp $ +# $NetBSD: files.pckbport,v 1.6.20.1 2009/09/13 22:07:47 snj Exp $ # devices attached at pckbport, for use with wscons defflag opt_wskbdmap.h WSKBD_USONLY @@ -15,7 +15,9 @@ defflag opt_pms.h PMS_DISABLE_POWERHOOK defflag opt_pms.h PMS_SYNAPTICS_TOUCHPAD +defflag opt_pms.h PMS_ELANTECH_TOUCHPAD device pms: wsmousedev attach pms at pckbport file dev/pckbport/pms.c pms file dev/pckbport/synaptics.c pms pms_synaptics_touchpad +file dev/pckbport/elantech.c pms pms_elantech_touchpad Index: src/sys/dev/pckbport/pms.c diff -u src/sys/dev/pckbport/pms.c:1.26 src/sys/dev/pckbport/pms.c:1.26.14.1 --- src/sys/dev/pckbport/pms.c:1.26 Sat Mar 15 18:59:07 2008 +++ src/sys/dev/pckbport/pms.c Sun Sep 13 22:07:47 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.26 2008/03/15 18:59:07 cube Exp $ */ +/* $NetBSD: pms.c,v 1.26.14.1 2009/09/13 22:07:47 snj Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.26 2008/03/15 18:59:07 cube Exp $); +__KERNEL_RCSID(0, $NetBSD: pms.c,v 1.26.14.1 2009/09/13 22:07:47 snj Exp $); #include opt_pms.h @@ -43,6 +43,9 @@ #ifdef PMS_SYNAPTICS_TOUCHPAD #include dev/pckbport/synapticsvar.h #endif +#ifdef PMS_ELANTECH_TOUCHPAD +#include dev/pckbport/elantechvar.h +#endif #include dev/pckbport/pmsreg.h #include dev/pckbport/pmsvar.h @@ -67,7 +70,8 @@ { { 0, 0, 0 }, 0, no scroll wheel (3 buttons) }, { { 200, 100, 80 }, 3, scroll wheel (3 buttons) }, { { 200, 200, 80 }, 4, scroll wheel (5 buttons) }, - { { 0, 0, 0 }, 0, synaptics } + { { 0, 0, 0 }, 0, synaptics }, + { { 0, 0, 0 }, 0, elantech } }; @@ -204,6 +208,11 @@ sc-protocol = PMS_SYNAPTICS; } else #endif +#ifdef PMS_ELANTECH_TOUCHPAD + if (pms_elantech_probe_init(sc) == 0) { + sc-protocol = PMS_ELANTECH; + } else +#endif /* Install generic handler. */ pckbport_set_inputhandler(sc-sc_kbctag, sc-sc_kbcslot, pmsinput, sc, device_xname(sc-sc_dev)); @@ -251,6 +260,10 @@ if (sc-protocol == PMS_SYNAPTICS) pms_synaptics_enable(sc); #endif +#ifdef PMS_ELANTECH_TOUCHPAD + if (sc-protocol == PMS_ELANTECH) + pms_elantech_enable(sc); +#endif cmd[0] = PMS_DEV_ENABLE; res = pckbport_enqueue_cmd(sc-sc_kbctag, sc-sc_kbcslot, cmd, @@ -359,6 +372,14 @@ } } else #endif +#ifdef PMS_ELANTECH_TOUCHPAD + if (sc-protocol == PMS_ELANTECH) { + pms_elantech_resume(sc); + if (sc-sc_enabled) { + do_enable(sc); + } + } else +#endif if (sc-sc_enabled) { /* recheck protocol init mouse */ sc-protocol = PMS_UNKNOWN; @@ -432,10 +453,8 @@ device_xname(sc-sc_dev), res)); } -#ifdef PMS_SYNAPTICS_TOUCHPAD - /* For the synaptics case, leave the protocol alone. */ - if (sc-protocol != PMS_SYNAPTICS) -#endif + /* For the synaptics and elantech case, leave the protocol alone. */ + if (sc-protocol != PMS_SYNAPTICS sc-protocol != PMS_ELANTECH) sc-protocol = PMS_UNKNOWN; pms_enable(sc); Index: src/sys/dev/pckbport/pmsvar.h diff -u src/sys/dev/pckbport/pmsvar.h:1.7 src/sys/dev/pckbport/pmsvar.h:1.7.14.1 --- src/sys/dev/pckbport/pmsvar.h:1.7 Sat Mar 15 18:59:07 2008 +++ src/sys/dev/pckbport/pmsvar.h Sun Sep 13 22:07:47 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmsvar.h,v 1.7 2008/03/15 18:59:07 cube Exp $ */ +/* $NetBSD: pmsvar.h,v 1.7.14.1 2009/09/13 22:07:47 snj Exp $ */ /*- * Copyright (c) 2004 Kentaro Kurahone. @@ -28,12 +28,16 @@ #ifndef
CVS commit: src/sys/dev/ic
Module Name:src Committed By: dyoung Date: Sun Sep 13 22:07:34 UTC 2009 Modified Files: src/sys/dev/ic: atw.c atwvar.h Log Message: Experimental support for fragmentation and RTS/CTS. Delete unused atw_voodoo and constants. Export Tx/Rx statistics with evcnt(9). Correct the Short Inter-Frame Space (SIFS) that we write to ADM8211's registers; I do not recall if that corrected the SIFS that I observed on the air. Use the constant IEEE80211_DUR_DS_EIFS to configure the ADM8211's EIFS, instead of writing the same magic number, 0x64, that my reference driver wrote. Do not clear OACTIVE in atw_init(), because atw_stop() cleared it previously by calling atw_txdrain(). Use the net80211 short-preamble flag and instead of ATW_SHPREAMBLE. Add an ADM8211 workaround from the reference driver, atw_workaround1(), but don't compile it right now. In at_intr(), don't stop processing the interrupt status after restarting the receive ring, but process Tx interrupt status. If a packet's Tx lifetime is exceeded, reinitialize the device to get packets moving again. If the Tx FIFO underflows, restart the transmitter, not the receiver! Avoid losing synchronization with the Rx ring by replicating one of Charles Hannum's fixes to rtw(4) here: receiving a management packet may, as a side-effect, reset the Rx ring, so refer to the softc's Rx ring pointer, sc_rxptr, every time through the loop in atw_rxintr(), instead of refering to a pointer on the stack, i. Re-synchronize DMA after reading the OWN bit on an Rx/Tx descriptor. XXX This needs more work. Reset sc_tx_timer as Tx descriptors are reclaimed from the device. Shorten staircases in atw_watchdog(). Remove from softc an unused member, sc_intr_ack. To generate a diff of this commit: cvs rdiff -u -r1.144 -r1.145 src/sys/dev/ic/atw.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/ic/atwvar.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/ic/atw.c diff -u src/sys/dev/ic/atw.c:1.144 src/sys/dev/ic/atw.c:1.145 --- src/sys/dev/ic/atw.c:1.144 Sat Sep 5 14:19:30 2009 +++ src/sys/dev/ic/atw.c Sun Sep 13 22:07:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: atw.c,v 1.144 2009/09/05 14:19:30 tsutsui Exp $ */ +/* $NetBSD: atw.c,v 1.145 2009/09/13 22:07:34 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: atw.c,v 1.144 2009/09/05 14:19:30 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: atw.c,v 1.145 2009/09/13 22:07:34 dyoung Exp $); #include bpfilter.h @@ -48,6 +48,7 @@ #include sys/ioctl.h #include sys/errno.h #include sys/device.h +#include sys/kauth.h #include sys/time.h #include lib/libkern/libkern.h @@ -131,10 +132,6 @@ #define ATW_REFSLAVE /* slavishly do what the reference driver does */ -#define VOODOO_DUR_11_ROUNDING 0x01 /* necessary */ -#define VOODOO_DUR_2_4_SPECIALCASE 0x02 /* NOT necessary */ -int atw_voodoo = VOODOO_DUR_11_ROUNDING; - int atw_pseudo_milli = 1; int atw_magic_delay1 = 100 * 1000; int atw_magic_delay2 = 100 * 1000; @@ -211,7 +208,7 @@ /* Interrupt handlers */ void atw_linkintr(struct atw_softc *, u_int32_t); void atw_rxintr(struct atw_softc *); -void atw_txintr(struct atw_softc *); +void atw_txintr(struct atw_softc *, uint32_t); /* 802.11 state machine */ static int atw_newstate(struct ieee80211com *, enum ieee80211_state, int); @@ -718,7 +715,7 @@ * before this point releases all resources that may have been * allocated. */ - sc-sc_flags |= ATWF_ATTACHED /* | ATWF_RTSCTS */; + sc-sc_flags |= ATWF_ATTACHED; ATW_DPRINTF(( SROM MAC %04x%04x%04x, htole16(sc-sc_srom[ATW_SR_MAC00]), @@ -1158,10 +1155,10 @@ * Go figure. */ ifst = __SHIFTIN(IEEE80211_DUR_DS_SLOT, ATW_IFST_SLOT_MASK) | - __SHIFTIN(22 * 5 /* IEEE80211_DUR_DS_SIFS */ /* # of 22 MHz cycles */, + __SHIFTIN(22 * 10 /* IEEE80211_DUR_DS_SIFS */ /* # of 22 MHz cycles */, ATW_IFST_SIFS_MASK) | __SHIFTIN(IEEE80211_DUR_DS_DIFS, ATW_IFST_DIFS_MASK) | - __SHIFTIN(0x64 /* IEEE80211_DUR_DS_EIFS */, ATW_IFST_EIFS_MASK); + __SHIFTIN(IEEE80211_DUR_DS_EIFS, ATW_IFST_EIFS_MASK); ATW_WRITE(sc, ATW_IFST, ifst); } @@ -1436,7 +1433,6 @@ * Note that the interface is now running. */ ifp-if_flags |= IFF_RUNNING; - ifp-if_flags = ~IFF_OACTIVE; /* send no beacons, yet. */ atw_start_beacon(sc, 0); @@ -1447,7 +1443,7 @@ error = ieee80211_new_state(ic, IEEE80211_S_SCAN, -1); out: if (error) { - ifp-if_flags = ~(IFF_RUNNING | IFF_OACTIVE); + ifp-if_flags = ~IFF_RUNNING; sc-sc_tx_timer = 0; ifp-if_timer = 0; printf(%s: interface not running\n, device_xname(sc-sc_dev)); @@ -2368,7 +2364,7 @@ /* TBD use ni_capinfo */ capinfo = 0; - if (sc-sc_flags ATWF_SHORT_PREAMBLE) + if (ic-ic_flags IEEE80211_F_SHPREAMBLE) capinfo |=
CVS commit: [netbsd-5] src/sys/dev/pckbport
Module Name:src Committed By: snj Date: Sun Sep 13 22:08:30 UTC 2009 Modified Files: src/sys/dev/pckbport [netbsd-5]: elantech.c Log Message: Pull up following revision(s) (requested by jmcneill in ticket #943): sys/dev/pckbport/elantech.c: revision 1.2 Remove debug printfs To generate a diff of this commit: cvs rdiff -u -r1.3.10.2 -r1.3.10.3 src/sys/dev/pckbport/elantech.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pckbport/elantech.c diff -u src/sys/dev/pckbport/elantech.c:1.3.10.2 src/sys/dev/pckbport/elantech.c:1.3.10.3 --- src/sys/dev/pckbport/elantech.c:1.3.10.2 Sun Sep 13 22:07:47 2009 +++ src/sys/dev/pckbport/elantech.c Sun Sep 13 22:08:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: elantech.c,v 1.3.10.2 2009/09/13 22:07:47 snj Exp $ */ +/* $NetBSD: elantech.c,v 1.3.10.3 2009/09/13 22:08:30 snj Exp $ */ /*- * Copyright (c) 2008 Jared D. McNeill jmcne...@invisible.ca @@ -29,7 +29,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.3.10.2 2009/09/13 22:07:47 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.3.10.3 2009/09/13 22:08:30 snj Exp $); #include sys/param.h #include sys/systm.h @@ -355,29 +355,21 @@ cmd[0] = PMS_SET_SCALE11; if ((res = pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, - cmd, 1, 0, NULL, 0)) != 0) { - printf(PMS_SET_SCALE11(1) failed\n); + cmd, 1, 0, NULL, 0)) != 0) goto doreset; - } cmd[0] = PMS_SET_SCALE11; if ((res = pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, - cmd, 1, 0, NULL, 0)) != 0) { - printf(PMS_SET_SCALE11(2) failed\n); + cmd, 1, 0, NULL, 0)) != 0) goto doreset; - } cmd[0] = PMS_SET_SCALE11; if ((res = pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, - cmd, 1, 0, NULL, 0)) != 0) { - printf(PMS_SET_SCALE11(3) failed\n); + cmd, 1, 0, NULL, 0)) != 0) goto doreset; - } cmd[0] = PMS_SEND_DEV_STATUS; if ((res = pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, - cmd, 1, 3, resp, 0)) != 0) { - printf(PMS_SEND_DEV_STATUS failed\n); + cmd, 1, 3, resp, 0)) != 0) goto doreset; - } if (!ELANTECH_MAGIC(resp)) { aprint_error_dev(psc-sc_dev, @@ -423,7 +415,6 @@ return 0; doreset: - printf(elantech probe failed, resetting device\n); cmd[0] = PMS_RESET; (void)pckbport_poll_cmd(psc-sc_kbctag, psc-sc_kbcslot, cmd, 1, 2, resp, 1);
CVS commit: [netbsd-5] src/sys/dev/pckbport
Module Name:src Committed By: snj Date: Sun Sep 13 22:09:17 UTC 2009 Modified Files: src/sys/dev/pckbport [netbsd-5]: elantech.c Log Message: Pull up following revision(s) (requested by jmcneill in ticket #943): sys/dev/pckbport/elantech.c: revision 1.3 Silence printf in common device not found error path. To generate a diff of this commit: cvs rdiff -u -r1.3.10.3 -r1.3.10.4 src/sys/dev/pckbport/elantech.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pckbport/elantech.c diff -u src/sys/dev/pckbport/elantech.c:1.3.10.3 src/sys/dev/pckbport/elantech.c:1.3.10.4 --- src/sys/dev/pckbport/elantech.c:1.3.10.3 Sun Sep 13 22:08:30 2009 +++ src/sys/dev/pckbport/elantech.c Sun Sep 13 22:09:17 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: elantech.c,v 1.3.10.3 2009/09/13 22:08:30 snj Exp $ */ +/* $NetBSD: elantech.c,v 1.3.10.4 2009/09/13 22:09:17 snj Exp $ */ /*- * Copyright (c) 2008 Jared D. McNeill jmcne...@invisible.ca @@ -29,7 +29,7 @@ #include opt_pms.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.3.10.3 2009/09/13 22:08:30 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: elantech.c,v 1.3.10.4 2009/09/13 22:09:17 snj Exp $); #include sys/param.h #include sys/systm.h @@ -47,6 +47,8 @@ #include dev/pckbport/pmsreg.h #include dev/pckbport/pmsvar.h +/* #define ELANTECH_DEBUG */ + static int elantech_xy_unprecision_nodenum; static int elantech_z_unprecision_nodenum; @@ -372,9 +374,11 @@ goto doreset; if (!ELANTECH_MAGIC(resp)) { +#ifdef ELANTECH_DEBUG aprint_error_dev(psc-sc_dev, bad elantech magic (%X %X %X)\n, resp[0], resp[1], resp[2]); +#endif res = 1; goto doreset; }
CVS commit: [netbsd-5] src/sys/arch/i386/conf
Module Name:src Committed By: snj Date: Sun Sep 13 22:11:14 UTC 2009 Modified Files: src/sys/arch/i386/conf [netbsd-5]: ALL GENERIC Log Message: Pull up following revision(s) (requested by jmcneill in ticket #943): sys/arch/i386/conf/ALL: revision 1.186 sys/arch/i386/conf/GENERIC: revision 1.921 add options PMS_ELANTECH_TOUCHPAD To generate a diff of this commit: cvs rdiff -u -r1.183.4.2 -r1.183.4.3 src/sys/arch/i386/conf/ALL cvs rdiff -u -r1.915.2.5 -r1.915.2.6 src/sys/arch/i386/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/i386/conf/ALL diff -u src/sys/arch/i386/conf/ALL:1.183.4.2 src/sys/arch/i386/conf/ALL:1.183.4.3 --- src/sys/arch/i386/conf/ALL:1.183.4.2 Fri May 1 01:20:41 2009 +++ src/sys/arch/i386/conf/ALL Sun Sep 13 22:11:14 2009 @@ -1,4 +1,4 @@ -# $NetBSD: ALL,v 1.183.4.2 2009/05/01 01:20:41 snj Exp $ +# $NetBSD: ALL,v 1.183.4.3 2009/09/13 22:11:14 snj Exp $ # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp # # ALL machine description file @@ -17,7 +17,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident ALL-$Revision: 1.183.4.2 $ +#ident ALL-$Revision: 1.183.4.3 $ maxusers 32 # estimated number of users @@ -519,6 +519,7 @@ pms* at pckbc? # PS/2 mouse for wsmouse options PMS_DISABLE_POWERHOOK # Disable PS/2 reset on resume options PMS_SYNAPTICS_TOUCHPAD # Enable support for Synaptics Touchpads +options PMS_ELANTECH_TOUCHPAD # Enable support for Elantech Touchpads vga0 at isa? vga* at pci? dev ? function ? pcdisplay0 at isa? # CGA, MDA, EGA, HGA Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.915.2.5 src/sys/arch/i386/conf/GENERIC:1.915.2.6 --- src/sys/arch/i386/conf/GENERIC:1.915.2.5 Sun May 3 23:45:46 2009 +++ src/sys/arch/i386/conf/GENERIC Sun Sep 13 22:11:14 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.915.2.5 2009/05/03 23:45:46 snj Exp $ +# $NetBSD: GENERIC,v 1.915.2.6 2009/09/13 22:11:14 snj Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident GENERIC-$Revision: 1.915.2.5 $ +#ident GENERIC-$Revision: 1.915.2.6 $ maxusers 64 # estimated number of users @@ -528,6 +528,7 @@ pms* at pckbc? # PS/2 mouse for wsmouse #options PMS_DISABLE_POWERHOOK # Disable PS/2 reset on resume options PMS_SYNAPTICS_TOUCHPAD # Enable support for Synaptics Touchpads +options PMS_ELANTECH_TOUCHPAD # Enable support for Elantech Touchpads vga0 at isa? vga* at pci? dev ? function ? pcdisplay0 at isa? # CGA, MDA, EGA, HGA
CVS commit: [netbsd-5] src/sys/arch/amd64/conf
Module Name:src Committed By: snj Date: Sun Sep 13 22:12:12 UTC 2009 Modified Files: src/sys/arch/amd64/conf [netbsd-5]: GENERIC Log Message: Pull up following revision(s) (requested by jmcneill in ticket #943): sys/arch/amd64/conf/GENERIC: revision 1.235 add options PMS_ELANTECH_TOUCHPAD To generate a diff of this commit: cvs rdiff -u -r1.231.4.3 -r1.231.4.4 src/sys/arch/amd64/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/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.231.4.3 src/sys/arch/amd64/conf/GENERIC:1.231.4.4 --- src/sys/arch/amd64/conf/GENERIC:1.231.4.3 Sun May 3 23:45:46 2009 +++ src/sys/arch/amd64/conf/GENERIC Sun Sep 13 22:12:12 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.231.4.3 2009/05/03 23:45:46 snj Exp $ +# $NetBSD: GENERIC,v 1.231.4.4 2009/09/13 22:12:12 snj Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident GENERIC-$Revision: 1.231.4.3 $ +#ident GENERIC-$Revision: 1.231.4.4 $ maxusers 64 # estimated number of users @@ -355,6 +355,7 @@ pms* at pckbc? # PS/2 mouse for wsmouse #options PMS_DISABLE_POWERHOOK # Disable PS/2 reset on resume options PMS_SYNAPTICS_TOUCHPAD # Enable support for Synaptics Touchpads +options PMS_ELANTECH_TOUCHPAD # Enable support for Elantech Touchpads vga* at pci? dev ? function ? wsdisplay* at vga? console ? wskbd* at pckbd? console ?
CVS commit: [netbsd-5] src/share/man/man4
Module Name:src Committed By: snj Date: Sun Sep 13 22:13:05 UTC 2009 Modified Files: src/share/man/man4 [netbsd-5]: pms.4 Log Message: Pull up following revision(s) (requested by jmcneill in ticket #943): share/man/man4/pms.4: revision 1.22 Document PMS_ELANTECH_TOUCHPAD option and hw.elantech.* sysctls, bump date. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.21.34.1 src/share/man/man4/pms.4 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man4/pms.4 diff -u src/share/man/man4/pms.4:1.21 src/share/man/man4/pms.4:1.21.34.1 --- src/share/man/man4/pms.4:1.21 Tue Jan 18 13:42:37 2005 +++ src/share/man/man4/pms.4 Sun Sep 13 22:13:04 2009 @@ -1,4 +1,4 @@ -.\ $NetBSD: pms.4,v 1.21 2005/01/18 13:42:37 wiz Exp $ +.\ $NetBSD: pms.4,v 1.21.34.1 2009/09/13 22:13:04 snj Exp $ .\ .\ Copyright (c) 1993 Christopher G. Demetriou .\ All rights reserved. @@ -32,7 +32,7 @@ .\ .\ Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp .\ -.Dd January 18, 2005 +.Dd December 13, 2008 .Dt PMS 4 .Os .Sh NAME @@ -45,6 +45,7 @@ .Pp .Cd options PMS_DISABLE_POWERHOOK .Cd options PMS_SYNAPTICS_TOUCHPAD +.Cd options PMS_ELANTECH_TOUCHPAD .Sh DESCRIPTION The .Nm @@ -82,14 +83,18 @@ .Nm driver supports the .Dq Synaptics -touchpad in native mode, enabled with the +and +.Dq Elantech +touchpads in native mode, enabled with the .Va PMS_SYNAPTICS_TOUCHPAD -kernel option. +and +.Va PMS_ELANTECH_TOUCHPAD +kernel options. This allows the driver to take advantage of extra -features available on Synaptics Touchpads. +features available on Synaptics and Elantech Touchpads. The following .Xr sysctl 8 -variables control the touchpad's behavior: +variables control behavior of Synaptics touchpads: .Bl -tag .It Dv hw.synaptics.up_down_emulation If the touchpad reports the existence of Up/Down buttons, this value @@ -144,6 +149,20 @@ Movements of less than this value (in Synaptics coordinates) are ignored (default 4). .El +.Pp +The following +.Xr sysctl 8 +variables control behavior of Elantech touchpads: +.Bl -tag +.It Dv hw.elantech.xy_precision_shift +.It Dv hw.elantech.z_precision_shift +Increased values improve the accuracy of X, Y, and Z-axis reporting +at the expense of slower mouse movement (default 2 for xy, +and 3 for z). +.El +.Pp +For Elantech touchpads, the Z-axis is emulated using two-finger +Y-axis reporting. .Sh SEE ALSO .Xr pckbc 4 , .Xr ums 4 , @@ -161,6 +180,9 @@ The changes to add .Dq Synaptics pad support were by Ales Krenek, Kentaro A. Kurahone, and Steve C. Woodford. +The changes to add +.Dq Elantech +pad support were by Jared D. McNeill. .Sh BUGS It is possible for the driver to mistakenly negotiate the non-scroll-wheel protocol, after which it is unlikely to recover until the device is closed
CVS commit: [netbsd-5] src/doc
Module Name:src Committed By: snj Date: Sun Sep 13 22:16:39 UTC 2009 Modified Files: src/doc [netbsd-5]: CHANGES-5.1 Log Message: Ticket 943. To generate a diff of this commit: cvs rdiff -u -r1.1.2.68 -r1.1.2.69 src/doc/CHANGES-5.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-5.1 diff -u src/doc/CHANGES-5.1:1.1.2.68 src/doc/CHANGES-5.1:1.1.2.69 --- src/doc/CHANGES-5.1:1.1.2.68 Fri Sep 11 23:01:27 2009 +++ src/doc/CHANGES-5.1 Sun Sep 13 22:16:39 2009 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-5.1,v 1.1.2.68 2009/09/11 23:01:27 bouyer Exp $ +# $NetBSD: CHANGES-5.1,v 1.1.2.69 2009/09/13 22:16:39 snj Exp $ A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1 release: @@ -2435,3 +2435,17 @@ Apply revisions 1.14 and 1.15 from expat CVS to fix SA36425. [snj, ticket #951] +share/man/man4/pms.41.22-1.23 +sys/arch/amd64/conf/GENERIC 1.235 +sys/arch/i386/conf/ALL1.186 +sys/arch/i386/conf/GENERIC 1.921 +sys/dev/pckbport/elantech.c 1.1-1.3 +sys/dev/pckbport/elantechreg.h 1.1 +sys/dev/pckbport/elantechvar.h 1.1 +sys/dev/pckbport/files.pckbport 1.7 +sys/dev/pckbport/pms.c1.27 +sys/dev/pckbport/pmsvar.h 1.8 + + Add Elantech multi-touch driver. + [jmcneill, ticket #943] +
CVS commit: src/external/bsd/file/dist/magic/magdir
Module Name:src Committed By: wiz Date: Sun Sep 13 22:16:45 UTC 2009 Modified Files: src/external/bsd/file/dist/magic/magdir: diff Log Message: Recognize bsdiff(1) files. Patch already sent upstream. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/file/dist/magic/magdir/diff Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/file/dist/magic/magdir/diff diff -u src/external/bsd/file/dist/magic/magdir/diff:1.1.1.1 src/external/bsd/file/dist/magic/magdir/diff:1.2 --- src/external/bsd/file/dist/magic/magdir/diff:1.1.1.1 Fri May 8 16:35:08 2009 +++ src/external/bsd/file/dist/magic/magdir/diff Sun Sep 13 22:16:45 2009 @@ -12,3 +12,8 @@ 0 search/1 Index: RCS/CVS diff output text !:mime text/x-diff +# +#-- +# bsdiff: file(1) magic for bsdiff(1) output +# +0 string BSDIFF40 bsdiff(1) patch file
CVS commit: [matt-nb5-mips64] src/share/mk
Module Name:src Committed By: matt Date: Sun Sep 13 22:24:41 UTC 2009 Modified Files: src/share/mk [matt-nb5-mips64]: bsd.own.mk Log Message: Enabled MKCOMPAT=yes for mips64e[bl] To generate a diff of this commit: cvs rdiff -u -r1.542.2.9.4.2 -r1.542.2.9.4.3 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.542.2.9.4.2 src/share/mk/bsd.own.mk:1.542.2.9.4.3 --- src/share/mk/bsd.own.mk:1.542.2.9.4.2 Wed Aug 26 03:34:20 2009 +++ src/share/mk/bsd.own.mk Sun Sep 13 22:24:40 2009 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.542.2.9.4.2 2009/08/26 03:34:20 matt Exp $ +# $NetBSD: bsd.own.mk,v 1.542.2.9.4.3 2009/09/13 22:24:40 matt Exp $ .if !defined(_BSD_OWN_MK_) _BSD_OWN_MK_=1 @@ -630,7 +630,8 @@ # # MK* options which have variable defaults. # -.if ${MACHINE} == amd64 || ${MACHINE} == sparc64 +.if ${MACHINE} == amd64 || ${MACHINE} == sparc64 || \ +${MACHINE_ARCH} == mips64eb || ${MACHINE_ARCH} == mips64el MKCOMPAT?= yes .else # Don't let this build where it really isn't supported.
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jmcneill Date: Sun Sep 13 22:45:27 UTC 2009 Modified Files: src/sys/arch/i386/stand/boot: boot2.c src/sys/arch/i386/stand/lib: biosdisk.c libi386.h Log Message: Make the 'dev' command print out a list of known boot devices based on information from the BIOS in addition to the currently selected default partition. Handy when you don't know where to boot from. Here's a demo: type ? or help for help. dev disk hd0 size 3815 MB hd0a(4.2BSD) hd0b(swap) disk cd0 cd0a(unknown) default hd0a To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.28 -r1.29 src/sys/arch/i386/stand/lib/biosdisk.c cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/stand/lib/libi386.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/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.44 src/sys/arch/i386/stand/boot/boot2.c:1.45 --- src/sys/arch/i386/stand/boot/boot2.c:1.44 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/boot/boot2.c Sun Sep 13 22:45:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.44 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: boot2.c,v 1.45 2009/09/13 22:45:27 jmcneill Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -420,7 +420,8 @@ const char *file; /* dummy */ if (*arg == '\0') { - printf(%s%d%c:\n, default_devname, default_unit, + biosdisk_probe(); + printf(default %s%d%c\n, default_devname, default_unit, 'a' + default_partition); return; } Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.28 src/sys/arch/i386/stand/lib/biosdisk.c:1.29 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.28 Sat Jan 5 15:28:43 2008 +++ src/sys/arch/i386/stand/lib/biosdisk.c Sun Sep 13 22:45:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.28 2008/01/05 15:28:43 dsl Exp $ */ +/* $NetBSD: biosdisk.c,v 1.29 2009/09/13 22:45:27 jmcneill Exp $ */ /* * Copyright (c) 1996, 1998 @@ -63,16 +63,21 @@ * the rights to redistribute these changes. */ +#ifndef NO_DISKLABEL +#define FSTYPENAMES +#endif + #include sys/types.h -#include sys/disklabel.h #include sys/md5.h #include sys/param.h +#include sys/disklabel.h #include fs/cd9660/iso.h #include lib/libsa/stand.h #include lib/libsa/saerrno.h #include machine/stdarg.h +#include machine/cpu.h #include libi386.h #include biosdisk_ll.h @@ -292,6 +297,79 @@ } #endif /* NO_DISKLABEL */ +void +biosdisk_probe(void) +{ +#ifndef NO_DISKLABEL + struct disklabel *lp; + int first, part; +#endif + struct biosdisk d; + struct biosdisk_extinfo ed; + uint64_t size; + int i; + + for (i = 0; i MAX_BIOSDISKS + 2; i++) { + first = 1; + memset(d, 0, sizeof(d)); + memset(ed, 0, sizeof(ed)); + if (i = MAX_BIOSDISKS) + d.ll.dev = 0x00 + i - MAX_BIOSDISKS; /* fd */ + else + d.ll.dev = 0x80 + i; /* hd/cd */ + if (set_geometry(d.ll, ed)) + continue; + switch (d.ll.type) { + case BIOSDISK_TYPE_CD: + printf(disk cd0\n); + printf( cd0a(unknown)\n); + break; + case BIOSDISK_TYPE_FD: + printf(disk fd%d\n, d.ll.dev 0x7f); + printf( fd%da(unknown)\n, d.ll.dev 0x7f); + break; + case BIOSDISK_TYPE_HD: + printf(disk hd%d, d.ll.dev 0x7f); + if (d.ll.flags BIOSDISK_INT13EXT) { +printf( size ); +size = ed.totsec * ed.sbytes; +if (size = (10ULL * 1024 * 1024 * 1024)) + printf(%llu GB, + size / (1024 * 1024 * 1024)); +else + printf(%llu MB, + size / (1024 * 1024)); + } + printf(\n); + break; + } +#ifndef NO_DISKLABEL + if (read_label(d) == -1) + break; + lp = (struct disklabel *)(d.buf + LABELOFFSET); + for (part = 0; part lp-d_npartitions; part++) { + if (lp-d_partitions[part].p_size == 0) +continue; + if (lp-d_partitions[part].p_fstype == FS_UNUSED) +continue; + if (first) { +printf( ); +first = 0; + } + printf( hd%d%c(, d.ll.dev 0x7f, part + 'a'); + if (lp-d_partitions[part].p_fstype FSMAXTYPES) +printf(%s, + fstypenames[lp-d_partitions[part].p_fstype]); + else +printf(%d, lp-d_partitions[part].p_fstype); + printf()); + } + if (first == 0) + printf(\n); +#endif + } +} + /* Determine likely partition for possible sector number of dos * partition. */ Index: src/sys/arch/i386/stand/lib/libi386.h diff -u src/sys/arch/i386/stand/lib/libi386.h:1.31 src/sys/arch/i386/stand/lib/libi386.h:1.32 --- src/sys/arch/i386/stand/lib/libi386.h:1.31 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/lib/libi386.h Sun Sep 13 22:45:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: libi386.h,v 1.31 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: libi386.h,v 1.32 2009/09/13 22:45:27 jmcneill Exp $ */ /* * Copyright (c) 1996 @@ -122,6 +122,7 @@ struct biosdisk_extinfo; void biosdisk_getextinfo(int, struct biosdisk_extinfo *); int
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Sun Sep 13 22:51:42 UTC 2009 Modified Files: src/sys/rump: Makefile.rump src/sys/rump/fs/lib: Makefile.inc src/sys/rump/net/lib/liblocal: Makefile src/sys/rump/net/lib/libnet: Makefile src/sys/rump/net/lib/libsockin: Makefile Added Files: src/sys/rump/librump: rump_domain.c rump_module.c Log Message: binutils 2.19 has changed the old behaviour of defining __start_SECTNAME for orphaned sections to using PROVIDE. What this means is that unless a rump component internally references that symbol, it will not be included in the component shared library, and hence cannot be referenced when the component is loaded. Add a workaround which works both with 2.16 and 2.19: force a reference to the __start symbol internally and hence retain it in the resulting library. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/rump/Makefile.rump cvs rdiff -u -r1.12 -r1.13 src/sys/rump/fs/lib/Makefile.inc cvs rdiff -u -r0 -r1.1 src/sys/rump/librump/rump_domain.c \ src/sys/rump/librump/rump_module.c cvs rdiff -u -r1.2 -r1.3 src/sys/rump/net/lib/liblocal/Makefile cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/lib/libnet/Makefile cvs rdiff -u -r1.3 -r1.4 src/sys/rump/net/lib/libsockin/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.40 src/sys/rump/Makefile.rump:1.41 --- src/sys/rump/Makefile.rump:1.40 Tue Sep 8 20:24:08 2009 +++ src/sys/rump/Makefile.rump Sun Sep 13 22:51:41 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.40 2009/09/08 20:24:08 pooka Exp $ +# $NetBSD: Makefile.rump,v 1.41 2009/09/13 22:51:41 pooka Exp $ # WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet @@ -39,6 +39,15 @@ # If this file changes, we need a full rebuild DPSRCS+= ${RUMPTOP}/Makefile.rump +.ifdef RUMP_ISMODULE +.PATH: ${RUMPTOP}/librump +SRCS+= rump_module.c +.endif +.ifdef RUMP_ISDOMAIN +.PATH: ${RUMPTOP}/librump +SRCS+= rump_domain.c +.endif + # # Rename library symbols before use. If a symbol does not already belong # to a rump namespace (rump or RUMP), prefix it with rumpns. This Index: src/sys/rump/fs/lib/Makefile.inc diff -u src/sys/rump/fs/lib/Makefile.inc:1.12 src/sys/rump/fs/lib/Makefile.inc:1.13 --- src/sys/rump/fs/lib/Makefile.inc:1.12 Wed Oct 15 13:57:03 2008 +++ src/sys/rump/fs/lib/Makefile.inc Sun Sep 13 22:51:41 2009 @@ -1,6 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.12 2008/10/15 13:57:03 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.13 2009/09/13 22:51:41 pooka Exp $ # RUMPTOP= ${.CURDIR}/../../.. +RUMP_ISMODULE= # defined .include ${RUMPTOP}/Makefile.rump Index: src/sys/rump/net/lib/liblocal/Makefile diff -u src/sys/rump/net/lib/liblocal/Makefile:1.2 src/sys/rump/net/lib/liblocal/Makefile:1.3 --- src/sys/rump/net/lib/liblocal/Makefile:1.2 Thu May 28 00:02:16 2009 +++ src/sys/rump/net/lib/liblocal/Makefile Sun Sep 13 22:51:42 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2009/05/28 00:02:16 pooka Exp $ +# $NetBSD: Makefile,v 1.3 2009/09/13 22:51:42 pooka Exp $ # .PATH: ${.CURDIR}/../../../../kern @@ -10,5 +10,7 @@ CFLAGS+= -Wno-pointer-sign +RUMP_ISDOMAIN= + .include bsd.lib.mk .include bsd.klinks.mk Index: src/sys/rump/net/lib/libnet/Makefile diff -u src/sys/rump/net/lib/libnet/Makefile:1.5 src/sys/rump/net/lib/libnet/Makefile:1.6 --- src/sys/rump/net/lib/libnet/Makefile:1.5 Thu May 28 00:02:16 2009 +++ src/sys/rump/net/lib/libnet/Makefile Sun Sep 13 22:51:42 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2009/05/28 00:02:16 pooka Exp $ +# $NetBSD: Makefile,v 1.6 2009/09/13 22:51:42 pooka Exp $ # .PATH: ${.CURDIR}/../../../../net @@ -12,6 +12,8 @@ CPPFLAGS+= -I${.CURDIR}/opt -I${.CURDIR}/../libnetinet/opt +RUMP_ISDOMAIN= + .include ${.CURDIR}/../libnetinet/Makefile.inc .include bsd.lib.mk Index: src/sys/rump/net/lib/libsockin/Makefile diff -u src/sys/rump/net/lib/libsockin/Makefile:1.3 src/sys/rump/net/lib/libsockin/Makefile:1.4 --- src/sys/rump/net/lib/libsockin/Makefile:1.3 Thu May 28 00:02:16 2009 +++ src/sys/rump/net/lib/libsockin/Makefile Sun Sep 13 22:51:42 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2009/05/28 00:02:16 pooka Exp $ +# $NetBSD: Makefile,v 1.4 2009/09/13 22:51:42 pooka Exp $ # LIB= rumpnet_sockin @@ -8,5 +8,7 @@ CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern +RUMP_ISDOMAIN= + .include bsd.lib.mk .include bsd.klinks.mk Added files: Index: src/sys/rump/librump/rump_domain.c diff -u /dev/null src/sys/rump/librump/rump_domain.c:1.1 --- /dev/null Sun Sep 13 22:51:42 2009 +++ src/sys/rump/librump/rump_domain.c Sun Sep 13 22:51:42 2009 @@ -0,0 +1,14 @@ +/* $NetBSD: rump_domain.c,v 1.1 2009/09/13 22:51:42 pooka Exp $ */ + +/* + * Force reference to __start_link_set_domains, so that the + * binutils 2.19 linker does not lose the symbol due to it being + *
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Sun Sep 13 23:06:22 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_exec.c Log Message: Try to find an exact interp match before defaulting to one supplied: o32: ld.elf_so-32 n32: ld.elf_so-n32 o64: ld.elf_so-o64 n64: ld.elf_so-64 To generate a diff of this commit: cvs rdiff -u -r1.50.54.1.4.8 -r1.50.54.1.4.9 \ src/sys/arch/mips/mips/cpu_exec.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_exec.c diff -u src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.8 src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.9 --- src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.8 Sat Sep 5 03:03:44 2009 +++ src/sys/arch/mips/mips/cpu_exec.c Sun Sep 13 23:06:22 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_exec.c,v 1.50.54.1.4.8 2009/09/05 03:03:44 matt Exp $ */ +/* $NetBSD: cpu_exec.c,v 1.50.54.1.4.9 2009/09/13 23:06:22 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.8 2009/09/05 03:03:44 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.9 2009/09/13 23:06:22 matt Exp $); #include opt_compat_netbsd.h #include opt_compat_ultrix.h @@ -47,6 +47,7 @@ #include sys/malloc.h #include sys/vnode.h #include sys/exec.h +#include sys/namei.h #include sys/resourcevar.h #include uvm/uvm_extern.h @@ -309,14 +310,52 @@ return 0; } +static int +elf_check_itp(struct exec_package *epp, const char *itp, + const char *itp_suffix) +{ + int error = 0; + if (itp) { + /* + * If the path is exactly /usr/libexec/ld.elf_so, first + * try to see if /usr/libexec/ld.elf_so-abi exists + * and if so, use that instead. + * XXX maybe move this into compat/common + */ + if (strcmp(itp, /usr/libexec/ld.elf_so) == 0 || + strcmp(itp, /libexec/ld.elf_so) == 0) { + struct nameidata nd; + char *path; + + path = PNBUF_GET(); + snprintf(path, MAXPATHLEN, %s-%s, itp, itp_suffix); + NDINIT(nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path); + error = namei(nd); + /* + * If that worked, replace interpreter in case we + * actually need to load it + */ + if (error == 0) { +if (epp-ep_interp != NULL) + vrele(epp-ep_interp); +epp-ep_interp = nd.ni_vp; + } + PNBUF_PUT(path); + error = 0; + } + } + return error; +} + #if EXEC_ELF32 int mips_netbsd_elf32_probe(struct lwp *l, struct exec_package *epp, void *eh0, - char *idt, vaddr_t *start_p) + char *itp, vaddr_t *start_p) { struct proc * const p = l-l_proc; const Elf32_Ehdr * const eh = eh0; int old_abi = p-p_md.md_abi; + const char *itp_suffix = NULL; /* * Verify we can support the architecture. @@ -350,22 +389,26 @@ switch (eh-e_flags (EF_MIPS_ABI|EF_MIPS_ABI2)) { #if !defined(__mips_o32) case EF_MIPS_ABI2: + itp_suffix = n32; p-p_md.md_abi = _MIPS_BSD_API_N32; if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to N32 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; #endif case EF_MIPS_ABI_O32: + itp_suffix = o32; p-p_md.md_abi = _MIPS_BSD_API_O32; #ifdef COMPAT_16 *start_p = ELF32_LINK_ADDR; #endif if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to O32 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; default: return ENOEXEC; } + + return elf_check_itp(epp, itp, itp_suffix); } void @@ -407,11 +450,12 @@ #if EXEC_ELF64 int mips_netbsd_elf64_probe(struct lwp *l, struct exec_package *epp, void *eh0, - char *idt, vaddr_t *start_p) + char *itp, vaddr_t *start_p) { struct proc * const p = l-l_proc; const Elf64_Ehdr * const eh = eh0; int old_abi = p-p_md.md_abi; + const char *itp_suffix = NULL; switch (eh-e_flags EF_MIPS_ARCH) { case EF_MIPS_ARCH_1: @@ -442,18 +486,22 @@ switch (eh-e_flags (EF_MIPS_ABI|EF_MIPS_ABI2)) { case 0: + itp_suffix = 64; p-p_md.md_abi = _MIPS_BSD_API_N64; if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to N64 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; case EF_MIPS_ABI_O64: + itp_suffix = o64; p-p_md.md_abi = _MIPS_BSD_API_O64; if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to O64 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; default: return ENOEXEC; } + + return elf_check_itp(epp, itp, itp_suffix); } void
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sun Sep 13 23:38:04 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: mcontext.h Log Message: Use __int32_t instead int32_t to make userland happy. To generate a diff of this commit: cvs rdiff -u -r1.8.18.2 -r1.8.18.3 src/sys/arch/mips/include/mcontext.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/mcontext.h diff -u src/sys/arch/mips/include/mcontext.h:1.8.18.2 src/sys/arch/mips/include/mcontext.h:1.8.18.3 --- src/sys/arch/mips/include/mcontext.h:1.8.18.2 Sat Sep 12 17:23:06 2009 +++ src/sys/arch/mips/include/mcontext.h Sun Sep 13 23:38:04 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.8.18.2 2009/09/12 17:23:06 matt Exp $ */ +/* $NetBSD: mcontext.h,v 1.8.18.3 2009/09/13 23:38:04 matt Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -110,7 +110,7 @@ union { double __fp_dregs[16]; float __fp_fregs[32]; - int32_t __fp_regs[32]; + __int32_t __fp_regs[32]; } __fp_r; unsigned int __fp_csr; unsigned int __fp_pad; @@ -128,7 +128,7 @@ } mcontext_t; #if defined(_KERNEL) defined(_LP64) -typedef int32_t __greg32_t; +typedef __int32_t __greg32_t; typedef __greg32_t __gregset32_t[_NGREG]; typedef struct {
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: jmcneill Date: Sun Sep 13 23:53:36 UTC 2009 Modified Files: src/sys/arch/i386/stand/lib: bootmenu.c Log Message: If the menuformat is not letter, do not allow letter keys to be aliases for number keys. snj@ often overshoots the spacebar in a panic and accidentally hits 'b' instead, which makes the loader boot item '2'. Can't fix snj@, so fix the boot loader instead. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/lib/bootmenu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/bootmenu.c diff -u src/sys/arch/i386/stand/lib/bootmenu.c:1.6 src/sys/arch/i386/stand/lib/bootmenu.c:1.7 --- src/sys/arch/i386/stand/lib/bootmenu.c:1.6 Fri Apr 10 19:41:41 2009 +++ src/sys/arch/i386/stand/lib/bootmenu.c Sun Sep 13 23:53:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bootmenu.c,v 1.6 2009/04/10 19:41:41 perry Exp $ */ +/* $NetBSD: bootmenu.c,v 1.7 2009/09/13 23:53:36 jmcneill Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -274,6 +274,10 @@ if (choice 0 || choice = bootconf.nummenu) choice = -1; } + + if (bootconf.menuformat != MENUFORMAT_LETTER !isnum(*input)) + choice = -1; + return choice; }
CVS commit: src/sys/arch/vax/vax
Module Name:src Committed By: mhitch Date: Mon Sep 14 02:19:15 UTC 2009 Modified Files: src/sys/arch/vax/vax: clock.c Log Message: Not understanding what vax_mfpr_get_counter() was doing, my fix for backwards time was incorrect, and actually disabled the use of mfpr for timecounters. The intent was to emulate a 32 bit counter using the hardclock_ticks from the clock interrupt and the contents of the Interval Counter register. The problem with that was when the ICR wrapped, but the clock interrupt was blocked resulted in an incorrect count. Work around this by keeping track of the previous ICR value and hardclock_ticks to ensure the 32 bit counter doesn't go backwards. Also, the ICR runs from -1 to -1, so adjust the value when reading it. Now mfpr works quit nicely on my 4000/90. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/arch/vax/vax/clock.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/vax/vax/clock.c diff -u src/sys/arch/vax/vax/clock.c:1.50 src/sys/arch/vax/vax/clock.c:1.51 --- src/sys/arch/vax/vax/clock.c:1.50 Sat Feb 21 23:19:30 2009 +++ src/sys/arch/vax/vax/clock.c Mon Sep 14 02:19:15 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.50 2009/02/21 23:19:30 mhitch Exp $ */ +/* $NetBSD: clock.c,v 1.51 2009/09/14 02:19:15 mhitch Exp $ */ /* * Copyright (c) 1995 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.50 2009/02/21 23:19:30 mhitch Exp $); +__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.51 2009/09/14 02:19:15 mhitch Exp $); #include sys/param.h #include sys/kernel.h @@ -83,13 +83,31 @@ { int cur_hardclock; u_int counter; + static int prev_count, prev_hardclock; do { cur_hardclock = hardclock_ticks; - counter = mfpr(PR_ICR); + counter = mfpr(PR_ICR) + tick; } while (cur_hardclock != hardclock_ticks); - return counter + hardclock_ticks * tick; + /* + * Handle interval counter wrapping with interrupts blocked. + * If the current hardclock_ticks is less than what we saw + * previously, use the previous value. + * If the interval counter is smaller, assume it has wrapped, + * and if the [adjusted] current hardclock ticks is the same + * as what we saw previously, increment the local copy of + * the hardclock ticks. + */ + if (cur_hardclock prev_hardclock) + cur_hardclock = prev_hardclock; + if (counter prev_count cur_hardclock == prev_hardclock) + cur_hardclock++; + + prev_count = counter; + prev_hardclock=cur_hardclock; + + return counter + cur_hardclock * tick; } #if VAX46 || VAXANY @@ -108,7 +126,7 @@ static struct timecounter vax_mfpr_tc = { vax_mfpr_get_counter, /* get_timecount */ 0, /* no poll_pps */ - 0x1fff, /* counter_mask */ + ~0u, /* counter_mask */ 100, /* frequency */ mfpr, /* name */ 100, /* quality */
CVS commit: src/sys/arch/amiga/conf
Module Name:src Committed By: mhitch Date: Mon Sep 14 02:23:05 UTC 2009 Modified Files: src/sys/arch/amiga/conf: files.amiga Log Message: Switch the amiga to the common m68k/m68k/pmap_motorola.c (Finally!!). To generate a diff of this commit: cvs rdiff -u -r1.140 -r1.141 src/sys/arch/amiga/conf/files.amiga 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/amiga/conf/files.amiga diff -u src/sys/arch/amiga/conf/files.amiga:1.140 src/sys/arch/amiga/conf/files.amiga:1.141 --- src/sys/arch/amiga/conf/files.amiga:1.140 Wed Feb 20 21:43:33 2008 +++ src/sys/arch/amiga/conf/files.amiga Mon Sep 14 02:23:05 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.amiga,v 1.140 2008/02/20 21:43:33 drochner Exp $ +# $NetBSD: files.amiga,v 1.141 2009/09/14 02:23:05 mhitch Exp $ # maxpartitions must be first item in files.${ARCH}.newconf maxpartitions 16 # NOTE THAT AMIGA IS SPECIAL! @@ -435,14 +435,14 @@ file arch/amiga/amiga/dkbad.c file arch/amiga/amiga/machdep.c file arch/amiga/amiga/mem.c -file arch/amiga/amiga/pmap.c +#file arch/amiga/amiga/pmap.c file arch/amiga/amiga/pmap_bootstrap.c file arch/amiga/amiga/trap.c file arch/amiga/amiga/cc.c file dev/md_root.c memory_disk_hooks file arch/m68k/m68k/cacheops.c file arch/m68k/m68k/db_memrw.c ddb -#file arch/m68k/m68k/pmap_motorola.c +file arch/m68k/m68k/pmap_motorola.c file arch/m68k/m68k/procfs_machdep.c procfs file arch/m68k/m68k/sys_machdep.c file arch/m68k/m68k/vm_machdep.c
CVS commit: src/sys/arch/alpha/conf
Module Name:src Committed By: mhitch Date: Mon Sep 14 02:28:22 UTC 2009 Modified Files: src/sys/arch/alpha/conf: GENERIC Log Message: Add the I2O iop controller, as used in the ES40 and ES45. To generate a diff of this commit: cvs rdiff -u -r1.328 -r1.329 src/sys/arch/alpha/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/alpha/conf/GENERIC diff -u src/sys/arch/alpha/conf/GENERIC:1.328 src/sys/arch/alpha/conf/GENERIC:1.329 --- src/sys/arch/alpha/conf/GENERIC:1.328 Sat Jan 24 05:06:05 2009 +++ src/sys/arch/alpha/conf/GENERIC Mon Sep 14 02:28:22 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.328 2009/01/24 05:06:05 mrg Exp $ +# $NetBSD: GENERIC,v 1.329 2009/09/14 02:28:22 mhitch Exp $ # # This machine description file is used to generate the default NetBSD # kernel. @@ -19,7 +19,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -ident GENERIC-$Revision: 1.328 $ +ident GENERIC-$Revision: 1.329 $ maxusers 32 @@ -386,6 +386,13 @@ mpu* at eso? mpu* at yds? +# I2O devices +iop* at pci? dev ? function ? # I/O processor +iopsp* at iop? tid ? # SCSI/FC-AL ports +ld* at iop? tid ? # block devices +# XXX dpti.c wants a processor type that is not assigned for x86-64 +#dpti* at iop? tid 0 # DPT/Adaptec control interface + # MII/PHY support exphy* at mii? phy ? # 3Com internal PHYs icsphy* at mii? phy ? # Integrated Circuit Systems ICS189x
CVS commit: src/sys/arch/alpha/alpha
Module Name:src Committed By: mhitch Date: Mon Sep 14 02:46:29 UTC 2009 Modified Files: src/sys/arch/alpha/alpha: dec_1000a.c dec_2100_a500.c dec_6600.c dec_kn300.c Log Message: Add support for booting off a couple of common RAID adapters found on several models of alpha systems: mlx [Mylex DAC060] and iop [I2O]. Addresses PR #25829. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/arch/alpha/alpha/dec_1000a.c \ src/sys/arch/alpha/alpha/dec_6600.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/alpha/alpha/dec_2100_a500.c cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/alpha/dec_kn300.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/alpha/alpha/dec_1000a.c diff -u src/sys/arch/alpha/alpha/dec_1000a.c:1.28 src/sys/arch/alpha/alpha/dec_1000a.c:1.29 --- src/sys/arch/alpha/alpha/dec_1000a.c:1.28 Sat Mar 14 15:35:59 2009 +++ src/sys/arch/alpha/alpha/dec_1000a.c Mon Sep 14 02:46:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dec_1000a.c,v 1.28 2009/03/14 15:35:59 dsl Exp $ */ +/* $NetBSD: dec_1000a.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: dec_1000a.c,v 1.28 2009/03/14 15:35:59 dsl Exp $); +__KERNEL_RCSID(0, $NetBSD: dec_1000a.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $); #include sys/param.h #include sys/systm.h @@ -98,6 +98,9 @@ #include dev/scsipi/scsipi_all.h #include dev/scsipi/scsiconf.h +#include dev/ic/mlxio.h +#include dev/ic/mlxvar.h + #include pckbd.h #ifndef CONSPEED @@ -255,7 +258,8 @@ return; if (!initted) { - diskboot = (strcasecmp(b-protocol, SCSI) == 0); + diskboot = (strcasecmp(b-protocol, SCSI) == 0) || + (strcasecmp(b-protocol, RAID) == 0); netboot = (strcasecmp(b-protocol, BOOTP) == 0) || (strcasecmp(b-protocol, MOP) == 0); #if 0 @@ -335,4 +339,25 @@ #endif found = 1; } + + if (device_is_a(dev, ld) device_is_a(parent, mlx)) { + /* + * Argh! The attach arguments for ld devices is not + * consistent, so each supported raid controller requires + * different checks. + */ + struct mlx_attach_args *mlxa = aux; + + if (parent != ctrlrdev) + return; + + if (b-unit != mlxa-mlxa_unit) + return; + /* we've found it! */ + booted_device = dev; +#if 0 + printf(\nbooted_device = %s\n, dev-dv_xname); +#endif + found = 1; + } } Index: src/sys/arch/alpha/alpha/dec_6600.c diff -u src/sys/arch/alpha/alpha/dec_6600.c:1.28 src/sys/arch/alpha/alpha/dec_6600.c:1.29 --- src/sys/arch/alpha/alpha/dec_6600.c:1.28 Sat Mar 14 15:35:59 2009 +++ src/sys/arch/alpha/alpha/dec_6600.c Mon Sep 14 02:46:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dec_6600.c,v 1.28 2009/03/14 15:35:59 dsl Exp $ */ +/* $NetBSD: dec_6600.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $ */ /* * Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University. @@ -31,7 +31,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: dec_6600.c,v 1.28 2009/03/14 15:35:59 dsl Exp $); +__KERNEL_RCSID(0, $NetBSD: dec_6600.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $); #include sys/param.h #include sys/systm.h @@ -63,6 +63,13 @@ #include dev/scsipi/scsiconf.h #include dev/ata/atavar.h +#include dev/ic/mlxio.h +#include dev/ic/mlxvar.h + +#include dev/i2o/i2o.h +#include dev/i2o/iopio.h +#include dev/i2o/iopvar.h + #include pckbd.h #ifndef CONSPEED @@ -190,6 +197,8 @@ if (!initted) { diskboot = (strcasecmp(b-protocol, SCSI) == 0) || + (strcasecmp(b-protocol, RAID) == 0) || + (strcasecmp(b-protocol, I2O) == 0) || (strcasecmp(b-protocol, IDE) == 0); netboot = (strcasecmp(b-protocol, BOOTP) == 0) || (strcasecmp(b-protocol, MOP) == 0); @@ -290,6 +299,44 @@ found = 1; } + if (device_is_a(dev, ld) device_is_a(parent, iop)) { + /* + * Argh! The attach arguments for ld devices is not + * consistent, so each supported raid controller requires + * different checks. + */ + struct iop_attach_args *iopa = aux; + + if (parent != ctrlrdev) + return; + + if (b-unit != iopa-ia_tid) + return; + /* we've found it! */ + booted_device = dev; + DR_VERBOSE(printf(\nbooted_device = %s\n, dev-dv_xname)); + found = 1; + } + + if (device_is_a(dev, ld) device_is_a(parent, mlx)) { + /* + * Argh! The attach arguments for ld devices is not + * consistent, so each supported raid controller requires + * different checks. + */ + struct mlx_attach_args *mlxa = aux; + + if (parent != ctrlrdev) + return; + + if (b-unit != mlxa-mlxa_unit) + return; + /* we've found it! */ + booted_device = dev; + DR_VERBOSE(printf(\nbooted_device = %s\n, dev-dv_xname)); + found = 1; + } + /* * Support to boot from IDE drives. */ Index: src/sys/arch/alpha/alpha/dec_2100_a500.c diff -u