Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/libefi/env.c
Show All 29 Lines | |||||
#include <stand.h> | #include <stand.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <efi.h> | #include <efi.h> | ||||
#include <efilib.h> | #include <efilib.h> | ||||
#include <uuid.h> | #include <uuid.h> | ||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include "bootstrap.h" | #include "bootstrap.h" | ||||
/* | |||||
* Simple wrappers to the underlying UEFI functions. | |||||
* See http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES | |||||
* for details. | |||||
*/ | |||||
EFI_STATUS | |||||
efi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, | |||||
EFI_GUID *vendor_guid) | |||||
{ | |||||
return (RS->GetNextVariableName(variable_name_size, variable_name, | |||||
vendor_guid)); | |||||
} | |||||
EFI_STATUS | |||||
efi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, | |||||
UINT32 *attributes, UINTN *data_size, void *data) | |||||
{ | |||||
return (RS->GetVariable(variable_name, vendor_guid, attributes, | |||||
data_size, data)); | |||||
} | |||||
EFI_STATUS | |||||
efi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, | |||||
UINT32 attributes, UINTN data_size, void *data) | |||||
{ | |||||
return (RS->SetVariable(variable_name, vendor_guid, attributes, | |||||
data_size, data)); | |||||
} | |||||
void | void | ||||
efi_init_environment(void) | efi_init_environment(void) | ||||
{ | { | ||||
char var[128]; | char var[128]; | ||||
snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16, | snprintf(var, sizeof(var), "%d.%02d", ST->Hdr.Revision >> 16, | ||||
ST->Hdr.Revision & 0xffff); | ST->Hdr.Revision & 0xffff); | ||||
env_setenv("efi-version", EV_VOLATILE, var, env_noset, env_nounset); | env_setenv("efi-version", EV_VOLATILE, var, env_noset, env_nounset); | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |