diff options
author | Bernhard Walle <bwalle@suse.de> | 2008-01-30 07:30:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:32 -0500 |
commit | c9cce83dd1d59f52e2c8f8c7d265ba4854c40785 (patch) | |
tree | 0d6801b5c069e573ee06464c567e838a6764f424 /arch/x86/kernel/e820_32.c | |
parent | 9773db2a301b089bb95907eec5ad1a2ef7fb4099 (diff) |
x86: remove extern declarations for code, data, bss resources
This patch removes the extern struct resource declarations for
data_resource, code_resource and bss_resource on x86 and declares that
three structures as static as done on other architectures like IA64.
On i386, these structures are moved to setup_32.c (from e820_32.c) because
that's code that is not specific to e820 and also required on EFI systems.
That makes the "extern" reference superfluous.
On x86_64, data_resource, code_resource and bss_resource are passed to
e820_reserve_resources() as arguments just as done on i386 and IA64. That
also avoids the "extern" reference and it's possible to make it static.
Signed-off-by: Bernhard Walle <bwalle@suse.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/e820_32.c')
-rw-r--r-- | arch/x86/kernel/e820_32.c | 110 |
1 files changed, 3 insertions, 107 deletions
diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c index 18f500d185a2..87cadc86d5ee 100644 --- a/arch/x86/kernel/e820_32.c +++ b/arch/x86/kernel/e820_32.c | |||
@@ -37,26 +37,6 @@ unsigned long pci_mem_start = 0x10000000; | |||
37 | EXPORT_SYMBOL(pci_mem_start); | 37 | EXPORT_SYMBOL(pci_mem_start); |
38 | #endif | 38 | #endif |
39 | extern int user_defined_memmap; | 39 | extern int user_defined_memmap; |
40 | struct resource data_resource = { | ||
41 | .name = "Kernel data", | ||
42 | .start = 0, | ||
43 | .end = 0, | ||
44 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
45 | }; | ||
46 | |||
47 | struct resource code_resource = { | ||
48 | .name = "Kernel code", | ||
49 | .start = 0, | ||
50 | .end = 0, | ||
51 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
52 | }; | ||
53 | |||
54 | struct resource bss_resource = { | ||
55 | .name = "Kernel bss", | ||
56 | .start = 0, | ||
57 | .end = 0, | ||
58 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
59 | }; | ||
60 | 40 | ||
61 | static struct resource system_rom_resource = { | 41 | static struct resource system_rom_resource = { |
62 | .name = "System ROM", | 42 | .name = "System ROM", |
@@ -111,60 +91,6 @@ static struct resource video_rom_resource = { | |||
111 | .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM | 91 | .flags = IORESOURCE_BUSY | IORESOURCE_READONLY | IORESOURCE_MEM |
112 | }; | 92 | }; |
113 | 93 | ||
114 | static struct resource video_ram_resource = { | ||
115 | .name = "Video RAM area", | ||
116 | .start = 0xa0000, | ||
117 | .end = 0xbffff, | ||
118 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
119 | }; | ||
120 | |||
121 | static struct resource standard_io_resources[] = { { | ||
122 | .name = "dma1", | ||
123 | .start = 0x0000, | ||
124 | .end = 0x001f, | ||
125 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
126 | }, { | ||
127 | .name = "pic1", | ||
128 | .start = 0x0020, | ||
129 | .end = 0x0021, | ||
130 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
131 | }, { | ||
132 | .name = "timer0", | ||
133 | .start = 0x0040, | ||
134 | .end = 0x0043, | ||
135 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
136 | }, { | ||
137 | .name = "timer1", | ||
138 | .start = 0x0050, | ||
139 | .end = 0x0053, | ||
140 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
141 | }, { | ||
142 | .name = "keyboard", | ||
143 | .start = 0x0060, | ||
144 | .end = 0x006f, | ||
145 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
146 | }, { | ||
147 | .name = "dma page reg", | ||
148 | .start = 0x0080, | ||
149 | .end = 0x008f, | ||
150 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
151 | }, { | ||
152 | .name = "pic2", | ||
153 | .start = 0x00a0, | ||
154 | .end = 0x00a1, | ||
155 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
156 | }, { | ||
157 | .name = "dma2", | ||
158 | .start = 0x00c0, | ||
159 | .end = 0x00df, | ||
160 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
161 | }, { | ||
162 | .name = "fpu", | ||
163 | .start = 0x00f0, | ||
164 | .end = 0x00ff, | ||
165 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
166 | } }; | ||
167 | |||
168 | #define ROMSIGNATURE 0xaa55 | 94 | #define ROMSIGNATURE 0xaa55 |
169 | 95 | ||
170 | static int __init romsignature(const unsigned char *rom) | 96 | static int __init romsignature(const unsigned char *rom) |
@@ -260,10 +186,9 @@ static void __init probe_roms(void) | |||
260 | * Request address space for all standard RAM and ROM resources | 186 | * Request address space for all standard RAM and ROM resources |
261 | * and also for regions reported as reserved by the e820. | 187 | * and also for regions reported as reserved by the e820. |
262 | */ | 188 | */ |
263 | static void __init | 189 | void __init legacy_init_iomem_resources(struct resource *code_resource, |
264 | legacy_init_iomem_resources(struct resource *code_resource, | 190 | struct resource *data_resource, |
265 | struct resource *data_resource, | 191 | struct resource *bss_resource) |
266 | struct resource *bss_resource) | ||
267 | { | 192 | { |
268 | int i; | 193 | int i; |
269 | 194 | ||
@@ -305,35 +230,6 @@ legacy_init_iomem_resources(struct resource *code_resource, | |||
305 | } | 230 | } |
306 | } | 231 | } |
307 | 232 | ||
308 | /* | ||
309 | * Request address space for all standard resources | ||
310 | * | ||
311 | * This is called just before pcibios_init(), which is also a | ||
312 | * subsys_initcall, but is linked in later (in arch/i386/pci/common.c). | ||
313 | */ | ||
314 | static int __init request_standard_resources(void) | ||
315 | { | ||
316 | int i; | ||
317 | |||
318 | printk("Setting up standard PCI resources\n"); | ||
319 | if (efi_enabled) | ||
320 | efi_initialize_iomem_resources(&code_resource, | ||
321 | &data_resource, &bss_resource); | ||
322 | else | ||
323 | legacy_init_iomem_resources(&code_resource, | ||
324 | &data_resource, &bss_resource); | ||
325 | |||
326 | /* EFI systems may still have VGA */ | ||
327 | request_resource(&iomem_resource, &video_ram_resource); | ||
328 | |||
329 | /* request I/O space for devices used on all i[345]86 PCs */ | ||
330 | for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) | ||
331 | request_resource(&ioport_resource, &standard_io_resources[i]); | ||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | subsys_initcall(request_standard_resources); | ||
336 | |||
337 | #if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION) | 233 | #if defined(CONFIG_PM) && defined(CONFIG_HIBERNATION) |
338 | /** | 234 | /** |
339 | * e820_mark_nosave_regions - Find the ranges of physical addresses that do not | 235 | * e820_mark_nosave_regions - Find the ranges of physical addresses that do not |