Module Name:    src
Committed By:   jym
Date:           Tue Sep 21 00:18:05 UTC 2010

Modified Files:
        src/sys/arch/i386/include: types.h

Log Message:
Promote paddr_t to 64 bits for i386 userland (non PAE and PAE).

paddr_t has limited interest in userland, and should only be used by specific
code like kvm(3) (for VA => PA translations). To support non PAE and PAE
kernels simultaneously in kvm(3), promote paddr_t to 64 bits.

No objection on current-us...@. See also:

http://mail-index.netbsd.org/current-users/2010/09/07/msg014249.html

Kernel remains untouched by this change. In-kernel 64 bits for paddr_t is for
a future commit (Yes, I do not forget about that :) )


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/i386/include/types.h

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/i386/include/types.h
diff -u src/sys/arch/i386/include/types.h:1.67 src/sys/arch/i386/include/types.h:1.68
--- src/sys/arch/i386/include/types.h:1.67	Fri Dec 11 05:52:03 2009
+++ src/sys/arch/i386/include/types.h	Tue Sep 21 00:18:05 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.67 2009/12/11 05:52:03 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.68 2010/09/21 00:18:05 jym Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -47,27 +47,43 @@
 } label_t;
 #endif
 
-/* NB: This should probably be if defined(_KERNEL) */
 #if defined(_NETBSD_SOURCE)
+#if defined(_KERNEL)
+
+/*
+ * XXX JYM for now, in kernel paddr_t can be 32 or 64 bits, depending
+ * on PAE. Revisit when paddr_t becomes 64 bits for !PAE systems.
+ */
 #ifdef PAE
-typedef unsigned long long paddr_t;
-typedef unsigned long long psize_t;
+typedef __uint64_t	paddr_t;
+typedef __uint64_t	psize_t;
 #define	PRIxPADDR	"llx"
 #define	PRIxPSIZE	"llx"
 #define	PRIuPSIZE	"llu"
-#else
+#else /* PAE */
 typedef unsigned long	paddr_t;
 typedef unsigned long	psize_t;
 #define	PRIxPADDR	"lx"
 #define	PRIxPSIZE	"lx"
 #define	PRIuPSIZE	"lu"
 #endif /* PAE */
+
+#else /* _KERNEL */
+/* paddr_t is always 64 bits for userland */
+typedef __uint64_t	paddr_t;
+typedef __uint64_t	psize_t;
+#define	PRIxPADDR	"llx"
+#define	PRIxPSIZE	"llx"
+#define	PRIuPSIZE	"llu"
+
+#endif /* _KERNEL */
+
 typedef unsigned long	vaddr_t;
 typedef unsigned long	vsize_t;
 #define	PRIxVADDR	"lx"
 #define	PRIxVSIZE	"lx"
 #define	PRIuVSIZE	"lu"
-#endif
+#endif /* _NETBSD_SOURCE */
 
 typedef int		pmc_evid_t;
 typedef __uint64_t	pmc_ctr_t;

Reply via email to