Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99737
b: refs/heads/master
c: ecacf09
h: refs/heads/master
i:
  99735: 0c4fdd3
v: v3
  • Loading branch information
Huang, Ying authored and Thomas Gleixner committed Jun 5, 2008
1 parent 0003760 commit 024c815
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0ec2c6f2c2f0478b34ae78b3e65f60a561ac807
refs/heads/master: ecacf09f7d26b2317e8b1d59fa40f62081fad0bb
33 changes: 20 additions & 13 deletions trunk/arch/x86/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,23 @@ static void __init add_efi_memmap(void)
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
}

void __init efi_reserve_early(void)
{
unsigned long pmap;

pmap = boot_params.efi_info.efi_memmap;
#ifdef CONFIG_X86_64
pmap += (__u64)boot_params.efi_info.efi_memmap_hi << 32;
#endif
memmap.phys_map = (void *)pmap;
memmap.nr_map = boot_params.efi_info.efi_memmap_size /
boot_params.efi_info.efi_memdesc_size;
memmap.desc_version = boot_params.efi_info.efi_memdesc_version;
memmap.desc_size = boot_params.efi_info.efi_memdesc_size;
reserve_early(pmap, pmap + memmap.nr_map * memmap.desc_size,
"EFI memmap");
}

#if EFI_DEBUG
static void __init print_efi_memmap(void)
{
Expand Down Expand Up @@ -267,21 +284,11 @@ void __init efi_init(void)
int i = 0;
void *tmp;

#ifdef CONFIG_X86_32
efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
memmap.phys_map = (void *)boot_params.efi_info.efi_memmap;
#else
efi_phys.systab = (efi_system_table_t *)
(boot_params.efi_info.efi_systab |
((__u64)boot_params.efi_info.efi_systab_hi<<32));
memmap.phys_map = (void *)
(boot_params.efi_info.efi_memmap |
((__u64)boot_params.efi_info.efi_memmap_hi<<32));
#ifdef CONFIG_X86_64
efi_phys.systab = (void *)efi_phys.systab +
((__u64)boot_params.efi_info.efi_systab_hi<<32);
#endif
memmap.nr_map = boot_params.efi_info.efi_memmap_size /
boot_params.efi_info.efi_memdesc_size;
memmap.desc_version = boot_params.efi_info.efi_memdesc_version;
memmap.desc_size = boot_params.efi_info.efi_memdesc_size;

efi.systab = early_ioremap((unsigned long)efi_phys.systab,
sizeof(efi_system_table_t));
Expand Down
6 changes: 0 additions & 6 deletions trunk/arch/x86/kernel/efi_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ void __init efi_call_phys_epilog(void)
early_runtime_code_mapping_set_exec(0);
}

void __init efi_reserve_bootmem(void)
{
reserve_bootmem_generic((unsigned long)memmap.phys_map,
memmap.nr_map * memmap.desc_size);
}

void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size)
{
static unsigned pages_mapped __initdata;
Expand Down
5 changes: 4 additions & 1 deletion trunk/arch/x86/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#include <asm/bios_ebda.h>
#include <asm/cacheflush.h>
#include <asm/processor.h>
#include <asm/efi.h>

/* This value is set up by the early boot code to point to the value
immediately after the boot time page tables. It contains a *physical*
Expand Down Expand Up @@ -683,8 +684,10 @@ void __init setup_arch(char **cmdline_p)

#ifdef CONFIG_EFI
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
"EL32", 4))
"EL32", 4)) {
efi_enabled = 1;
efi_reserve_early();
}
#endif

ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/x86/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,10 @@ void __init setup_arch(char **cmdline_p)
#endif
#ifdef CONFIG_EFI
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
"EL64", 4))
"EL64", 4)) {
efi_enabled = 1;
efi_reserve_early();
}
#endif

ARCH_SETUP
Expand Down Expand Up @@ -457,9 +459,6 @@ void __init setup_arch(char **cmdline_p)
acpi_reserve_bootmem();
#endif

if (efi_enabled)
efi_reserve_bootmem();

#ifdef CONFIG_X86_MPPARSE
/*
* Find and reserve possible boot-time SMP configuration:
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-x86/efi.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ extern void *efi_ioremap(unsigned long addr, unsigned long size);

#endif /* CONFIG_X86_32 */

extern void efi_reserve_bootmem(void);
extern void efi_reserve_early(void);
extern void efi_call_phys_prelog(void);
extern void efi_call_phys_epilog(void);

Expand Down

0 comments on commit 024c815

Please sign in to comment.