From: Heinrich Schuchardt Date: Thu, 23 Jul 2020 17:55:39 +0200 Subject: [PATCH v2] efi_loader: Enable run-time variable support for tee based variables In-Reply-To: <20200723124949.762219-1-ilias.apalodimas@linaro.org> References: <20200723124949.762219-1-ilias.apalodimas@linaro.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 23.07.20 14:49, Ilias Apalodimas wrote: > 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 I will reformat comments in get_max_payload() exceeding 80 columns when merging. Reviewed-by: Heinrich Schuchardt