Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99691
b: refs/heads/master
c: 69c9189
h: refs/heads/master
i:
  99689: d9bb5a0
  99687: a37114f
v: v3
  • Loading branch information
Paul Jackson authored and Thomas Gleixner committed May 25, 2008
1 parent e5b8485 commit 3dbcfcd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b7eb2e9ef4e467a1248537b47a63bab265be3cc
refs/heads/master: 69c9189320c46b14e5ae3ad4b3a0d35cc63cba20
26 changes: 26 additions & 0 deletions trunk/arch/x86/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,31 @@ unsigned long efi_get_time(void)
eft.minute, eft.second);
}

/*
* Tell the kernel about the EFI memory map. This might include
* more than the max 128 entries that can fit in the e820 legacy
* (zeropage) memory map.
*/

static void __init add_efi_memmap(void)
{
void *p;

for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
efi_memory_desc_t *md = p;
unsigned long long start = md->phys_addr;
unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
int e820_type;

if (md->attribute & EFI_MEMORY_WB)
e820_type = E820_RAM;
else
e820_type = E820_RESERVED;
add_memory_region(start, size, e820_type);
}
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
}

#if EFI_DEBUG
static void __init print_efi_memmap(void)
{
Expand Down Expand Up @@ -370,6 +395,7 @@ void __init efi_init(void)
if (memmap.desc_size != sizeof(efi_memory_desc_t))
printk(KERN_WARNING "Kernel-defined memdesc"
"doesn't match the one from EFI!\n");
add_efi_memmap();

/* Setup for EFI runtime service */
reboot_type = BOOT_EFI;
Expand Down

0 comments on commit 3dbcfcd

Please sign in to comment.