CVS commit: src/sys
Module Name:src Committed By: uebayasi Date: Fri Nov 12 07:59:28 UTC 2010 Modified Files: src/sys/arch/alpha/alpha: pmap.c src/sys/arch/arm/arm32: mem.c pmap.c src/sys/arch/hppa/hppa: pmap.c src/sys/arch/ia64/ia64: pmap.c src/sys/arch/mips/mips: pmap.c src/sys/arch/powerpc/oea: pmap.c src/sys/arch/powerpc/powerpc: pmap_subr.c src/sys/arch/sh3/sh3: pmap.c src/sys/arch/sparc64/sparc64: pmap.c src/sys/uvm: uvm_page.h Log Message: Put VM_PAGE_TO_MD() definition in one place. No functional changes. To generate a diff of this commit: cvs rdiff -u -r1.254 -r1.255 src/sys/arch/alpha/alpha/pmap.c cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/arm32/mem.c cvs rdiff -u -r1.218 -r1.219 src/sys/arch/arm/arm32/pmap.c cvs rdiff -u -r1.77 -r1.78 src/sys/arch/hppa/hppa/pmap.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/ia64/ia64/pmap.c cvs rdiff -u -r1.191 -r1.192 src/sys/arch/mips/mips/pmap.c cvs rdiff -u -r1.73 -r1.74 src/sys/arch/powerpc/oea/pmap.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/powerpc/pmap_subr.c cvs rdiff -u -r1.76 -r1.77 src/sys/arch/sh3/sh3/pmap.c cvs rdiff -u -r1.268 -r1.269 src/sys/arch/sparc64/sparc64/pmap.c cvs rdiff -u -r1.65 -r1.66 src/sys/uvm/uvm_page.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/alpha/alpha/pmap.c diff -u src/sys/arch/alpha/alpha/pmap.c:1.254 src/sys/arch/alpha/alpha/pmap.c:1.255 --- src/sys/arch/alpha/alpha/pmap.c:1.254 Wed Nov 10 09:27:21 2010 +++ src/sys/arch/alpha/alpha/pmap.c Fri Nov 12 07:59:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.254 2010/11/10 09:27:21 uebayasi Exp $ */ +/* $NetBSD: pmap.c,v 1.255 2010/11/12 07:59:25 uebayasi Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc. @@ -140,7 +140,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.254 2010/11/10 09:27:21 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.255 2010/11/12 07:59:25 uebayasi Exp $"); #include #include @@ -159,8 +159,6 @@ #include #endif -#define VM_PAGE_TO_MD(pg) (&(pg)->mdpage) - #ifdef DEBUG #define PDB_FOLLOW 0x0001 #define PDB_INIT 0x0002 Index: src/sys/arch/arm/arm32/mem.c diff -u src/sys/arch/arm/arm32/mem.c:1.29 src/sys/arch/arm/arm32/mem.c:1.30 --- src/sys/arch/arm/arm32/mem.c:1.29 Sat Nov 6 11:46:00 2010 +++ src/sys/arch/arm/arm32/mem.c Fri Nov 12 07:59:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mem.c,v 1.29 2010/11/06 11:46:00 uebayasi Exp $ */ +/* $NetBSD: mem.c,v 1.30 2010/11/12 07:59:25 uebayasi Exp $ */ /* * Copyright (c) 1982, 1986, 1990, 1993 @@ -76,7 +76,7 @@ #include "opt_compat_netbsd.h" #include -__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.29 2010/11/06 11:46:00 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.30 2010/11/12 07:59:25 uebayasi Exp $"); #include #include @@ -92,8 +92,6 @@ #include -#define VM_PAGE_TO_MD(pg) (&(pg)->mdpage) - extern vaddr_t memhook; /* in pmap.c (poor name!) */ extern kmutex_t memlock; /* in pmap.c */ extern void *zeropage; /* in pmap.c */ Index: src/sys/arch/arm/arm32/pmap.c diff -u src/sys/arch/arm/arm32/pmap.c:1.218 src/sys/arch/arm/arm32/pmap.c:1.219 --- src/sys/arch/arm/arm32/pmap.c:1.218 Wed Nov 10 09:27:22 2010 +++ src/sys/arch/arm/arm32/pmap.c Fri Nov 12 07:59:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.218 2010/11/10 09:27:22 uebayasi Exp $ */ +/* $NetBSD: pmap.c,v 1.219 2010/11/12 07:59:25 uebayasi Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -211,9 +211,7 @@ #include #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.218 2010/11/10 09:27:22 uebayasi Exp $"); - -#define VM_PAGE_TO_MD(pg) (&(pg)->mdpage) +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.219 2010/11/12 07:59:25 uebayasi Exp $"); #ifdef PMAP_DEBUG Index: src/sys/arch/hppa/hppa/pmap.c diff -u src/sys/arch/hppa/hppa/pmap.c:1.77 src/sys/arch/hppa/hppa/pmap.c:1.78 --- src/sys/arch/hppa/hppa/pmap.c:1.77 Sat Oct 30 17:20:43 2010 +++ src/sys/arch/hppa/hppa/pmap.c Fri Nov 12 07:59:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.77 2010/10/30 17:20:43 uebayasi Exp $ */ +/* $NetBSD: pmap.c,v 1.78 2010/11/12 07:59:26 uebayasi Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2010/10/30 17:20:43 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.78 2010/11/12 07:59:26 uebayasi Exp $"); #include "opt_cputype.h" @@ -91,8 +91,6 @@ #include #endif -#define VM_PAGE_TO_MD(pg) (&(pg)->mdpage) - #ifdef PMAPDEBUG #define static /**/ Index: src/sys/arch/ia64/ia64/pmap.c diff -u src/sys/arch/ia64/ia64/pmap.c:1.26 src/sys/arch/ia64/ia64/pmap.c:1.27 --- src/sys/arch/ia64/ia64/pmap.c:1.26 Wed Nov 10 09:27:22 2010 +++ src/sys/arch/ia64/ia64/pmap.c Fri Nov 12 07:59:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.26
CVS commit: src/sys/arch/hp700/hp700
Module Name:src Committed By: skrll Date: Fri Nov 12 06:54:57 UTC 2010 Modified Files: src/sys/arch/hp700/hp700: mainbus.c Log Message: Add some more machines that need help with autoconf. Slight variation on patch from Sergey Svishchev To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/arch/hp700/hp700/mainbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/hp700/hp700/mainbus.c diff -u src/sys/arch/hp700/hp700/mainbus.c:1.71 src/sys/arch/hp700/hp700/mainbus.c:1.72 --- src/sys/arch/hp700/hp700/mainbus.c:1.71 Wed Jun 30 06:33:52 2010 +++ src/sys/arch/hp700/hp700/mainbus.c Fri Nov 12 06:54:56 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.71 2010/06/30 06:33:52 skrll Exp $ */ +/* $NetBSD: mainbus.c,v 1.72 2010/11/12 06:54:56 skrll Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.71 2010/06/30 06:33:52 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.72 2010/11/12 06:54:56 skrll Exp $"); #include "locators.h" #include "power.h" @@ -1425,6 +1425,11 @@ #endif switch (cpu_hvers) { + case HPPA_BOARD_HPE23: + case HPPA_BOARD_HPE25: + case HPPA_BOARD_HPE35: + case HPPA_BOARD_HPE45: + case HPPA_BOARD_HP809: case HPPA_BOARD_HP819: case HPPA_BOARD_HP829:
CVS commit: src/sys
Module Name:src Committed By: uebayasi Date: Fri Nov 12 05:23:41 UTC 2010 Modified Files: src/sys/rump/librump/rumpkern: vm.c src/sys/uvm: uvm_page.c uvm_page.h Log Message: Abstraction fix; move physical address -> per-page metadata (struct vm_page *) "reverse" lookup code from uvm_page.h to uvm_page.c, to help migration to not do that. Likewise move per-page metadata (struct vm_page *) -> physical address "forward" conversion code into *.c too. This is called only low-layer VM and MD code. To generate a diff of this commit: cvs rdiff -u -r1.98 -r1.99 src/sys/rump/librump/rumpkern/vm.c cvs rdiff -u -r1.162 -r1.163 src/sys/uvm/uvm_page.c cvs rdiff -u -r1.64 -r1.65 src/sys/uvm/uvm_page.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/rump/librump/rumpkern/vm.c diff -u src/sys/rump/librump/rumpkern/vm.c:1.98 src/sys/rump/librump/rumpkern/vm.c:1.99 --- src/sys/rump/librump/rumpkern/vm.c:1.98 Wed Oct 27 20:44:49 2010 +++ src/sys/rump/librump/rumpkern/vm.c Fri Nov 12 05:23:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vm.c,v 1.98 2010/10/27 20:44:49 pooka Exp $ */ +/* $NetBSD: vm.c,v 1.99 2010/11/12 05:23:41 uebayasi Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.98 2010/10/27 20:44:49 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.99 2010/11/12 05:23:41 uebayasi Exp $"); #include #include @@ -799,6 +799,24 @@ } /* + * Physical address accessors. + */ + +struct vm_page * +uvm_phys_to_vm_page(paddr_t pa) +{ + + return NULL; +} + +paddr_t +uvm_vm_page_to_phys(const struct vm_page *pg) +{ + + return 0; +} + +/* * Routines related to the Page Baroness. */ Index: src/sys/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.162 src/sys/uvm/uvm_page.c:1.163 --- src/sys/uvm/uvm_page.c:1.162 Fri Nov 12 03:21:04 2010 +++ src/sys/uvm/uvm_page.c Fri Nov 12 05:23:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.163 2010/11/12 05:23:41 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.163 2010/11/12 05:23:41 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -978,6 +978,30 @@ #endif /* + * PHYS_TO_VM_PAGE: find vm_page for a PA. used by MI code to get vm_pages + * back from an I/O mapping (ugh!). used in some MD code as well. + */ +struct vm_page * +uvm_phys_to_vm_page(paddr_t pa) +{ + paddr_t pf = atop(pa); + int off; + int psi; + + psi = vm_physseg_find(pf, &off); + if (psi != -1) + return(&VM_PHYSMEM_PTR(psi)->pgs[off]); + return(NULL); +} + +paddr_t +uvm_vm_page_to_phys(const struct vm_page *pg) +{ + + return pg->phys_addr; +} + +/* * uvm_page_recolor: Recolor the pages if the new bucket count is * larger than the old one. */ Index: src/sys/uvm/uvm_page.h diff -u src/sys/uvm/uvm_page.h:1.64 src/sys/uvm/uvm_page.h:1.65 --- src/sys/uvm/uvm_page.h:1.64 Fri Nov 12 03:21:04 2010 +++ src/sys/uvm/uvm_page.h Fri Nov 12 05:23:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.h,v 1.64 2010/11/12 03:21:04 uebayasi Exp $ */ +/* $NetBSD: uvm_page.h,v 1.65 2010/11/12 05:23:41 uebayasi Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -294,8 +294,9 @@ int uvm_page_lookup_freelist(struct vm_page *); -static struct vm_page *PHYS_TO_VM_PAGE(paddr_t); int vm_physseg_find(paddr_t, int *); +struct vm_page *uvm_phys_to_vm_page(paddr_t); +paddr_t uvm_vm_page_to_phys(const struct vm_page *); /* * macros @@ -303,7 +304,7 @@ #define UVM_PAGE_TREE_PENALTY 4 /* XXX: a guess */ -#define VM_PAGE_TO_PHYS(entry) ((entry)->phys_addr) +#define VM_PAGE_TO_PHYS(entry) uvm_vm_page_to_phys(entry) /* * Compute the page color bucket for a given page. @@ -311,23 +312,7 @@ #define VM_PGCOLOR_BUCKET(pg) \ (atop(VM_PAGE_TO_PHYS((pg))) & uvmexp.colormask) - -/* - * PHYS_TO_VM_PAGE: find vm_page for a PA. used by MI code to get vm_pages - * back from an I/O mapping (ugh!). used in some MD code as well. - */ -static inline struct vm_page * -PHYS_TO_VM_PAGE(paddr_t pa) -{ - paddr_t pf = atop(pa); - int off; - int psi; - - psi = vm_physseg_find(pf, &off); - if (psi != -1) - return(&vm_physmem[psi].pgs[off]); - return(NULL); -} +#define PHYS_TO_VM_PAGE(pa) uvm_phys_to_vm_page(pa) #define VM_PAGE_IS_FREE(entry) ((entry)->pqflags & PQ_FREE) #define VM_FREE_PAGE_TO_CPU(pg) ((struct uvm_cpu *)((uintptr_t)pg->offset))
CVS commit: src/lib/libkvm
Module Name:src Committed By: uebayasi Date: Fri Nov 12 04:52:09 UTC 2010 Modified Files: src/lib/libkvm: kvm_proc.c Log Message: Fix build. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/lib/libkvm/kvm_proc.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/libkvm/kvm_proc.c diff -u src/lib/libkvm/kvm_proc.c:1.87 src/lib/libkvm/kvm_proc.c:1.88 --- src/lib/libkvm/kvm_proc.c:1.87 Sun Sep 26 22:28:05 2010 +++ src/lib/libkvm/kvm_proc.c Fri Nov 12 04:52:08 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: kvm_proc.c,v 1.87 2010/09/26 22:28:05 jym Exp $ */ +/* $NetBSD: kvm_proc.c,v 1.88 2010/11/12 04:52:08 uebayasi Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)kvm_proc.c 8.3 (Berkeley) 9/23/93"; #else -__RCSID("$NetBSD: kvm_proc.c,v 1.87 2010/09/26 22:28:05 jym Exp $"); +__RCSID("$NetBSD: kvm_proc.c,v 1.88 2010/11/12 04:52:08 uebayasi Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -102,6 +102,7 @@ #include #include #include +#include #include
CVS commit: src/sys/uvm
Module Name:src Committed By: uebayasi Date: Fri Nov 12 03:21:04 UTC 2010 Modified Files: src/sys/uvm: uvm_page.c uvm_page.h Log Message: Abstraction fix; move physical address -> physical segment "reverse" lookup code from uvm_page.h to uvm_page.c. This code is used by some pmaps to lookup per-page state (PV) from per-segment metadata (struct vm_physseg). This is not needed if UVM looks up physical segment once in fault handler, then directly passes it to pmap. This change helps transition to that model. The only users of vm_physseg_find() are pmap_motorola.c and powerpc/ibm4xx/pmap.c. Tested By: Compiling and running powerpc/ibm4xx/pmap.c (evbppc/conf/OPENBLOCKS266) To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/uvm/uvm_page.c cvs rdiff -u -r1.63 -r1.64 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.161 src/sys/uvm/uvm_page.c:1.162 --- src/sys/uvm/uvm_page.c:1.161 Thu Nov 11 15:59:27 2010 +++ src/sys/uvm/uvm_page.c Fri Nov 12 03:21:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.162 2010/11/12 03:21:04 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -872,6 +872,112 @@ } /* + * when VM_PHYSSEG_MAX is 1, we can simplify these functions + */ + +#if VM_PHYSSEG_MAX == 1 +static inline int vm_physseg_find_contig(struct vm_physseg *, int, paddr_t, int *); +#elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH) +static inline int vm_physseg_find_bsearch(struct vm_physseg *, int, paddr_t, int *); +#else +static inline int vm_physseg_find_linear(struct vm_physseg *, int, paddr_t, int *); +#endif + +/* + * vm_physseg_find: find vm_physseg structure that belongs to a PA + */ +int +vm_physseg_find(paddr_t pframe, int *offp) +{ + +#if VM_PHYSSEG_MAX == 1 + return vm_physseg_find_contig(vm_physmem, vm_nphysseg, pframe, offp); +#elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH) + return vm_physseg_find_bsearch(vm_physmem, vm_nphysseg, pframe, offp); +#else + return vm_physseg_find_linear(vm_physmem, vm_nphysseg, pframe, offp); +#endif +} + +#if VM_PHYSSEG_MAX == 1 +static inline int +vm_physseg_find_contig(struct vm_physseg *segs, int nsegs, paddr_t pframe, int *offp) +{ + + /* 'contig' case */ + if (pframe >= segs[0].start && pframe < segs[0].end) { + if (offp) + *offp = pframe - segs[0].start; + return(0); + } + return(-1); +} + +#elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH) + +static inline int +vm_physseg_find_bsearch(struct vm_physseg *segs, int nsegs, paddr_t pframe, int *offp) +{ + /* binary search for it */ + u_int start, len, try; + + /* + * if try is too large (thus target is less than try) we reduce + * the length to trunc(len/2) [i.e. everything smaller than "try"] + * + * if the try is too small (thus target is greater than try) then + * we set the new start to be (try + 1). this means we need to + * reduce the length to (round(len/2) - 1). + * + * note "adjust" below which takes advantage of the fact that + * (round(len/2) - 1) == trunc((len - 1) / 2) + * for any value of len we may have + */ + + for (start = 0, len = nsegs ; len != 0 ; len = len / 2) { + try = start + (len / 2); /* try in the middle */ + + /* start past our try? */ + if (pframe >= segs[try].start) { + /* was try correct? */ + if (pframe < segs[try].end) { +if (offp) + *offp = pframe - segs[try].start; +return(try);/* got it */ + } + start = try + 1; /* next time, start here */ + len--; /* "adjust" */ + } else { + /* + * pframe before try, just reduce length of + * region, done in "for" loop + */ + } + } + return(-1); +} + +#else + +static inline int +vm_physseg_find_linear(struct vm_physseg *segs, int nsegs, paddr_t pframe, int *offp) +{ + /* linear search for it */ + int lcv; + + for (lcv = 0; lcv < nsegs; lcv++) { + if (pframe >= segs[lcv].start && + pframe < segs[lcv].end) { + if (offp) +*offp = pframe - segs[lcv].start; + return(lcv); /* got it */ + } + } + return(-1); +} +#endif + +/* * uvm_page_recolor: Recolor the pages if the new bucket count is * larger than the old one. */ Index: src/sys/uvm/uvm_page.h diff -u src/sys/uvm/uvm_page.h:1.63 src/sys/uvm/uvm_page.h:1.64 --- src/sys/uvm/uvm_page.h:1.63 Wed Nov 10 09:27:21 2010 +++ src/sys/uvm/uvm_page.h Fri Nov 12 03:21:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.h,v 1.63 2010/11/10 09:27:21 uebayasi Exp $ */ +/* $NetBSD: uvm_page.h,v 1.64 2010/11/12 03:21:04 uebayasi Exp $ */ /* * Copyright (c)
CVS commit: src/sys/uvm
Module Name:src Committed By: uebayasi Date: Fri Nov 12 02:36:02 UTC 2010 Modified Files: src/sys/uvm: uvm_extern.h Log Message: Abstraction fix; don't pull in physical segment/page definitions in UVM external API, uvm_extern.h. Because most users care only virtual memory. Device drivers use bus_dma(9) to manage physical memory. Device drivers pull in bus_dma(9) API, bus_dma.h. bus_dma(9) implementations pull in UVM internal API, uvm.h. Tested By: Compiling i386 ALL kernel To generate a diff of this commit: cvs rdiff -u -r1.163 -r1.164 src/sys/uvm/uvm_extern.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/uvm/uvm_extern.h diff -u src/sys/uvm/uvm_extern.h:1.163 src/sys/uvm/uvm_extern.h:1.164 --- src/sys/uvm/uvm_extern.h:1.163 Fri Apr 16 03:21:49 2010 +++ src/sys/uvm/uvm_extern.h Fri Nov 12 02:36:02 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_extern.h,v 1.163 2010/04/16 03:21:49 rmind Exp $ */ +/* $NetBSD: uvm_extern.h,v 1.164 2010/11/12 02:36:02 uebayasi Exp $ */ /* * @@ -476,7 +476,6 @@ #include #include #include -#include #include #include #include
CVS commit: src/sys/arch/xen/x86
Module Name:src Committed By: dholland Date: Fri Nov 12 02:07:28 UTC 2010 Modified Files: src/sys/arch/xen/x86: mainbus.c Log Message: Build fix for xen domu + PCI, from Juho Salminen in PR 44083. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/xen/x86/mainbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/xen/x86/mainbus.c diff -u src/sys/arch/xen/x86/mainbus.c:1.12 src/sys/arch/xen/x86/mainbus.c:1.13 --- src/sys/arch/xen/x86/mainbus.c:1.12 Sat Aug 7 21:59:11 2010 +++ src/sys/arch/xen/x86/mainbus.c Fri Nov 12 02:07:27 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.12 2010/08/07 21:59:11 cegger Exp $ */ +/* $NetBSD: mainbus.c,v 1.13 2010/11/12 02:07:27 dholland Exp $ */ /* NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp */ /* @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.12 2010/08/07 21:59:11 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.13 2010/11/12 02:07:27 dholland Exp $"); #include #include @@ -133,7 +133,7 @@ void mainbus_attach(device_t parent, device_t self, void *aux) { -#if NPCI > 0 +#if defined(DOM0OPS) && NPCI > 0 int mode; #endif union mainbus_attach_args mba;
CVS commit: src/share/examples/rump
Module Name:src Committed By: pooka Date: Thu Nov 11 23:04:24 UTC 2010 Added Files: src/share/examples/rump: README Log Message: Add readme explaining which grue has ok'd the eating of some code until recently located here. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/share/examples/rump/README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/share/examples/rump/README diff -u /dev/null src/share/examples/rump/README:1.1 --- /dev/null Thu Nov 11 23:04:24 2010 +++ src/share/examples/rump/README Thu Nov 11 23:04:24 2010 @@ -0,0 +1,8 @@ + $NetBSD: README,v 1.1 2010/11/11 23:04:24 pooka Exp $ + + +This directory contains various examples on how to interface with +a rump kernel. Another place which contains even more examples +is src/tests and its subdirectories. Some programs which were +located here have in fact been moved to src/tests to serve as +automated tests.
CVS commit: src/share/examples/rump
Module Name:src Committed By: pooka Date: Thu Nov 11 23:01:01 UTC 2010 Modified Files: src/share/examples/rump: Makefile Removed Files: src/share/examples/rump/img2cgd: Makefile cgd.conf img2cgd.c src/share/examples/rump/pad_nothai: Makefile musa.c pad_nothai.c src/share/examples/rump/swwdog_arm: Makefile swwdog_arm.c Log Message: Remove some programs which live as atf tests now. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/share/examples/rump/Makefile cvs rdiff -u -r1.2 -r0 src/share/examples/rump/img2cgd/Makefile cvs rdiff -u -r1.1 -r0 src/share/examples/rump/img2cgd/cgd.conf cvs rdiff -u -r1.3 -r0 src/share/examples/rump/img2cgd/img2cgd.c cvs rdiff -u -r1.1 -r0 src/share/examples/rump/pad_nothai/Makefile \ src/share/examples/rump/pad_nothai/musa.c \ src/share/examples/rump/pad_nothai/pad_nothai.c cvs rdiff -u -r1.1 -r0 src/share/examples/rump/swwdog_arm/Makefile \ src/share/examples/rump/swwdog_arm/swwdog_arm.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/Makefile diff -u src/share/examples/rump/Makefile:1.5 src/share/examples/rump/Makefile:1.6 --- src/share/examples/rump/Makefile:1.5 Sat May 1 23:31:01 2010 +++ src/share/examples/rump/Makefile Thu Nov 11 23:01:00 2010 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.5 2010/05/01 23:31:01 pooka Exp $ +# $NetBSD: Makefile,v 1.6 2010/11/11 23:01:00 pooka Exp $ # -SUBDIR= btplay img2cgd pad_nothai sdread swwdog_arm tipsy ttyserv \ +SUBDIR= btplay sdread tipsy ttyserv \ ulptprint umserv ukbd_read ums_draw wirelessconf .include
CVS commit: src/sbin/ping
Module Name:src Committed By: pooka Date: Thu Nov 11 22:56:39 UTC 2010 Modified Files: src/sbin/ping: Makefile ping.c Log Message: add compile-conditional rumpclient support To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sbin/ping/Makefile cvs rdiff -u -r1.90 -r1.91 src/sbin/ping/ping.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/ping/Makefile diff -u src/sbin/ping/Makefile:1.14 src/sbin/ping/Makefile:1.15 --- src/sbin/ping/Makefile:1.14 Mon May 28 12:06:23 2007 +++ src/sbin/ping/Makefile Thu Nov 11 22:56:38 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2007/05/28 12:06:23 tls Exp $ +# $NetBSD: Makefile,v 1.15 2010/11/11 22:56:38 pooka Exp $ # @(#)Makefile 8.1 (Berkeley) 6/5/93 USE_FORT?= yes # setuid @@ -12,4 +12,16 @@ LDADD+= -lipsec DPADD+= ${LIBIPSEC} +# +# Compile-time debug flag. If compiled with "make RUMP_ACTION=1", +# make rump system calls. This allows to single-step ioctl commands +# to figure out where ioctl's go in the kernel. +# +.ifdef RUMP_ACTION +CPPFLAGS+= -DRUMP_SYS_NETWORKING -DRUMP_SYS_IOCTL -DRUMP_SYS_CLOSE +CPPFLAGS+= -DRUMP_ACTION +LDADD+= -lrumpclient +DBG=-g +.endif + .include Index: src/sbin/ping/ping.c diff -u src/sbin/ping/ping.c:1.90 src/sbin/ping/ping.c:1.91 --- src/sbin/ping/ping.c:1.90 Mon Nov 2 00:47:09 2009 +++ src/sbin/ping/ping.c Thu Nov 11 22:56:38 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ping.c,v 1.90 2009/11/02 00:47:09 christos Exp $ */ +/* $NetBSD: ping.c,v 1.91 2010/11/11 22:56:38 pooka Exp $ */ /* * Copyright (c) 1989, 1993 @@ -58,7 +58,7 @@ #include #ifndef lint -__RCSID("$NetBSD: ping.c,v 1.90 2009/11/02 00:47:09 christos Exp $"); +__RCSID("$NetBSD: ping.c,v 1.91 2010/11/11 22:56:38 pooka Exp $"); #endif #include @@ -92,6 +92,13 @@ #include #endif /*IPSEC*/ +#ifdef RUMP_ACTION +#include +#include +#include +#define poll(a,b,c) rump_sys_poll(a,b,c) +#endif + #define FLOOD_INTVL 0.01 /* default flood output interval */ #define MAXPACKET (IP_MAXPACKET-60-8) /* max packet size */ @@ -244,6 +251,11 @@ struct sigaction sa; #endif +#ifdef RUMP_ACTION + if (rumpclient_init() == -1) + err(1, "rumpclient init failed"); +#endif + if ((s = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0) err(1, "Cannot create socket"); if ((sloop = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
CVS commit: src
Module Name:src Committed By: pooka Date: Thu Nov 11 22:48:48 UTC 2010 Modified Files: src/distrib/sets/lists/tests: mi src/etc/mtree: NetBSD.dist.base Log Message: build system worship for new tests. To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.60 -r1.61 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/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.153 src/distrib/sets/lists/tests/mi:1.154 --- src/distrib/sets/lists/tests/mi:1.153 Tue Nov 9 15:26:41 2010 +++ src/distrib/sets/lists/tests/mi Thu Nov 11 22:48:48 2010 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.153 2010/11/09 15:26:41 pooka Exp $ +# $NetBSD: mi,v 1.154 2010/11/11 22:48:48 pooka Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -215,6 +215,9 @@ ./usr/libdata/debug/usr/tests/dev tests-fs-debug ./usr/libdata/debug/usr/tests/dev/audio tests-fs-debug ./usr/libdata/debug/usr/tests/dev/audio/h_pad.debug tests-fs-debug debug,atf +./usr/libdata/debug/usr/tests/dev/cgd tests-fs-debug +./usr/libdata/debug/usr/tests/dev/cgd/h_img2cgd tests-fs-debug +./usr/libdata/debug/usr/tests/dev/cgd/h_img2cgd/h_img2cgd.debug tests-fs-debug debug,atf ./usr/libdata/debug/usr/tests/dev/scsipi tests-fs-debug ./usr/libdata/debug/usr/tests/dev/scsipi/t_cd.debug tests-fs-debug debug,atf ./usr/libdata/debug/usr/tests/dev/sysmon tests-fs-debug @@ -1013,6 +1016,12 @@ ./usr/tests/dev/audio/h_pad tests-fs-tests atf ./usr/tests/dev/audio/t_pad tests-fs-tests atf ./usr/tests/dev/audio/t_pad_output.bz2.uue tests-fs-tests atf +./usr/tests/dev/cgdtests-fs-tests +./usr/tests/dev/cgd/Atffile tests-fs-tests atf +./usr/tests/dev/cgd/t_cgd tests-fs-tests atf +./usr/tests/dev/cgd/h_img2cgdtests-fs-tests +./usr/tests/dev/cgd/h_img2cgd/h_img2cgd tests-fs-tests atf +./usr/tests/dev/cgd/h_img2cgd/cgd.conf tests-fs-tests atf ./usr/tests/dev/scsipitests-fs-tests ./usr/tests/dev/scsipi/Atffile tests-fs-tests atf ./usr/tests/dev/scsipi/t_cd tests-fs-tests atf Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.60 src/etc/mtree/NetBSD.dist.base:1.61 --- src/etc/mtree/NetBSD.dist.base:1.60 Sun Nov 7 19:55:58 2010 +++ src/etc/mtree/NetBSD.dist.base Thu Nov 11 22:48:47 2010 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.60 2010/11/07 19:55:58 pooka Exp $ +# $NetBSD: NetBSD.dist.base,v 1.61 2010/11/11 22:48:47 pooka Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -208,6 +208,8 @@ ./usr/libdata/debug/usr/tests/crypto/libcrypto ./usr/libdata/debug/usr/tests/dev ./usr/libdata/debug/usr/tests/dev/audio +./usr/libdata/debug/usr/tests/dev/cgd +./usr/libdata/debug/usr/tests/dev/cgd/h_img2cgd ./usr/libdata/debug/usr/tests/dev/scsipi ./usr/libdata/debug/usr/tests/dev/sysmon ./usr/libdata/debug/usr/tests/fs @@ -1145,6 +1147,8 @@ ./usr/tests/crypto/libcrypto ./usr/tests/dev ./usr/tests/dev/audio +./usr/tests/dev/cgd +./usr/tests/dev/cgd/h_img2cgd ./usr/tests/dev/scsipi ./usr/tests/dev/sysmon ./usr/tests/fs
CVS commit: src/tests/dev/cgd/h_img2cgd
Module Name:src Committed By: pooka Date: Thu Nov 11 22:44:50 UTC 2010 Modified Files: src/tests/dev/cgd/h_img2cgd: Makefile Log Message: fix To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/dev/cgd/h_img2cgd/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/dev/cgd/h_img2cgd/Makefile diff -u src/tests/dev/cgd/h_img2cgd/Makefile:1.1 src/tests/dev/cgd/h_img2cgd/Makefile:1.2 --- src/tests/dev/cgd/h_img2cgd/Makefile:1.1 Thu Nov 11 22:38:47 2010 +++ src/tests/dev/cgd/h_img2cgd/Makefile Thu Nov 11 22:44:50 2010 @@ -1,9 +1,13 @@ -# $NetBSD: Makefile,v 1.1 2010/11/11 22:38:47 pooka Exp $ +# $NetBSD: Makefile,v 1.2 2010/11/11 22:44:50 pooka Exp $ # -PROG= h_img2cgd -SRCS= img2cgd.c -NOMAN= +PROG= h_img2cgd +SRCS= img2cgd.c +FILES= cgd.conf +NOMAN=1 + +BINDIR= ${TESTSBASE}/dev/cgd/h_img2cgd +FILESDIR= ${TESTSBASE}/dev/cgd/h_img2cgd .include @@ -11,7 +15,6 @@ CPPFLAGS+= -DCGDCONFIG_AS_LIB .include "${NETBSDSRCDIR}/sbin/cgdconfig/Makefile.cgdconfig" -DBG= -g -O0 WARNS= 3 .include
CVS commit: src/tests/dev
Module Name:src Committed By: pooka Date: Thu Nov 11 22:38:47 UTC 2010 Modified Files: src/tests/dev: Makefile Added Files: src/tests/dev/cgd: Makefile t_cgd.sh src/tests/dev/cgd/h_img2cgd: Makefile cgd.conf img2cgd.c Log Message: Add rudimentary cgd tests. The tests use cgd to transform a plaintext into into an encrypted image and back into plaintext by doing rump I/O on /dev/cgd. There is one test to check that giving the same password for both encryption and decryption produces the same plaintext and another to check that giving a different passwords does not produce the same plaintext. This could be fairly easily extended to test all feature of cgd (hint hint). For example, now cgd.conf is included in cvs, but the only reason for that is that without further hacking cgdconfig uses /dev/random quality random to generate the salt for a pkcsetcetc_kdf2 cgconfig -g, and making an automated test block on the entropy pool is just not good form. Details are everything. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/dev/Makefile cvs rdiff -u -r0 -r1.1 src/tests/dev/cgd/Makefile src/tests/dev/cgd/t_cgd.sh cvs rdiff -u -r0 -r1.1 src/tests/dev/cgd/h_img2cgd/Makefile \ src/tests/dev/cgd/h_img2cgd/cgd.conf \ src/tests/dev/cgd/h_img2cgd/img2cgd.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/dev/Makefile diff -u src/tests/dev/Makefile:1.3 src/tests/dev/Makefile:1.4 --- src/tests/dev/Makefile:1.3 Tue Aug 24 11:29:45 2010 +++ src/tests/dev/Makefile Thu Nov 11 22:38:46 2010 @@ -1,10 +1,10 @@ -# $NetBSD: Makefile,v 1.3 2010/08/24 11:29:45 pooka Exp $ +# $NetBSD: Makefile,v 1.4 2010/11/11 22:38:46 pooka Exp $ # .include TESTSDIR= ${TESTSBASE}/dev -TESTS_SUBDIRS+= audio scsipi sysmon +TESTS_SUBDIRS+= audio cgd scsipi sysmon .include Added files: Index: src/tests/dev/cgd/Makefile diff -u /dev/null src/tests/dev/cgd/Makefile:1.1 --- /dev/null Thu Nov 11 22:38:47 2010 +++ src/tests/dev/cgd/Makefile Thu Nov 11 22:38:47 2010 @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.1 2010/11/11 22:38:47 pooka Exp $ +# + +.include + +TESTSDIR= ${TESTSBASE}/dev/cgd + +TESTS_SH= t_cgd + +SUBDIR= h_img2cgd + +LDADD+= -lrumpdev_cgd -lrumpdev -lrumpvfs +LDADD+= -lrump +LDADD+= -lrumpuser -lpthread + +NOMAN= + +.include Index: src/tests/dev/cgd/t_cgd.sh diff -u /dev/null src/tests/dev/cgd/t_cgd.sh:1.1 --- /dev/null Thu Nov 11 22:38:47 2010 +++ src/tests/dev/cgd/t_cgd.sh Thu Nov 11 22:38:47 2010 @@ -0,0 +1,74 @@ +# $NetBSD: t_cgd.sh,v 1.1 2010/11/11 22:38:47 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. +# + +atf_test_case basic +basic_head() +{ + + atf_set "descr" "Tests that encrypt/decrypt works" +} + +basic_body() +{ + + d=$(atf_get_srcdir) + atf_check -s exit:0 sh -c "echo 12345 | \ + $d/h_img2cgd/h_img2cgd $d/h_img2cgd/cgd.conf write \ + enc.img $d/h_img2cgd/cgd.conf" + atf_check -s exit:0 sh -c "echo 12345 | \ + $d/h_img2cgd/h_img2cgd $d/h_img2cgd/cgd.conf read \ + enc.img clear.txt" + atf_check -s exit:0 cmp clear.txt $d/h_img2cgd/cgd.conf +} + +atf_test_case wrongpass +wrongpass_head() +{ + + atf_set "descr" "Tests that wrong password does not give original " \ + "plaintext" +} + +wrongpass_body() +{ + + d=$(atf_get_srcdir) + atf_check -s exit:0 sh -c "echo 12345 | \ + $d/h_img2cgd/h_img2cgd $d/h_img2cgd/cgd.conf write \ + enc.img $d/h_img2cgd/cgd.conf" + atf_check -s exit:0 sh -c "echo 54321 | \ + $d/h_img2cgd/h_img2cgd $d/h_img2cgd/cgd.conf read \ + enc.img clear.txt" + atf_check -s
CVS commit: src/tests/lib/libevent
Module Name:src Committed By: pgoyette Date: Thu Nov 11 22:18:53 UTC 2010 Modified Files: src/tests/lib/libevent: t_event.sh Log Message: The libevent tests are fairly lengthy - each test case actually contains about 20 or so mini-cases. Increase the timeout for these tests to let them run to completion. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libevent/t_event.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libevent/t_event.sh diff -u src/tests/lib/libevent/t_event.sh:1.1 src/tests/lib/libevent/t_event.sh:1.2 --- src/tests/lib/libevent/t_event.sh:1.1 Mon Nov 2 10:15:45 2009 +++ src/tests/lib/libevent/t_event.sh Thu Nov 11 22:18:53 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_event.sh,v 1.1 2009/11/02 10:15:45 plunky Exp $ +# $NetBSD: t_event.sh,v 1.2 2010/11/11 22:18:53 pgoyette Exp $ # # Copyright (c) 2009 The NetBSD Foundation, Inc. # All rights reserved. @@ -35,6 +35,7 @@ atf_test_case kqueue kqueue_head() { atf_set "descr" "Test libevent with kqueue backend" + atf_set "timeout" "90" } kqueue_body() { EVENT_NOPOLL=1 EVENT_NOSELECT=1 \ @@ -44,6 +45,7 @@ atf_test_case poll poll_head() { atf_set "descr" "Test libevent with poll backend" + atf_set "timeout" "90" } poll_body() { EVENT_NOKQUEUE=1 EVENT_NOSELECT=1 \ @@ -53,6 +55,7 @@ atf_test_case select select_head() { atf_set "descr" "Test libevent with select backend" + atf_set "timeout" "90" } select_body() { EVENT_NOKQUEUE=1 EVENT_NOPOLL=1 \
CVS commit: src/sys/dev/sysmon
Module Name:src Committed By: pooka Date: Thu Nov 11 21:55:04 UTC 2010 Modified Files: src/sys/dev/sysmon: swwdog.c Log Message: Apparently swwdog reboot hasn't worked in several years since it tried to cpu_reboot() from a callout. Make it reboot from a workq instead. problem made manifest by atf test rumpfs unmount flush caused issue to un-shush tested: rump kernel (tests/dev/sysmon) and qemu To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/sysmon/swwdog.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/sysmon/swwdog.c diff -u src/sys/dev/sysmon/swwdog.c:1.11 src/sys/dev/sysmon/swwdog.c:1.12 --- src/sys/dev/sysmon/swwdog.c:1.11 Fri Aug 6 16:02:56 2010 +++ src/sys/dev/sysmon/swwdog.c Thu Nov 11 21:55:04 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: swwdog.c,v 1.11 2010/08/06 16:02:56 pooka Exp $ */ +/* $NetBSD: swwdog.c,v 1.12 2010/11/11 21:55:04 pooka Exp $ */ /* * Copyright (c) 2004, 2005 Steven M. Bellovin @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.11 2010/08/06 16:02:56 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.12 2010/11/11 21:55:04 pooka Exp $"); /* * @@ -49,6 +49,7 @@ #include #include #include +#include #include #include "ioconf.h" @@ -85,17 +86,32 @@ static void swwdog_sysctl_setup(void); static struct sysctllog *swwdog_sysctllog; +static void +doreboot(struct work *wrkwrkwrk, void *p) +{ + + cpu_reboot(0, NULL); +} + +static struct workqueue *wq; + void swwdogattach(int n __unused) { int err; static struct cfdata cf; + if (workqueue_create(&wq, "swwreboot", doreboot, NULL, + PRI_NONE, IPL_NONE, 0) != 0) { + aprint_error("failed to create swwdog reboot wq"); + } + err = config_cfattach_attach(swwdog_cd.cd_name, &swwdog_ca); if (err) { aprint_error("%s: couldn't register cfattach: %d\n", swwdog_cd.cd_name, err); config_cfdriver_detach(&swwdog_cd); + workqueue_destroy(wq); return; } @@ -149,6 +165,7 @@ swwdog_disarm(sc); callout_destroy(&sc->sc_c); sysctl_teardown(&swwdog_sysctllog); + workqueue_destroy(wq); return 1; } @@ -211,6 +228,7 @@ swwdog_panic(void *vsc) { struct swwdog_softc *sc = vsc; + static struct work wk; /* we'll need it max once */ bool do_panic; do_panic = !swwdog_reboot; @@ -223,7 +241,7 @@ if (do_panic) panic("watchdog timer expired"); else - cpu_reboot(0, NULL); + workqueue_enqueue(wq, &wk, NULL); } static void
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Nov 11 18:45:09 UTC 2010 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: help me if you can i'm gcc and i do appreciate work'round-eee'e help me, get my head out of the ground won't you please, please help me? To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.72 src/sys/rump/librump/rumpvfs/rumpfs.c:1.73 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.72 Thu Nov 11 17:33:22 2010 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 18:45:09 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.72 2010/11/11 17:33:22 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.73 2010/11/11 18:45:09 pooka Exp $ */ /* * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.72 2010/11/11 17:33:22 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.73 2010/11/11 18:45:09 pooka Exp $"); #include #include @@ -1129,7 +1129,7 @@ struct uio *uio = ap->a_uio; const int advice = IO_ADV_DECODE(ap->a_ioflag); off_t chunk; - int error; + int error = 0; /* et op? */ if (rn->rn_flags & RUMPNODE_ET_PHONE_HOST) @@ -1191,7 +1191,7 @@ void *olddata; size_t oldlen, newlen; off_t chunk; - int error; + int error = 0; bool allocd = false; /* consult et? */ @@ -1209,6 +1209,8 @@ * No, it doesn't really support sparse files, just fakes it. */ newlen = uio->uio_offset + uio->uio_resid; + oldlen = 0; /* XXXgcc */ + olddata = NULL; if (rn->rn_dlen < newlen) { oldlen = rn->rn_dlen; olddata = rn->rn_data;
CVS commit: src/tests/fs/vfs
Module Name:src Committed By: pooka Date: Thu Nov 11 17:44:44 UTC 2010 Modified Files: src/tests/fs/vfs: t_full.c t_renamerace.c t_vnops.c Log Message: skip tests which use features which rumpfs does not support (namely: vop_rename and a file system size limit) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/fs/vfs/t_full.c cvs rdiff -u -r1.13 -r1.14 src/tests/fs/vfs/t_renamerace.c cvs rdiff -u -r1.9 -r1.10 src/tests/fs/vfs/t_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/vfs/t_full.c diff -u src/tests/fs/vfs/t_full.c:1.3 src/tests/fs/vfs/t_full.c:1.4 --- src/tests/fs/vfs/t_full.c:1.3 Sat Aug 28 10:56:11 2010 +++ src/tests/fs/vfs/t_full.c Thu Nov 11 17:44:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: t_full.c,v 1.3 2010/08/28 10:56:11 wiz Exp $ */ +/* $NetBSD: t_full.c,v 1.4 2010/11/11 17:44:44 pooka Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -56,8 +56,9 @@ size_t bonus; int fd, i = 0; - if (FSTYPE_PUFFS(tc)) { - atf_tc_skip("puffs does not support explicit block allocation (GOP_ALLOC)"); + if (FSTYPE_PUFFS(tc) || FSTYPE_RUMPFS(tc)) { + atf_tc_skip("fs does not support explicit block allocation " + "(GOP_ALLOC)"); } bonus = 0; Index: src/tests/fs/vfs/t_renamerace.c diff -u src/tests/fs/vfs/t_renamerace.c:1.13 src/tests/fs/vfs/t_renamerace.c:1.14 --- src/tests/fs/vfs/t_renamerace.c:1.13 Mon Nov 1 14:04:02 2010 +++ src/tests/fs/vfs/t_renamerace.c Thu Nov 11 17:44:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: t_renamerace.c,v 1.13 2010/11/01 14:04:02 pooka Exp $ */ +/* $NetBSD: t_renamerace.c,v 1.14 2010/11/11 17:44:44 pooka Exp $ */ /* * Modified for rump and atf from a program supplied @@ -87,6 +87,9 @@ if (FSTYPE_MSDOS(tc)) atf_tc_skip("test fails in some setups, reason unknown"); + if (FSTYPE_RUMPFS(tc)) + atf_tc_skip("rename not supported by fs"); + RZ(rump_pub_lwproc_newproc()); RL(wrkpid = rump_sys_getpid()); @@ -122,6 +125,9 @@ if (FSTYPE_SYSVBFS(tc)) atf_tc_skip("directories not supported"); + if (FSTYPE_RUMPFS(tc)) + atf_tc_skip("rename not supported by fs"); + /* XXX: msdosfs also sometimes hangs */ if (FSTYPE_FFS(tc) || FSTYPE_EXT2FS(tc) || FSTYPE_LFS(tc) || FSTYPE_MSDOS(tc)) Index: src/tests/fs/vfs/t_vnops.c diff -u src/tests/fs/vfs/t_vnops.c:1.9 src/tests/fs/vfs/t_vnops.c:1.10 --- src/tests/fs/vfs/t_vnops.c:1.9 Thu Sep 9 11:42:52 2010 +++ src/tests/fs/vfs/t_vnops.c Thu Nov 11 17:44:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: t_vnops.c,v 1.9 2010/09/09 11:42:52 njoly Exp $ */ +/* $NetBSD: t_vnops.c,v 1.10 2010/11/11 17:44:44 pooka Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -171,6 +171,9 @@ if (FSTYPE_MSDOS(tc)) atf_tc_skip("test fails in some setups, reason unknown"); + if (FSTYPE_RUMPFS(tc)) + atf_tc_skip("rename not supported by fs"); + USES_DIRS; md(pb1, mp, "dir1"); @@ -251,6 +254,9 @@ rename_dotdot(const atf_tc_t *tc, const char *mp) { + if (FSTYPE_RUMPFS(tc)) + atf_tc_skip("rename not supported by fs"); + USES_DIRS; if (rump_sys_chdir(mp) == -1) @@ -284,6 +290,9 @@ struct stat sb; ino_t f1ino, f2ino; + if (FSTYPE_RUMPFS(tc)) + atf_tc_skip("rename not supported by fs"); + if (FSTYPE_MSDOS(tc)) atf_tc_skip("test fails in some setups, reason unknown"); @@ -403,6 +412,9 @@ long val; size_t len; + if (FSTYPE_RUMPFS(tc)) + atf_tc_skip("rename not supported by fs"); + if (rump_sys_chdir(mp) == -1) atf_tc_fail_errno("chdir mountpoint");
CVS commit: src/tests/fs/common
Module Name:src Committed By: pooka Date: Thu Nov 11 17:39:29 UTC 2010 Modified Files: src/tests/fs/common: Makefile h_fsmacros.h Added Files: src/tests/fs/common: fstest_rumpfs.c Log Message: Add rumpfs to list of file systems to be autotested. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/fs/common/Makefile cvs rdiff -u -r0 -r1.1 src/tests/fs/common/fstest_rumpfs.c cvs rdiff -u -r1.21 -r1.22 src/tests/fs/common/h_fsmacros.h 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/common/Makefile diff -u src/tests/fs/common/Makefile:1.5 src/tests/fs/common/Makefile:1.6 --- src/tests/fs/common/Makefile:1.5 Tue Aug 3 17:24:45 2010 +++ src/tests/fs/common/Makefile Thu Nov 11 17:39:29 2010 @@ -1,11 +1,12 @@ -# $NetBSD: Makefile,v 1.5 2010/08/03 17:24:45 drochner Exp $ +# $NetBSD: Makefile,v 1.6 2010/11/11 17:39:29 pooka Exp $ # .include LIB= vfstest SRCS= fstest_ext2fs.c fstest_ffs.c fstest_lfs.c fstest_msdosfs.c \ - fstest_nfs.c fstest_puffs.c fstest_sysvbfs.c fstest_tmpfs.c + fstest_nfs.c fstest_puffs.c fstest_rumpfs.c fstest_sysvbfs.c \ + fstest_tmpfs.c WARNS= 3 Index: src/tests/fs/common/h_fsmacros.h diff -u src/tests/fs/common/h_fsmacros.h:1.21 src/tests/fs/common/h_fsmacros.h:1.22 --- src/tests/fs/common/h_fsmacros.h:1.21 Sun Nov 7 17:51:17 2010 +++ src/tests/fs/common/h_fsmacros.h Thu Nov 11 17:39:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: h_fsmacros.h,v 1.21 2010/11/07 17:51:17 jmmv Exp $ */ +/* $NetBSD: h_fsmacros.h,v 1.22 2010/11/11 17:39:29 pooka Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -55,6 +55,7 @@ FSPROTOS(msdosfs); FSPROTOS(nfs); FSPROTOS(puffs); +FSPROTOS(rumpfs); FSPROTOS(sysvbfs); FSPROTOS(tmpfs); @@ -133,6 +134,7 @@ ATF_TC_FSADD(msdosfs,MOUNT_MSDOS,func,desc) \ ATF_TC_FSADD(nfs,MOUNT_NFS,func,desc) \ ATF_TC_FSADD(puffs,MOUNT_PUFFS,func,desc) \ + ATF_TC_FSADD(rumpfs,MOUNT_RUMPFS,func,desc) \ ATF_TC_FSADD(sysvbfs,MOUNT_SYSVBFS,func,desc) \ ATF_TC_FSADD(tmpfs,MOUNT_TMPFS,func,desc) @@ -143,6 +145,7 @@ ATF_TP_FSADD(msdosfs,func); \ ATF_TP_FSADD(nfs,func); \ ATF_TP_FSADD(puffs,func); \ + ATF_TP_FSADD(rumpfs,func); \ ATF_TP_FSADD(sysvbfs,func); \ ATF_TP_FSADD(tmpfs,func); @@ -179,6 +182,8 @@ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_NFS) == 0) #define FSTYPE_PUFFS(tc)\ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_PUFFS) == 0) +#define FSTYPE_RUMPFS(tc)\ +(strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_RUMPFS) == 0) #define FSTYPE_SYSVBFS(tc)\ (strcmp(atf_tc_get_md_var(tc, "X-fs.type"), MOUNT_SYSVBFS) == 0) #define FSTYPE_TMPFS(tc)\ Added files: Index: src/tests/fs/common/fstest_rumpfs.c diff -u /dev/null src/tests/fs/common/fstest_rumpfs.c:1.1 --- /dev/null Thu Nov 11 17:39:29 2010 +++ src/tests/fs/common/fstest_rumpfs.c Thu Nov 11 17:39:29 2010 @@ -0,0 +1,83 @@ +/* $NetBSD: fstest_rumpfs.c,v 1.1 2010/11/11 17:39:29 pooka Exp $ */ + +/*- + * Copyright (c) 2010 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Nicolas Joly. + * + * 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 +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "h_fsmacros.h" + +int +rumpfs_fstest_newfs(const atf_tc_t *tc, void **buf, const char *image, +off_t size, void *fspriv) +{ + + return rump_init(); +} + +int +rumpfs_fstest_delfs(const atf_tc_t *tc, void *buf) +{ + + return 0; +} + +int +rumpfs_fstest_mount(const atf_tc_t *tc, void *buf, cons
CVS commit: src/tests/kernel
Module Name:src Committed By: pooka Date: Thu Nov 11 17:36:57 UTC 2010 Modified Files: src/tests/kernel: Makefile Log Message: add necessary libs for t_posix_fadvise To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/kernel/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/kernel/Makefile diff -u src/tests/kernel/Makefile:1.8 src/tests/kernel/Makefile:1.9 --- src/tests/kernel/Makefile:1.8 Mon Aug 2 10:29:48 2010 +++ src/tests/kernel/Makefile Thu Nov 11 17:36:57 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.8 2010/08/02 10:29:48 pooka Exp $ +# $NetBSD: Makefile,v 1.9 2010/11/11 17:36:57 pooka Exp $ NOMAN= # defined @@ -27,6 +27,7 @@ LDADD.t_rnd+= -lrumpvfs -lrumpdev_rnd -lrumpdev -lrump -lrumpuser -lpthread LDADD.t_filedesc+= -lrumpvfs -lrumpdev_rnd -lrumpdev -lrump -lrumpuser -lpthread LDADD.t_extattrctl+= -lrumpvfs -lrump -lrumpuser -lpthread +LDADD.t_posix_fadvise+= -lrumpvfs -lrump -lrumpuser -lpthread .PATH: ${NETBSDSRCDIR}/sys/kern TESTS_C+= t_extent
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Nov 11 17:33:22 UTC 2010 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: +VOP_RENAME To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.71 src/sys/rump/librump/rumpvfs/rumpfs.c:1.72 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.71 Thu Nov 11 17:26:01 2010 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 17:33:22 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.71 2010/11/11 17:26:01 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.72 2010/11/11 17:33:22 pooka Exp $ */ /* * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.71 2010/11/11 17:26:01 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.72 2010/11/11 17:33:22 pooka Exp $"); #include #include @@ -64,6 +64,7 @@ static int rump_vop_getattr(void *); static int rump_vop_mkdir(void *); static int rump_vop_rmdir(void *); +static int rump_vop_remove(void *); static int rump_vop_mknod(void *); static int rump_vop_create(void *); static int rump_vop_inactive(void *); @@ -96,6 +97,7 @@ { &vop_getattr_desc, rump_vop_getattr }, { &vop_mkdir_desc, rump_vop_mkdir }, { &vop_rmdir_desc, rump_vop_rmdir }, + { &vop_remove_desc, rump_vop_remove }, { &vop_mknod_desc, rump_vop_mknod }, { &vop_create_desc, rump_vop_create }, { &vop_symlink_desc, rump_vop_symlink }, @@ -116,7 +118,6 @@ { &vop_islocked_desc, genfs_islocked }, { &vop_inactive_desc, rump_vop_inactive }, { &vop_reclaim_desc, rump_vop_reclaim }, - { &vop_remove_desc, genfs_eopnotsupp }, { &vop_link_desc, genfs_eopnotsupp }, { &vop_pathconf_desc, rump_vop_pathconf }, { &vop_bmap_desc, rump_vop_bmap }, @@ -630,7 +631,7 @@ return 0; } - /* we handle only some "non-special" cases */ + /* we don't do rename */ if (!(((cnp->cn_flags & ISLASTCN) == 0) || (cnp->cn_nameiop != RENAME))) return EOPNOTSUPP; @@ -816,6 +817,38 @@ } static int +rump_vop_remove(void *v) +{ +struct vop_rmdir_args /* { +struct vnode *a_dvp; +struct vnode *a_vp; +struct componentname *a_cnp; +}; */ *ap = v; + struct vnode *dvp = ap->a_dvp; + struct vnode *vp = ap->a_vp; + struct componentname *cnp = ap->a_cnp; + struct rumpfs_node *rnd = dvp->v_data; + struct rumpfs_node *rn = vp->v_data; + int rv = 0; + + if (rn->rn_flags & RUMPNODE_ET_PHONE_HOST) + return EOPNOTSUPP; + + if (vp->v_type == VREG) { + rump_hyperfree(rn->rn_data, rn->rn_dlen); + } + + freedir(rnd, cnp); + rn->rn_flags |= RUMPNODE_CANRECLAIM; + + PNBUF_PUT(cnp->cn_pnbuf); + vput(dvp); + vput(vp); + + return rv; +} + +static int rump_vop_mknod(void *v) { struct vop_mknod_args /* {
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Nov 11 17:26:01 UTC 2010 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: support read/write & ubc To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.70 src/sys/rump/librump/rumpvfs/rumpfs.c:1.71 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.70 Thu Nov 11 16:08:31 2010 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 17:26:01 2010 @@ -1,7 +1,7 @@ -/* $NetBSD: rumpfs.c,v 1.70 2010/11/11 16:08:31 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.71 2010/11/11 17:26:01 pooka Exp $ */ /* - * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,10 +26,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.70 2010/11/11 16:08:31 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.71 2010/11/11 17:26:01 pooka Exp $"); #include #include +#include #include #include #include @@ -52,6 +53,8 @@ #include #include +#include + #include #include "rump_private.h" @@ -75,6 +78,8 @@ static int rump_vop_readlink(void *); static int rump_vop_whiteout(void *); static int rump_vop_pathconf(void *); +static int rump_vop_bmap(void *); +static int rump_vop_strategy(void *); int (**fifo_vnodeop_p)(void *); const struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { @@ -114,6 +119,8 @@ { &vop_remove_desc, genfs_eopnotsupp }, { &vop_link_desc, genfs_eopnotsupp }, { &vop_pathconf_desc, rump_vop_pathconf }, + { &vop_bmap_desc, rump_vop_bmap }, + { &vop_strategy_desc, rump_vop_strategy }, { NULL, NULL } }; const struct vnodeopv_desc rump_vnodeop_opv_desc = @@ -165,6 +172,10 @@ int writefd; uint64_t offset; } reg; + struct { + void *data; + size_t dlen; + } reg_noet; struct { /* VDIR */ LIST_HEAD(, rumpfs_dent) dents; struct rumpfs_node *parent; @@ -179,6 +190,8 @@ #define rn_readfd rn_u.reg.readfd #define rn_writefd rn_u.reg.writefd #define rn_offset rn_u.reg.offset +#define rn_data rn_u.reg_noet.data +#define rn_dlen rn_u.reg_noet.dlen #define rn_dir rn_u.dir.dents #define rn_parent rn_u.dir.parent #define rn_linktarg rn_u.link.target @@ -193,7 +206,7 @@ struct vnode *rfsmp_rvp; }; -static struct rumpfs_node *makeprivate(enum vtype, dev_t, off_t); +static struct rumpfs_node *makeprivate(enum vtype, dev_t, off_t, bool); /* * Extra Terrestrial stuff. We map a given key (pathname) to a file on @@ -340,7 +353,7 @@ et = kmem_alloc(sizeof(*et), KM_SLEEP); strcpy(et->et_key, key); et->et_keylen = strlen(et->et_key); - et->et_rn = rn = makeprivate(ettype_to_vtype(ftype), rdev, size); + et->et_rn = rn = makeprivate(ettype_to_vtype(ftype), rdev, size, true); et->et_removing = false; et->et_blkmin = dmin; @@ -462,7 +475,7 @@ static kmutex_t reclock; static struct rumpfs_node * -makeprivate(enum vtype vt, dev_t rdev, off_t size) +makeprivate(enum vtype vt, dev_t rdev, off_t size, bool et) { struct rumpfs_node *rn; struct vattr *va; @@ -475,8 +488,10 @@ LIST_INIT(&rn->rn_dir); break; case VREG: - rn->rn_readfd = -1; - rn->rn_writefd = -1; + if (et) { + rn->rn_readfd = -1; + rn->rn_writefd = -1; + } break; default: break; @@ -668,10 +683,11 @@ return ENOENT; } - rn = makeprivate(hft_to_vtype(hft), NODEV, fsize); + rn = makeprivate(hft_to_vtype(hft), NODEV, fsize, true); rn->rn_flags |= RUMPNODE_CANRECLAIM; if (rnd->rn_flags & RUMPNODE_DIR_ETSUBS) { rn->rn_flags |= RUMPNODE_DIR_ET | RUMPNODE_DIR_ETSUBS; + rn->rn_flags |= RUMPNODE_ET_PHONE_HOST; } rn->rn_hostpath = newpath; @@ -754,7 +770,7 @@ struct rumpfs_node *rnd = dvp->v_data, *rn; int rv = 0; - rn = makeprivate(VDIR, NODEV, DEV_BSIZE); + rn = makeprivate(VDIR, NODEV, DEV_BSIZE, false); rn->rn_parent = rnd; rv = makevnode(dvp->v_mount, rn, vpp); if (rv) @@ -815,7 +831,7 @@ struct rumpfs_node *rnd = dvp->v_data, *rn; int rv; - rn = makeprivate(va->va_type, va->va_rdev, DEV_BSIZE); + rn = makeprivate(va->va_type, va->va_rdev, DEV_BSIZE, false); rv = makevnode(dvp->v_mount, rn, vpp); if (rv) goto out; @@ -846,7 +862,7 @@ int rv; newsize = va->va_type == VSOCK ? DEV_BSIZE : 0; - rn = makeprivate(va->va_type, NODEV, newsize); + rn = makeprivate(va->va_type, NODEV, newsize, false); rv = makevnode(dvp->v_mount, rn, vpp); if (rv) goto out; @@ -879,7 +895,7 @@ linklen = strlen(target); KASSERT(linklen < MAXPATHLEN); - rn = makeprivate(VLNK, NODEV, linklen); + rn = makeprivate(VLNK, NODEV, linklen, false); rv =
CVS commit: [uebayasi-xip] src/sys/uvm
Module Name:src Committed By: uebayasi Date: Thu Nov 11 16:22:25 UTC 2010 Modified Files: src/sys/uvm [uebayasi-xip]: uvm_page.c Log Message: s/managed device page/device page/ To generate a diff of this commit: cvs rdiff -u -r1.153.2.61 -r1.153.2.62 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.153.2.61 src/sys/uvm/uvm_page.c:1.153.2.62 --- src/sys/uvm/uvm_page.c:1.153.2.61 Thu Nov 11 16:20:28 2010 +++ src/sys/uvm/uvm_page.c Thu Nov 11 16:22:25 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.153.2.62 2010/11/11 16:22:25 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.62 2010/11/11 16:22:25 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -843,7 +843,7 @@ seg->flags = flags; /* - * Managed device page metadata initialization + * Device page metadata initialization * - Pages are not used for general purpose memory. * - Pages are not put in free lists. * - Pages are not paged out ("fixed").
CVS commit: [uebayasi-xip] src/sys/uvm
Module Name:src Committed By: uebayasi Date: Thu Nov 11 16:20:28 UTC 2010 Modified Files: src/sys/uvm [uebayasi-xip]: uvm_page.c Log Message: Use vm_physseg accessors. Remove confusing comments. To generate a diff of this commit: cvs rdiff -u -r1.153.2.60 -r1.153.2.61 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.153.2.60 src/sys/uvm/uvm_page.c:1.153.2.61 --- src/sys/uvm/uvm_page.c:1.153.2.60 Thu Nov 4 11:57:49 2010 +++ src/sys/uvm/uvm_page.c Thu Nov 11 16:20:28 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.153.2.60 2010/11/04 11:57:49 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.60 2010/11/04 11:57:49 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.61 2010/11/11 16:20:28 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -433,7 +433,7 @@ freepages = 0; for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) { - seg = vm_physmem_ptrs[lcv]; + seg = VM_PHYSMEM_PTR(lcv); freepages += (seg->end - seg->start); } @@ -480,7 +480,7 @@ */ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) { - seg = vm_physmem_ptrs[lcv]; + seg = VM_PHYSMEM_PTR(lcv); n = seg->end - seg->start; /* set up page array pointers */ @@ -490,7 +490,7 @@ seg->endpg = seg->pgs + n; /* init and free vm_pages (we've already zeroed them) */ - paddr = ctob(vm_physmem_ptrs[lcv]->start); + paddr = ctob(seg->start); for (i = 0 ; i < n ; i++, paddr += PAGE_SIZE) { seg->pgs[i].phys_addr = paddr; #ifdef __HAVE_VM_PAGE_MD @@ -684,7 +684,7 @@ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) #endif { - seg = vm_physmem_ptrs[lcv]; + seg = VM_PHYSMEM_PTR(lcv); if (uvm.page_init_done == true) panic("uvm_page_physget: called _after_ bootstrap"); @@ -704,7 +704,7 @@ panic("uvm_page_physget: out of memory!"); vm_nphysmem--; for (x = lcv ; x < vm_nphysmem ; x++) - vm_physmem_ptrs[x] = vm_physmem_ptrs[x+1]; + VM_PHYSMEM_PTR_SWAP(x, x + 1); } return (true); } @@ -721,7 +721,7 @@ panic("uvm_page_physget: out of memory!"); vm_nphysmem--; for (x = lcv ; x < vm_nphysmem ; x++) - vm_physmem_ptrs[x] = vm_physmem_ptrs[x+1]; + VM_PHYSMEM_PTR_SWAP(x, x + 1); } return (true); } @@ -734,7 +734,7 @@ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) #endif { - seg = vm_physmem_ptrs[lcv]; + seg = VM_PHYSMEM_PTR(lcv); /* any room in this bank? */ if (seg->avail_start >= seg->avail_end) @@ -751,7 +751,7 @@ panic("uvm_page_physget: out of memory!"); vm_nphysmem--; for (x = lcv ; x < vm_nphysmem ; x++) -vm_physmem_ptrs[x] = vm_physmem_ptrs[x+1]; +VM_PHYSMEM_PTR_SWAP(x, x + 1); } return (true); } @@ -801,14 +801,15 @@ * check to see if this is a "preload" (i.e. uvm_page_init hasn't been * called yet, so malloc is not available). */ - for (lcv = 0; lcv < vm_nphysmem; lcv++) { - if (vm_physmem_ptrs[lcv]->pgs) + + for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) { + if (VM_PHYSMEM_PTR(lcv)->pgs) break; } if (lcv == vm_nphysmem) { seg->pgs = NULL; seg->endpg = NULL; - seg->free_list = free_list; /* XXX */ + seg->free_list = free_list; } else { panic("uvm_page_physload: " "tried to add RAM after uvm_page_init"); @@ -824,8 +825,6 @@ panic("memory unload is not supported yet"); - /* XXX */ - uvm_physseg_free(&vm_physmem_freelist, vm_physmem_ptrs, seg); vm_nphysmem--; } @@ -841,7 +840,7 @@ KASSERT(seg != NULL); seg->prot = prot; - seg->flags = flags; /* XXXUEBS BUS_SPACE_MAP_* */ + seg->flags = flags; /* * Managed device page metadata initialization @@ -921,7 +920,6 @@ "\tincrease VM_PHYSSEG_MAX\n", VM_PHYSSEG_MAX, (long long)start, (long long)end); - /* XXXUEBS too early to use RUN_ONCE(9)? */ if (uvm_physseg_inited == 0) { uvm_physseg_inited = 1; uvm_physseg_init(); @@ -1193,10 +1191,10 @@ psi = vm_physseg_find_device(pf, &off); if (psi != -1) - return(&vm_physdev_ptrs[psi]->pgs[off]); + return(&VM_PHYSDEV_PTR(psi)->pgs[off]); psi = vm_physseg_find(pf, &off); if (psi != -1) - return(&vm_physmem_ptrs[psi]->pgs[off]); + return(&VM_PHYSMEM_PTR(psi)->pgs[off]); return(NULL); } @@ -2234,7 +2232,7 @@ lcv = vm_physseg_find(atop(VM_PAGE_TO_PHYS(pg)), NULL); KASSERT(lcv != -1); - return (vm_physmem_ptrs[lcv]->free_list); + return (VM_PHYSMEM_PTR(lcv)->free_list); } #if defined(DDB) || defined(DEBUGPRINT) @@ -2341,7 +2339,7 @@ #endif "\n", "PAGE", "FLAG", "PQ", "UOBJECT", "UANON"); for (i = 0; i < vm_nphysmem; i++) { - for (pg = vm_physmem_ptrs[i]->pgs; pg < vm_physmem_ptrs[i]->endpg; pg++) { + for (pg = VM_PHY
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Nov 11 16:08:31 UTC 2010 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: support vop_pathconf To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.69 src/sys/rump/librump/rumpvfs/rumpfs.c:1.70 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.69 Thu Nov 11 16:01:59 2010 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 16:08:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.69 2010/11/11 16:01:59 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.70 2010/11/11 16:08:31 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.69 2010/11/11 16:01:59 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.70 2010/11/11 16:08:31 pooka Exp $"); #include #include @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -73,6 +74,7 @@ static int rump_vop_symlink(void *); static int rump_vop_readlink(void *); static int rump_vop_whiteout(void *); +static int rump_vop_pathconf(void *); int (**fifo_vnodeop_p)(void *); const struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { @@ -111,6 +113,7 @@ { &vop_reclaim_desc, rump_vop_reclaim }, { &vop_remove_desc, genfs_eopnotsupp }, { &vop_link_desc, genfs_eopnotsupp }, + { &vop_pathconf_desc, rump_vop_pathconf }, { NULL, NULL } }; const struct vnodeopv_desc rump_vnodeop_opv_desc = @@ -1113,6 +1116,53 @@ } static int +rump_vop_pathconf(void *v) +{ + struct vop_pathconf_args /* { + struct vnode *a_vp; + int a_name; + register_t *a_retval; + }; */ *ap = v; + int name = ap->a_name; + register_t *retval = ap->a_retval; + + switch (name) { + case _PC_LINK_MAX: + *retval = LINK_MAX; + return 0; + case _PC_NAME_MAX: + *retval = NAME_MAX; + return 0; + case _PC_PATH_MAX: + *retval = PATH_MAX; + return 0; + case _PC_PIPE_BUF: + *retval = PIPE_BUF; + return 0; + case _PC_CHOWN_RESTRICTED: + *retval = 1; + return 0; + case _PC_NO_TRUNC: + *retval = 1; + return 0; + case _PC_SYNC_IO: + *retval = 1; + return 0; + case _PC_FILESIZEBITS: + *retval = 43; /* this one goes to 11 */ + return 0; + case _PC_SYMLINK_MAX: + *retval = MAXPATHLEN; + return 0; + case _PC_2_SYMLINKS: + *retval = 1; + return 0; + default: + return EINVAL; + } +} + +static int rump_vop_success(void *v) {
CVS commit: src/tests/fs/vfs
Module Name:src Committed By: pooka Date: Thu Nov 11 16:03:55 UTC 2010 Modified Files: src/tests/fs/vfs: t_io.c Log Message: use atf interfaces for error reportage To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/fs/vfs/t_io.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/vfs/t_io.c diff -u src/tests/fs/vfs/t_io.c:1.1 src/tests/fs/vfs/t_io.c:1.2 --- src/tests/fs/vfs/t_io.c:1.1 Thu Aug 19 02:36:02 2010 +++ src/tests/fs/vfs/t_io.c Thu Nov 11 16:03:55 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: t_io.c,v 1.1 2010/08/19 02:36:02 pooka Exp $ */ +/* $NetBSD: t_io.c,v 1.2 2010/11/11 16:03:55 pooka Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -67,8 +67,7 @@ memset(b3, 0, therange); memset(b3 + getpagesize() - 1, 'B', 2); - if (memcmp(b2, b3, therange) != 0) - abort(); + ATF_REQUIRE_EQ(memcmp(b2, b3, therange), 0); rump_sys_close(fd); rump_sys_chdir("/");
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Nov 11 16:01:59 UTC 2010 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: support vfs_mount/unmount To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.68 src/sys/rump/librump/rumpvfs/rumpfs.c:1.69 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.68 Thu Nov 11 15:05:54 2010 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 16:01:59 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.68 2010/11/11 15:05:54 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.69 2010/11/11 16:01:59 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.68 2010/11/11 15:05:54 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.69 2010/11/11 16:01:59 pooka Exp $"); #include #include @@ -98,6 +98,7 @@ { &vop_read_desc, rump_vop_read }, { &vop_write_desc, rump_vop_write }, { &vop_open_desc, rump_vop_open }, + { &vop_close_desc, genfs_nullop }, { &vop_seek_desc, genfs_seek }, { &vop_getpages_desc, genfs_getpages }, { &vop_putpages_desc, genfs_putpages }, @@ -183,6 +184,7 @@ #define RUMPNODE_CANRECLAIM 0x01 #define RUMPNODE_DIR_ET 0x02 #define RUMPNODE_DIR_ETSUBS 0x04 +#define RUMPNODE_ET_PHONE_HOST 0x10 struct rumpfs_mount { struct vnode *rfsmp_rvp; @@ -339,6 +341,8 @@ et->et_removing = false; et->et_blkmin = dmin; + rn->rn_flags |= RUMPNODE_ET_PHONE_HOST; + if (ftype == RUMP_ETFS_REG || REGDIR(ftype) || et->et_blkmin != -1) { size_t len = strlen(hostpath)+1; @@ -947,7 +951,7 @@ int mode = ap->a_mode; int error = EINVAL; - if (vp->v_type != VREG || rn->rn_hostpath == NULL) + if (vp->v_type != VREG || (rn->rn_flags & RUMPNODE_ET_PHONE_HOST) == 0) return 0; if (mode & FREAD) { @@ -1126,7 +1130,7 @@ struct rumpfs_node *rn = vp->v_data; int error; - if (vp->v_type == VREG) { + if (rn->rn_flags & RUMPNODE_ET_PHONE_HOST && vp->v_type == VREG) { if (rn->rn_readfd != -1) { rumpuser_close(rn->rn_readfd, &error); rn->rn_readfd = -1; @@ -1137,7 +1141,7 @@ } } *ap->a_recycle = (rn->rn_flags & RUMPNODE_CANRECLAIM) ? true : false; - + VOP_UNLOCK(vp); return 0; } @@ -1222,22 +1226,62 @@ /* vfs_list */ }; +static int +rumpfs_mountfs(struct mount *mp) +{ + struct rumpfs_mount *rfsmp; + struct rumpfs_node *rn; + int error; + + rfsmp = kmem_alloc(sizeof(*rfsmp), KM_SLEEP); + + rn = makeprivate(VDIR, NODEV, DEV_BSIZE); + rn->rn_parent = rn; + if ((error = makevnode(mp, rn, &rfsmp->rfsmp_rvp)) != 0) + return error; + + rfsmp->rfsmp_rvp->v_vflag |= VV_ROOT; + VOP_UNLOCK(rfsmp->rfsmp_rvp); + + mp->mnt_data = rfsmp; + mp->mnt_stat.f_namemax = MAXNAMLEN; + mp->mnt_stat.f_iosize = 512; + mp->mnt_flag |= MNT_LOCAL; + mp->mnt_iflag |= IMNT_MPSAFE; + vfs_getnewfsid(mp); + + return 0; +} + int rumpfs_mount(struct mount *mp, const char *mntpath, void *arg, size_t *alen) { + int error; - return EOPNOTSUPP; + error = set_statvfs_info(mntpath, UIO_USERSPACE, "rumpfs", UIO_SYSSPACE, + mp->mnt_op->vfs_name, mp, curlwp); + if (error) + return error; + + return rumpfs_mountfs(mp); } int -rumpfs_unmount(struct mount *mp, int flags) +rumpfs_unmount(struct mount *mp, int mntflags) { + struct rumpfs_mount *rfsmp = mp->mnt_data; + int flags = 0, error; - /* if going for it, just lie about it */ - if (panicstr) - return 0; + if (panicstr || mntflags & MNT_FORCE) + flags |= FORCECLOSE; - return EOPNOTSUPP; /* ;) */ + if ((error = vflush(mp, rfsmp->rfsmp_rvp, flags)) != 0) + return error; + vgone(rfsmp->rfsmp_rvp); /* XXX */ + + kmem_free(rfsmp, sizeof(*rfsmp)); + + return 0; } int @@ -1280,8 +1324,6 @@ rumpfs_mountroot() { struct mount *mp; - struct rumpfs_mount *rfsmp; - struct rumpfs_node *rn; int error; if ((error = vfs_rootmountalloc(MOUNT_RUMPFS, "rootdev", &mp)) != 0) { @@ -1289,31 +1331,17 @@ return error; } - rfsmp = kmem_alloc(sizeof(*rfsmp), KM_SLEEP); - - rn = makeprivate(VDIR, NODEV, DEV_BSIZE); - rn->rn_parent = rn; - error = makevnode(mp, rn, &rfsmp->rfsmp_rvp); - if (error) - panic("could not create root vnode: %d", error); - rfsmp->rfsmp_rvp->v_vflag |= VV_ROOT; - VOP_UNLOCK(rfsmp->rfsmp_rvp); + if ((error = rumpfs_mountfs(mp)) != 0) + panic("mounting rootfs failed: %d", error); mutex_enter(&mountlist_lock); CIRCLEQ_INSERT_TAIL(&mountlist, mp, mnt_list); mutex_exit(&mountlist_lock); - mp->mnt_data = rfsmp; - mp->mnt_stat.f_namemax = MAXNAMLEN; - mp->mnt_stat.f_iosize = 512; - mp->mnt_flag |= MNT_LOCAL; - mp->mnt_iflag |= IMNT_MPSAFE; - vfs_getnewfsid(mp); - error = set_statvfs_info("/", UIO_SYSSPACE, "rumpfs", UIO_SYSSPACE, mp->mnt_op->vfs_name, mp, curlwp); if
CVS commit: src/sys/uvm
Module Name:src Committed By: uebayasi Date: Thu Nov 11 15:59:27 UTC 2010 Modified Files: src/sys/uvm: uvm_page.c Log Message: C style; make a sentinel pointer have an exclusive value; no functional changes. To generate a diff of this commit: cvs rdiff -u -r1.160 -r1.161 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.160 src/sys/uvm/uvm_page.c:1.161 --- src/sys/uvm/uvm_page.c:1.160 Thu Nov 11 15:51:05 2010 +++ src/sys/uvm/uvm_page.c Thu Nov 11 15:59:27 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.161 2010/11/11 15:59:27 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -467,7 +467,7 @@ seg->pgs = pagearray; pagearray += n; pagecount -= n; - seg->lastpg = seg->pgs + (n - 1); + seg->lastpg = seg->pgs + n; /* init and free vm_pages (we've already zeroed them) */ paddr = ctob(seg->start); @@ -861,7 +861,7 @@ ps->pgs = NULL; } else { ps->pgs = pgs; - ps->lastpg = pgs + npages - 1; + ps->lastpg = pgs + npages; } ps->free_list = free_list; vm_nphysmem++; @@ -1987,7 +1987,7 @@ #endif "\n", "PAGE", "FLAG", "PQ", "UOBJECT", "UANON"); for (i = 0; i < vm_nphysmem; i++) { - for (pg = VM_PHYSMEM_PTR(i)->pgs; pg <= VM_PHYSMEM_PTR(i)->lastpg; pg++) { + for (pg = VM_PHYSMEM_PTR(i)->pgs; pg < VM_PHYSMEM_PTR(i)->lastpg; pg++) { (*pr)("%18p %04x %04x %18p %18p", pg, pg->flags, pg->pqflags, pg->uobject, pg->uanon);
CVS commit: src/sys/arch/arm/s3c2xx0
Module Name:src Committed By: dyoung Date: Thu Nov 11 15:58:41 UTC 2010 Modified Files: src/sys/arch/arm/s3c2xx0: ohci_s3c24x0.c Log Message: Fix usb_port.h-removal fallout with the patch by Brett Slager in port-arm/44081, "evbarm/SMDK2410 kernel fails to compile". Use device_t instead of device_ptr_t. Use device_t and cfdata_t typedefs. Insert missing aprint_naive(). To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/s3c2xx0/ohci_s3c24x0.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/s3c2xx0/ohci_s3c24x0.c diff -u src/sys/arch/arm/s3c2xx0/ohci_s3c24x0.c:1.6 src/sys/arch/arm/s3c2xx0/ohci_s3c24x0.c:1.7 --- src/sys/arch/arm/s3c2xx0/ohci_s3c24x0.c:1.6 Mon Apr 28 20:23:14 2008 +++ src/sys/arch/arm/s3c2xx0/ohci_s3c24x0.c Thu Nov 11 15:58:41 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: ohci_s3c24x0.c,v 1.6 2008/04/28 20:23:14 martin Exp $ */ +/* $NetBSD: ohci_s3c24x0.c,v 1.7 2010/11/11 15:58:41 dyoung Exp $ */ /* derived from ohci_pci.c */ @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ohci_s3c24x0.c,v 1.6 2008/04/28 20:23:14 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci_s3c24x0.c,v 1.7 2010/11/11 15:58:41 dyoung Exp $"); #include #include @@ -54,9 +54,9 @@ #include #include -int ohci_ssio_match(struct device *, struct cfdata *, void *); -void ohci_ssio_attach(struct device *, struct device *, void *); -int ohci_ssio_detach(device_ptr_t, int); +int ohci_ssio_match(device_t, cfdata_t, void *); +void ohci_ssio_attach(device_t, device_t, void *); +int ohci_ssio_detach(device_t, int); extern int ohcidebug; @@ -70,7 +70,7 @@ ohci_ssio_match, ohci_ssio_attach, ohci_ssio_detach, ohci_activate); int -ohci_ssio_match(struct device *parent, struct cfdata *match, void *aux) +ohci_ssio_match(device_t parent, cfdata_t match, void *aux) { struct s3c2xx0_attach_args *sa = (struct s3c2xx0_attach_args *)aux; /* XXX: check some registers */ @@ -84,7 +84,7 @@ } void -ohci_ssio_attach(struct device *parent, struct device *self, void *aux) +ohci_ssio_attach(device_t parent, device_t self, void *aux) { struct ohci_ssio_softc *sc = device_private(self); struct s3c2xx0_attach_args *sa = (struct s3c2xx0_attach_args *)aux; @@ -92,6 +92,7 @@ usbd_status r; aprint_normal("\n"); + aprint_naive("\n"); sc->sc.sc_dev = self; sc->sc.sc_bus.hci_private = sc; @@ -134,7 +135,7 @@ } int -ohci_ssio_detach(device_ptr_t self, int flags) +ohci_ssio_detach(device_t self, int flags) { return (0); }
CVS commit: src/sys/uvm
Module Name:src Committed By: uebayasi Date: Thu Nov 11 15:51:05 UTC 2010 Modified Files: src/sys/uvm: uvm_page.c Log Message: Typo in a comment. To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.159 src/sys/uvm/uvm_page.c:1.160 --- src/sys/uvm/uvm_page.c:1.159 Thu Nov 11 15:47:43 2010 +++ src/sys/uvm/uvm_page.c Thu Nov 11 15:51:05 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.160 2010/11/11 15:51:05 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -794,7 +794,7 @@ } /* - * check to see if this is a "preload" (i.e. uvm_mem_init hasn't been + * check to see if this is a "preload" (i.e. uvm_page_init hasn't been * called yet, so malloc is not available). */
CVS commit: src/sys/uvm
Module Name:src Committed By: uebayasi Date: Thu Nov 11 15:47:43 UTC 2010 Modified Files: src/sys/uvm: uvm_page.c Log Message: Minor clean up. To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.158 src/sys/uvm/uvm_page.c:1.159 --- src/sys/uvm/uvm_page.c:1.158 Thu Nov 11 14:50:54 2010 +++ src/sys/uvm/uvm_page.c Thu Nov 11 15:47:43 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.159 2010/11/11 15:47:43 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -367,8 +367,8 @@ static struct uvm_cpu boot_cpu; psize_t freepages, pagecount, bucketcount, n; struct pgflbucket *bucketarray, *cpuarray; - struct vm_page *pagearray; struct vm_physseg *seg; + struct vm_page *pagearray; int lcv; u_int i; paddr_t paddr; @@ -654,6 +654,7 @@ static bool uvm_page_physget_freelist(paddr_t *paddrp, int freelist) { + struct vm_physseg *seg; int lcv, x; /* pass 1: try allocating from a matching end */ @@ -663,22 +664,22 @@ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) #endif { + seg = VM_PHYSMEM_PTR(lcv); if (uvm.page_init_done == true) panic("uvm_page_physget: called _after_ bootstrap"); - if (vm_physmem[lcv].free_list != freelist) + if (seg->free_list != freelist) continue; /* try from front */ - if (vm_physmem[lcv].avail_start == vm_physmem[lcv].start && - vm_physmem[lcv].avail_start < vm_physmem[lcv].avail_end) { - *paddrp = ctob(vm_physmem[lcv].avail_start); - vm_physmem[lcv].avail_start++; - vm_physmem[lcv].start++; + if (seg->avail_start == seg->start && + seg->avail_start < seg->avail_end) { + *paddrp = ctob(seg->avail_start); + seg->avail_start++; + seg->start++; /* nothing left? nuke it */ - if (vm_physmem[lcv].avail_start == - vm_physmem[lcv].end) { + if (seg->avail_start == seg->end) { if (vm_nphysmem == 1) panic("uvm_page_physget: out of memory!"); vm_nphysmem--; @@ -690,14 +691,13 @@ } /* try from rear */ - if (vm_physmem[lcv].avail_end == vm_physmem[lcv].end && - vm_physmem[lcv].avail_start < vm_physmem[lcv].avail_end) { - *paddrp = ctob(vm_physmem[lcv].avail_end - 1); - vm_physmem[lcv].avail_end--; - vm_physmem[lcv].end--; + if (seg->avail_end == seg->end && + seg->avail_start < seg->avail_end) { + *paddrp = ctob(seg->avail_end - 1); + seg->avail_end--; + seg->end--; /* nothing left? nuke it */ - if (vm_physmem[lcv].avail_end == - vm_physmem[lcv].start) { + if (seg->avail_end == seg->start) { if (vm_nphysmem == 1) panic("uvm_page_physget: out of memory!"); vm_nphysmem--; @@ -716,18 +716,19 @@ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) #endif { + seg = VM_PHYSMEM_PTR(lcv); /* any room in this bank? */ - if (vm_physmem[lcv].avail_start >= vm_physmem[lcv].avail_end) + if (seg->avail_start >= seg->avail_end) continue; /* nope */ - *paddrp = ctob(vm_physmem[lcv].avail_start); - vm_physmem[lcv].avail_start++; + *paddrp = ctob(seg->avail_start); + seg->avail_start++; /* truncate! */ - vm_physmem[lcv].start = vm_physmem[lcv].avail_start; + seg->start = seg->avail_start; /* nothing left? nuke it */ - if (vm_physmem[lcv].avail_start == vm_physmem[lcv].end) { + if (seg->avail_start == seg->end) { if (vm_nphysmem == 1) panic("uvm_page_physget: out of memory!"); vm_nphysmem--; @@ -798,7 +799,7 @@ */ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) { - if (vm_physmem[lcv].pgs) + if (VM_PHYSMEM_PTR(lcv)->pgs) break; } preload = (lcv == vm_nphysmem); @@ -820,15 +821,15 @@ #if (VM_PHYSSEG_STRAT == VM_PSTRAT_RANDOM) /* random: put it at the end (easy!) */ - ps = &vm_physmem[vm_nphysmem]; + ps = VM_PHYSMEM_PTR(vm_nphysmem); #elif (VM_PHYSSEG_STRAT == VM_PSTRAT_BSEARCH) { int x; /* sort by address for binary search */ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) - if (start < vm_physmem[lcv].start) + if (start < VM_PHYSMEM_PTR(lcv)->start) break; - ps = &vm_physmem[lcv]; + ps = VM_PHYSMEM_PTR(lcv); /* move back other entries, if necessary ... */ for (x = vm_nphysmem ; x > lcv ; x--) /* structure copy */ @@ -840,9 +841,9 @@ /* sort by largest segment first */ for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) if ((end - start) > - (vm_physmem[lcv].end - vm_physmem[lcv].start)) + (VM_PHYSMEM_PTR(lcv)->end - VM_PHYSMEM_PTR(lcv)->start)) break; - ps = &vm_phys
CVS commit: src/tests/kernel
Module Name:src Committed By: pooka Date: Thu Nov 11 15:08:07 UTC 2010 Modified Files: src/tests/kernel: t_posix_fadvise.c Log Message: Actually, add a full tc for operating on fd's backed by regular files (as opposed to pipes and devices). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/kernel/t_posix_fadvise.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/kernel/t_posix_fadvise.c diff -u src/tests/kernel/t_posix_fadvise.c:1.2 src/tests/kernel/t_posix_fadvise.c:1.3 --- src/tests/kernel/t_posix_fadvise.c:1.2 Thu Nov 11 14:50:58 2010 +++ src/tests/kernel/t_posix_fadvise.c Thu Nov 11 15:08:07 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: t_posix_fadvise.c,v 1.2 2010/11/11 14:50:58 pooka Exp $ */ +/* $NetBSD: t_posix_fadvise.c,v 1.3 2010/11/11 15:08:07 pooka Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_posix_fadvise.c,v 1.2 2010/11/11 14:50:58 pooka Exp $"); +__RCSID("$NetBSD: t_posix_fadvise.c,v 1.3 2010/11/11 15:08:07 pooka Exp $"); #include @@ -78,20 +78,24 @@ { atf_tc_set_md_var(tc, "descr", "Checks posix_fadvise(2)"); } + +ATF_TC(posix_fadvise_reg); +ATF_TC_HEAD(posix_fadvise_reg, tc) +{ + atf_tc_set_md_var(tc, "descr", "Checks posix_fadvise(2) " + "for regular files"); +} + ATF_TC_BODY(posix_fadvise, tc) { int fd = STDIN_FILENO; int pipe_fds[2]; int badfd = 10; - int rfd; int ret; (void)close(badfd); RL(pipe(pipe_fds)); - rump_init(); - RL(rfd = rump_sys_open("/a_file", O_CREAT, 0666)); - /* * it's hard to check if posix_fadvise is working properly. * only check return values here. @@ -117,6 +121,21 @@ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED), 0); CE(posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED), 0); CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE), 0); +} + +ATF_TC_BODY(posix_fadvise_reg, tc) +{ + int rfd, ret; + + rump_init(); + RL(rfd = rump_sys_open("/a_file", O_CREAT, 0666)); + + CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_NORMAL), 0); + CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_SEQUENTIAL), 0); + CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_RANDOM), 0); + CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_WILLNEED), 0); + CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_NOREUSE), 0); + atf_tc_expect_signal(-1, "http://mail-index.netbsd.org/source-changes-d/2010/11/11/msg002508.html";); CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_DONTNEED), 0); #undef CE @@ -125,6 +144,7 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, posix_fadvise); + ATF_TP_ADD_TC(tp, posix_fadvise_reg); return atf_no_error(); }
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Nov 11 15:05:54 UTC 2010 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: be friends with genfs To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.67 src/sys/rump/librump/rumpvfs/rumpfs.c:1.68 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.67 Thu Nov 11 14:46:55 2010 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 15:05:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.67 2010/11/11 14:46:55 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.68 2010/11/11 15:05:54 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.67 2010/11/11 14:46:55 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.68 2010/11/11 15:05:54 pooka Exp $"); #include #include @@ -49,6 +49,7 @@ #include #include #include +#include #include @@ -138,7 +139,17 @@ LIST_ENTRY(rumpfs_dent) rd_entries; }; +struct genfs_ops rumpfs_genfsops = { + .gop_size = genfs_size, + .gop_write = genfs_gop_write, + + /* optional */ + .gop_alloc = NULL, + .gop_markupdate = NULL, +}; + struct rumpfs_node { + struct genfs_node rn_gn; struct vattr rn_va; struct vnode *rn_vp; char *rn_hostpath; @@ -521,6 +532,7 @@ } vp->v_data = rn; + genfs_node_init(vp, &rumpfs_genfsops); vn_lock(vp, LK_RETRY | LK_EXCLUSIVE); mutex_enter(&reclock); rn->rn_vp = vp; @@ -1142,6 +1154,7 @@ mutex_enter(&reclock); rn->rn_vp = NULL; mutex_exit(&reclock); + genfs_node_destroy(vp); vp->v_data = NULL; if (rn->rn_flags & RUMPNODE_CANRECLAIM) {
CVS commit: src/tests/kernel
Module Name:src Committed By: pooka Date: Thu Nov 11 14:50:58 UTC 2010 Modified Files: src/tests/kernel: t_posix_fadvise.c Log Message: Add expected failure test for posix_fadvise() panic reported by yamt on source-changes-d. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/kernel/t_posix_fadvise.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/kernel/t_posix_fadvise.c diff -u src/tests/kernel/t_posix_fadvise.c:1.1 src/tests/kernel/t_posix_fadvise.c:1.2 --- src/tests/kernel/t_posix_fadvise.c:1.1 Fri Feb 20 21:39:57 2009 +++ src/tests/kernel/t_posix_fadvise.c Thu Nov 11 14:50:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: t_posix_fadvise.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $ */ +/* $NetBSD: t_posix_fadvise.c,v 1.2 2010/11/11 14:50:58 pooka Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_posix_fadvise.c,v 1.1 2009/02/20 21:39:57 jmmv Exp $"); +__RCSID("$NetBSD: t_posix_fadvise.c,v 1.2 2010/11/11 14:50:58 pooka Exp $"); #include @@ -70,6 +70,9 @@ #include "../h_macros.h" +#include +#include + ATF_TC(posix_fadvise); ATF_TC_HEAD(posix_fadvise, tc) { @@ -80,11 +83,15 @@ int fd = STDIN_FILENO; int pipe_fds[2]; int badfd = 10; + int rfd; int ret; (void)close(badfd); RL(pipe(pipe_fds)); + rump_init(); + RL(rfd = rump_sys_open("/a_file", O_CREAT, 0666)); + /* * it's hard to check if posix_fadvise is working properly. * only check return values here. @@ -110,6 +117,8 @@ CE(posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED), 0); CE(posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED), 0); CE(posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE), 0); + atf_tc_expect_signal(-1, "http://mail-index.netbsd.org/source-changes-d/2010/11/11/msg002508.html";); + CE(rump_sys_posix_fadvise(rfd, 0, 0, POSIX_FADV_DONTNEED), 0); #undef CE }
CVS commit: src/sys/uvm
Module Name:src Committed By: uebayasi Date: Thu Nov 11 14:50:54 UTC 2010 Modified Files: src/sys/uvm: uvm_page.c Log Message: Minor clean up. To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.157 src/sys/uvm/uvm_page.c:1.158 --- src/sys/uvm/uvm_page.c:1.157 Sat Nov 6 15:42:43 2010 +++ src/sys/uvm/uvm_page.c Thu Nov 11 14:50:54 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.157 2010/11/06 15:42:43 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.157 2010/11/06 15:42:43 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.158 2010/11/11 14:50:54 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -127,6 +127,7 @@ struct vm_physseg vm_physmem[VM_PHYSSEG_MAX]; /* XXXCDC: uvm.physmem */ int vm_nphysseg = 0;/* XXXCDC: uvm.nphysseg */ +#define vm_nphysmem vm_nphysseg /* * Some supported CPUs in a given architecture don't support all @@ -367,6 +368,7 @@ psize_t freepages, pagecount, bucketcount, n; struct pgflbucket *bucketarray, *cpuarray; struct vm_page *pagearray; + struct vm_physseg *seg; int lcv; u_int i; paddr_t paddr; @@ -398,7 +400,7 @@ * now is to allocate vm_page structures for this memory. */ - if (vm_nphysseg == 0) + if (vm_nphysmem == 0) panic("uvm_page_bootstrap: no memory pre-allocated"); /* @@ -410,8 +412,10 @@ */ freepages = 0; - for (lcv = 0 ; lcv < vm_nphysseg ; lcv++) - freepages += (vm_physmem[lcv].end - vm_physmem[lcv].start); + for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) { + seg = VM_PHYSMEM_PTR(lcv); + freepages += (seg->end - seg->start); + } /* * Let MD code initialize the number of colors, or default @@ -455,27 +459,28 @@ * init the vm_page structures and put them in the correct place. */ - for (lcv = 0 ; lcv < vm_nphysseg ; lcv++) { - n = vm_physmem[lcv].end - vm_physmem[lcv].start; + for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) { + seg = VM_PHYSMEM_PTR(lcv); + n = seg->end - seg->start; /* set up page array pointers */ - vm_physmem[lcv].pgs = pagearray; + seg->pgs = pagearray; pagearray += n; pagecount -= n; - vm_physmem[lcv].lastpg = vm_physmem[lcv].pgs + (n - 1); + seg->lastpg = seg->pgs + (n - 1); /* init and free vm_pages (we've already zeroed them) */ - paddr = ctob(vm_physmem[lcv].start); + paddr = ctob(seg->start); for (i = 0 ; i < n ; i++, paddr += PAGE_SIZE) { - vm_physmem[lcv].pgs[i].phys_addr = paddr; + seg->pgs[i].phys_addr = paddr; #ifdef __HAVE_VM_PAGE_MD - VM_MDPAGE_INIT(&vm_physmem[lcv].pgs[i]); + VM_MDPAGE_INIT(&seg->pgs[i]); #endif - if (atop(paddr) >= vm_physmem[lcv].avail_start && - atop(paddr) <= vm_physmem[lcv].avail_end) { + if (atop(paddr) >= seg->avail_start && + atop(paddr) <= seg->avail_end) { uvmexp.npages++; /* add page to free pool */ -uvm_pagefree(&vm_physmem[lcv].pgs[i]); +uvm_pagefree(&seg->pgs[i]); } } } @@ -653,9 +658,9 @@ /* pass 1: try allocating from a matching end */ #if (VM_PHYSSEG_STRAT == VM_PSTRAT_BIGFIRST) - for (lcv = vm_nphysseg - 1 ; lcv >= 0 ; lcv--) + for (lcv = vm_nphysmem - 1 ; lcv >= 0 ; lcv--) #else - for (lcv = 0 ; lcv < vm_nphysseg ; lcv++) + for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) #endif { @@ -674,12 +679,12 @@ /* nothing left? nuke it */ if (vm_physmem[lcv].avail_start == vm_physmem[lcv].end) { -if (vm_nphysseg == 1) +if (vm_nphysmem == 1) panic("uvm_page_physget: out of memory!"); -vm_nphysseg--; -for (x = lcv ; x < vm_nphysseg ; x++) +vm_nphysmem--; +for (x = lcv ; x < vm_nphysmem ; x++) /* structure copy */ - vm_physmem[x] = vm_physmem[x+1]; + VM_PHYSMEM_PTR_SWAP(x, x + 1); } return (true); } @@ -693,12 +698,12 @@ /* nothing left? nuke it */ if (vm_physmem[lcv].avail_end == vm_physmem[lcv].start) { -if (vm_nphysseg == 1) +if (vm_nphysmem == 1) panic("uvm_page_physget: out of memory!"); -vm_nphysseg--; -for (x = lcv ; x < vm_nphysseg ; x++) +vm_nphysmem--; +for (x = lcv ; x < vm_nphysmem ; x++) /* structure copy */ - vm_physmem[x] = vm_physmem[x+1]; + VM_PHYSMEM_PTR_SWAP(x, x + 1); } return (true); } @@ -706,9 +711,9 @@ /* pass2: forget about matching ends, just allocate something */ #if (VM_PHYSSEG_STRAT == VM_PSTRAT_BIGFIRST) - for (lcv = vm_nphysseg - 1 ; lcv >= 0 ; lcv--) + for (lcv = vm_nphysmem - 1 ; lcv >= 0 ; lcv--) #else - for (lcv = 0 ; lcv < vm_nphysseg ; lcv++) + for (lcv = 0 ; lcv < vm_nphysmem ; lcv++) #endif { @@ -723,12 +728,12 @@ /* nothi
CVS commit: src/sys/rump
Module Name:src Committed By: pooka Date: Thu Nov 11 14:48:14 UTC 2010 Modified Files: src/sys/rump/include/rump: rump_syscalls.h src/sys/rump/librump/rumpkern: rump_syscalls.c Log Message: +posix_fadvise To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/sys/rump/include/rump/rump_syscalls.h cvs rdiff -u -r1.53 -r1.54 src/sys/rump/librump/rumpkern/rump_syscalls.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/include/rump/rump_syscalls.h diff -u src/sys/rump/include/rump/rump_syscalls.h:1.32 src/sys/rump/include/rump/rump_syscalls.h:1.33 --- src/sys/rump/include/rump/rump_syscalls.h:1.32 Thu Nov 4 20:54:07 2010 +++ src/sys/rump/include/rump/rump_syscalls.h Thu Nov 11 14:48:13 2010 @@ -1,10 +1,10 @@ -/* $NetBSD: rump_syscalls.h,v 1.32 2010/11/04 20:54:07 pooka Exp $ */ +/* $NetBSD: rump_syscalls.h,v 1.33 2010/11/11 14:48:13 pooka Exp $ */ /* * System call protos in rump namespace. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.238 2010/09/07 17:10:08 pooka Exp + * created from NetBSD: syscalls.master,v 1.239 2010/11/11 14:47:41 pooka Exp */ #ifndef _RUMP_RUMP_SYSCALLS_H_ @@ -154,6 +154,7 @@ int rump_sys_fhopen(const void *, size_t, int) __RENAME(rump_sys___fhopen40); int rump_sys_fhstatvfs1(const void *, size_t, struct statvfs *, int) __RENAME(rump_sys___fhstatvfs140); int rump_sys_mount(const char *, const char *, int, void *, size_t) __RENAME(rump_sys___mount50); +int rump_sys_posix_fadvise(int, off_t, off_t, int) __RENAME(rump_sys___posix_fadvise50); int rump_sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *) __RENAME(rump_sys___select50); int rump_sys_utimes(const char *, const struct timeval *) __RENAME(rump_sys___utimes50); int rump_sys_futimes(int, const struct timeval *) __RENAME(rump_sys___futimes50); Index: src/sys/rump/librump/rumpkern/rump_syscalls.c diff -u src/sys/rump/librump/rumpkern/rump_syscalls.c:1.53 src/sys/rump/librump/rumpkern/rump_syscalls.c:1.54 --- src/sys/rump/librump/rumpkern/rump_syscalls.c:1.53 Thu Nov 4 20:51:18 2010 +++ src/sys/rump/librump/rumpkern/rump_syscalls.c Thu Nov 11 14:48:14 2010 @@ -1,14 +1,14 @@ -/* $NetBSD: rump_syscalls.c,v 1.53 2010/11/04 20:51:18 pooka Exp $ */ +/* $NetBSD: rump_syscalls.c,v 1.54 2010/11/11 14:48:14 pooka Exp $ */ /* * System call vector and marshalling for rump. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.238 2010/09/07 17:10:08 pooka Exp + * created from NetBSD: syscalls.master,v 1.239 2010/11/11 14:47:41 pooka Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.53 2010/11/04 20:51:18 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rump_syscalls.c,v 1.54 2010/11/11 14:48:14 pooka Exp $"); #include #include @@ -2803,6 +2803,29 @@ } rsys_alias(sys___mount50,rump_enosys) +int rump_sys___posix_fadvise50(int, off_t, off_t, int); +int +rump_sys___posix_fadvise50(int fd, off_t offset, off_t len, int advice) +{ + register_t rval[2] = {0, 0}; + int error = 0; + struct sys___posix_fadvise50_args callarg; + + SPARG(&callarg, fd) = fd; + SPARG(&callarg, PAD) = 0; + SPARG(&callarg, offset) = offset; + SPARG(&callarg, len) = len; + SPARG(&callarg, advice) = advice; + + error = rsys_syscall(SYS___posix_fadvise50, &callarg, sizeof(callarg), rval); + if (error) { + rval[0] = -1; + rsys_seterrno(error); + } + return rval[0]; +} +rsys_alias(sys___posix_fadvise50,rump_enosys) + int rump_sys___select50(int, fd_set *, fd_set *, fd_set *, struct timeval *); int rump_sys___select50(int nd, fd_set * in, fd_set * ou, fd_set * ex, struct timeval * tv) @@ -3981,8 +4004,8 @@ (sy_call_t *)rump_enosys }, /* 414 = unrumped */ { 0, 0, 0, (sy_call_t *)rump_enosys }, /* 415 = unrumped */ - { 0, 0, 0, - (sy_call_t *)rump_enosys }, /* 416 = unrumped */ + { ns(struct sys___posix_fadvise50_args), 0, + (sy_call_t *)sys___posix_fadvise50 }, /* 416 = __posix_fadvise50 */ { ns(struct sys___select50_args), 0, (sy_call_t *)sys___select50 }, /* 417 = __select50 */ { 0, 0, 0,
CVS commit: src/sys/kern
Module Name:src Committed By: pooka Date: Thu Nov 11 14:47:41 UTC 2010 Modified Files: src/sys/kern: syscalls.master Log Message: rump posix_fadvise() To generate a diff of this commit: cvs rdiff -u -r1.238 -r1.239 src/sys/kern/syscalls.master 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/syscalls.master diff -u src/sys/kern/syscalls.master:1.238 src/sys/kern/syscalls.master:1.239 --- src/sys/kern/syscalls.master:1.238 Tue Sep 7 17:10:08 2010 +++ src/sys/kern/syscalls.master Thu Nov 11 14:47:41 2010 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.238 2010/09/07 17:10:08 pooka Exp $ + $NetBSD: syscalls.master,v 1.239 2010/11/11 14:47:41 pooka Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -788,7 +788,7 @@ psetid_t *opsid); } 415 STD { int|sys||_pset_bind(idtype_t idtype, id_t first_id, \ id_t second_id, psetid_t psid, psetid_t *opsid); } -416 STD { int|sys|50|posix_fadvise(int fd, int PAD, \ +416 STD RUMP { int|sys|50|posix_fadvise(int fd, int PAD, \ off_t offset, off_t len, int advice); } 417 STD RUMP { int|sys|50|select(int nd, fd_set *in, fd_set *ou, \ fd_set *ex, struct timeval *tv); }
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: pooka Date: Thu Nov 11 14:46:55 UTC 2010 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: Support non-hostbacked regular files, at least just a little bit. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/rump/librump/rumpvfs/rumpfs.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/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.66 src/sys/rump/librump/rumpvfs/rumpfs.c:1.67 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.66 Mon Nov 8 11:01:45 2010 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 14:46:55 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.66 2010/11/08 11:01:45 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.67 2010/11/11 14:46:55 pooka Exp $ */ /* * Copyright (c) 2009 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.66 2010/11/08 11:01:45 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.67 2010/11/11 14:46:55 pooka Exp $"); #include #include @@ -98,7 +98,8 @@ { &vop_write_desc, rump_vop_write }, { &vop_open_desc, rump_vop_open }, { &vop_seek_desc, genfs_seek }, - { &vop_putpages_desc, genfs_null_putpages }, + { &vop_getpages_desc, genfs_getpages }, + { &vop_putpages_desc, genfs_putpages }, { &vop_whiteout_desc, rump_vop_whiteout }, { &vop_fsync_desc, rump_vop_success }, { &vop_lock_desc, genfs_lock }, @@ -507,10 +508,6 @@ } else { vpops = rump_vnodeop_p; } - if (vpops != rump_specop_p && va->va_type != VDIR - && !(va->va_type == VREG && rn->rn_hostpath != NULL) - && va->va_type != VSOCK && va->va_type != VLNK) - return EOPNOTSUPP; rv = getnewvnode(VT_RUMP, mp, vpops, &vp); if (rv) @@ -826,13 +823,11 @@ struct componentname *cnp = ap->a_cnp; struct vattr *va = ap->a_vap; struct rumpfs_node *rnd = dvp->v_data, *rn; + off_t newsize; int rv; - if (va->va_type != VSOCK) { - rv = EOPNOTSUPP; - goto out; - } - rn = makeprivate(VSOCK, NODEV, DEV_BSIZE); + newsize = va->va_type == VSOCK ? DEV_BSIZE : 0; + rn = makeprivate(va->va_type, NODEV, newsize); rv = makevnode(dvp->v_mount, rn, vpp); if (rv) goto out; @@ -940,7 +935,7 @@ int mode = ap->a_mode; int error = EINVAL; - if (vp->v_type != VREG) + if (vp->v_type != VREG || rn->rn_hostpath == NULL) return 0; if (mode & FREAD) { @@ -1047,6 +1042,9 @@ ssize_t n; int error = 0; + if (rn->rn_readfd == -1) + return EOPNOTSUPP; + bufsize = uio->uio_resid; buf = kmem_alloc(bufsize, KM_SLEEP); if ((n = rumpuser_pread(rn->rn_readfd, buf, bufsize, @@ -1077,6 +1075,9 @@ ssize_t n; int error = 0; + if (rn->rn_writefd == -1) + return EOPNOTSUPP; + bufsize = uio->uio_resid; buf = kmem_alloc(bufsize, KM_SLEEP); error = uiomove(buf, bufsize, uio);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: cegger Date: Thu Nov 11 14:37:41 UTC 2010 Modified Files: src/sys/dev/pci: pcidevs Log Message: add AMD RD880, ATI Radeon HD5600, ATI Radeon HD4200 and Atheros AR9285 To generate a diff of this commit: cvs rdiff -u -r1.1051 -r1.1052 src/sys/dev/pci/pcidevs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/pcidevs diff -u src/sys/dev/pci/pcidevs:1.1051 src/sys/dev/pci/pcidevs:1.1052 --- src/sys/dev/pci/pcidevs:1.1051 Sat Nov 6 14:20:34 2010 +++ src/sys/dev/pci/pcidevs Thu Nov 11 14:37:41 2010 @@ -1,4 +1,4 @@ -$NetBSD: pcidevs,v 1.1051 2010/11/06 14:20:34 jakllsch Exp $ +$NetBSD: pcidevs,v 1.1052 2010/11/11 14:37:41 cegger Exp $ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou @@ -984,6 +984,12 @@ product AMD PBC8111_AC_756b 0x756b AMD8111 756b ACPI Controller product AMD HUDSON2_IDE 0x780c HUDSON-2 IDE Controller product AMD HUDSON2_SATA 0x7800 HUDSON-2 SATA Controller +product AMD RS880_HB 0x9601 RS880 Host Bridge +product AMD RS780_PPB_GFX 0x9602 RS780 PCI-PCI Bridge (int gfx) +product AMD RS780_PPB_GFX0 0x9603 RS780 PCI-PCI Bridge (ext gfx port 0) +product AMD RS780_PPB0 0x9604 RS780 PCI-PCIE Bridge (port 0) +product AMD RS780_PPB1 0x9605 RS780 PCI-PCIE Brdige (port 1) +product AMD RS780_PPB2 0x9606 RS780 PCI-PCIE Bridge (port 2) /* American Megatrends products */ product AMI MEGARAID 0x9010 MegaRAID @@ -1377,6 +1383,7 @@ product ATI RADEON_X850XT_S 0x5d72 Radeon X850 XT Secondary product ATI RADEON_X700 0x5e4b Radeon X700 Pro product ATI RADEON_X700_S 0x5e6b Radeon X700 Pro Secondary +product ATI RADEON_HD5600_RD 0x68c1 Redwood product ATI RADEON_X1300 0x7146 Radeon X1300 Series (RV515) product ATI RADEON_X1300_S 0x7166 Radeon X1300 Series (RV515) Secondary product ATI RADEON_X1600 0x71c5 Radeon Mobility X1600 @@ -1389,9 +1396,11 @@ product ATI RS690_PPB_7916 0x7916 RS690 PCI to PCI-Express Port 2 Bridge product ATI RS690_PPB_7917 0x7917 RS690 PCI to PCI-Express Port 3 Bridge product ATI RADEON_HD4250_S 0x95C5 Radeon HD4250 GPU (RV610) Secondary +product ATI RADEON_HD4200 0x9712 Radeon HD4200 Mobility product ATI RADEON_HD4250 0x9715 Radeon HD4250 GPU (RS880) product ATI RADEON_HD2600_XT 0x9588 Radeon HD2600 XT GDDR3 product ATI RADEON_HD2600_HD 0xaa08 Radeon HD2600 HD Audio Controller +product ATI RADEON_HD5600_HDMI 0xaa60 Redwood HDMI Audio /* Auravision products */ product AURAVISION VXP524 0x01f7 VxP524 PCI Video Processor @@ -1413,6 +1422,7 @@ product ATHEROS AR5311 0x0011 AR5211 Wireless LAN product ATHEROS AR5211 0x0012 AR5211 Wireless LAN product ATHEROS AR5212 0x0013 AR5212 Wireless LAN +product ATHEROS AR9285 0x002b AR9285 Wireless LAN product ATHEROS AR5201_AP 0x0207 AR5201 Wireless LAN Reference Card (Early AP11) product ATHEROS AR5201_DEFAULT 0x1107 AR5201 Wireless LAN (no eeprom) product ATHEROS AR5212_DEFAULT 0x1113 AR5212 Wireless LAN (no eeprom)
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: pgoyette Date: Thu Nov 11 14:11:26 UTC 2010 Modified Files: src/external/bsd/libevent/dist/test: regress.c Log Message: Calibrate the amount of time that a sleep() requires, and use that interval instead of assuming that there are exactly 1000 real-time-clock milliseconds per second! On some ports when running under qemu, there can be twice as many RTC milliseconds as expected. This is part 2 of the changes required to make the libevent tests work on port-amd64 under qemu. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/libevent/dist/test/regress.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress.c diff -u src/external/bsd/libevent/dist/test/regress.c:1.1.1.1 src/external/bsd/libevent/dist/test/regress.c:1.2 --- src/external/bsd/libevent/dist/test/regress.c:1.1.1.1 Mon Nov 2 10:01:03 2009 +++ src/external/bsd/libevent/dist/test/regress.c Thu Nov 11 14:11:26 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: regress.c,v 1.1.1.1 2009/11/02 10:01:03 plunky Exp $ */ +/* $NetBSD: regress.c,v 1.2 2010/11/11 14:11:26 pgoyette Exp $ */ /* * Copyright (c) 2003, 2004 Niels Provos * All rights reserved. @@ -78,6 +78,8 @@ static struct timeval tcalled; static struct event_base *global_base; +static int interval; + #define TEST1 "this is a test" #define SECONDS 1 @@ -183,6 +185,27 @@ } static void +calibrate(void) +{ + struct timeval start, end, diff; + int delta; + + gettimeofday(&start, NULL); + sleep(SECONDS); + gettimeofday(&end, NULL); + + timersub(&end, &start, &diff); + + delta = diff.tv_sec * 1000 + diff.tv_usec / 1000; + if (delta < 0) + delta = -delta; + + interval = delta; + fprintf(stdout, "Calibrated interval: %d sec = %d msec\n", SECONDS, + interval); +} + +static void timeout_cb(int fd, short event, void *arg) { struct timeval tv; @@ -194,7 +217,7 @@ else evutil_timersub(&tset, &tcalled, &tv); - diff = tv.tv_sec*1000 + tv.tv_usec/1000 - SECONDS * 1000; + diff = tv.tv_sec*1000 + tv.tv_usec/1000 - interval; if (diff < 0) diff = -diff; @@ -924,7 +947,7 @@ evtimer_add(&ev, &tv); tv.tv_usec = 0; - tv.tv_sec = 1; + tv.tv_sec = SECONDS; event_loopexit(&tv); evutil_gettimeofday(&tv_start, NULL); @@ -1625,6 +1648,11 @@ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) return (1); #endif + /* + * Calibrate sleep() vs elapsed real-time + */ + calibrate(); + setvbuf(stdout, NULL, _IONBF, 0); /* Initalize the event library */
CVS commit: src/external/bsd/libevent/dist/test
Module Name:src Committed By: pgoyette Date: Thu Nov 11 14:08:45 UTC 2010 Modified Files: src/external/bsd/libevent/dist/test: regress_http.c Log Message: Adjust timers a bit so that the http timer can get a chance to expire, even when running under qemu on platforms with a clock-skew problem. The original 3-second timer was intended to be "longer than the http timeout" (which is 2 seconds), and the updated 5-second value still meets this requirement. The updated value also meets the requirement even when the http timeout stretches to 4-seconds under qemu. This is part 1 of getting the libevent tests working on port-amd64 with qemu. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/bsd/libevent/dist/test/regress_http.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libevent/dist/test/regress_http.c diff -u src/external/bsd/libevent/dist/test/regress_http.c:1.1.1.1 src/external/bsd/libevent/dist/test/regress_http.c:1.2 --- src/external/bsd/libevent/dist/test/regress_http.c:1.1.1.1 Mon Nov 2 10:01:04 2009 +++ src/external/bsd/libevent/dist/test/regress_http.c Thu Nov 11 14:08:45 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: regress_http.c,v 1.1.1.1 2009/11/02 10:01:04 plunky Exp $ */ +/* $NetBSD: regress_http.c,v 1.2 2010/11/11 14:08:45 pgoyette Exp $ */ /* * Copyright (c) 2003-2006 Niels Provos * All rights reserved. @@ -857,7 +857,7 @@ test_ok = 1; timerclear(&tv); - tv.tv_sec = 3; /* longer than the http time out */ + tv.tv_sec = 5; /* longer than the http time out */ event_loopexit(&tv); } @@ -893,7 +893,7 @@ } timerclear(&tv); - tv.tv_sec = 3; /* longer than the http time out */ + tv.tv_sec = 5; /* longer than the http time out */ /* launch a new request on the persistent connection in 6 seconds */ event_once(-1, EV_TIMEOUT, close_detect_launch, evcon, &tv);
CVS commit: src/sys/kern
Module Name:src Committed By: yamt Date: Thu Nov 11 13:58:59 UTC 2010 Modified Files: src/sys/kern: vfs_subr.c Log Message: vclean: fix a bug which makes getcleanvnode always cause VOP_INACTIVE. To generate a diff of this commit: cvs rdiff -u -r1.415 -r1.416 src/sys/kern/vfs_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/vfs_subr.c diff -u src/sys/kern/vfs_subr.c:1.415 src/sys/kern/vfs_subr.c:1.416 --- src/sys/kern/vfs_subr.c:1.415 Tue Aug 17 13:17:47 2010 +++ src/sys/kern/vfs_subr.c Thu Nov 11 13:58:58 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.415 2010/08/17 13:17:47 hannken Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.416 2010/11/11 13:58:58 yamt Exp $ */ /*- * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc. @@ -91,7 +91,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.415 2010/08/17 13:17:47 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.416 2010/11/11 13:58:58 yamt Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -1847,7 +1847,7 @@ atomic_add_int(&uvmexp.filepages, vp->v_uobj.uo_npages); } vp->v_iflag &= ~(VI_TEXT|VI_EXECMAP); - active = (vp->v_usecount > 1); + active = (vp->v_usecount & VC_MASK) > 1; /* XXXAD should not lock vnode under layer */ mutex_exit(&vp->v_interlock);
CVS commit: src/sys
Module Name:src Committed By: hannken Date: Thu Nov 11 11:07:07 UTC 2010 Modified Files: src/sys/dev: md.c src/sys/kern: kern_subr.c Log Message: Change md(4) to: - create md devices on first open and destroy on last close. - add enough disk label support to make DIOCGDINFO and DIOCGPART work. - add disk_busy()/disk_unbusy() instrumentation. Ok: David Young To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/dev/md.c cvs rdiff -u -r1.207 -r1.208 src/sys/kern/kern_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/md.c diff -u src/sys/dev/md.c:1.62 src/sys/dev/md.c:1.63 --- src/sys/dev/md.c:1.62 Thu Jan 21 02:14:42 2010 +++ src/sys/dev/md.c Thu Nov 11 11:07:06 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.62 2010/01/21 02:14:42 dyoung Exp $ */ +/* $NetBSD: md.c,v 1.63 2010/11/11 11:07:06 hannken Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross, Leo Weppelman. @@ -40,10 +40,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.62 2010/01/21 02:14:42 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: md.c,v 1.63 2010/11/11 11:07:06 hannken Exp $"); #include "opt_md.h" -#include "opt_tftproot.h" #include #include @@ -78,6 +77,7 @@ /* autoconfig stuff... */ struct md_softc { + device_t sc_dev; /* Self. */ struct disk sc_dkdev; /* hook for generic disk handling */ struct md_conf sc_md; struct bufq_state *sc_buflist; @@ -115,43 +115,23 @@ CFATTACH_DECL3_NEW(md, sizeof(struct md_softc), 0, md_attach, md_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); +static kmutex_t md_device_lock; /* Protect unit creation / deletion. */ extern size_t md_root_size; +static void md_set_disklabel(struct md_softc *); + /* * This is called if we are configured as a pseudo-device */ void mdattach(int n) { - int i; - cfdata_t cf; -#ifdef TFTPROOT - /* - * Attachement of md0 must be done after md_root_setconf(), - * because the RAMdisk is not loaded yet. - */ - if (md_root_size == 0) - return; -#endif - if (config_cfattach_attach("md", &md_ca)) { - printf("md: cfattach_attach failed\n"); + mutex_init(&md_device_lock, MUTEX_DEFAULT, IPL_NONE); + if (config_cfattach_attach(md_cd.cd_name, &md_ca)) { + aprint_error("%s: cfattach_attach failed\n", md_cd.cd_name); return; } - - /* XXX: Are we supposed to provide a default? */ - if (n <= 1) - n = 1; - - /* Attach as if by autoconfig. */ - for (i = 0; i < n; i++) { - cf = malloc(sizeof(*cf), M_DEVBUF, M_WAITOK); - cf->cf_name = "md"; - cf->cf_atname = "md"; - cf->cf_unit = i; - cf->cf_fstate = FSTATE_NOTFOUND; - (void)config_attach_pseudo(cf); - } } static void @@ -159,6 +139,7 @@ { struct md_softc *sc = device_private(self); + sc->sc_dev = self; bufq_alloc(&sc->sc_buflist, "fcfs", 0); /* XXX - Could accept aux info here to set the config. */ @@ -177,6 +158,9 @@ disk_init(&sc->sc_dkdev, device_xname(self), &mddkdriver); disk_attach(&sc->sc_dkdev); + if (sc->sc_type != MD_UNCONFIGURED) + md_set_disklabel(sc); + if (!pmf_device_register(self, NULL, NULL)) aprint_error_dev(self, "couldn't establish power handler\n"); } @@ -240,13 +224,29 @@ int unit; int part = DISKPART(dev); int pmask = 1 << part; + cfdata_t cf; struct md_softc *sc; struct disk *dk; + mutex_enter(&md_device_lock); unit = MD_UNIT(dev); sc = device_lookup_private(&md_cd, unit); - if (sc == NULL) - return ENXIO; + if (sc == NULL) { + if (part != RAW_PART) { + mutex_exit(&md_device_lock); + return ENXIO; + } + cf = malloc(sizeof(*cf), M_DEVBUF, M_WAITOK); + cf->cf_name = md_cd.cd_name; + cf->cf_atname = md_cd.cd_name; + cf->cf_unit = unit; + cf->cf_fstate = FSTATE_STAR; + sc = device_private(config_attach_pseudo(cf)); + if (sc == NULL) { + mutex_exit(&md_device_lock); + return ENOMEM; + } + } dk = &sc->sc_dkdev; @@ -265,8 +265,10 @@ * This is a normal, "slave" device, so * enforce initialized. */ - if (sc->sc_type == MD_UNCONFIGURED) + if (sc->sc_type == MD_UNCONFIGURED) { + mutex_exit(&md_device_lock); return ENXIO; + } ok: /* XXX duplicates code in dk_open(). Call dk_open(), instead? */ @@ -284,6 +286,7 @@ dk->dk_openmask = dk->dk_copenmask | dk->dk_bopenmask; mutex_exit(&dk->dk_openlock); + mutex_exit(&md_device_lock); return 0; } @@ -292,6 +295,8 @@ { int part = DISKPART(dev); int pmask = 1 << part; + int error; + cfdata_t cf; struct md_softc *sc; struct disk *dk; @@ -314,7 +319,14 @@ dk->dk_openmask = dk->dk_copenmask | dk->dk_bopenmask; mutex_exit(&dk->dk_openlock); - return 0; + + mutex_enter(&md_device_lock); + cf = device_cfdata(sc->sc_dev); + error = config_detach(sc->sc_dev, DETACH_QUIET); + if (! error) + free(cf, M_DEVBUF); + mutex_exit(&md_device_lock); + return error; } static int @@ -353,6 +365,7 @@ struct md_softc *sc; void * addr; size_t off, xfer; + bool is_read; sc =