diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-10 16:34:43 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-10 16:34:43 +0100 |
commit | 8c54436ae9f59146b3d02820a3ebbf71e61f2aee (patch) | |
tree | 0ab1a3847809bd7d5f44fc52b1f16fabd953c4bb /arch/x86/kernel/efi_64.c | |
parent | 5ed0cec0ac5f1b3759bdbe4d9df32ee4ff8afb5a (diff) | |
parent | 7a203f3b089be4410fe065dd9927027eade94557 (diff) |
Merge branches 'sched/cleanups' and 'linus' into sched/core
Diffstat (limited to 'arch/x86/kernel/efi_64.c')
-rw-r--r-- | arch/x86/kernel/efi_64.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c index 652c5287215..cb783b92c50 100644 --- a/arch/x86/kernel/efi_64.c +++ b/arch/x86/kernel/efi_64.c @@ -99,24 +99,11 @@ void __init efi_call_phys_epilog(void) void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size) { - static unsigned pages_mapped __initdata; - unsigned i, pages; - unsigned long offset; + unsigned long last_map_pfn; - pages = PFN_UP(phys_addr + size) - PFN_DOWN(phys_addr); - offset = phys_addr & ~PAGE_MASK; - phys_addr &= PAGE_MASK; - - if (pages_mapped + pages > MAX_EFI_IO_PAGES) + last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); + if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) return NULL; - for (i = 0; i < pages; i++) { - __set_fixmap(FIX_EFI_IO_MAP_FIRST_PAGE - pages_mapped, - phys_addr, PAGE_KERNEL); - phys_addr += PAGE_SIZE; - pages_mapped++; - } - - return (void __iomem *)__fix_to_virt(FIX_EFI_IO_MAP_FIRST_PAGE - \ - (pages_mapped - pages)) + offset; + return (void __iomem *)__va(phys_addr); } |