Commit 8308c54d authored by Jeremy Fitzhardinge's avatar Jeremy Fitzhardinge Committed by Ingo Molnar

generic: redefine resource_size_t as phys_addr_t

There's no good reason why a resource_size_t shouldn't just be a
physical address, so simply redefine it in terms of phys_addr_t.
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 947d0496
...@@ -135,7 +135,6 @@ config PTE_64BIT ...@@ -135,7 +135,6 @@ config PTE_64BIT
config PHYS_64BIT config PHYS_64BIT
bool 'Large physical address support' if E500 bool 'Large physical address support' if E500
depends on 44x || E500 depends on 44x || E500
select RESOURCES_64BIT
default y if 44x default y if 44x
---help--- ---help---
This option enables kernel support for larger than 32-bit physical This option enables kernel support for larger than 32-bit physical
......
...@@ -41,13 +41,10 @@ extern unsigned long total_memory; ...@@ -41,13 +41,10 @@ extern unsigned long total_memory;
#define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL)) #define U64_TO_U32_LOW(val) ((u32)((val) & 0x00000000ffffffffULL))
#define U64_TO_U32_HIGH(val) ((u32)((val) >> 32)) #define U64_TO_U32_HIGH(val) ((u32)((val) >> 32))
#ifdef CONFIG_RESOURCES_64BIT #define RES_TO_U32_LOW(val) \
#define RES_TO_U32_LOW(val) U64_TO_U32_LOW(val) ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_LOW(val) : (val))
#define RES_TO_U32_HIGH(val) U64_TO_U32_HIGH(val) #define RES_TO_U32_HIGH(val) \
#else ((sizeof(resource_size_t) > sizeof(u32)) ? U64_TO_U32_HIGH(val) : (0))
#define RES_TO_U32_LOW(val) (val)
#define RES_TO_U32_HIGH(val) (0)
#endif
static inline int ppc440spe_revA(void) static inline int ppc440spe_revA(void)
{ {
...@@ -145,12 +142,11 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose, ...@@ -145,12 +142,11 @@ static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
/* Use that */ /* Use that */
res->start = pci_addr; res->start = pci_addr;
#ifndef CONFIG_RESOURCES_64BIT
/* Beware of 32 bits resources */ /* Beware of 32 bits resources */
if ((pci_addr + size) > 0x100000000ull) if (sizeof(resource_size_t) == sizeof(u32) &&
(pci_addr + size) > 0x100000000ull)
res->end = 0xffffffff; res->end = 0xffffffff;
else else
#endif
res->end = res->start + size - 1; res->end = res->start + size - 1;
break; break;
} }
......
...@@ -925,7 +925,6 @@ config X86_PAE ...@@ -925,7 +925,6 @@ config X86_PAE
def_bool n def_bool n
prompt "PAE (Physical Address Extension) Support" prompt "PAE (Physical Address Extension) Support"
depends on X86_32 && !HIGHMEM4G depends on X86_32 && !HIGHMEM4G
select RESOURCES_64BIT
help help
PAE is required for NX support, and furthermore enables PAE is required for NX support, and furthermore enables
larger swapspace support for non-overcommit purposes. It larger swapspace support for non-overcommit purposes. It
......
...@@ -1276,12 +1276,10 @@ void __init e820_reserve_resources(void) ...@@ -1276,12 +1276,10 @@ void __init e820_reserve_resources(void)
res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map); res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
for (i = 0; i < e820.nr_map; i++) { for (i = 0; i < e820.nr_map; i++) {
end = e820.map[i].addr + e820.map[i].size - 1; end = e820.map[i].addr + e820.map[i].size - 1;
#ifndef CONFIG_RESOURCES_64BIT if (end != (resource_size_t)end) {
if (end > 0x100000000ULL) {
res++; res++;
continue; continue;
} }
#endif
res->name = e820_type_to_string(e820.map[i].type); res->name = e820_type_to_string(e820.map[i].type);
res->start = e820.map[i].addr; res->start = e820.map[i].addr;
res->end = end; res->end = end;
......
...@@ -378,11 +378,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long ...@@ -378,11 +378,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long
align = 0; align = 0;
min_align = 0; min_align = 0;
for (order = 0; order <= max_order; order++) { for (order = 0; order <= max_order; order++) {
#ifdef CONFIG_RESOURCES_64BIT resource_size_t align1 = 1;
resource_size_t align1 = 1ULL << (order + 20);
#else align1 <<= (order + 20);
resource_size_t align1 = 1U << (order + 20);
#endif
if (!align) if (!align)
min_align = align1; min_align = align1;
else if (ALIGN(align + min_align, min_align) < align1) else if (ALIGN(align + min_align, min_align) < align1)
......
...@@ -191,18 +191,14 @@ typedef __u32 __bitwise __wsum; ...@@ -191,18 +191,14 @@ typedef __u32 __bitwise __wsum;
#ifdef __KERNEL__ #ifdef __KERNEL__
typedef unsigned __bitwise__ gfp_t; typedef unsigned __bitwise__ gfp_t;
#ifdef CONFIG_RESOURCES_64BIT
typedef u64 resource_size_t;
#else
typedef u32 resource_size_t;
#endif
#ifdef CONFIG_PHYS_ADDR_T_64BIT #ifdef CONFIG_PHYS_ADDR_T_64BIT
typedef u64 phys_addr_t; typedef u64 phys_addr_t;
#else #else
typedef u32 phys_addr_t; typedef u32 phys_addr_t;
#endif #endif
typedef phys_addr_t resource_size_t;
struct ustat { struct ustat {
__kernel_daddr_t f_tfree; __kernel_daddr_t f_tfree;
__kernel_ino_t f_tinode; __kernel_ino_t f_tinode;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment