Subversion Repositories HelenOS

Rev

Rev 2726 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  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. }
  33.