From 21aca233bc773de3254e9ea6847ba467a48a0f19 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 12 Jun 2006 17:11:31 -0700 Subject: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes Introduce the Kconfig entry and actually switch to a 64bit value, if wanted, for resource_size_t. Based on a patch series originally from Vivek Goyal Cc: Vivek Goyal Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- arch/i386/Kconfig | 1 + include/linux/types.h | 7 ++++++- kernel/resource.c | 8 +++----- mm/Kconfig | 6 ++++++ 4 files changed, 16 insertions(+), 6 deletions(-) --- gregkh-2.6.orig/arch/i386/Kconfig +++ gregkh-2.6/arch/i386/Kconfig @@ -529,6 +529,7 @@ config X86_PAE bool depends on HIGHMEM64G default y + select RESOURCES_64BIT # Common NUMA Features config NUMA --- gregkh-2.6.orig/include/linux/types.h +++ gregkh-2.6/include/linux/types.h @@ -178,9 +178,14 @@ typedef __u64 __bitwise __be64; #ifdef __KERNEL__ typedef unsigned __bitwise__ gfp_t; -typedef unsigned long resource_size_t; +#ifdef CONFIG_RESOURCES_64BIT +typedef u64 resource_size_t; +#else +typedef u32 resource_size_t; #endif +#endif /* __KERNEL__ */ + struct ustat { __kernel_daddr_t f_tfree; __kernel_ino_t f_tinode; --- gregkh-2.6.orig/kernel/resource.c +++ gregkh-2.6/kernel/resource.c @@ -23,20 +23,18 @@ struct resource ioport_resource = { .name = "PCI IO", - .start = 0x0000, + .start = 0, .end = IO_SPACE_LIMIT, .flags = IORESOURCE_IO, }; - EXPORT_SYMBOL(ioport_resource); struct resource iomem_resource = { .name = "PCI mem", - .start = 0UL, - .end = ~0UL, + .start = 0, + .end = -1, .flags = IORESOURCE_MEM, }; - EXPORT_SYMBOL(iomem_resource); static DEFINE_RWLOCK(resource_lock); --- gregkh-2.6.orig/mm/Kconfig +++ gregkh-2.6/mm/Kconfig @@ -146,3 +146,9 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" if (!64BIT && EXPERIMENTAL) + default 64BIT + help + This option allows memory and IO resources to be 64 bit.