Redefine ptoa() to be the inverse of atop. If you were using a 32-bit vaddr_t
with 64-bit paddr_t and using managed addresses > 4GB, uvm_page_init would silently discard the upper 32-bits of the physical address possibly double mapping pages.
This commit is contained in:
parent
38f95ba1b7
commit
a617230f3e
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: uvm_param.h,v 1.25 2010/11/14 04:31:02 uebayasi Exp $ */
|
||||
/* $NetBSD: uvm_param.h,v 1.26 2011/11/29 07:43:54 matt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -199,7 +199,7 @@ extern int *uvmexp_pageshift;
|
||||
*/
|
||||
#ifdef _KERNEL
|
||||
#define atop(x) (((paddr_t)(x)) >> PAGE_SHIFT)
|
||||
#define ptoa(x) ((vaddr_t)((vaddr_t)(x) << PAGE_SHIFT))
|
||||
#define ptoa(x) (((paddr_t)(x)) << PAGE_SHIFT)
|
||||
|
||||
/*
|
||||
* Round off or truncate to the nearest page. These will work
|
||||
|
Loading…
Reference in New Issue
Block a user