efi_loader: adjust definitions of variable services
The definitons of the variable services are adjusted:
- use efi_uintn_t instead of unsigned long
- use u16 * instead of s16 * for Unicode strings
- correct definition of QueryVariableInfo
- rename efi_get_next_variable to efi_get_next_variable_name
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
index 7e0e7f0..64cf981 100644
--- a/lib/efi_loader/efi_variable.c
+++ b/lib/efi_loader/efi_variable.c
@@ -113,8 +113,8 @@
return hexstr;
}
-static efi_status_t efi_to_native(char *native, s16 *variable_name,
- efi_guid_t *vendor)
+static efi_status_t efi_to_native(char *native, u16 *variable_name,
+ efi_guid_t *vendor)
{
size_t len;
@@ -176,9 +176,9 @@
}
/* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#GetVariable.28.29 */
-efi_status_t EFIAPI efi_get_variable(s16 *variable_name,
- efi_guid_t *vendor, u32 *attributes,
- unsigned long *data_size, void *data)
+efi_status_t EFIAPI efi_get_variable(u16 *variable_name, efi_guid_t *vendor,
+ u32 *attributes, efi_uintn_t *data_size,
+ void *data)
{
char native_name[MAX_NATIVE_VAR_NAME + 1];
efi_status_t ret;
@@ -250,9 +250,9 @@
}
/* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#GetNextVariableName.28.29 */
-efi_status_t EFIAPI efi_get_next_variable(
- unsigned long *variable_name_size,
- s16 *variable_name, efi_guid_t *vendor)
+efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
+ u16 *variable_name,
+ efi_guid_t *vendor)
{
EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, vendor);
@@ -260,16 +260,16 @@
}
/* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#SetVariable.28.29 */
-efi_status_t EFIAPI efi_set_variable(s16 *variable_name,
- efi_guid_t *vendor, u32 attributes,
- unsigned long data_size, void *data)
+efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor,
+ u32 attributes, efi_uintn_t data_size,
+ void *data)
{
char native_name[MAX_NATIVE_VAR_NAME + 1];
efi_status_t ret = EFI_SUCCESS;
char *val, *s;
u32 attr;
- EFI_ENTRY("\"%ls\" %pUl %x %lu %p", variable_name, vendor, attributes,
+ EFI_ENTRY("\"%ls\" %pUl %x %zu %p", variable_name, vendor, attributes,
data_size, data);
if (!variable_name || !vendor)