CVS commit: [uebayasi-xip] src/sys/arch/x86/x86

2010-08-25 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Wed Aug 25 13:36:09 UTC 2010

Modified Files:
src/sys/arch/x86/x86 [uebayasi-xip]: xmd_machdep.c

Log Message:
PA != VA here, use vtophys() to convert VA to PA.

(I hate x86.)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/x86/x86/xmd_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/x86/x86/xmd_machdep.c
diff -u src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.1 src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.2
--- src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.1	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/x86/x86/xmd_machdep.c	Wed Aug 25 13:36:09 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $	*/
+/*	$NetBSD: xmd_machdep.c,v 1.1.2.2 2010/08/25 13:36:09 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: xmd_machdep.c,v 1.1.2.2 2010/08/25 13:36:09 uebayasi Exp $);
 
 #include opt_xip.h
 
@@ -46,7 +46,7 @@
 xmd_machdep_mmap(vaddr_t addr, off_t off, int prot)
 {
 
-	return x86_btop(addr + off);
+	return x86_btop(vtophys(addr + off));
 }
 
 void *
@@ -54,8 +54,8 @@
 {
 	paddr_t start, end;
 
-	start = x86_btop(addr);
-	end = x86_btop(addr + size);
+	start = x86_btop(vtophys(addr));
+	end = x86_btop(vtophys(addr + size));
 
 	return uvm_page_physload_device(start, end, start, end, PROT_READ, 0);
 }



CVS commit: [uebayasi-xip] src/sys/arch/x86/x86

2010-02-24 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Feb 25 02:57:18 UTC 2010

Modified Files:
src/sys/arch/x86/x86 [uebayasi-xip]: pmap.c

Log Message:
pg-mdpage - VM_PAGE_TO_MD(pg)


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.100.2.1 src/sys/arch/x86/x86/pmap.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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.100 src/sys/arch/x86/x86/pmap.c:1.100.2.1
--- src/sys/arch/x86/x86/pmap.c:1.100	Sun Jan 31 00:43:37 2010
+++ src/sys/arch/x86/x86/pmap.c	Thu Feb 25 02:57:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.100 2010/01/31 00:43:37 hubertf Exp $	*/
+/*	$NetBSD: pmap.c,v 1.100.2.1 2010/02/25 02:57:17 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -149,7 +149,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.100 2010/01/31 00:43:37 hubertf Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.100.2.1 2010/02/25 02:57:17 uebayasi Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -415,7 +415,7 @@
 paddr_t pmap_pa_end;   /* PA of last physical page for this domain */
 #endif /* XEN */
 
-#define	VM_PAGE_TO_PP(pg)	((pg)-mdpage.mp_pp)
+#define	VM_PAGE_TO_PP(pg)	(VM_PAGE_TO_MD(pg)-mp_pp)
 
 #define	pp_lock(pp)	mutex_spin_enter((pp)-pp_lock)
 #define	pp_unlock(pp)	mutex_spin_exit((pp)-pp_lock)