
On 1/21/19 4:10 AM, AKASHI Takahiro wrote:
The current GetNextVariableName() is a placeholder. With this patch, it works well as expected.
Signed-off-by: AKASHI Takahiro takahiro.akashi@linaro.org
lib/efi_loader/efi_variable.c | 154 +++++++++++++++++++++++++++++++++- 1 file changed, 152 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c index 19d9cb865f25..398680289df0 100644 --- a/lib/efi_loader/efi_variable.c +++ b/lib/efi_loader/efi_variable.c @@ -8,6 +8,9 @@ #include <malloc.h> #include <charset.h> #include <efi_loader.h> +#include <environment.h> +#include <search.h> +#include <uuid.h>
#define READ_ONLY BIT(31)
@@ -241,14 +244,161 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name, efi_guid_t *vendor, return EFI_EXIT(EFI_SUCCESS); }
-/* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#GetNextVariableN... */ +static char *efi_variables_list; +static char *efi_cur_variable;
+/**
- parse_uboot_variable() - parse a u-boot variable and get uefi-related
information
- @variable: whole data of u-boot variable (ie. name=value)
- @variable_name_size: size of variable_name buffer in byte
- @variable_name: name of uefi variable in u16, null-terminated
- @vendor: vendor's guid
- @attributes: attributes
- A uefi variable is encoded into a u-boot variable as described above.
- This function parses such a u-boot variable and retrieve uefi-related
- information into respective parameters. In return, variable_name_size
- is the size of variable name including NULL.
- Return: EFI_SUCCESS if parsing is OK, EFI_NOT_FOUND when
the entire variable list has been returned,
otherwise non-zero status code
- */
+static efi_status_t parse_uboot_variable(char *variable,
efi_uintn_t *variable_name_size,
u16 *variable_name,
efi_guid_t *vendor,
Make this
const efi_guid_t *vendor,
to avoid a build warning with current efi-next.
Please, rebase the patch on efi-next.
Reviewed-by: Heinrich Schuchardt xypron.glpk@gmx.de