aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi
diff options
context:
space:
mode:
authorRoy Franz <roy.franz@linaro.org>2013-09-22 18:45:36 -0400
committerMatt Fleming <matt.fleming@intel.com>2013-09-25 07:34:40 -0400
commit1c089c65f54b70261fdcb4c238986a979c11fad7 (patch)
treeec104c4f5e2589b6c8cb570b9636431b5a9ec3db /drivers/firmware/efi
parent86cc653b1955c0a47681d16457f9ee9009f2561a (diff)
efi: generalize efi_get_memory_map()
Add arguments for returning the descriptor version and also the memory map key. The key is required for calling exit_boot_services(). Signed-off-by: Roy Franz <roy.franz@linaro.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware/efi')
-rw-r--r--drivers/firmware/efi/efi-stub-helper.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/firmware/efi/efi-stub-helper.c b/drivers/firmware/efi/efi-stub-helper.c
index 561b9cf7745f..b314bf720272 100644
--- a/drivers/firmware/efi/efi-stub-helper.c
+++ b/drivers/firmware/efi/efi-stub-helper.c
@@ -49,7 +49,9 @@ static void efi_printk(efi_system_table_t *sys_table_arg, char *str)
49static efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg, 49static efi_status_t efi_get_memory_map(efi_system_table_t *sys_table_arg,
50 efi_memory_desc_t **map, 50 efi_memory_desc_t **map,
51 unsigned long *map_size, 51 unsigned long *map_size,
52 unsigned long *desc_size) 52 unsigned long *desc_size,
53 u32 *desc_ver,
54 unsigned long *key_ptr)
53{ 55{
54 efi_memory_desc_t *m = NULL; 56 efi_memory_desc_t *m = NULL;
55 efi_status_t status; 57 efi_status_t status;
@@ -77,6 +79,10 @@ again:
77 79
78 if (status != EFI_SUCCESS) 80 if (status != EFI_SUCCESS)
79 efi_call_phys1(sys_table_arg->boottime->free_pool, m); 81 efi_call_phys1(sys_table_arg->boottime->free_pool, m);
82 if (key_ptr && status == EFI_SUCCESS)
83 *key_ptr = key;
84 if (desc_ver && status == EFI_SUCCESS)
85 *desc_ver = desc_version;
80 86
81fail: 87fail:
82 *map = m; 88 *map = m;
@@ -97,7 +103,8 @@ static efi_status_t efi_high_alloc(efi_system_table_t *sys_table_arg,
97 u64 max_addr = 0; 103 u64 max_addr = 0;
98 int i; 104 int i;
99 105
100 status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size); 106 status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size,
107 NULL, NULL);
101 if (status != EFI_SUCCESS) 108 if (status != EFI_SUCCESS)
102 goto fail; 109 goto fail;
103 110
@@ -183,7 +190,8 @@ static efi_status_t efi_low_alloc(efi_system_table_t *sys_table_arg,
183 unsigned long nr_pages; 190 unsigned long nr_pages;
184 int i; 191 int i;
185 192
186 status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size); 193 status = efi_get_memory_map(sys_table_arg, &map, &map_size, &desc_size,
194 NULL, NULL);
187 if (status != EFI_SUCCESS) 195 if (status != EFI_SUCCESS)
188 goto fail; 196 goto fail;
189 197