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 Cc: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- arch/arm/Kconfig | 7 +++++++ arch/arm26/Kconfig | 7 +++++++ arch/cris/Kconfig | 7 +++++++ arch/frv/Kconfig | 7 +++++++ arch/i386/Kconfig | 7 +++++++ arch/m32r/Kconfig | 7 +++++++ arch/m68k/Kconfig | 7 +++++++ arch/m68knommu/Kconfig | 7 +++++++ arch/mips/Kconfig | 8 ++++++++ arch/parisc/Kconfig | 8 ++++++++ arch/powerpc/Kconfig | 8 ++++++++ arch/ppc/Kconfig | 7 +++++++ arch/s390/Kconfig | 8 ++++++++ arch/sh/Kconfig | 7 +++++++ arch/sparc/Kconfig | 7 +++++++ arch/v850/Kconfig | 7 +++++++ arch/xtensa/Kconfig | 7 +++++++ include/linux/types.h | 7 ++++++- kernel/resource.c | 11 ++++++++++- 19 files changed, 139 insertions(+), 2 deletions(-) --- gregkh-2.6.orig/arch/arm/Kconfig +++ gregkh-2.6/arch/arm/Kconfig @@ -531,6 +531,13 @@ config NODES_SHIFT source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + config LEDS bool "Timer and CPU usage LEDs" depends on ARCH_CDB89712 || ARCH_CO285 || ARCH_EBSA110 || \ --- gregkh-2.6.orig/arch/arm26/Kconfig +++ gregkh-2.6/arch/arm26/Kconfig @@ -187,6 +187,13 @@ config CMDLINE source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + endmenu source "net/Kconfig" --- gregkh-2.6.orig/arch/cris/Kconfig +++ gregkh-2.6/arch/cris/Kconfig @@ -80,6 +80,13 @@ config PREEMPT source mm/Kconfig +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + endmenu menu "Hardware setup" --- gregkh-2.6.orig/arch/frv/Kconfig +++ gregkh-2.6/arch/frv/Kconfig @@ -80,6 +80,13 @@ config HIGHPTE source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + choice prompt "uClinux kernel load address" depends on !MMU --- gregkh-2.6.orig/arch/i386/Kconfig +++ gregkh-2.6/arch/i386/Kconfig @@ -754,6 +754,13 @@ config PHYSICAL_START Don't change this unless you know what you are doing. +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL && !X86_PAE + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + config HOTPLUG_CPU bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER --- gregkh-2.6.orig/arch/m32r/Kconfig +++ gregkh-2.6/arch/m32r/Kconfig @@ -188,6 +188,13 @@ config ARCH_DISCONTIGMEM_ENABLE source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + config IRAM_START hex "Internal memory start address (hex)" default "00f00000" if !CHIP_M32104 --- gregkh-2.6.orig/arch/m68k/Kconfig +++ gregkh-2.6/arch/m68k/Kconfig @@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + endmenu menu "General setup" --- gregkh-2.6.orig/arch/m68knommu/Kconfig +++ gregkh-2.6/arch/m68knommu/Kconfig @@ -605,6 +605,13 @@ endchoice source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + endmenu config ISA_DMA_API --- gregkh-2.6.orig/arch/mips/Kconfig +++ gregkh-2.6/arch/mips/Kconfig @@ -1784,6 +1784,14 @@ config HZ source "kernel/Kconfig.preempt" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on 32BIT + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + config RTC_DS1742 bool "DS1742 BRAM/RTC support" depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927 --- gregkh-2.6.orig/arch/parisc/Kconfig +++ gregkh-2.6/arch/parisc/Kconfig @@ -217,6 +217,14 @@ source "kernel/Kconfig.preempt" source "kernel/Kconfig.hz" source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on !64BIT + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + config COMPAT def_bool y depends on 64BIT --- gregkh-2.6.orig/arch/powerpc/Kconfig +++ gregkh-2.6/arch/powerpc/Kconfig @@ -626,6 +626,14 @@ config CRASH_DUMP Don't change this unless you know what you are doing. +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on PPC32 + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + config EMBEDDEDBOOT bool depends on 8xx || 8260 --- gregkh-2.6.orig/arch/ppc/Kconfig +++ gregkh-2.6/arch/ppc/Kconfig @@ -953,6 +953,13 @@ source kernel/Kconfig.hz source kernel/Kconfig.preempt source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + source "fs/Kconfig.binfmt" config PREP_RESIDUAL --- gregkh-2.6.orig/arch/s390/Kconfig +++ gregkh-2.6/arch/s390/Kconfig @@ -218,6 +218,14 @@ config WARN_STACK_SIZE source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + depends on !64BIT + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + comment "I/O subsystem configuration" config MACHCHK_WARNING --- gregkh-2.6.orig/arch/sh/Kconfig +++ gregkh-2.6/arch/sh/Kconfig @@ -532,6 +532,13 @@ config NODES_SHIFT default "1" depends on NEED_MULTIPLE_NODES +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + endmenu menu "Boot options" --- gregkh-2.6.orig/arch/sparc/Kconfig +++ gregkh-2.6/arch/sparc/Kconfig @@ -67,6 +67,13 @@ config SPARC32 maintains both the SPARC32 and SPARC64 ports; its web page is available at . +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + # Global things across all Sun machines. config ISA bool --- gregkh-2.6.orig/arch/v850/Kconfig +++ gregkh-2.6/arch/v850/Kconfig @@ -235,6 +235,13 @@ menu "Processor type and features" source "mm/Kconfig" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + endmenu --- gregkh-2.6.orig/arch/xtensa/Kconfig +++ gregkh-2.6/arch/xtensa/Kconfig @@ -99,6 +99,13 @@ config MATH_EMULATION config HIGHMEM bool "High memory support" +config RESOURCES_32BIT + bool "32 bit Memory and IO resources (EXPERIMENTAL)" + depends on EXPERIMENTAL + help + By default resources are 64 bit. This option allows memory and IO + resources to be 32 bit to optimize code size. + endmenu menu "Platform options" --- 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_32BIT +typedef __u32 resource_size_t; +#else +typedef __u64 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,7 +23,11 @@ struct resource ioport_resource = { .name = "PCI IO", - .start = 0x0000, +#ifdef CONFIG_RESOURCES_32BIT + .start = 0x0000UL, +#else + .start = 0x0000ULL, +#endif .end = IO_SPACE_LIMIT, .flags = IORESOURCE_IO, }; @@ -32,8 +36,13 @@ EXPORT_SYMBOL(ioport_resource); struct resource iomem_resource = { .name = "PCI mem", +#ifdef CONFIG_RESOURCES_32BIT .start = 0UL, .end = ~0UL, +#else + .start = 0ULL, + .end = ~0ULL, +#endif .flags = IORESOURCE_MEM, };