]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
generic: add phys_addr_t for holding physical addresses
authorJeremy Fitzhardinge <jeremy@goop.org>
Thu, 11 Sep 2008 08:31:45 +0000 (01:31 -0700)
committerIngo Molnar <mingo@elte.hu>
Sun, 14 Sep 2008 15:24:25 +0000 (17:24 +0200)
Add a kernel-wide "phys_addr_t" which is guaranteed to be able to hold
any physical address.  By default it equals the word size of the
architecture, but a 32-bit architecture can set ARCH_PHYS_ADDR_T_64BIT
if it needs a 64-bit phys_addr_t.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/powerpc/Kconfig
arch/powerpc/include/asm/types.h
arch/x86/Kconfig
include/asm-x86/page_32.h
include/asm-x86/page_64.h
include/linux/types.h
mm/Kconfig

index 587da5e0990f9504979f9357b2783305e6a23d02..f5f83ee6041126832b6c0f514b47e082759aac0c 100644 (file)
@@ -22,6 +22,9 @@ config WORD_SIZE
 config PPC_MERGE
        def_bool y
 
+config ARCH_PHYS_ADDR_T_64BIT
+       def_bool PPC64 || PHYS_64BIT
+
 config MMU
        bool
        default y
index d3374bc865ba565c803056ed33cc57d64241d670..c646f34c4e8b5879d1c4c4922b40bf43191f0445 100644 (file)
@@ -48,13 +48,6 @@ typedef struct {
 
 typedef __vector128 vector128;
 
-/* Physical address used by some IO functions */
-#if defined(CONFIG_PPC64) || defined(CONFIG_PHYS_64BIT)
-typedef u64 phys_addr_t;
-#else
-typedef u32 phys_addr_t;
-#endif
-
 #ifdef __powerpc64__
 typedef u64 dma_addr_t;
 #else
index ed92864d1325c09092f3e8ed4918f26341f23161..a0ffb5188c8cc24be9648c8e6a50ed66d532be34 100644 (file)
@@ -932,6 +932,9 @@ config X86_PAE
          has the cost of more pagetable lookup overhead, and also
          consumes more pagetable space per process.
 
+config ARCH_PHYS_ADDR_T_64BIT
+       def_bool X86_64 || X86_PAE
+
 # Common NUMA Features
 config NUMA
        bool "Numa Memory Allocation and Scheduler Support (EXPERIMENTAL)"
index ab8528793f081bef8d7c945b7bddbaf1bff54073..d0e58605a5200d852f881551a3f62ac092964526 100644 (file)
@@ -33,7 +33,6 @@ typedef u64   pmdval_t;
 typedef u64    pudval_t;
 typedef u64    pgdval_t;
 typedef u64    pgprotval_t;
-typedef u64    phys_addr_t;
 
 typedef union {
        struct {
@@ -54,7 +53,6 @@ typedef unsigned long pmdval_t;
 typedef unsigned long  pudval_t;
 typedef unsigned long  pgdval_t;
 typedef unsigned long  pgprotval_t;
-typedef unsigned long  phys_addr_t;
 
 typedef union {
        pteval_t pte;
index c6916c83e6b1aee454e8a8d55ccd787652bee88e..2456fbf2d7dcc58e5bf1f826af425b1167e395bc 100644 (file)
@@ -79,7 +79,6 @@ typedef unsigned long pmdval_t;
 typedef unsigned long  pudval_t;
 typedef unsigned long  pgdval_t;
 typedef unsigned long  pgprotval_t;
-typedef unsigned long  phys_addr_t;
 
 typedef struct page *pgtable_t;
 
index d4a9ce6e2760394a7fb29d4812e03a4728a9a555..022c668496da16782940e08047745e849c6350ef 100644 (file)
@@ -197,6 +197,12 @@ typedef u64 resource_size_t;
 typedef u32 resource_size_t;
 #endif
 
+#ifdef CONFIG_PHYS_ADDR_T_64BIT
+typedef u64 phys_addr_t;
+#else
+typedef u32 phys_addr_t;
+#endif
+
 struct ustat {
        __kernel_daddr_t        f_tfree;
        __kernel_ino_t          f_tinode;
index 0bd9c2dbb2a0be8d184b4b9f1d75dc03ec2a14ba..91ee3922510aef5d27d91ad49a01cae866ccf390 100644 (file)
@@ -187,6 +187,9 @@ config RESOURCES_64BIT
        help
          This option allows memory and IO resources to be 64 bit.
 
+config PHYS_ADDR_T_64BIT
+       def_bool 64BIT || ARCH_PHYS_ADDR_T_64BIT
+
 config ZONE_DMA_FLAG
        int
        default "0" if !ZONE_DMA