]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
Change the EFI_BOOT_KEY_DATA definition to use macro instead of bit fields.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Hotkey.c
index d3bb1ef47890b95522de36eb26741d581a1b5c1b..55b615d6d25537c96f8baa32ed4d0847d9a3a470 100644 (file)
@@ -101,7 +101,7 @@ RegisterHotkey (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  KeyOptionSize = sizeof (EFI_KEY_OPTION) + KeyOption->KeyData.Options.InputKeyCount * sizeof (EFI_INPUT_KEY);\r
+  KeyOptionSize = sizeof (EFI_KEY_OPTION) + KEY_OPTION_INPUT_KEY_COUNT (KeyOption) * sizeof (EFI_INPUT_KEY);\r
   UpdateBootOption = FALSE;\r
 \r
   //\r
@@ -143,9 +143,8 @@ RegisterHotkey (
       return EFI_SUCCESS;\r
     }\r
 \r
-    if (KeyOption->KeyData.PackedValue == TempOption->KeyData.PackedValue) {\r
-      if (KeyOption->KeyData.Options.InputKeyCount == 0 ||\r
-          CompareMem (\r
+    if (KeyOption->KeyData == TempOption->KeyData) {\r
+      if (CompareMem (\r
             ((UINT8 *) TempOption) + sizeof (EFI_KEY_OPTION),\r
             ((UINT8 *) KeyOption) + sizeof (EFI_KEY_OPTION),\r
             KeyOptionSize - sizeof (EFI_KEY_OPTION)\r
@@ -551,7 +550,6 @@ HotkeyInsertList (
   BDS_HOTKEY_OPTION  *HotkeyLeft;\r
   BDS_HOTKEY_OPTION  *HotkeyRight;\r
   UINTN              Index;\r
-  EFI_BOOT_KEY_DATA  KeyOptions;\r
   UINT32             KeyShiftStateLeft;\r
   UINT32             KeyShiftStateRight;\r
   EFI_INPUT_KEY      *InputKey;\r
@@ -564,35 +562,31 @@ HotkeyInsertList (
 \r
   HotkeyLeft->Signature = BDS_HOTKEY_OPTION_SIGNATURE;\r
   HotkeyLeft->BootOptionNumber = KeyOption->BootOption;\r
-\r
-  KeyOptions = KeyOption->KeyData;\r
-\r
-  HotkeyLeft->CodeCount = (UINT8) KeyOptions.Options.InputKeyCount;\r
+  HotkeyLeft->CodeCount = (UINT8) KEY_OPTION_INPUT_KEY_COUNT (KeyOption);\r
 \r
   //\r
   // Map key shift state from KeyOptions to EFI_KEY_DATA.KeyState\r
   //\r
   KeyShiftStateRight = EFI_SHIFT_STATE_VALID;\r
-  if (KeyOptions.Options.ShiftPressed) {\r
+  if (KEY_OPTION_SHIFT_PRESSED (KeyOption)) {\r
     KeyShiftStateRight |= EFI_RIGHT_SHIFT_PRESSED;\r
   }\r
-  if (KeyOptions.Options.ControlPressed) {\r
+  if (KEY_OPTION_CONTROL_PRESSED (KeyOption)) {\r
     KeyShiftStateRight |= EFI_RIGHT_CONTROL_PRESSED;\r
   }\r
-  if (KeyOptions.Options.AltPressed) {\r
+  if (KEY_OPTION_ALT_PRESSED (KeyOption)) {\r
     KeyShiftStateRight |= EFI_RIGHT_ALT_PRESSED;\r
   }\r
-  if (KeyOptions.Options.LogoPressed) {\r
+  if (KEY_OPTION_LOGO_PRESSED (KeyOption)) {\r
     KeyShiftStateRight |= EFI_RIGHT_LOGO_PRESSED;\r
   }\r
-  if (KeyOptions.Options.MenuPressed) {\r
+  if (KEY_OPTION_MENU_PRESSED (KeyOption)) {\r
     KeyShiftStateRight |= EFI_MENU_KEY_PRESSED;\r
   }\r
-  if (KeyOptions.Options.SysReqPressed) {\r
+  if (KEY_OPTION_SYS_REQ_PRESSED (KeyOption)) {\r
     KeyShiftStateRight |= EFI_SYS_REQ_PRESSED;\r
   }\r
 \r
-\r
   KeyShiftStateLeft = (KeyShiftStateRight & 0xffffff00) | ((KeyShiftStateRight & 0xff) << 1);\r
 \r
   InputKey = (EFI_INPUT_KEY *) (((UINT8 *) KeyOption) + sizeof (EFI_KEY_OPTION));\r