Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Redefine ptoa() to be the inverse of atop. If you w...
details: https://anonhg.NetBSD.org/src/rev/f86680d86501
branches: trunk
changeset: 771695:f86680d86501
user: matt <matt%NetBSD.org@localhost>
date: Tue Nov 29 07:43:54 2011 +0000
description:
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.
diffstat:
sys/uvm/uvm_param.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r d66e5daefd5a -r f86680d86501 sys/uvm/uvm_param.h
--- a/sys/uvm/uvm_param.h Tue Nov 29 03:50:31 2011 +0000
+++ b/sys/uvm/uvm_param.h Tue Nov 29 07:43:54 2011 +0000
@@ -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 @@
*/
#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
Home |
Main Index |
Thread Index |
Old Index