Subversion Repositories HelenOS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2726 vana 1
#include <efi.h>
2
#include <efilib.h>
3
 
4
EFI_STATUS
5
efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
6
{
7
    EFI_STATUS status;
8
    CHAR16 name[256], *val, fmt[20];
9
    EFI_GUID vendor;
10
    UINTN size;
11
 
12
    InitializeLib(image, systab);
13
 
14
    name[0] = 0;
15
    vendor = NullGuid;
16
 
17
    Print(L"GUID                                Variable Name        Value\n");
18
    Print(L"=================================== ==================== ========\n");
19
 
20
    StrCpy(fmt, L"%.-35g %.-20s %s\n");
21
    while (1) {
22
        size = sizeof(name);
23
        status = RT->GetNextVariableName(&size, name, &vendor);
24
        if (status != EFI_SUCCESS)
25
            break;
26
 
27
        val = LibGetVariable(name, &vendor);
28
        Print(fmt, &vendor, name, val);
29
        FreePool(val);
30
    }
31
    return EFI_SUCCESS;
32
}