diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-14 13:08:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-14 13:08:40 -0500 |
commit | d42b3a2906a10b732ea7d7f849d49be79d242ef0 (patch) | |
tree | 1f4f2387bf53f8015aa87eb9c05ba8316cb5ed50 /arch/x86/platform/efi/efi.c | |
parent | 18dd0bf22b6f0c1bd5e4e813a42245ed86ec57b6 (diff) | |
parent | e83af1f18c78c7b6aa720beecc927ecc8afd3647 (diff) |
Merge branch 'core-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 EFI update from Peter Anvin:
"EFI tree, from Matt Fleming. Most of the patches are the new efivarfs
filesystem by Matt Garrett & co. The balance are support for EFI
wallclock in the absence of a hardware-specific driver, and various
fixes and cleanups."
* 'core-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
efivarfs: Make efivarfs_fill_super() static
x86, efi: Check table header length in efi_bgrt_init()
efivarfs: Use query_variable_info() to limit kmalloc()
efivarfs: Fix return value of efivarfs_file_write()
efivarfs: Return a consistent error when efivarfs_get_inode() fails
efivarfs: Make 'datasize' unsigned long
efivarfs: Add unique magic number
efivarfs: Replace magic number with sizeof(attributes)
efivarfs: Return an error if we fail to read a variable
efi: Clarify GUID length calculations
efivarfs: Implement exclusive access for {get,set}_variable
efivarfs: efivarfs_fill_super() ensure we clean up correctly on error
efivarfs: efivarfs_fill_super() ensure we free our temporary name
efivarfs: efivarfs_fill_super() fix inode reference counts
efivarfs: efivarfs_create() ensure we drop our reference on inode on error
efivarfs: efivarfs_file_read ensure we free data in error paths
x86-64/efi: Use EFI to deal with platform wall clock (again)
x86/kernel: remove tboot 1:1 page table creation code
x86, efi: 1:1 pagetable mapping for virtual EFI calls
x86, mm: Include the entire kernel memory map in trampoline_pgd
...
Diffstat (limited to 'arch/x86/platform/efi/efi.c')
-rw-r--r-- | arch/x86/platform/efi/efi.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index ad4439145f85..0a34d9e9c263 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -239,22 +239,7 @@ static efi_status_t __init phys_efi_set_virtual_address_map( | |||
239 | return status; | 239 | return status; |
240 | } | 240 | } |
241 | 241 | ||
242 | static efi_status_t __init phys_efi_get_time(efi_time_t *tm, | 242 | static int efi_set_rtc_mmss(unsigned long nowtime) |
243 | efi_time_cap_t *tc) | ||
244 | { | ||
245 | unsigned long flags; | ||
246 | efi_status_t status; | ||
247 | |||
248 | spin_lock_irqsave(&rtc_lock, flags); | ||
249 | efi_call_phys_prelog(); | ||
250 | status = efi_call_phys2(efi_phys.get_time, virt_to_phys(tm), | ||
251 | virt_to_phys(tc)); | ||
252 | efi_call_phys_epilog(); | ||
253 | spin_unlock_irqrestore(&rtc_lock, flags); | ||
254 | return status; | ||
255 | } | ||
256 | |||
257 | int efi_set_rtc_mmss(unsigned long nowtime) | ||
258 | { | 243 | { |
259 | int real_seconds, real_minutes; | 244 | int real_seconds, real_minutes; |
260 | efi_status_t status; | 245 | efi_status_t status; |
@@ -283,7 +268,7 @@ int efi_set_rtc_mmss(unsigned long nowtime) | |||
283 | return 0; | 268 | return 0; |
284 | } | 269 | } |
285 | 270 | ||
286 | unsigned long efi_get_time(void) | 271 | static unsigned long efi_get_time(void) |
287 | { | 272 | { |
288 | efi_status_t status; | 273 | efi_status_t status; |
289 | efi_time_t eft; | 274 | efi_time_t eft; |
@@ -639,18 +624,13 @@ static int __init efi_runtime_init(void) | |||
639 | } | 624 | } |
640 | /* | 625 | /* |
641 | * We will only need *early* access to the following | 626 | * We will only need *early* access to the following |
642 | * two EFI runtime services before set_virtual_address_map | 627 | * EFI runtime service before set_virtual_address_map |
643 | * is invoked. | 628 | * is invoked. |
644 | */ | 629 | */ |
645 | efi_phys.get_time = (efi_get_time_t *)runtime->get_time; | ||
646 | efi_phys.set_virtual_address_map = | 630 | efi_phys.set_virtual_address_map = |
647 | (efi_set_virtual_address_map_t *) | 631 | (efi_set_virtual_address_map_t *) |
648 | runtime->set_virtual_address_map; | 632 | runtime->set_virtual_address_map; |
649 | /* | 633 | |
650 | * Make efi_get_time can be called before entering | ||
651 | * virtual mode. | ||
652 | */ | ||
653 | efi.get_time = phys_efi_get_time; | ||
654 | early_iounmap(runtime, sizeof(efi_runtime_services_t)); | 634 | early_iounmap(runtime, sizeof(efi_runtime_services_t)); |
655 | 635 | ||
656 | return 0; | 636 | return 0; |
@@ -736,12 +716,10 @@ void __init efi_init(void) | |||
736 | efi_enabled = 0; | 716 | efi_enabled = 0; |
737 | return; | 717 | return; |
738 | } | 718 | } |
739 | #ifdef CONFIG_X86_32 | ||
740 | if (efi_is_native()) { | 719 | if (efi_is_native()) { |
741 | x86_platform.get_wallclock = efi_get_time; | 720 | x86_platform.get_wallclock = efi_get_time; |
742 | x86_platform.set_wallclock = efi_set_rtc_mmss; | 721 | x86_platform.set_wallclock = efi_set_rtc_mmss; |
743 | } | 722 | } |
744 | #endif | ||
745 | 723 | ||
746 | #if EFI_DEBUG | 724 | #if EFI_DEBUG |
747 | print_efi_memmap(); | 725 | print_efi_memmap(); |