]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c
IntelFrameworkModulePkg/KeyboardDxe: Use macro to enable/disable page 0
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / BiosThunk / KeyboardDxe / BiosKeyboard.c
index 742d00982f5cc3fe1f435282c7ca8bc15d3722f5..ec525891dc7a5659af89d1151a008ee1cc84fd4f 100644 (file)
@@ -1842,8 +1842,10 @@ BiosKeyboardTimerHandler (
   //\r
   // Clear the CTRL and ALT BDA flag\r
   //\r
-  KbFlag1 = *((UINT8 *) (UINTN) 0x417);  // read the STATUS FLAGS 1\r
-  KbFlag2 = *((UINT8 *) (UINTN) 0x418); // read STATUS FLAGS 2\r
+  ACCESS_PAGE0_CODE (\r
+    KbFlag1 = *((UINT8 *) (UINTN) 0x417); // read the STATUS FLAGS 1\r
+    KbFlag2 = *((UINT8 *) (UINTN) 0x418); // read STATUS FLAGS 2\r
+  );\r
 \r
   DEBUG_CODE (\r
     {\r
@@ -1911,11 +1913,12 @@ BiosKeyboardTimerHandler (
   //\r
   // Clear left alt and left ctrl BDA flag\r
   //\r
-  KbFlag2 &= ~(KB_LEFT_ALT_PRESSED | KB_LEFT_CTRL_PRESSED);\r
-  *((UINT8 *) (UINTN) 0x418) = KbFlag2;\r
-  KbFlag1 &= ~0x0C;                      \r
-  *((UINT8 *) (UINTN) 0x417) = KbFlag1; \r
-\r
+  ACCESS_PAGE0_CODE (\r
+    KbFlag2 &= ~(KB_LEFT_ALT_PRESSED | KB_LEFT_CTRL_PRESSED);\r
+    *((UINT8 *) (UINTN) 0x418) = KbFlag2;\r
+    KbFlag1 &= ~0x0C;\r
+    *((UINT8 *) (UINTN) 0x417) = KbFlag1;\r
+  );\r
   \r
   //\r
   // Output EFI input key and shift/toggle state\r
@@ -2313,17 +2316,20 @@ Exit:
 \r
   @param  This                    Protocol instance pointer.\r
   @param  KeyData                 A pointer to a buffer that is filled in with the keystroke \r
-                                  information data for the key that was pressed.\r
+                                  information data for the key that was pressed. If KeyData.Key,\r
+                                  KeyData.KeyState.KeyToggleState and KeyData.KeyState.KeyShiftState\r
+                                  are 0, then any incomplete keystroke will trigger a notification of\r
+                                  the KeyNotificationFunction.\r
   @param  KeyNotificationFunction Points to the function to be called when the key \r
-                                  sequence is typed specified by KeyData.                        \r
-  @param  NotifyHandle            Points to the unique handle assigned to the registered notification.                          \r
+                                  sequence is typed specified by KeyData. This notification function\r
+                                  should be called at <=TPL_CALLBACK.\r
+  @param  NotifyHandle            Points to the unique handle assigned to the registered notification.\r
 \r
-  \r
   @retval EFI_SUCCESS             The notification function was registered successfully.\r
   @retval EFI_OUT_OF_RESOURCES    Unable to allocate resources for necesssary data structures.\r
   @retval EFI_INVALID_PARAMETER   KeyData or NotifyHandle is NULL.\r
-                                                  \r
-**/   \r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 BiosKeyboardRegisterKeyNotify (\r