Module Name: src Committed By: matt Date: Tue Jun 14 03:12:43 UTC 2011
Modified Files: src/sys/arch/powerpc/include: types.h src/sys/arch/powerpc/powerpc: powerpc_machdep.c Log Message: Add mm_md_kernacc and now kmem tools work again. To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/sys/arch/powerpc/include/types.h cvs rdiff -u -r1.52 -r1.53 src/sys/arch/powerpc/powerpc/powerpc_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/include/types.h diff -u src/sys/arch/powerpc/include/types.h:1.43 src/sys/arch/powerpc/include/types.h:1.44 --- src/sys/arch/powerpc/include/types.h:1.43 Mon Jun 13 21:19:02 2011 +++ src/sys/arch/powerpc/include/types.h Tue Jun 14 03:12:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.43 2011/06/13 21:19:02 matt Exp $ */ +/* $NetBSD: types.h,v 1.44 2011/06/14 03:12:43 matt Exp $ */ /*- * Copyright (C) 1995 Wolfgang Solfrank. @@ -91,5 +91,6 @@ #endif #define __HAVE_MM_MD_DIRECT_MAPPED_PHYS +#define __HAVE_MM_MD_KERNACC #endif /* _MACHTYPES_H_ */ Index: src/sys/arch/powerpc/powerpc/powerpc_machdep.c diff -u src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.52 src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.53 --- src/sys/arch/powerpc/powerpc/powerpc_machdep.c:1.52 Sun Jun 12 06:10:42 2011 +++ src/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jun 14 03:12:43 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: powerpc_machdep.c,v 1.52 2011/06/12 06:10:42 matt Exp $ */ +/* $NetBSD: powerpc_machdep.c,v 1.53 2011/06/14 03:12:43 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.52 2011/06/12 06:10:42 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.53 2011/06/14 03:12:43 matt Exp $"); #include "opt_altivec.h" #include "opt_modular.h" @@ -450,3 +450,20 @@ return (atop(pa) < physmem) ? 0 : EFAULT; } + +int +mm_md_kernacc(void *va, vm_prot_t prot, bool *handled) +{ + if (atop((paddr_t)va) < physmem) { + *handled = true; + return 0; + } + + if ((vaddr_t)va < VM_MIN_KERNEL_ADDRESS + || (vaddr_t)va >= VM_MAX_KERNEL_ADDRESS) + return EFAULT; + + *handled = false; + return 0; +} +