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/setup_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/setup_32.c')
-rw-r--r-- | arch/x86/kernel/setup_32.c | 106 |
1 files changed, 103 insertions, 3 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index 236d30b264d8..32edf70d6b0d 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -73,9 +73,80 @@ int disable_pse __cpuinitdata = 0; | |||
73 | /* | 73 | /* |
74 | * Machine setup.. | 74 | * Machine setup.. |
75 | */ | 75 | */ |
76 | extern struct resource code_resource; | 76 | static struct resource data_resource = { |
77 | extern struct resource data_resource; | 77 | .name = "Kernel data", |
78 | extern struct resource bss_resource; | 78 | .start = 0, |
79 | .end = 0, | ||
80 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
81 | }; | ||
82 | |||
83 | static struct resource code_resource = { | ||
84 | .name = "Kernel code", | ||
85 | .start = 0, | ||
86 | .end = 0, | ||
87 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
88 | }; | ||
89 | |||
90 | static struct resource bss_resource = { | ||
91 | .name = "Kernel bss", | ||
92 | .start = 0, | ||
93 | .end = 0, | ||
94 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
95 | }; | ||
96 | |||
97 | static struct resource video_ram_resource = { | ||
98 | .name = "Video RAM area", | ||
99 | .start = 0xa0000, | ||
100 | .end = 0xbffff, | ||
101 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | ||
102 | }; | ||
103 | |||
104 | static struct resource standard_io_resources[] = { { | ||
105 | .name = "dma1", | ||
106 | .start = 0x0000, | ||
107 | .end = 0x001f, | ||
108 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
109 | }, { | ||
110 | .name = "pic1", | ||
111 | .start = 0x0020, | ||
112 | .end = 0x0021, | ||
113 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
114 | }, { | ||
115 | .name = "timer0", | ||
116 | .start = 0x0040, | ||
117 | .end = 0x0043, | ||
118 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
119 | }, { | ||
120 | .name = "timer1", | ||
121 | .start = 0x0050, | ||
122 | .end = 0x0053, | ||
123 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
124 | }, { | ||
125 | .name = "keyboard", | ||
126 | .start = 0x0060, | ||
127 | .end = 0x006f, | ||
128 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
129 | }, { | ||
130 | .name = "dma page reg", | ||
131 | .start = 0x0080, | ||
132 | .end = 0x008f, | ||
133 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
134 | }, { | ||
135 | .name = "pic2", | ||
136 | .start = 0x00a0, | ||
137 | .end = 0x00a1, | ||
138 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
139 | }, { | ||
140 | .name = "dma2", | ||
141 | .start = 0x00c0, | ||
142 | .end = 0x00df, | ||
143 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
144 | }, { | ||
145 | .name = "fpu", | ||
146 | .start = 0x00f0, | ||
147 | .end = 0x00ff, | ||
148 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
149 | } }; | ||
79 | 150 | ||
80 | /* cpu data as detected by the assembly code in head.S */ | 151 | /* cpu data as detected by the assembly code in head.S */ |
81 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; | 152 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; |
@@ -693,3 +764,32 @@ void __init setup_arch(char **cmdline_p) | |||
693 | #endif | 764 | #endif |
694 | #endif | 765 | #endif |
695 | } | 766 | } |
767 | |||
768 | /* | ||
769 | * Request address space for all standard resources | ||
770 | * | ||
771 | * This is called just before pcibios_init(), which is also a | ||
772 | * subsys_initcall, but is linked in later (in arch/i386/pci/common.c). | ||
773 | */ | ||
774 | static int __init request_standard_resources(void) | ||
775 | { | ||
776 | int i; | ||
777 | |||
778 | printk(KERN_INFO "Setting up standard PCI resources\n"); | ||
779 | if (efi_enabled) | ||
780 | efi_initialize_iomem_resources(&code_resource, | ||
781 | &data_resource, &bss_resource); | ||
782 | else | ||
783 | legacy_init_iomem_resources(&code_resource, | ||
784 | &data_resource, &bss_resource); | ||
785 | |||
786 | /* EFI systems may still have VGA */ | ||
787 | request_resource(&iomem_resource, &video_ram_resource); | ||
788 | |||
789 | /* request I/O space for devices used on all i[345]86 PCs */ | ||
790 | for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) | ||
791 | request_resource(&ioport_resource, &standard_io_resources[i]); | ||
792 | return 0; | ||
793 | } | ||
794 | |||
795 | subsys_initcall(request_standard_resources); | ||