Commit 6550e07f41ce8473ed684dac54fbfbd42183ffda

Authored by Greg Kroah-Hartman
1 parent 2427ddd8fa

[PATCH] 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 <vgoyal@in.ibm.com>

Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 4 changed files with 16 additions and 6 deletions Side-by-side Diff

... ... @@ -529,6 +529,7 @@
529 529 bool
530 530 depends on HIGHMEM64G
531 531 default y
  532 + select RESOURCES_64BIT
532 533  
533 534 # Common NUMA Features
534 535 config NUMA
include/linux/types.h
... ... @@ -178,8 +178,13 @@
178 178 #ifdef __KERNEL__
179 179 typedef unsigned __bitwise__ gfp_t;
180 180  
181   -typedef unsigned long resource_size_t;
  181 +#ifdef CONFIG_RESOURCES_64BIT
  182 +typedef u64 resource_size_t;
  183 +#else
  184 +typedef u32 resource_size_t;
182 185 #endif
  186 +
  187 +#endif /* __KERNEL__ */
183 188  
184 189 struct ustat {
185 190 __kernel_daddr_t f_tfree;
... ... @@ -23,20 +23,18 @@
23 23  
24 24 struct resource ioport_resource = {
25 25 .name = "PCI IO",
26   - .start = 0x0000,
  26 + .start = 0,
27 27 .end = IO_SPACE_LIMIT,
28 28 .flags = IORESOURCE_IO,
29 29 };
30   -
31 30 EXPORT_SYMBOL(ioport_resource);
32 31  
33 32 struct resource iomem_resource = {
34 33 .name = "PCI mem",
35   - .start = 0UL,
36   - .end = ~0UL,
  34 + .start = 0,
  35 + .end = -1,
37 36 .flags = IORESOURCE_MEM,
38 37 };
39   -
40 38 EXPORT_SYMBOL(iomem_resource);
41 39  
42 40 static DEFINE_RWLOCK(resource_lock);
... ... @@ -145,4 +145,10 @@
145 145 while the virtual addresses are not changed. This is useful for
146 146 example on NUMA systems to put pages nearer to the processors accessing
147 147 the page.
  148 +
  149 +config RESOURCES_64BIT
  150 + bool "64 bit Memory and IO resources (EXPERIMENTAL)" if (!64BIT && EXPERIMENTAL)
  151 + default 64BIT
  152 + help
  153 + This option allows memory and IO resources to be 64 bit.