Module Name: src Committed By: uebayasi Date: Wed Aug 11 13:14:55 UTC 2010
Modified Files: src/sys/uvm [uebayasi-xip]: uvm_page.c uvm_pmap.h Log Message: If both __HAVE_PMAP_PHYSSEG and __HAVE_PMAP_PHYSSEG_INIT is defined, call per-vm_physseg initialization/finalization hooks. To generate a diff of this commit: cvs rdiff -u -r1.153.2.52 -r1.153.2.53 src/sys/uvm/uvm_page.c cvs rdiff -u -r1.32.2.2 -r1.32.2.3 src/sys/uvm/uvm_pmap.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.153.2.52 src/sys/uvm/uvm_page.c:1.153.2.53 --- src/sys/uvm/uvm_page.c:1.153.2.52 Wed Aug 11 09:50:01 2010 +++ src/sys/uvm/uvm_page.c Wed Aug 11 13:14:55 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.153.2.52 2010/08/11 09:50:01 uebayasi Exp $ */ +/* $NetBSD: uvm_page.c,v 1.153.2.53 2010/08/11 13:14:55 uebayasi Exp $ */ /* * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -97,7 +97,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.52 2010/08/11 09:50:01 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.153.2.53 2010/08/11 13:14:55 uebayasi Exp $"); #include "opt_ddb.h" #include "opt_uvmhist.h" @@ -873,6 +873,14 @@ #endif } + KASSERT(uvm_physseg_inited); + +#ifdef __HAVE_PMAP_PHYSSEG +#ifdef __HAVE_PMAP_PHYSSEG_INIT + pmap_physseg_init(seg); +#endif +#endif + vm_nphysdev++; return seg; } @@ -882,6 +890,12 @@ { struct vm_physseg *seg = cookie; +#ifdef __HAVE_PMAP_PHYSSEG +#ifdef __HAVE_PMAP_PHYSSEG_INIT + pmap_physseg_fini(seg); +#endif +#endif + kmem_free(seg->pgs, sizeof(struct vm_page) * (seg->end - seg->start)); uvm_physseg_free(&vm_physdev_freelist, vm_physdev_ptrs, seg); vm_nphysdev--; Index: src/sys/uvm/uvm_pmap.h diff -u src/sys/uvm/uvm_pmap.h:1.32.2.2 src/sys/uvm/uvm_pmap.h:1.32.2.3 --- src/sys/uvm/uvm_pmap.h:1.32.2.2 Tue Apr 27 07:17:25 2010 +++ src/sys/uvm/uvm_pmap.h Wed Aug 11 13:14:55 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_pmap.h,v 1.32.2.2 2010/04/27 07:17:25 uebayasi Exp $ */ +/* $NetBSD: uvm_pmap.h,v 1.32.2.3 2010/08/11 13:14:55 uebayasi Exp $ */ /* * Copyright (c) 1991, 1993 @@ -185,6 +185,14 @@ #if defined(PMAP_FORK) void pmap_fork(pmap_t, pmap_t); #endif + +#if defined(__HAVE_PMAP_PHYSSEG) +#if defined(__HAVE_PMAP_PHYSSEG_INIT) +struct vm_physseg; +void pmap_physseg_init(struct vm_physseg *); +void pmap_physseg_fini(struct vm_physseg *); +#endif +#endif __END_DECLS #endif /* kernel*/ #endif /* PMAP_EXCLUDE_DECLS */