diff options
author | Huang, Ying <ying.huang@intel.com> | 2008-02-25 15:18:37 +0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 19:19:54 +0200 |
commit | 4a3575fd436aa98957184afd745e4ada8f1542d8 (patch) | |
tree | 786585e3d89af847c126d0b4577e212288a134fe /include/linux | |
parent | f8dfd5ed149ae340451f25847b434297c20d4645 (diff) |
x86: EFI_PAGE_SHIFT fix
Make x86 EFI code works when EFI_PAGE_SHIFT != PAGE_SHIFT. The
memrage_efi_to_native() provided in this patch can be used on other
EFI platform such as IA64 too.
This patch has been tested on Intel x86_64 platform with EFI 64/32
firmware.
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/efi.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index 14813b595802..a5f359a7ad0e 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -18,6 +18,7 @@ #include <linux/proc_fs.h> #include <linux/rtc.h> #include <linux/ioport.h> +#include <linux/pfn.h> #include <asm/page.h> #include <asm/system.h> @@ -394,4 +395,10 @@ struct efi_generic_dev_path { u16 length; } __attribute ((packed)); +static inline void memrange_efi_to_native(u64 *addr, u64 *npages) +{ + *npages = PFN_UP(*addr + (*npages<<EFI_PAGE_SHIFT)) - PFN_DOWN(*addr); + *addr &= PAGE_MASK; +} + #endif /* _LINUX_EFI_H */ |