diff options
author | Huang, Ying <ying.huang@intel.com> | 2008-01-30 07:31:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:19 -0500 |
commit | 5b83683f32b113d07edfb67a33ce389fc624423d (patch) | |
tree | 03efde0750c9d7e477ab695aeee26173ffcc4abf /arch/x86/kernel/setup_64.c | |
parent | 8c8b8859b64baf6d7c33900e8720c7bafe775b2c (diff) |
x86: EFI runtime service support
This patch adds basic runtime services support for EFI x86_64 system. The
main file of the patch is the addition of efi_64.c for x86_64. This file is
modeled after the EFI IA32 avatar. EFI runtime services initialization are
implemented in efi_64.c. Some x86_64 specifics are worth noting here. On
x86_64, parameters passed to EFI firmware services need to follow the EFI
calling convention. For this purpose, a set of functions named efi_call<x>
(<x> is the number of parameters) are implemented. EFI function calls are
wrapped before calling the firmware service. The duplicated code between
efi_32.c and efi_64.c is placed in efi.c to remove them from efi_32.c.
Signed-off-by: Chandramouli Narayanan <mouli@linux.intel.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/setup_64.c')
-rw-r--r-- | arch/x86/kernel/setup_64.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 8dd110d93e73..90b8bb4748b9 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/crash_dump.h> | 30 | #include <linux/crash_dump.h> |
31 | #include <linux/root_dev.h> | 31 | #include <linux/root_dev.h> |
32 | #include <linux/pci.h> | 32 | #include <linux/pci.h> |
33 | #include <linux/efi.h> | ||
33 | #include <linux/acpi.h> | 34 | #include <linux/acpi.h> |
34 | #include <linux/kallsyms.h> | 35 | #include <linux/kallsyms.h> |
35 | #include <linux/edd.h> | 36 | #include <linux/edd.h> |
@@ -299,6 +300,11 @@ void __init setup_arch(char **cmdline_p) | |||
299 | rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0); | 300 | rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0); |
300 | rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0); | 301 | rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0); |
301 | #endif | 302 | #endif |
303 | #ifdef CONFIG_EFI | ||
304 | if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, | ||
305 | "EL64", 4)) | ||
306 | efi_enabled = 1; | ||
307 | #endif | ||
302 | 308 | ||
303 | ARCH_SETUP | 309 | ARCH_SETUP |
304 | 310 | ||
@@ -341,6 +347,8 @@ void __init setup_arch(char **cmdline_p) | |||
341 | discover_ebda(); | 347 | discover_ebda(); |
342 | 348 | ||
343 | init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); | 349 | init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); |
350 | if (efi_enabled) | ||
351 | efi_init(); | ||
344 | 352 | ||
345 | dmi_scan_machine(); | 353 | dmi_scan_machine(); |
346 | 354 | ||
@@ -414,6 +422,12 @@ void __init setup_arch(char **cmdline_p) | |||
414 | */ | 422 | */ |
415 | acpi_reserve_bootmem(); | 423 | acpi_reserve_bootmem(); |
416 | #endif | 424 | #endif |
425 | |||
426 | if (efi_enabled) { | ||
427 | efi_map_memmap(); | ||
428 | efi_reserve_bootmem(); | ||
429 | } | ||
430 | |||
417 | /* | 431 | /* |
418 | * Find and reserve possible boot-time SMP configuration: | 432 | * Find and reserve possible boot-time SMP configuration: |
419 | */ | 433 | */ |
@@ -479,7 +493,8 @@ void __init setup_arch(char **cmdline_p) | |||
479 | 493 | ||
480 | #ifdef CONFIG_VT | 494 | #ifdef CONFIG_VT |
481 | #if defined(CONFIG_VGA_CONSOLE) | 495 | #if defined(CONFIG_VGA_CONSOLE) |
482 | conswitchp = &vga_con; | 496 | if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY)) |
497 | conswitchp = &vga_con; | ||
483 | #elif defined(CONFIG_DUMMY_CONSOLE) | 498 | #elif defined(CONFIG_DUMMY_CONSOLE) |
484 | conswitchp = &dummy_con; | 499 | conswitchp = &dummy_con; |
485 | #endif | 500 | #endif |