diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-07-29 09:49:04 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2018-08-20 14:43:12 +0200 |
commit | a39f39cdd8be5cd3e7a8b696a463b621e3d827e0 (patch) | |
tree | c56fdf1df31c2b16e8f8f6c8b85728a83bbb9530 /lib/efi_loader/efi_runtime.c | |
parent | 483dbab9f9318149e5ea97daacbfae320f53e35a (diff) |
efi_loader: update runtime services table crc32
The crc32 of the runtime services table must be updated after detaching.
efi_update_table_header_crc32() must be __efi_runtime. So move it to
efi_runtime.c
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader/efi_runtime.c')
-rw-r--r-- | lib/efi_loader/efi_runtime.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index 45b7809dec..633e4cc3e5 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -84,6 +84,18 @@ struct elf_rela { * handle a good number of runtime callbacks */ +/** + * efi_update_table_header_crc32() - Update crc32 in table header + * + * @table: EFI table + */ +void __efi_runtime efi_update_table_header_crc32(struct efi_table_hdr *table) +{ + table->crc32 = 0; + table->crc32 = crc32(0, (const unsigned char *)table, + table->headersize); +} + static void EFIAPI efi_reset_system_boottime( enum efi_reset_type reset_type, efi_status_t reset_status, @@ -273,6 +285,9 @@ static void efi_runtime_detach(ulong offset) debug("%s: Setting %p to %lx\n", __func__, p, newaddr); *p = newaddr; } + + /* Update crc32 */ + efi_update_table_header_crc32(&efi_runtime_services.hdr); } /* Relocate EFI runtime to uboot_reloc_base = offset */ |