diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 20:03:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 20:03:14 -0400 |
commit | 227ad9bc070db2801a7f586b4d350dd1d8b82e03 (patch) | |
tree | fe5182ed4131e5f4c77eaedda6566e1b3ca082e0 /arch/x86/platform | |
parent | 35b004cce1b0880876faecb8e0bd7cb2cb5a59d1 (diff) | |
parent | d80603c9d876efafd8b07469c891076de470e323 (diff) |
Merge branch 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-efi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, efi: Properly pre-initialize table pointers
x86, efi: Add infrastructure for UEFI 2.0 runtime services
x86, efi: Fix argument types for SetVariable()
Diffstat (limited to 'arch/x86/platform')
-rw-r--r-- | arch/x86/platform/efi/efi.c | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index cfc588ce1155..3ae4128013e6 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -51,7 +51,17 @@ | |||
51 | int efi_enabled; | 51 | int efi_enabled; |
52 | EXPORT_SYMBOL(efi_enabled); | 52 | EXPORT_SYMBOL(efi_enabled); |
53 | 53 | ||
54 | struct efi efi; | 54 | struct efi __read_mostly efi = { |
55 | .mps = EFI_INVALID_TABLE_ADDR, | ||
56 | .acpi = EFI_INVALID_TABLE_ADDR, | ||
57 | .acpi20 = EFI_INVALID_TABLE_ADDR, | ||
58 | .smbios = EFI_INVALID_TABLE_ADDR, | ||
59 | .sal_systab = EFI_INVALID_TABLE_ADDR, | ||
60 | .boot_info = EFI_INVALID_TABLE_ADDR, | ||
61 | .hcdp = EFI_INVALID_TABLE_ADDR, | ||
62 | .uga = EFI_INVALID_TABLE_ADDR, | ||
63 | .uv_systab = EFI_INVALID_TABLE_ADDR, | ||
64 | }; | ||
55 | EXPORT_SYMBOL(efi); | 65 | EXPORT_SYMBOL(efi); |
56 | 66 | ||
57 | struct efi_memory_map memmap; | 67 | struct efi_memory_map memmap; |
@@ -146,7 +156,7 @@ static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, | |||
146 | 156 | ||
147 | static efi_status_t virt_efi_set_variable(efi_char16_t *name, | 157 | static efi_status_t virt_efi_set_variable(efi_char16_t *name, |
148 | efi_guid_t *vendor, | 158 | efi_guid_t *vendor, |
149 | unsigned long attr, | 159 | u32 attr, |
150 | unsigned long data_size, | 160 | unsigned long data_size, |
151 | void *data) | 161 | void *data) |
152 | { | 162 | { |
@@ -155,6 +165,18 @@ static efi_status_t virt_efi_set_variable(efi_char16_t *name, | |||
155 | data_size, data); | 165 | data_size, data); |
156 | } | 166 | } |
157 | 167 | ||
168 | static efi_status_t virt_efi_query_variable_info(u32 attr, | ||
169 | u64 *storage_space, | ||
170 | u64 *remaining_space, | ||
171 | u64 *max_variable_size) | ||
172 | { | ||
173 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) | ||
174 | return EFI_UNSUPPORTED; | ||
175 | |||
176 | return efi_call_virt4(query_variable_info, attr, storage_space, | ||
177 | remaining_space, max_variable_size); | ||
178 | } | ||
179 | |||
158 | static efi_status_t virt_efi_get_next_high_mono_count(u32 *count) | 180 | static efi_status_t virt_efi_get_next_high_mono_count(u32 *count) |
159 | { | 181 | { |
160 | return efi_call_virt1(get_next_high_mono_count, count); | 182 | return efi_call_virt1(get_next_high_mono_count, count); |
@@ -169,6 +191,28 @@ static void virt_efi_reset_system(int reset_type, | |||
169 | data_size, data); | 191 | data_size, data); |
170 | } | 192 | } |
171 | 193 | ||
194 | static efi_status_t virt_efi_update_capsule(efi_capsule_header_t **capsules, | ||
195 | unsigned long count, | ||
196 | unsigned long sg_list) | ||
197 | { | ||
198 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) | ||
199 | return EFI_UNSUPPORTED; | ||
200 | |||
201 | return efi_call_virt3(update_capsule, capsules, count, sg_list); | ||
202 | } | ||
203 | |||
204 | static efi_status_t virt_efi_query_capsule_caps(efi_capsule_header_t **capsules, | ||
205 | unsigned long count, | ||
206 | u64 *max_size, | ||
207 | int *reset_type) | ||
208 | { | ||
209 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) | ||
210 | return EFI_UNSUPPORTED; | ||
211 | |||
212 | return efi_call_virt4(query_capsule_caps, capsules, count, max_size, | ||
213 | reset_type); | ||
214 | } | ||
215 | |||
172 | static efi_status_t __init phys_efi_set_virtual_address_map( | 216 | static efi_status_t __init phys_efi_set_virtual_address_map( |
173 | unsigned long memory_map_size, | 217 | unsigned long memory_map_size, |
174 | unsigned long descriptor_size, | 218 | unsigned long descriptor_size, |
@@ -696,6 +740,9 @@ void __init efi_enter_virtual_mode(void) | |||
696 | efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count; | 740 | efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count; |
697 | efi.reset_system = virt_efi_reset_system; | 741 | efi.reset_system = virt_efi_reset_system; |
698 | efi.set_virtual_address_map = NULL; | 742 | efi.set_virtual_address_map = NULL; |
743 | efi.query_variable_info = virt_efi_query_variable_info; | ||
744 | efi.update_capsule = virt_efi_update_capsule; | ||
745 | efi.query_capsule_caps = virt_efi_query_capsule_caps; | ||
699 | if (__supported_pte_mask & _PAGE_NX) | 746 | if (__supported_pte_mask & _PAGE_NX) |
700 | runtime_code_page_mkexec(); | 747 | runtime_code_page_mkexec(); |
701 | early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); | 748 | early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); |