CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: kiyohara Date: Mon Jul 5 06:54:48 UTC 2010 Modified Files: src/sys/arch/arm/arm: cpufunc.c Log Message: Remove unnecessary white-spaces. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/arch/arm/arm/cpufunc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm/cpufunc.c diff -u src/sys/arch/arm/arm/cpufunc.c:1.98 src/sys/arch/arm/arm/cpufunc.c:1.99 --- src/sys/arch/arm/arm/cpufunc.c:1.98 Mon Jul 5 06:50:01 2010 +++ src/sys/arch/arm/arm/cpufunc.c Mon Jul 5 06:54:48 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: cpufunc.c,v 1.98 2010/07/05 06:50:01 kiyohara Exp $ */ +/* $NetBSD: cpufunc.c,v 1.99 2010/07/05 06:54:48 kiyohara Exp $ */ /* * arm7tdmi support code Copyright (c) 2001 John Fremlin @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.98 2010/07/05 06:50:01 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.99 2010/07/05 06:54:48 kiyohara Exp $"); #include "opt_compat_netbsd.h" #include "opt_cpuoptions.h" @@ -102,7 +102,7 @@ #if (ARM_MMU_V6 + ARM_MMU_V7) != 0 int arm_cache_prefer_mask; #endif - + int arm_pcache_type; int arm_pcache_unified; @@ -116,7 +116,7 @@ #ifdef CPU_ARM2 struct cpu_functions arm2_cpufuncs = { /* CPU functions */ - + .cf_id = arm2_id, .cf_cpwait = cpufunc_nullop, @@ -157,7 +157,7 @@ /* Soft functions */ - .cf_dataabt_fixup = early_abort_fixup, + .cf_dataabt_fixup = early_abort_fixup, .cf_prefetchabt_fixup = cpufunc_null_fixup, .cf_setup = (void *)cpufunc_nullop @@ -168,7 +168,7 @@ #ifdef CPU_ARM250 struct cpu_functions arm250_cpufuncs = { /* CPU functions */ - + .cf_id = arm250_id, .cf_cpwait = cpufunc_nullop, @@ -220,7 +220,7 @@ #ifdef CPU_ARM3 struct cpu_functions arm3_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -272,10 +272,10 @@ #ifdef CPU_ARM6 struct cpu_functions arm6_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, - + /* MMU functions */ .cf_control = cpufunc_control, @@ -334,7 +334,7 @@ #ifdef CPU_ARM7 struct cpu_functions arm7_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -392,7 +392,7 @@ #ifdef CPU_ARM7TDMI struct cpu_functions arm7tdmi_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -450,7 +450,7 @@ #ifdef CPU_ARM8 struct cpu_functions arm8_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -501,7 +501,7 @@ .cf_context_switch = arm8_context_switch, .cf_setup = arm8_setup -}; +}; #endif /* CPU_ARM8 */ #ifdef CPU_ARM9 @@ -797,7 +797,7 @@ #ifdef CPU_SA110 struct cpu_functions sa110_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -848,13 +848,13 @@ .cf_context_switch = sa110_context_switch, .cf_setup = sa110_setup -}; +}; #endif /* CPU_SA110 */ #if defined(CPU_SA1100) || defined(CPU_SA1110) struct cpu_functions sa11x0_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -905,13 +905,13 @@ .cf_context_switch = sa11x0_context_switch, .cf_setup = sa11x0_setup -}; +}; #endif /* CPU_SA1100 || CPU_SA1110 */ #if defined(CPU_FA526) struct cpu_functions fa526_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -962,13 +962,13 @@ .cf_context_switch = fa526_context_switch, .cf_setup = fa526_setup -}; +}; #endif /* CPU_FA526 */ #ifdef CPU_IXP12X0 struct cpu_functions ixp12x0_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = cpufunc_nullop, @@ -1018,15 +1018,15 @@ .cf_context_switch = ixp12x0_context_switch, - .cf_setup = ixp12x0_setup -}; + .cf_setup = ixp12x0_setup +}; #endif /* CPU_IXP12X0 */ #if defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(__CPU_XSCALE_PXA2XX) || defined(CPU_XSCALE_IXP425) struct cpu_functions xscale_cpufuncs = { /* CPU functions */ - + .cf_id = cpufunc_id, .cf_cpwait = xscale_cpwait, @@ -1086,7 +1086,7 @@ /* CPU functions */ .cf_id = cpufunc_id, - .cf_cpwait = cpufunc_nullop, + .cf_cpwait = cpufunc_nullop, /* MMU functions */ @@ -1114,7 +1114,7 @@ .cf_dcache_wb_range = armv7_dcache_wb_range, .cf_dcache_wbinv_range = armv7_dcache_wbinv_range, - .cf_icache_sync_range = armv7_icache_sync_range, + .cf_icache_sync_range = armv7_icache_sync_range, .cf_idcache_wbinv_range = armv7_idcache_wbinv_range, @@ -1202,7 +1202,7 @@ goto out; #if (ARM_MMU_V6 + ARM_MMU_V7) > 0 - if (CPU_CT_FORMAT(ctype) == 4) { + if (CPU_CT_FORMAT(ctype) == 4) { u_int csid0, csid1,
CVS commit: src/sys/arch/arm/arm
Module Name:src Committed By: kiyohara Date: Mon Jul 5 06:50:02 UTC 2010 Modified Files: src/sys/arch/arm/arm: cpufunc.c Log Message: Fix set the control register. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/sys/arch/arm/arm/cpufunc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm/cpufunc.c diff -u src/sys/arch/arm/arm/cpufunc.c:1.97 src/sys/arch/arm/arm/cpufunc.c:1.98 --- src/sys/arch/arm/arm/cpufunc.c:1.97 Sat Jun 19 20:42:43 2010 +++ src/sys/arch/arm/arm/cpufunc.c Mon Jul 5 06:50:01 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: cpufunc.c,v 1.97 2010/06/19 20:42:43 matt Exp $ */ +/* $NetBSD: cpufunc.c,v 1.98 2010/07/05 06:50:01 kiyohara Exp $ */ /* * arm7tdmi support code Copyright (c) 2001 John Fremlin @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.97 2010/06/19 20:42:43 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.98 2010/07/05 06:50:01 kiyohara Exp $"); #include "opt_compat_netbsd.h" #include "opt_cpuoptions.h" @@ -2604,7 +2604,10 @@ /* Clear out the cache */ cpu_idcache_wbinv_all(); - /* set some cortrol register? */ + + /* Set the control register */ + curcpu()->ci_ctrl = cpuctrl; + cpu_control(0x, cpuctrl); } /* Clean the data cache to the level of coherency. Slow. */
CVS commit: src/lib/libc/string
Module Name:src Committed By: christos Date: Mon Jul 5 00:45:19 UTC 2010 Modified Files: src/lib/libc/string: Lint_swab.c Log Message: consistency with c source To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/string/Lint_swab.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/string/Lint_swab.c diff -u src/lib/libc/string/Lint_swab.c:1.2 src/lib/libc/string/Lint_swab.c:1.3 --- src/lib/libc/string/Lint_swab.c:1.2 Wed Jun 14 02:49:10 2000 +++ src/lib/libc/string/Lint_swab.c Sun Jul 4 20:45:19 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: Lint_swab.c,v 1.2 2000/06/14 06:49:10 cgd Exp $ */ +/* $NetBSD: Lint_swab.c,v 1.3 2010/07/05 00:45:19 christos Exp $ */ /* * This file placed in the public domain. @@ -9,9 +9,6 @@ /*ARGSUSED*/ void -swab(src, dst, len) - const void *src; - void *dst; - size_t len; +swab(const void *src, void *dst, ssize_t len) { }
CVS commit: src/share/man/man4
Module Name:src Committed By: wiz Date: Sun Jul 4 21:10:39 UTC 2010 Modified Files: src/share/man/man4: upgt.4 Log Message: Fix xref, put all Nd arguments on Nd line. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/upgt.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/upgt.4 diff -u src/share/man/man4/upgt.4:1.3 src/share/man/man4/upgt.4:1.4 --- src/share/man/man4/upgt.4:1.3 Sun Jul 4 19:58:52 2010 +++ src/share/man/man4/upgt.4 Sun Jul 4 21:10:39 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: upgt.4,v 1.3 2010/07/04 19:58:52 dholland Exp $ +.\" $NetBSD: upgt.4,v 1.4 2010/07/04 21:10:39 wiz Exp $ .\" $OpenBSD: upgt.4,v 1.14 2010/04/29 09:20:17 jmc Exp $ .\" .\" Copyright (c) 2007 Marcus Glocker @@ -54,8 +54,7 @@ .Os .Sh NAME .Nm upgt -.Nd Conexant/Intersil PrismGT SoftMAC USB IEEE 802.11b/g wireless network -device +.Nd Conexant/Intersil PrismGT SoftMAC USB IEEE 802.11b/g wireless network device .Sh SYNOPSIS .Cd "upgt* at uhub? port ?" .Sh DESCRIPTION @@ -161,7 +160,7 @@ .El .Sh EXAMPLES The following -.Xr hostname.if 5 +.Xr ifconfig.if 5 example configures upgt0 to join whatever network is available on boot, using WEP key .Dq 0x1deadbeef1 ,
CVS commit: src/share/man/man4
Module Name:src Committed By: dholland Date: Sun Jul 4 19:58:52 UTC 2010 Modified Files: src/share/man/man4: upgt.4 Log Message: fix typo (firwmware -> firmware) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/upgt.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/upgt.4 diff -u src/share/man/man4/upgt.4:1.2 src/share/man/man4/upgt.4:1.3 --- src/share/man/man4/upgt.4:1.2 Sun Jul 4 19:57:51 2010 +++ src/share/man/man4/upgt.4 Sun Jul 4 19:58:52 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: upgt.4,v 1.2 2010/07/04 19:57:51 dholland Exp $ +.\" $NetBSD: upgt.4,v 1.3 2010/07/04 19:58:52 dholland Exp $ .\" $OpenBSD: upgt.4,v 1.14 2010/04/29 09:20:17 jmc Exp $ .\" .\" Copyright (c) 2007 Marcus Glocker @@ -127,7 +127,7 @@ .Nx base system. Please download these files and put them into -the above firwmware directory. +the above firmware directory. .Pp A tar archive file that includes .Pa upgt-gw3887
CVS commit: src/share/man/man4
Module Name:src Committed By: dholland Date: Sun Jul 4 19:57:52 UTC 2010 Modified Files: src/share/man/man4: upgt.4 Log Message: Comment out an .Ed whose .Bd was itself commented out; this was making mandoc belch. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/upgt.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/upgt.4 diff -u src/share/man/man4/upgt.4:1.1 src/share/man/man4/upgt.4:1.2 --- src/share/man/man4/upgt.4:1.1 Sun Jul 4 15:21:58 2010 +++ src/share/man/man4/upgt.4 Sun Jul 4 19:57:51 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: upgt.4,v 1.1 2010/07/04 15:21:58 tsutsui Exp $ +.\" $NetBSD: upgt.4,v 1.2 2010/07/04 19:57:51 dholland Exp $ .\" $OpenBSD: upgt.4,v 1.14 2010/04/29 09:20:17 jmc Exp $ .\" .\" Copyright (c) 2007 Marcus Glocker @@ -178,7 +178,7 @@ .\".Bd -literal -offset indent .\"inet 192.168.1.1 255.255.255.0 NONE media autoselect \e .\" mediaopt hostap nwid my_net chan 11 -.Ed +.\".Ed .\".Pp .\"Configure upgt0 to join network .\".Dq my_net
CVS commit: src/distrib/sets/lists/tests
Module Name:src Committed By: pooka Date: Sun Jul 4 19:34:45 UTC 2010 Modified Files: src/distrib/sets/lists/tests: mi Log Message: +tp To generate a diff of this commit: cvs rdiff -u -r1.96 -r1.97 src/distrib/sets/lists/tests/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.96 src/distrib/sets/lists/tests/mi:1.97 --- src/distrib/sets/lists/tests/mi:1.96 Sat Jul 3 21:48:54 2010 +++ src/distrib/sets/lists/tests/mi Sun Jul 4 19:34:44 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.96 2010/07/03 21:48:54 njoly Exp $ +# $NetBSD: mi,v 1.97 2010/07/04 19:34:44 pooka Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -263,6 +263,8 @@ ./usr/libdata/debug/usr/tests/net tests-net-debug ./usr/libdata/debug/usr/tests/net/bpf tests-net-debug ./usr/libdata/debug/usr/tests/net/bpf/t_div-by-zero.debug tests-net-debug debug,atf +./usr/libdata/debug/usr/tests/net/icmp tests-net-debug +./usr/libdata/debug/usr/tests/net/icmp/t_forward.debug tests-net-debug debug,atf ./usr/libdata/debug/usr/tests/net/sys tests-net-debug ./usr/libdata/debug/usr/tests/net/sys/t_connect.debug tests-net-debug debug,atf ./usr/libdata/debug/usr/tests/net/sys/t_listen.debug tests-net-debug debug,atf @@ -1285,6 +1287,9 @@ ./usr/tests/net/bpftests-net-tests ./usr/tests/net/bpf/Atffile tests-net-tests atf ./usr/tests/net/bpf/t_div-by-zero tests-net-tests atf +./usr/tests/net/icmptests-net-tests +./usr/tests/net/icmp/Atffile tests-net-tests atf +./usr/tests/net/icmp/t_forward tests-net-tests atf ./usr/tests/net/systests-net-tests ./usr/tests/net/sys/Atffile tests-net-tests atf ./usr/tests/net/sys/t_connect tests-net-tests atf
CVS commit: src/etc/mtree
Module Name:src Committed By: pooka Date: Sun Jul 4 19:33:18 UTC 2010 Modified Files: src/etc/mtree: NetBSD.dist.base Log Message: the usual testdir boogie-woogie To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/etc/mtree/NetBSD.dist.base Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.28 src/etc/mtree/NetBSD.dist.base:1.29 --- src/etc/mtree/NetBSD.dist.base:1.28 Sat Jul 3 15:29:22 2010 +++ src/etc/mtree/NetBSD.dist.base Sun Jul 4 19:33:18 2010 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.28 2010/07/03 15:29:22 njoly Exp $ +# $NetBSD: NetBSD.dist.base,v 1.29 2010/07/04 19:33:18 pooka Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -228,6 +228,7 @@ ./usr/libdata/debug/usr/tests/modules ./usr/libdata/debug/usr/tests/net ./usr/libdata/debug/usr/tests/net/bpf +./usr/libdata/debug/usr/tests/net/icmp ./usr/libdata/debug/usr/tests/net/sys ./usr/libdata/debug/usr/tests/rump ./usr/libdata/debug/usr/tests/rump/modautoload @@ -1131,6 +1132,7 @@ ./usr/tests/modules ./usr/tests/net ./usr/tests/net/bpf +./usr/tests/net/icmp ./usr/tests/net/sys ./usr/tests/rump ./usr/tests/rump/modautoload
CVS commit: src/tests/net
Module Name:src Committed By: pooka Date: Sun Jul 4 19:31:30 UTC 2010 Modified Files: src/tests/net: Makefile Log Message: descend into icmp To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/net/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/Makefile diff -u src/tests/net/Makefile:1.2 src/tests/net/Makefile:1.3 --- src/tests/net/Makefile:1.2 Wed Apr 21 11:07:34 2010 +++ src/tests/net/Makefile Sun Jul 4 19:31:30 2010 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.2 2010/04/21 11:07:34 pooka Exp $ +# $NetBSD: Makefile,v 1.3 2010/07/04 19:31:30 pooka Exp $ .include TESTSDIR= ${TESTSBASE}/net -SUBDIR= bpf sys +SUBDIR= bpf icmp sys .include .include
CVS commit: src/tests/net/icmp
Module Name:src Committed By: pooka Date: Sun Jul 4 19:30:59 UTC 2010 Added Files: src/tests/net/icmp: Atffile Makefile t_forward.c Log Message: Add test case for PR kern/43548 Due to the nature of the feature under test, this one is a little different, so let me explain how it works. The test program forks and bootstraps a rump kernel in both processes. It then configures shared memory interfaces in both. shmif is nice in that it uses a mmaped file as the bus and does not require root privileges for communication between two (or more) processes. The child process then proceeds to increase icmp.returndatabytes as indicated by the PR, while the parent process sets the global TTL of the rump kernel to 1 (note: both values only affect the respective rump kernels, not each other or more importantly the host kernel). The parent then sends the bad packet which is supposed to be routed by the child. If ip_icmp.c was too old, *boom* + fail; otherwise nothing bad happens and the test exists with success after one second. Eventually this test can be extended into a framework for automated testing of any networking code which requires (arbitrarily complex) routing setups. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/tests/net/icmp/Atffile src/tests/net/icmp/Makefile \ src/tests/net/icmp/t_forward.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tests/net/icmp/Atffile diff -u /dev/null src/tests/net/icmp/Atffile:1.1 --- /dev/null Sun Jul 4 19:30:59 2010 +++ src/tests/net/icmp/Atffile Sun Jul 4 19:30:59 2010 @@ -0,0 +1,6 @@ +Content-Type: application/X-atf-atffile; version="1" +X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2010/07/04 19:30:59 pooka Exp $" + +prop: test-suite = "NetBSD" + +tp-glob: * Index: src/tests/net/icmp/Makefile diff -u /dev/null src/tests/net/icmp/Makefile:1.1 --- /dev/null Sun Jul 4 19:30:59 2010 +++ src/tests/net/icmp/Makefile Sun Jul 4 19:30:59 2010 @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 2010/07/04 19:30:59 pooka Exp $ +# + +.include + +TESTSDIR= ${TESTSBASE}/net/icmp + +TESTS_C= t_forward + +LDADD+= -lrumpnet_shmif -lrumpnet_netinet -lrumpnet_net -lrumpnet +LDADD+= -lrump -lrumpuser -lpthread + +.include Index: src/tests/net/icmp/t_forward.c diff -u /dev/null src/tests/net/icmp/t_forward.c:1.1 --- /dev/null Sun Jul 4 19:30:59 2010 +++ src/tests/net/icmp/t_forward.c Sun Jul 4 19:30:59 2010 @@ -0,0 +1,271 @@ +/* $NetBSD: t_forward.c,v 1.1 2010/07/04 19:30:59 pooka Exp $ */ + +/*- + * Copyright (c) 2010 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND + * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#ifndef lint +__RCSID("$NetBSD: t_forward.c,v 1.1 2010/07/04 19:30:59 pooka Exp $"); +#endif /* not lint */ + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../../h_macros.h" + +static void +configure_interface(const char *busname, const char *addr, const char *mask, + const char *bcast) +{ + char ifname[32]; + struct ifaliasreq ia; + struct sockaddr_in *sin; + int s, rv, ifnum; + + if ((s = rump_pub_shmif_create(busname, &ifnum)) != 0) { + atf_tc_fail("rump_pub_virtif_create(%d)", s); + } + + if ((s = rump_sys_socket(PF_INET, SOCK_DGRAM, 0)) < 0) { + atf_tc_fail_errno("if config socket"); + } + sprintf(ifname, "shmif%d", ifnum); + + /* Address */ + memset(&ia, 0, sizeof(ia)); + strcpy(ia.ifra_name, ifname); + sin = (struct sockaddr_in *)&ia.ifra_addr; + sin->sin_family = AF_IN
CVS commit: src/share/examples/rump/virtual_ip_router
Module Name:src Committed By: pooka Date: Sun Jul 4 17:24:10 UTC 2010 Modified Files: src/share/examples/rump/virtual_ip_router: rumprouter.c Log Message: send routing messages via routing sucket -- works better than via inet sucket To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/share/examples/rump/virtual_ip_router/rumprouter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/examples/rump/virtual_ip_router/rumprouter.c diff -u src/share/examples/rump/virtual_ip_router/rumprouter.c:1.4 src/share/examples/rump/virtual_ip_router/rumprouter.c:1.5 --- src/share/examples/rump/virtual_ip_router/rumprouter.c:1.4 Sun Jul 4 15:44:46 2010 +++ src/share/examples/rump/virtual_ip_router/rumprouter.c Sun Jul 4 17:24:10 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumprouter.c,v 1.4 2010/07/04 15:44:46 pooka Exp $ */ +/* $NetBSD: rumprouter.c,v 1.5 2010/07/04 17:24:10 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -126,7 +126,7 @@ DP("Entering %s\n", __FUNCTION__); DP("Open a routing socket\n"); - s = rump_sys_socket(PF_INET, SOCK_DGRAM, 0); + s = rump_sys_socket(PF_ROUTE, SOCK_RAW, 0); if (s == -1) { err(1, "rump_sys_socket"); }
CVS commit: src
Module Name:src Committed By: pooka Date: Sun Jul 4 15:44:47 UTC 2010 Modified Files: src/share/examples/rump/virtual_ip_router: rumprouter.c src/sys/rump/net/rumptest: rumptest_net.c Log Message: Fix pointer assignment in previous commit (test compile works better when you do it with the #defines which actually compile the code in question). To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/share/examples/rump/virtual_ip_router/rumprouter.c cvs rdiff -u -r1.22 -r1.23 src/sys/rump/net/rumptest/rumptest_net.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/examples/rump/virtual_ip_router/rumprouter.c diff -u src/share/examples/rump/virtual_ip_router/rumprouter.c:1.3 src/share/examples/rump/virtual_ip_router/rumprouter.c:1.4 --- src/share/examples/rump/virtual_ip_router/rumprouter.c:1.3 Sun Jul 4 15:31:04 2010 +++ src/share/examples/rump/virtual_ip_router/rumprouter.c Sun Jul 4 15:44:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumprouter.c,v 1.3 2010/07/04 15:31:04 pooka Exp $ */ +/* $NetBSD: rumprouter.c,v 1.4 2010/07/04 15:44:46 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -119,7 +119,7 @@ uint8_t m_space[512]; } m_rtmsg; #define rtm m_rtmsg.m_rtm - uint8_t *bp = &m_rtmsg.m_space; + uint8_t *bp = m_rtmsg.m_space; struct sockaddr_in sinstore; int s, rv; Index: src/sys/rump/net/rumptest/rumptest_net.c diff -u src/sys/rump/net/rumptest/rumptest_net.c:1.22 src/sys/rump/net/rumptest/rumptest_net.c:1.23 --- src/sys/rump/net/rumptest/rumptest_net.c:1.22 Sun Jul 4 15:31:04 2010 +++ src/sys/rump/net/rumptest/rumptest_net.c Sun Jul 4 15:44:47 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumptest_net.c,v 1.22 2010/07/04 15:31:04 pooka Exp $ */ +/* $NetBSD: rumptest_net.c,v 1.23 2010/07/04 15:44:47 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -101,7 +101,7 @@ uint8_t m_space[512]; } m_rtmsg; #define rtm m_rtmsg.m_rtm - uint8_t *bp = &m_rtmsg.m_space; + uint8_t *bp = m_rtmsg.m_space; int s, rv; if ((rv = rump_pub_virtif_create(0)) != 0) {
CVS commit: src/sys/dev/usb
Module Name:src Committed By: tsutsui Date: Sun Jul 4 15:38:27 UTC 2010 Modified Files: src/sys/dev/usb: if_zyd.c Log Message: Make zyd(4) use config_mountroot(9) to complete device initialization (which requires firmload(9)) right after mountroot. Now it's attached on boot as following: --- uhub4 at usb4: vendor 0x1033 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub4: 5 ports with 5 removable, self powered : zyd0 at uhub4 port 4 zyd0: PCI PCI GW-US54GXS, rev 2.00/48.10, addr 3 : boot device: wd0 root on wd0a dumps on wd0b root file system type: ffs zyd0: HMAC ZD1211B, FW 47.25, RF AL2230, PA 0, address 00:22:cf:xx:xx:xx zyd0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps zyd0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps : --- Should close PR kern/43125, no particular objections in that PR. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/dev/usb/if_zyd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_zyd.c diff -u src/sys/dev/usb/if_zyd.c:1.25 src/sys/dev/usb/if_zyd.c:1.26 --- src/sys/dev/usb/if_zyd.c:1.25 Mon Apr 5 07:21:49 2010 +++ src/sys/dev/usb/if_zyd.c Sun Jul 4 15:38:27 2010 @@ -1,5 +1,5 @@ /* $OpenBSD: if_zyd.c,v 1.52 2007/02/11 00:08:04 jsg Exp $ */ -/* $NetBSD: if_zyd.c,v 1.25 2010/04/05 07:21:49 joerg Exp $ */ +/* $NetBSD: if_zyd.c,v 1.26 2010/07/04 15:38:27 tsutsui Exp $ */ /*- * Copyright (c) 2006 by Damien Bergamini @@ -22,7 +22,7 @@ * ZyDAS ZD1211/ZD1211B USB WLAN driver. */ #include -__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.25 2010/04/05 07:21:49 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_zyd.c,v 1.26 2010/07/04 15:38:27 tsutsui Exp $"); #include @@ -156,7 +156,7 @@ CFATTACH_DECL_NEW(zyd, sizeof(struct zyd_softc), zyd_match, zyd_attach, zyd_detach, zyd_activate); -Static int zyd_attachhook(void *); +Static void zyd_attachhook(device_t); Static int zyd_complete_attach(struct zyd_softc *); Static int zyd_open_pipes(struct zyd_softc *); Static void zyd_close_pipes(struct zyd_softc *); @@ -245,10 +245,10 @@ UMATCH_VENDOR_PRODUCT : UMATCH_NONE; } -Static int -zyd_attachhook(void *xsc) +Static void +zyd_attachhook(device_t self) { - struct zyd_softc *sc = xsc; + struct zyd_softc *sc = device_private(self); firmware_handle_t fwh; const char *fwname; u_char *fw; @@ -259,7 +259,7 @@ if ((error = firmware_open("zyd", fwname, &fwh)) != 0) { aprint_error_dev(sc->sc_dev, "failed to open firmware %s (error=%d)\n", fwname, error); - return error; + return; } size = firmware_get_size(fwh); fw = firmware_malloc(size); @@ -267,7 +267,7 @@ aprint_error_dev(sc->sc_dev, "failed to allocate firmware memory\n"); firmware_close(fwh); - return ENOMEM; + return; } error = firmware_read(fwh, 0, fw, size); firmware_close(fwh); @@ -275,7 +275,7 @@ aprint_error_dev(sc->sc_dev, "failed to read firmware (error %d)\n", error); firmware_free(fw, 0); - return error; + return; } error = zyd_loadfirmware(sc, fw, size); @@ -283,7 +283,7 @@ aprint_error_dev(sc->sc_dev, "could not load firmware (error=%d)\n", error); firmware_free(fw, 0); - return ENXIO; + return; } firmware_free(fw, 0); @@ -292,7 +292,7 @@ /* complete the attach process */ if ((error = zyd_complete_attach(sc)) == 0) sc->attached = 1; - return error; + return; } void @@ -334,13 +334,10 @@ IFQ_SET_READY(&ifp->if_snd); memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ); - if_attach(ifp); - /* : alloc temporarily until the layer2 can be configured. */ - if_alloc_sadl(ifp); - SIMPLEQ_INIT(&sc->sc_rqh); - return; + /* defer configrations after file system is ready to load firmware */ + config_mountroot(self, zyd_attachhook); } Static int @@ -424,7 +421,7 @@ IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ; } - if_free_sadl(ifp); + if_attach(ifp); ieee80211_ifattach(ic); ic->ic_node_alloc = zyd_node_alloc; ic->ic_newassoc = zyd_newassoc; @@ -461,11 +458,8 @@ struct ifnet *ifp = &sc->sc_if; int s; - if (!sc->attached) { - if_free_sadl(ifp); - if_detach(ifp); + if (!sc->attached) return 0; - } s = splusb(); @@ -2450,10 +2444,6 @@ struct ieee80211com *ic = &sc->sc_ic; int i, error; - if ((sc->sc_flags & ZD1211_FWLOADED) == 0) - if ((error = zyd_attachhook(sc)) != 0) - return error; - zyd_stop(ifp, 0); IEEE80211_ADDR_COPY(ic->ic_myaddr, CLLADDR(ifp->if_sadl));
CVS commit: src
Module Name:src Committed By: pooka Date: Sun Jul 4 15:31:04 UTC 2010 Modified Files: src/share/examples/rump/virtual_ip_router: rumprouter.c src/sys/rump/net/rumptest: rumptest_net.c Log Message: Use a bit more than 1 byte of space for routing messages. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/share/examples/rump/virtual_ip_router/rumprouter.c cvs rdiff -u -r1.21 -r1.22 src/sys/rump/net/rumptest/rumptest_net.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/examples/rump/virtual_ip_router/rumprouter.c diff -u src/share/examples/rump/virtual_ip_router/rumprouter.c:1.2 src/share/examples/rump/virtual_ip_router/rumprouter.c:1.3 --- src/share/examples/rump/virtual_ip_router/rumprouter.c:1.2 Mon Mar 29 11:01:16 2010 +++ src/share/examples/rump/virtual_ip_router/rumprouter.c Sun Jul 4 15:31:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumprouter.c,v 1.2 2010/03/29 11:01:16 pooka Exp $ */ +/* $NetBSD: rumprouter.c,v 1.3 2010/07/04 15:31:04 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -116,7 +116,7 @@ size_t len; struct { struct rt_msghdr m_rtm; - uint8_t m_space; + uint8_t m_space[512]; } m_rtmsg; #define rtm m_rtmsg.m_rtm uint8_t *bp = &m_rtmsg.m_space; Index: src/sys/rump/net/rumptest/rumptest_net.c diff -u src/sys/rump/net/rumptest/rumptest_net.c:1.21 src/sys/rump/net/rumptest/rumptest_net.c:1.22 --- src/sys/rump/net/rumptest/rumptest_net.c:1.21 Mon May 31 23:13:17 2010 +++ src/sys/rump/net/rumptest/rumptest_net.c Sun Jul 4 15:31:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumptest_net.c,v 1.21 2010/05/31 23:13:17 pooka Exp $ */ +/* $NetBSD: rumptest_net.c,v 1.22 2010/07/04 15:31:04 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -98,7 +98,7 @@ ssize_t len; struct { struct rt_msghdr m_rtm; - uint8_t m_space; + uint8_t m_space[512]; } m_rtmsg; #define rtm m_rtmsg.m_rtm uint8_t *bp = &m_rtmsg.m_space;
CVS commit: src/doc
Module Name:src Committed By: tsutsui Date: Sun Jul 4 15:25:00 UTC 2010 Modified Files: src/doc: CHANGES Log Message: Mention about upgt(4). To generate a diff of this commit: cvs rdiff -u -r1.1410 -r1.1411 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1410 src/doc/CHANGES:1.1411 --- src/doc/CHANGES:1.1410 Sat Jul 3 08:19:14 2010 +++ src/doc/CHANGES Sun Jul 4 15:25:00 2010 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1410 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.1411 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -641,3 +641,6 @@ network: Add mpls(4) - MultiProtocol Label Switching support [kefren 20100626] atf(7): Import 0.10. [jmmv 20100703] + upgt(4): Add a driver for Conexant/Intersil PrismGT SoftMAC USB + IEEE 802.11b/g WLAN device, ported from OpenBSD by + FUKAUMI Naoki. [tsutsui 20100704]
CVS commit: src/tests/fs/tmpfs
Module Name:src Committed By: pooka Date: Sun Jul 4 12:43:23 UTC 2010 Modified Files: src/tests/fs/tmpfs: t_renamerace.c Log Message: Add a test case for PR kern/36681 demonstrating how easy it is to get tmpfs rename to "tstile". Note1: triggering this on any non-SMP system is not as easy (because one system call tends to run from start to finish in one go) and therefore I've limited it to i386 and amd64. Incidentally, I'm still waiting for the eternally elusive MI CPU_INFO_FOREACH (or at least something else than a stupid macro) ... Note2: this is a "race condition" test. I tested it on my development host and in qemu and it triggers pretty instantly. But YMMV. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/fs/tmpfs/t_renamerace.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/tmpfs/t_renamerace.c diff -u src/tests/fs/tmpfs/t_renamerace.c:1.6 src/tests/fs/tmpfs/t_renamerace.c:1.7 --- src/tests/fs/tmpfs/t_renamerace.c:1.6 Sun Apr 26 15:15:38 2009 +++ src/tests/fs/tmpfs/t_renamerace.c Sun Jul 4 12:43:23 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: t_renamerace.c,v 1.6 2009/04/26 15:15:38 pooka Exp $ */ +/* $NetBSD: t_renamerace.c,v 1.7 2010/07/04 12:43:23 pooka Exp $ */ /* * Modified for rump and atf from a program supplied @@ -7,14 +7,16 @@ #include #include +#include #include #include #include #include #include -#include +#include #include +#include #include #include @@ -73,8 +75,102 @@ sleep(10); } +ATF_TC(renamerace2); +ATF_TC_HEAD(renamerace2, tc) +{ + atf_tc_set_md_var(tc, "descr", "rename(2) lock order inversion"); + atf_tc_set_md_var(tc, "timeout", "6"); +} + +static volatile int quittingtime = 0; + +static void * +r2w1(void *arg) +{ + int fd; + + rump_pub_lwp_alloc_and_switch(0, 0); + + fd = rump_sys_open("/file", O_CREAT | O_RDWR, 0777); + if (fd == -1) + atf_tc_fail_errno("creat"); + rump_sys_close(fd); + + while (!quittingtime) { + if (rump_sys_rename("/file", "/dir/file") == -1) + atf_tc_fail_errno("rename 1"); + if (rump_sys_rename("/dir/file", "/file") == -1) + atf_tc_fail_errno("rename 2"); + } + + return NULL; +} + +static void * +r2w2(void *arg) +{ + int fd; + + rump_pub_lwp_alloc_and_switch(0, 0); + + while (!quittingtime) { + fd = rump_sys_open("/dir/file1", O_RDWR); + if (fd != -1) + rump_sys_close(fd); + } + + return NULL; +} + +ATF_TC_BODY(renamerace2, tc) +{ + struct tmpfs_args args; + struct utsname un; + pthread_t pt[2]; + + /* + * Check that we are running on an SMP-capable arch. It should + * be a rump capability, but after the CPU_INFO_FOREACH is + * fixed, it will be every arch (for rump), so don't bother. + */ + if (uname(&un) == -1) + atf_tc_fail_errno("uname"); + if (strcmp(un.machine, "i386") != 0 && strcmp(un.machine, "amd64") != 0) + atf_tc_skip("i386 or amd64 required (have %s)", un.machine); + + /* + * Force SMP regardless of how many host CPUs there are. + * Deadlock is highly unlikely to trigger otherwise. + */ + setenv("RUMP_NCPU", "2", 1); + + rump_init(); + memset(&args, 0, sizeof(args)); + args.ta_version = TMPFS_ARGS_VERSION; + args.ta_root_mode = 0777; + if (rump_sys_mount(MOUNT_TMPFS, "/", 0, &args, sizeof(args)) == -1) + atf_tc_fail_errno("could not mount tmpfs"); + + if (rump_sys_mkdir("/dir", 0777) == -1) + atf_tc_fail_errno("cannot create directory"); + + pthread_create(&pt[0], NULL, r2w1, NULL); + pthread_create(&pt[1], NULL, r2w2, NULL); + + /* usually triggers in <<1s for me */ + sleep(4); + quittingtime = 1; + + atf_tc_expect_timeout("PR kern/36681"); + + pthread_join(pt[0], NULL); + pthread_join(pt[1], NULL); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, renamerace); - return 0; /*XXX?*/ + ATF_TP_ADD_TC(tp, renamerace2); + + return atf_no_error(); }
CVS commit: src/lib/libterminfo
Module Name:src Committed By: roy Date: Sun Jul 4 07:30:33 UTC 2010 Modified Files: src/lib/libterminfo: termcap.c Log Message: area is now used To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libterminfo/termcap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/termcap.c diff -u src/lib/libterminfo/termcap.c:1.7 src/lib/libterminfo/termcap.c:1.8 --- src/lib/libterminfo/termcap.c:1.7 Thu Mar 4 15:35:26 2010 +++ src/lib/libterminfo/termcap.c Sun Jul 4 07:30:33 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: termcap.c,v 1.7 2010/03/04 15:35:26 roy Exp $ */ +/* $NetBSD: termcap.c,v 1.8 2010/07/04 07:30:33 roy Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ */ #include -__RCSID("$NetBSD: termcap.c,v 1.7 2010/03/04 15:35:26 roy Exp $"); +__RCSID("$NetBSD: termcap.c,v 1.8 2010/07/04 07:30:33 roy Exp $"); #include #include @@ -132,7 +132,7 @@ } char * -tgetstr(const char *id, __unused char **area) +tgetstr(const char *id, char **area) { uint32_t ind; size_t i;