summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_runtime.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-10-01 08:48:38 -0400
committerTom Rini <trini@konsulko.com>2017-10-01 08:48:38 -0400
commit958046fc78f95a3d28b06980a7eb3ed80123c533 (patch)
treeebae5f10fae8263315d42b6513734e9ceb32bd41 /lib/efi_loader/efi_runtime.c
parent6ca43a58db61aea8ca2ebec4003bb6cfacf81d46 (diff)
parent7dd5d44753969167a6059405635bdb8b9d961fa1 (diff)
downloadu-boot-958046fc78f95a3d28b06980a7eb3ed80123c533.tar.gz
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Patch queue for efi - 2017-10-01 Lots of new things this time. High level highlights are: - Shim support (to boot Fedora) - Initial set of unit tests - Preparations to support UEFI Shell
Diffstat (limited to 'lib/efi_loader/efi_runtime.c')
-rw-r--r--lib/efi_loader/efi_runtime.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index ad7f3754bd..8104e08c46 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -184,7 +184,16 @@ static const struct efi_runtime_detach_list_struct efi_runtime_detach_list[] = {
/* Clean up system table */
.ptr = &systab.boottime,
.patchto = NULL,
- },
+ }, {
+ .ptr = &efi_runtime_services.get_variable,
+ .patchto = &efi_device_error,
+ }, {
+ .ptr = &efi_runtime_services.get_next_variable,
+ .patchto = &efi_device_error,
+ }, {
+ .ptr = &efi_runtime_services.set_variable,
+ .patchto = &efi_device_error,
+ }
};
static bool efi_runtime_tobedetached(void *p)
@@ -243,7 +252,8 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
/* Check if the relocation is inside bounds */
if (map && ((newaddr < map->virtual_start) ||
- newaddr > (map->virtual_start + (map->num_pages << 12)))) {
+ newaddr > (map->virtual_start +
+ (map->num_pages << EFI_PAGE_SHIFT)))) {
if (!efi_runtime_tobedetached(p))
printf("U-Boot EFI: Relocation at %p is out of "
"range (%lx)\n", p, newaddr);
@@ -269,7 +279,8 @@ static efi_status_t EFIAPI efi_set_virtual_address_map(
uint32_t descriptor_version,
struct efi_mem_desc *virtmap)
{
- ulong runtime_start = (ulong)&__efi_runtime_start & ~0xfffULL;
+ ulong runtime_start = (ulong)&__efi_runtime_start &
+ ~(ulong)EFI_PAGE_MASK;
int n = memory_map_size / descriptor_size;
int i;
@@ -382,9 +393,9 @@ struct efi_runtime_services __efi_runtime_data efi_runtime_services = {
.set_wakeup_time = (void *)&efi_unimplemented,
.set_virtual_address_map = &efi_set_virtual_address_map,
.convert_pointer = (void *)&efi_invalid_parameter,
- .get_variable = (void *)&efi_device_error,
- .get_next_variable = (void *)&efi_device_error,
- .set_variable = (void *)&efi_device_error,
+ .get_variable = efi_get_variable,
+ .get_next_variable = efi_get_next_variable,
+ .set_variable = efi_set_variable,
.get_next_high_mono_count = (void *)&efi_device_error,
.reset_system = &efi_reset_system_boottime,
};