diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-21 23:22:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:50:12 -0400 |
commit | ce97c40e28223c148e142bda7af48fd0f27c81f9 (patch) | |
tree | 319f690fab49750a7d8c0a79b6babfc3a2d8d0ef /arch | |
parent | f81be876eaa9c71b3024c3dc05e4d1bf210cc255 (diff) |
x86: move reserve_standard_io_resource to setup.c
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/setup.c | 32 | ||||
-rw-r--r-- | arch/x86/kernel/setup_32.c | 57 |
2 files changed, 33 insertions, 56 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 56aee55cf8dc..3b9ec81ba4fb 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -468,4 +468,36 @@ void __init reserve_crashkernel(void) | |||
468 | void __init reserve_crashkernel(void) | 468 | void __init reserve_crashkernel(void) |
469 | {} | 469 | {} |
470 | #endif | 470 | #endif |
471 | static struct resource standard_io_resources[] = { | ||
472 | { .name = "dma1", .start = 0x00, .end = 0x1f, | ||
473 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
474 | { .name = "pic1", .start = 0x20, .end = 0x21, | ||
475 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
476 | { .name = "timer0", .start = 0x40, .end = 0x43, | ||
477 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
478 | { .name = "timer1", .start = 0x50, .end = 0x53, | ||
479 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
480 | { .name = "keyboard", .start = 0x60, .end = 0x60, | ||
481 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
482 | { .name = "keyboard", .start = 0x64, .end = 0x64, | ||
483 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
484 | { .name = "dma page reg", .start = 0x80, .end = 0x8f, | ||
485 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
486 | { .name = "pic2", .start = 0xa0, .end = 0xa1, | ||
487 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
488 | { .name = "dma2", .start = 0xc0, .end = 0xdf, | ||
489 | .flags = IORESOURCE_BUSY | IORESOURCE_IO }, | ||
490 | { .name = "fpu", .start = 0xf0, .end = 0xff, | ||
491 | .flags = IORESOURCE_BUSY | IORESOURCE_IO } | ||
492 | }; | ||
493 | |||
494 | void __init reserve_standard_io_resources(void) | ||
495 | { | ||
496 | int i; | ||
497 | |||
498 | /* request I/O space for devices used on all i[345]86 PCs */ | ||
499 | for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) | ||
500 | request_resource(&ioport_resource, &standard_io_resources[i]); | ||
501 | |||
502 | } | ||
471 | 503 | ||
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index 602a45c59ff6..2574ec8234c7 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -108,58 +108,6 @@ static struct resource video_ram_resource = { | |||
108 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM | 108 | .flags = IORESOURCE_BUSY | IORESOURCE_MEM |
109 | }; | 109 | }; |
110 | 110 | ||
111 | static struct resource standard_io_resources[] = { { | ||
112 | .name = "dma1", | ||
113 | .start = 0x0000, | ||
114 | .end = 0x001f, | ||
115 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
116 | }, { | ||
117 | .name = "pic1", | ||
118 | .start = 0x0020, | ||
119 | .end = 0x0021, | ||
120 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
121 | }, { | ||
122 | .name = "timer0", | ||
123 | .start = 0x0040, | ||
124 | .end = 0x0043, | ||
125 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
126 | }, { | ||
127 | .name = "timer1", | ||
128 | .start = 0x0050, | ||
129 | .end = 0x0053, | ||
130 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
131 | }, { | ||
132 | .name = "keyboard", | ||
133 | .start = 0x0060, | ||
134 | .end = 0x0060, | ||
135 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
136 | }, { | ||
137 | .name = "keyboard", | ||
138 | .start = 0x0064, | ||
139 | .end = 0x0064, | ||
140 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
141 | }, { | ||
142 | .name = "dma page reg", | ||
143 | .start = 0x0080, | ||
144 | .end = 0x008f, | ||
145 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
146 | }, { | ||
147 | .name = "pic2", | ||
148 | .start = 0x00a0, | ||
149 | .end = 0x00a1, | ||
150 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
151 | }, { | ||
152 | .name = "dma2", | ||
153 | .start = 0x00c0, | ||
154 | .end = 0x00df, | ||
155 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
156 | }, { | ||
157 | .name = "fpu", | ||
158 | .start = 0x00f0, | ||
159 | .end = 0x00ff, | ||
160 | .flags = IORESOURCE_BUSY | IORESOURCE_IO | ||
161 | } }; | ||
162 | |||
163 | /* cpu data as detected by the assembly code in head.S */ | 111 | /* cpu data as detected by the assembly code in head.S */ |
164 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; | 112 | struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 }; |
165 | /* common cpu data for all cpus */ | 113 | /* common cpu data for all cpus */ |
@@ -614,7 +562,6 @@ static void set_mca_bus(int x) { } | |||
614 | */ | 562 | */ |
615 | void __init setup_arch(char **cmdline_p) | 563 | void __init setup_arch(char **cmdline_p) |
616 | { | 564 | { |
617 | int i; | ||
618 | unsigned long max_low_pfn; | 565 | unsigned long max_low_pfn; |
619 | 566 | ||
620 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); | 567 | memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data)); |
@@ -824,9 +771,7 @@ void __init setup_arch(char **cmdline_p) | |||
824 | e820_mark_nosave_regions(max_low_pfn); | 771 | e820_mark_nosave_regions(max_low_pfn); |
825 | 772 | ||
826 | request_resource(&iomem_resource, &video_ram_resource); | 773 | request_resource(&iomem_resource, &video_ram_resource); |
827 | /* request I/O space for devices used on all i[345]86 PCs */ | 774 | reserve_standard_io_resources(); |
828 | for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++) | ||
829 | request_resource(&ioport_resource, &standard_io_resources[i]); | ||
830 | 775 | ||
831 | e820_setup_gap(); | 776 | e820_setup_gap(); |
832 | 777 | ||