+// SPDX-License-Identifier: GPL-2.0+
/*
* EFI utils
*
* Copyright (c) 2017 Rob Clark
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
/* free() the result */
static void *get_var(u16 *name, const efi_guid_t *vendor,
- unsigned long *size)
+ efi_uintn_t *size)
{
efi_guid_t *v = (efi_guid_t *)vendor;
efi_status_t ret;
void *buf = NULL;
*size = 0;
- EFI_CALL(ret = rs->get_variable((s16 *)name, v, NULL, size, buf));
+ EFI_CALL(ret = rs->get_variable(name, v, NULL, size, buf));
if (ret == EFI_BUFFER_TOO_SMALL) {
buf = malloc(*size);
- EFI_CALL(ret = rs->get_variable((s16 *)name, v, NULL, size, buf));
+ EFI_CALL(ret = rs->get_variable(name, v, NULL, size, buf));
}
if (ret != EFI_SUCCESS) {
u16 varname[] = L"Boot0000";
u16 hexmap[] = L"0123456789ABCDEF";
void *load_option, *image = NULL;
- unsigned long size;
+ efi_uintn_t size;
varname[4] = hexmap[(n & 0xf000) >> 12];
varname[5] = hexmap[(n & 0x0f00) >> 8];
if (lo.attributes & LOAD_OPTION_ACTIVE) {
efi_status_t ret;
- u16 *str = NULL;
- debug("%s: trying to load \"%ls\" from: %ls\n", __func__,
- lo.label, (str = efi_dp_str(lo.file_path)));
- efi_free_pool(str);
+ debug("%s: trying to load \"%ls\" from %pD\n",
+ __func__, lo.label, lo.file_path);
ret = efi_load_image_from_path(lo.file_path, &image);
struct efi_device_path **file_path)
{
uint16_t *bootorder;
- unsigned long size;
+ efi_uintn_t size;
void *image = NULL;
int i, num;