Commit ac989232 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86_64: Split ACPI boot table parsing

Split ACPI boot table parsing

Split ACPI boot table parsing into two parts.  First a acpi_boot_table_init()
call that initializes the basic ACPI table parsing machinery and discovers the
RSDP, and then another call to actually parse the various boot tables.

This is needed for a followon patch that implements SRAT support, because
nodes need to be set up before the other ACPI tables can be parsed.

On x86-64 I moved the early initialization very early because that is needed
for the SRAT parser.

On i386 it should be a nop.
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 346e7bb4
......@@ -810,13 +810,16 @@ acpi_process_madt(void)
}
/*
* acpi_boot_init()
* acpi_boot_table_init() and acpi_boot_init()
* called from setup_arch(), always.
* 1. checksums all tables
* 2. enumerates lapics
* 3. enumerates io-apics
*
* side effects:
* acpi_table_init() is separate to allow reading SRAT without
* other side effects.
*
* side effects of acpi_boot_init:
* acpi_lapic = 1 if LAPIC found
* acpi_ioapic = 1 if IOAPIC found
* if (acpi_lapic && acpi_ioapic) smp_found_config = 1;
......@@ -830,7 +833,7 @@ acpi_process_madt(void)
*/
int __init
acpi_boot_init (void)
acpi_boot_table_init(void)
{
int error;
......@@ -872,6 +875,21 @@ acpi_boot_init (void)
}
}
return 0;
}
int __init acpi_boot_init(void)
{
/*
* If acpi_disabled, bail out
* One exception: acpi=ht continues far enough to enumerate LAPICs
*/
if (acpi_disabled && !acpi_ht)
return 1;
acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
/*
* set sci_int and PM timer address
*/
......
......@@ -1417,6 +1417,7 @@ void __init setup_arch(char **cmdline_p)
/*
* Parse the ACPI tables for possible boot-time SMP configuration.
*/
acpi_boot_table_init();
acpi_boot_init();
#ifdef CONFIG_X86_LOCAL_APIC
......
......@@ -490,6 +490,14 @@ void __init setup_arch(char **cmdline_p)
init_memory_mapping();
#ifdef CONFIG_ACPI_BOOT
/*
* Initialize the ACPI boot-time table parser (gets the RSDP and SDT).
* Call this early for SRAT node setup.
*/
acpi_boot_table_init();
#endif
#ifdef CONFIG_DISCONTIGMEM
numa_initmem_init(0, end_pfn);
#else
......@@ -556,16 +564,15 @@ void __init setup_arch(char **cmdline_p)
#endif
paging_init();
check_ioapic();
check_ioapic();
#ifdef CONFIG_ACPI_BOOT
/*
* Initialize the ACPI boot-time table parser (gets the RSDP and SDT).
* Must do this after paging_init (due to reliance on fixmap, and thus
* the bootmem allocator) but before get_smp_config (to allow parsing
* of MADT).
*/
/*
* Read APIC and some other early information from ACPI tables.
*/
acpi_boot_init();
#endif
#ifdef CONFIG_X86_LOCAL_APIC
/*
* get boot-time SMP configuration:
......
......@@ -379,6 +379,7 @@ typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header, const u
char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
unsigned long acpi_find_rsdp (void);
int acpi_boot_init (void);
int acpi_boot_table_init (void);
int acpi_numa_init (void);
int acpi_table_init (void);
......@@ -417,6 +418,11 @@ static inline int acpi_boot_init(void)
return 0;
}
static inline int acpi_boot_table_init(void)
{
return 0;
}
#endif /*!CONFIG_ACPI_BOOT*/
unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment