]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
Rollback the change to EFI_BOOT_KEY_DATA structure since UEFI Spec adds the clarifica...
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / Bcfg.c
index 73831d267e1cbf249ef9760e94351ee90c01d6b7..b19d8d9fb8490d6c47277e864a4bdea5bba16de2 100644 (file)
@@ -47,16 +47,6 @@ typedef struct {
   CONST CHAR16          *OptData;\r
 } BGFG_OPERATION;\r
 \r
-/**\r
-  Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.\r
-\r
-  @param   KeyOption  Pointer to the EFI_KEY_OPTION structure. \r
-\r
-  @return  Actual number of entries in EFI_KEY_OPTION.Keys.\r
-**/\r
-#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) \\r
-  (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))\r
-\r
 /**\r
   Update the optional data for a boot or driver option.\r
 \r
@@ -843,7 +833,7 @@ BcfgAddOptDebug1(
           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Walker);\r
           ShellStatus = SHELL_INVALID_PARAMETER;\r
         }\r
-        NewKeyOption.KeyData = (UINT32)Intermediate;\r
+        NewKeyOption.KeyData.PackedValue = (UINT32)Intermediate;\r
         Temp = StrStr(Walker, L" ");\r
         if (Temp != NULL) {\r
           Walker = Temp;\r
@@ -858,13 +848,13 @@ BcfgAddOptDebug1(
         // Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct.  \r
         // Re-allocate with the added information.\r
         //\r
-        KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)), &NewKeyOption);\r
+        KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * NewKeyOption.KeyData.Options.InputKeyCount), &NewKeyOption);\r
         if (KeyOptionBuffer == NULL) {\r
           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellDebug1HiiHandle);\r
           ShellStatus = SHELL_OUT_OF_RESOURCES;\r
         }\r
       }\r
-      for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption); LoopCounter++) {\r
+      for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < NewKeyOption.KeyData.Options.InputKeyCount; LoopCounter++) {\r
         //\r
         // ScanCode\r
         //\r
@@ -930,7 +920,7 @@ BcfgAddOptDebug1(
           VariableName,\r
           (EFI_GUID*)&gEfiGlobalVariableGuid,\r
           EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,\r
-          sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)),\r
+          sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * NewKeyOption.KeyData.Options.InputKeyCount),\r
           KeyOptionBuffer);\r
         if (EFI_ERROR(Status)) {\r
           ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellDebug1HiiHandle, VariableName, Status);\r