From: Yinghai Lu <yhlu.kernel@gmail.com>
To: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: move reserve_standard_io_resource to setup.c
Date: Sat, 21 Jun 2008 20:22:09 -0700 [thread overview]
Message-ID: <200806212022.10077.yhlu.kernel@gmail.com> (raw)
In-Reply-To: <200806211916.52949.yhlu.kernel@gmail.com>
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
---
arch/x86/kernel/setup.c | 33 ++++++++++++++++++++++++++
arch/x86/kernel/setup_32.c | 57 ---------------------------------------------
arch/x86/kernel/setup_64.c | 29 ----------------------
include/asm-x86/setup.h | 2 +
4 files changed, 37 insertions(+), 84 deletions(-)
Index: linux-2.6/arch/x86/kernel/setup_64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_64.c
+++ linux-2.6/arch/x86/kernel/setup_64.c
@@ -110,29 +110,6 @@ extern int root_mountflags;
static char __initdata command_line[COMMAND_LINE_SIZE];
-static struct resource standard_io_resources[] = {
- { .name = "dma1", .start = 0x00, .end = 0x1f,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "pic1", .start = 0x20, .end = 0x21,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "timer0", .start = 0x40, .end = 0x43,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "timer1", .start = 0x50, .end = 0x53,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "keyboard", .start = 0x60, .end = 0x60,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "keyboard", .start = 0x64, .end = 0x64,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "dma page reg", .start = 0x80, .end = 0x8f,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "pic2", .start = 0xa0, .end = 0xa1,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "dma2", .start = 0xc0, .end = 0xdf,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO },
- { .name = "fpu", .start = 0xf0, .end = 0xff,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO }
-};
-
#define IORESOURCE_RAM (IORESOURCE_BUSY | IORESOURCE_MEM)
static struct resource data_resource = {
@@ -220,8 +197,6 @@ static inline void copy_edd(void)
*/
void __init setup_arch(char **cmdline_p)
{
- unsigned i;
-
printk(KERN_INFO "Command line: %s\n", boot_command_line);
ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
@@ -430,9 +405,7 @@ void __init setup_arch(char **cmdline_p)
e820_reserve_resources();
e820_mark_nosave_regions(end_pfn);
- /* request I/O space for devices used on all i[345]86 PCs */
- for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
- request_resource(&ioport_resource, &standard_io_resources[i]);
+ reserve_standard_io_resources();
e820_setup_gap();
Index: linux-2.6/arch/x86/kernel/setup_32.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_32.c
+++ linux-2.6/arch/x86/kernel/setup_32.c
@@ -109,58 +109,6 @@ static struct resource video_ram_resourc
.flags = IORESOURCE_BUSY | IORESOURCE_MEM
};
-static struct resource standard_io_resources[] = { {
- .name = "dma1",
- .start = 0x0000,
- .end = 0x001f,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "pic1",
- .start = 0x0020,
- .end = 0x0021,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "timer0",
- .start = 0x0040,
- .end = 0x0043,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "timer1",
- .start = 0x0050,
- .end = 0x0053,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "keyboard",
- .start = 0x0060,
- .end = 0x0060,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "keyboard",
- .start = 0x0064,
- .end = 0x0064,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "dma page reg",
- .start = 0x0080,
- .end = 0x008f,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "pic2",
- .start = 0x00a0,
- .end = 0x00a1,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "dma2",
- .start = 0x00c0,
- .end = 0x00df,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-}, {
- .name = "fpu",
- .start = 0x00f0,
- .end = 0x00ff,
- .flags = IORESOURCE_BUSY | IORESOURCE_IO
-} };
-
/* cpu data as detected by the assembly code in head.S */
struct cpuinfo_x86 new_cpu_data __cpuinitdata = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
/* common cpu data for all cpus */
@@ -615,7 +563,6 @@ static void set_mca_bus(int x) { }
*/
void __init setup_arch(char **cmdline_p)
{
- int i;
unsigned long max_low_pfn;
memcpy(&boot_cpu_data, &new_cpu_data, sizeof(new_cpu_data));
@@ -830,9 +777,7 @@ void __init setup_arch(char **cmdline_p)
e820_mark_nosave_regions(max_low_pfn);
request_resource(&iomem_resource, &video_ram_resource);
- /* request I/O space for devices used on all i[345]86 PCs */
- for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
- request_resource(&ioport_resource, &standard_io_resources[i]);
+ reserve_standard_io_resources();
e820_setup_gap();
Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -467,3 +467,36 @@ void __init reserve_crashkernel(void)
void __init reserve_crashkernel(void)
{}
#endif
+
+static struct resource standard_io_resources[] = {
+ { .name = "dma1", .start = 0x00, .end = 0x1f,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "pic1", .start = 0x20, .end = 0x21,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "timer0", .start = 0x40, .end = 0x43,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "timer1", .start = 0x50, .end = 0x53,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "keyboard", .start = 0x60, .end = 0x60,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "keyboard", .start = 0x64, .end = 0x64,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "dma page reg", .start = 0x80, .end = 0x8f,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "pic2", .start = 0xa0, .end = 0xa1,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "dma2", .start = 0xc0, .end = 0xdf,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO },
+ { .name = "fpu", .start = 0xf0, .end = 0xff,
+ .flags = IORESOURCE_BUSY | IORESOURCE_IO }
+};
+
+void __init reserve_standard_io_resources(void)
+{
+ int i;
+
+ /* request I/O space for devices used on all i[345]86 PCs */
+ for (i = 0; i < ARRAY_SIZE(standard_io_resources); i++)
+ request_resource(&ioport_resource, &standard_io_resources[i]);
+
+}
Index: linux-2.6/include/asm-x86/setup.h
===================================================================
--- linux-2.6.orig/include/asm-x86/setup.h
+++ linux-2.6/include/asm-x86/setup.h
@@ -38,6 +38,8 @@ void reserve_crashkernel(void);
#ifndef __ASSEMBLY__
#include <asm/bootparam.h>
+void reserve_standard_io_resources(void);
+
#ifndef _SETUP
/*
next prev parent reply other threads:[~2008-06-22 3:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-18 9:15 [PATCH] x86: make 64bit identify_cpu use cpu_dev Yinghai Lu
2008-06-18 14:17 ` Ingo Molnar
2008-06-19 9:03 ` Ingo Molnar
2008-06-19 20:00 ` Yinghai Lu
2008-06-19 22:30 ` [PATCH] x86: make 64bit identify_cpu use cpu_dev v2 Yinghai Lu
2008-06-20 6:29 ` Ingo Molnar
2008-06-20 7:08 ` Yinghai Lu
[not found] ` <200806210323.01590.yhlu.kernel@gmail.com>
2008-06-21 10:24 ` [PATCH] x86: change identify_cpu to static Yinghai Lu
2008-06-21 10:24 ` [PATCH] x86: seperate funcs from setup_64 to cpu common_64.c Yinghai Lu
2008-06-21 23:25 ` [PATCH] x86: merge setup64.c into common_64.c Yinghai Lu
2008-06-22 2:16 ` [PATCH] x86: remove two duplicated func in setup_32.c Yinghai Lu
2008-06-22 3:22 ` Yinghai Lu [this message]
2008-06-22 4:02 ` [PATCH] x86: move elfcorehdr parsing to setup.c Yinghai Lu
2008-06-22 9:44 ` [PATCH] x86: introduce initmem_init for 64 bit Yinghai Lu
2008-06-22 9:45 ` [PATCH] x86: introduce initmem_init for 32 bit Yinghai Lu
2008-06-22 9:46 ` [PATCH] x86: introduce reserve_initrd Yinghai Lu
2008-06-23 0:37 ` [PATCH] x86: move boot_params declaring to setup.c Yinghai Lu
2008-06-23 0:40 ` [PATCH] x86: move reservetop and vmalloc parsing to pgtable_32.c Yinghai Lu
2008-06-23 0:40 ` [PATCH] x86: introduce reserve_initrd Yinghai Lu
2008-06-23 10:04 ` [PATCH] x86: move reservetop and vmalloc parsing to pgtable_32.c Yinghai Lu
2008-06-23 10:05 ` [PATCH] x86: cleanup using max_low_pfn for 32 bit Yinghai Lu
2008-06-23 19:56 ` Ingo Molnar
2008-06-23 19:57 ` H. Peter Anvin
2008-06-23 20:22 ` Ingo Molnar
2008-06-23 20:27 ` Yinghai Lu
2008-06-23 10:06 ` [PATCH] x86: cleanup min_low_pfn Yinghai Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806212022.10077.yhlu.kernel@gmail.com \
--to=yhlu.kernel@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox