efi_loader: Enable run-time variable support for tee based variables
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Thu, 23 Jul 2020 12:49:49 +0000 (15:49 +0300)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 1 Aug 2020 09:57:41 +0000 (11:57 +0200)
commite01aed47d6a0e4d99e886d80b885fe0898850357
tree718e81bb971d7211e89604cbe4c95cd44c53760a
parentdb94dfbd525943b1bf4ecda81477cedfe70fc50e
efi_loader: Enable run-time variable support for tee based variables

We recently added functions for storing/restoring variables
from a file to a memory backed buffer marked as __efi_runtime_data
commit f1f990a8c958 ("efi_loader: memory buffer for variables")
commit 5f7dcf079de8 ("efi_loader: UEFI variable persistence")

Using the same idea we now can support GetVariable() and GetNextVariable()
on the OP-TEE based variables as well.

So let's re-arrange the code a bit and move the commmon code for
accessing variables out of efi_variable.c. Create common functions for
reading variables from memory that both implementations can use on
run-time. Then just use those functions in the run-time variants of the
OP-TEE based EFI variable implementation and initialize the memory
buffer on ExitBootServices()

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
include/efi_variable.h
lib/efi_loader/Makefile
lib/efi_loader/efi_var_common.c
lib/efi_loader/efi_var_file.c
lib/efi_loader/efi_var_mem.c
lib/efi_loader/efi_variable.c
lib/efi_loader/efi_variable_tee.c