efi: stub: Pass EFI system table address to U-Boot payload
[oweals/u-boot.git] / lib / efi / efi_stub.c
index 1b495ec81b296601794be376f842522c945bd572..12e3d637ddaab3974c1e502021fa62d22bd8bb28 100644 (file)
@@ -277,6 +277,7 @@ efi_status_t EFIAPI efi_main(efi_handle_t image,
        struct efi_entry_memmap map;
        struct efi_gop *gop;
        struct efi_entry_gopmode mode;
+       struct efi_entry_systable table;
        efi_guid_t efi_gop_guid = EFI_GOP_GUID;
        efi_uintn_t key, desc_size, size;
        efi_status_t ret;
@@ -335,6 +336,9 @@ efi_status_t EFIAPI efi_main(efi_handle_t image,
                return ret;
        }
 
+       table.sys_table = (ulong)sys_table;
+       add_entry_addr(priv, EFIET_SYS_TABLE, &table, sizeof(table), NULL, 0);
+
        ret = boot->exit_boot_services(image, key);
        if (ret) {
                /*