Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/include Promote paddr_t to 64 bits for i386 us...
details: https://anonhg.NetBSD.org/src/rev/9ec9d43714e5
branches: trunk
changeset: 757756:9ec9d43714e5
user: jym <jym%NetBSD.org@localhost>
date: Tue Sep 21 00:18:05 2010 +0000
description:
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-users@. 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 :) )
diffstat:
sys/arch/i386/include/types.h | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)
diffs (58 lines):
diff -r 35ce78033b49 -r 9ec9d43714e5 sys/arch/i386/include/types.h
--- a/sys/arch/i386/include/types.h Mon Sep 20 23:23:16 2010 +0000
+++ b/sys/arch/i386/include/types.h Tue Sep 21 00:18:05 2010 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index