Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc Add mm_md_kernacc and now kmem tools work a...
details: https://anonhg.NetBSD.org/src/rev/8245a27832b4
branches: trunk
changeset: 766035:8245a27832b4
user: matt <matt%NetBSD.org@localhost>
date: Tue Jun 14 03:12:43 2011 +0000
description:
Add mm_md_kernacc and now kmem tools work again.
diffstat:
sys/arch/powerpc/include/types.h | 3 ++-
sys/arch/powerpc/powerpc/powerpc_machdep.c | 21 +++++++++++++++++++--
2 files changed, 21 insertions(+), 3 deletions(-)
diffs (55 lines):
diff -r 372cfc1666fc -r 8245a27832b4 sys/arch/powerpc/include/types.h
--- a/sys/arch/powerpc/include/types.h Tue Jun 14 02:45:58 2011 +0000
+++ b/sys/arch/powerpc/include/types.h Tue Jun 14 03:12:43 2011 +0000
@@ -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_ */
diff -r 372cfc1666fc -r 8245a27832b4 sys/arch/powerpc/powerpc/powerpc_machdep.c
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jun 14 02:45:58 2011 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c Tue Jun 14 03:12:43 2011 +0000
@@ -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;
+}
+
Home |
Main Index |
Thread Index |
Old Index