浏览代码

[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>
Greg Kroah-Hartman 19 年之前
父节点
当前提交
6550e07f41
共有 4 个文件被更改,包括 16 次插入6 次删除
  1. 1 0
      arch/i386/Kconfig
  2. 6 1
      include/linux/types.h
  3. 3 5
      kernel/resource.c
  4. 6 0
      mm/Kconfig

+ 1 - 0
arch/i386/Kconfig

@@ -529,6 +529,7 @@ config X86_PAE
 	bool
 	bool
 	depends on HIGHMEM64G
 	depends on HIGHMEM64G
 	default y
 	default y
+	select RESOURCES_64BIT
 
 
 # Common NUMA Features
 # Common NUMA Features
 config NUMA
 config NUMA

+ 6 - 1
include/linux/types.h

@@ -178,9 +178,14 @@ typedef __u64 __bitwise __be64;
 #ifdef __KERNEL__
 #ifdef __KERNEL__
 typedef unsigned __bitwise__ gfp_t;
 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
 
 
+#endif	/* __KERNEL__ */
+
 struct ustat {
 struct ustat {
 	__kernel_daddr_t	f_tfree;
 	__kernel_daddr_t	f_tfree;
 	__kernel_ino_t		f_tinode;
 	__kernel_ino_t		f_tinode;

+ 3 - 5
kernel/resource.c

@@ -23,20 +23,18 @@
 
 
 struct resource ioport_resource = {
 struct resource ioport_resource = {
 	.name	= "PCI IO",
 	.name	= "PCI IO",
-	.start	= 0x0000,
+	.start	= 0,
 	.end	= IO_SPACE_LIMIT,
 	.end	= IO_SPACE_LIMIT,
 	.flags	= IORESOURCE_IO,
 	.flags	= IORESOURCE_IO,
 };
 };
-
 EXPORT_SYMBOL(ioport_resource);
 EXPORT_SYMBOL(ioport_resource);
 
 
 struct resource iomem_resource = {
 struct resource iomem_resource = {
 	.name	= "PCI mem",
 	.name	= "PCI mem",
-	.start	= 0UL,
-	.end	= ~0UL,
+	.start	= 0,
+	.end	= -1,
 	.flags	= IORESOURCE_MEM,
 	.flags	= IORESOURCE_MEM,
 };
 };
-
 EXPORT_SYMBOL(iomem_resource);
 EXPORT_SYMBOL(iomem_resource);
 
 
 static DEFINE_RWLOCK(resource_lock);
 static DEFINE_RWLOCK(resource_lock);

+ 6 - 0
mm/Kconfig

@@ -145,3 +145,9 @@ config MIGRATION
 	  while the virtual addresses are not changed. This is useful for
 	  while the virtual addresses are not changed. This is useful for
 	  example on NUMA systems to put pages nearer to the processors accessing
 	  example on NUMA systems to put pages nearer to the processors accessing
 	  the page.
 	  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.