Add mm_md_kernacc and now kmem tools work again.

This commit is contained in:
matt 2011-06-14 03:12:43 +00:00
parent 3b469f3ce9
commit 643b4a3d8b
2 changed files with 21 additions and 3 deletions

View File

@ -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 @@ typedef volatile __uint32_t __cpuset_t;
#endif
#define __HAVE_MM_MD_DIRECT_MAPPED_PHYS
#define __HAVE_MM_MD_KERNACC
#endif /* _MACHTYPES_H_ */

View File

@ -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 @@ mm_md_physacc(paddr_t pa, vm_prot_t prot)
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;
}