summaryrefslogtreecommitdiff
path: root/edk2/IntelFrameworkModulePkg
diff options
context:
space:
mode:
Diffstat (limited to 'edk2/IntelFrameworkModulePkg')
-rw-r--r--edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c192
-rw-r--r--edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c20
-rw-r--r--edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf3
-rw-r--r--edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c250
-rw-r--r--edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf5
-rw-r--r--edk2/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec10
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3Save.c2
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h3
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf2
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c52
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c18
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c389
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h37
13 files changed, 446 insertions, 537 deletions
diff --git a/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c b/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index 4ad80c17c..2a20b789a 100644
--- a/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1519,16 +1519,18 @@ InitKeyboard (
// Perform a read to cleanup the Status Register's
// output buffer full bits within MAX TRY times
//
- while (!EFI_ERROR (Status) && TryTime < KEYBOARD_MAX_TRY) {
- Status = KeyboardRead (ConsoleIn, &CommandByte);
- TryTime ++;
- }
- //
- // Exceed the max try times. The device may be error.
- //
- if (TryTime == KEYBOARD_MAX_TRY) {
- Status = EFI_DEVICE_ERROR;
- goto Done;
+ if ((KeyReadStatusRegister (ConsoleIn) & KEYBOARD_STATUS_REGISTER_HAS_OUTPUT_DATA) != 0) {
+ while (!EFI_ERROR (Status) && TryTime < KEYBOARD_MAX_TRY) {
+ Status = KeyboardRead (ConsoleIn, &CommandByte);
+ TryTime ++;
+ }
+ //
+ // Exceed the max try times. The device may be error.
+ //
+ if (TryTime == KEYBOARD_MAX_TRY) {
+ Status = EFI_DEVICE_ERROR;
+ goto Done;
+ }
}
//
// We should disable mouse interface during the initialization process
@@ -1543,34 +1545,37 @@ InitKeyboard (
// time initialization
//
if ((KeyReadStatusRegister (ConsoleIn) & KEYBOARD_STATUS_REGISTER_SYSTEM_FLAG) != 0) {
- //
- // 8042 controller is already setup (by myself or by mouse driver):
- // See whether mouse interface is already enabled
- // which determines whether we should enable it later
- //
- //
- // Read the command byte of 8042 controller
- //
- Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_READ);
- if (EFI_ERROR (Status)) {
- KeyboardError (ConsoleIn, L"\n\r");
- goto Done;
- }
-
- Status = KeyboardRead (ConsoleIn, &CommandByte);
- if (EFI_ERROR (Status)) {
- KeyboardError (ConsoleIn, L"\n\r");
- goto Done;
- }
- //
- // Test the mouse enabling bit
- //
- if ((CommandByte & 0x20) != 0) {
- mEnableMouseInterface = FALSE;
+ if (!PcdGetBool (PcdFastPS2Detection)) {
+ //
+ // 8042 controller is already setup (by myself or by mouse driver):
+ // See whether mouse interface is already enabled
+ // which determines whether we should enable it later
+ //
+ //
+ // Read the command byte of 8042 controller
+ //
+ Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_READ);
+ if (EFI_ERROR (Status)) {
+ KeyboardError (ConsoleIn, L"\n\r");
+ goto Done;
+ }
+
+ Status = KeyboardRead (ConsoleIn, &CommandByte);
+ if (EFI_ERROR (Status)) {
+ KeyboardError (ConsoleIn, L"\n\r");
+ goto Done;
+ }
+ //
+ // Test the mouse enabling bit
+ //
+ if ((CommandByte & 0x20) != 0) {
+ mEnableMouseInterface = FALSE;
+ } else {
+ mEnableMouseInterface = TRUE;
+ }
} else {
- mEnableMouseInterface = TRUE;
- }
-
+ mEnableMouseInterface = FALSE;
+ }
} else {
//
// 8042 controller is not setup yet:
@@ -1580,36 +1585,38 @@ InitKeyboard (
//
// Disable keyboard and mouse interfaces
//
- Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE);
- if (EFI_ERROR (Status)) {
- KeyboardError (ConsoleIn, L"\n\r");
- goto Done;
- }
-
- Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_MOUSE_INTERFACE);
- if (EFI_ERROR (Status)) {
- KeyboardError (ConsoleIn, L"\n\r");
- goto Done;
- }
-
- REPORT_STATUS_CODE_WITH_DEVICE_PATH (
- EFI_PROGRESS_CODE,
- EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_SELF_TEST,
- ConsoleIn->DevicePath
- );
- //
- // 8042 Controller Self Test
- //
- Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_CONTROLLER_SELF_TEST);
- if (EFI_ERROR (Status)) {
- KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r");
- goto Done;
- }
-
- Status = KeyboardWaitForValue (ConsoleIn, 0x55);
- if (EFI_ERROR (Status)) {
- KeyboardError (ConsoleIn, L"8042 controller self test failed!\n\r");
- goto Done;
+ if (!PcdGetBool (PcdFastPS2Detection)) {
+ Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE);
+ if (EFI_ERROR (Status)) {
+ KeyboardError (ConsoleIn, L"\n\r");
+ goto Done;
+ }
+
+ Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_DISABLE_MOUSE_INTERFACE);
+ if (EFI_ERROR (Status)) {
+ KeyboardError (ConsoleIn, L"\n\r");
+ goto Done;
+ }
+
+ REPORT_STATUS_CODE_WITH_DEVICE_PATH (
+ EFI_PROGRESS_CODE,
+ EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_SELF_TEST,
+ ConsoleIn->DevicePath
+ );
+ //
+ // 8042 Controller Self Test
+ //
+ Status = KeyboardCommand (ConsoleIn, KEYBOARD_8042_COMMAND_CONTROLLER_SELF_TEST);
+ if (EFI_ERROR (Status)) {
+ KeyboardError (ConsoleIn, L"8042 controller command write error!\n\r");
+ goto Done;
+ }
+
+ Status = KeyboardWaitForValue (ConsoleIn, 0x55);
+ if (EFI_ERROR (Status)) {
+ KeyboardError (ConsoleIn, L"8042 controller self test failed!\n\r");
+ goto Done;
+ }
}
//
// Don't enable mouse interface later
@@ -1865,34 +1872,37 @@ CheckKeyboardConnect (
EFI_STATUS Status;
UINTN WaitForValueTimeOutBcakup;
- Status = EFI_SUCCESS;
//
// enable keyboard itself and wait for its ack
// If can't receive ack, Keyboard should not be connected.
//
- Status = KeyboardWrite (
- ConsoleIn,
- KEYBOARD_KBEN
- );
-
- if (EFI_ERROR (Status)) {
- return FALSE;
- }
- //
- // wait for 1s
- //
- WaitForValueTimeOutBcakup = mWaitForValueTimeOut;
- mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT;
- Status = KeyboardWaitForValue (
- ConsoleIn,
- KEYBOARD_CMDECHO_ACK
- );
- mWaitForValueTimeOut = WaitForValueTimeOutBcakup;
-
- if (EFI_ERROR (Status)) {
- return FALSE;
+ if (!PcdGetBool (PcdFastPS2Detection)) {
+ Status = KeyboardWrite (
+ ConsoleIn,
+ KEYBOARD_KBEN
+ );
+
+ if (EFI_ERROR (Status)) {
+ return FALSE;
+ }
+ //
+ // wait for 1s
+ //
+ WaitForValueTimeOutBcakup = mWaitForValueTimeOut;
+ mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT;
+ Status = KeyboardWaitForValue (
+ ConsoleIn,
+ KEYBOARD_CMDECHO_ACK
+ );
+ mWaitForValueTimeOut = WaitForValueTimeOutBcakup;
+
+ if (EFI_ERROR (Status)) {
+ return FALSE;
+ }
+
+ return TRUE;
+ } else {
+ return TRUE;
}
-
- return TRUE;
}
diff --git a/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c b/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
index c73cf9361..4f8799087 100644
--- a/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
+++ b/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.c
@@ -263,15 +263,17 @@ KbdControllerDriverStart (
//
// Return code is ignored on purpose.
//
- KeyboardRead (ConsoleIn, &Data);
- if ((KeyReadStatusRegister (ConsoleIn) & (KBC_PARE | KBC_TIM)) == (KBC_PARE | KBC_TIM)) {
- //
- // If nobody decodes KBC I/O port, it will read back as 0xFF.
- // Check the Time-Out and Parity bit to see if it has an active KBC in system
- //
- Status = EFI_DEVICE_ERROR;
- StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED;
- goto ErrorExit;
+ if (!PcdGetBool (PcdFastPS2Detection)) {
+ KeyboardRead (ConsoleIn, &Data);
+ if ((KeyReadStatusRegister (ConsoleIn) & (KBC_PARE | KBC_TIM)) == (KBC_PARE | KBC_TIM)) {
+ //
+ // If nobody decodes KBC I/O port, it will read back as 0xFF.
+ // Check the Time-Out and Parity bit to see if it has an active KBC in system
+ //
+ Status = EFI_DEVICE_ERROR;
+ StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED;
+ goto ErrorExit;
+ }
}
//
diff --git a/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf b/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
index 61fd036c3..f2cc8b006 100644
--- a/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
+++ b/edk2/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf
@@ -68,6 +68,9 @@
[FeaturePcd]
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPs2KbdExtendedVerification
+[Pcd]
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFastPS2Detection
+
# [Event]
# ##
# # Event will be signaled for WaitForKey event.
diff --git a/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c b/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c
index 3f0f9b699..4ee20df1f 100644
--- a/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c
+++ b/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c
@@ -1037,95 +1037,96 @@ BiosKeyboardReset (
// if not skip step 4&5 and jump to step 6 to selftest KBC and report this
// else go step 4
//
- if ((KeyReadStatusRegister (BiosKeyboardPrivate) & KBC_STSREG_VIA64_SYSF) != 0) {
- //
- // 4
- // CheckMouseStatus to decide enable it later or not
- //
- //
- // Read the command byte of KBC
- //
- Status = KeyboardCommand (
- BiosKeyboardPrivate,
- KBC_CMDREG_VIA64_CMDBYTE_R
- );
-
- if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Exit;
- }
-
- Status = KeyboardRead (
- BiosKeyboardPrivate,
- &CommandByte
- );
-
- if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Exit;
- }
- //
- // Check mouse enabled or not before
- //
- if ((CommandByte & KB_CMMBYTE_DISABLE_AUX) != 0) {
- MouseEnable = FALSE;
+ if (!PcdGetBool (PcdFastPS2Detection)) {
+ if ((KeyReadStatusRegister (BiosKeyboardPrivate) & KBC_STSREG_VIA64_SYSF) != 0) {
+ //
+ // 4
+ // CheckMouseStatus to decide enable it later or not
+ //
+ //
+ // Read the command byte of KBC
+ //
+ Status = KeyboardCommand (
+ BiosKeyboardPrivate,
+ KBC_CMDREG_VIA64_CMDBYTE_R
+ );
+
+ if (EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ goto Exit;
+ }
+
+ Status = KeyboardRead (
+ BiosKeyboardPrivate,
+ &CommandByte
+ );
+
+ if (EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ goto Exit;
+ }
+ //
+ // Check mouse enabled or not before
+ //
+ if ((CommandByte & KB_CMMBYTE_DISABLE_AUX) != 0) {
+ MouseEnable = FALSE;
+ } else {
+ MouseEnable = TRUE;
+ }
+ //
+ // 5
+ // disable mouse (via KBC) and Keyborad device
+ //
+ Status = KeyboardCommand (
+ BiosKeyboardPrivate,
+ KBC_CMDREG_VIA64_AUX_DISABLE
+ );
+
+ if (EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ goto Exit;
+ }
+
+ Status = KeyboardCommand (
+ BiosKeyboardPrivate,
+ KBC_CMDREG_VIA64_KB_DISABLE
+ );
+
+ if (EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ goto Exit;
+ }
} else {
- MouseEnable = TRUE;
- }
- //
- // 5
- // disable mouse (via KBC) and Keyborad device
- //
- Status = KeyboardCommand (
- BiosKeyboardPrivate,
- KBC_CMDREG_VIA64_AUX_DISABLE
- );
-
- if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Exit;
- }
-
- Status = KeyboardCommand (
- BiosKeyboardPrivate,
- KBC_CMDREG_VIA64_KB_DISABLE
- );
-
- if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Exit;
- }
-
- } else {
- //
- // 6
- // KBC Self Test
- //
- //
- // Report a Progress Code for performing a self test on the keyboard controller
- //
- REPORT_STATUS_CODE (
- EFI_PROGRESS_CODE,
- EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_SELF_TEST
- );
-
- Status = KeyboardCommand (
- BiosKeyboardPrivate,
- KBC_CMDREG_VIA64_KBC_SLFTEST
- );
- if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Exit;
- }
-
- Status = KeyboardWaitForValue (
- BiosKeyboardPrivate,
- KBC_CMDECHO_KBCSLFTEST_OK,
- KEYBOARD_WAITFORVALUE_TIMEOUT
- );
- if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Exit;
+ //
+ // 6
+ // KBC Self Test
+ //
+ //
+ // Report a Progress Code for performing a self test on the keyboard controller
+ //
+ REPORT_STATUS_CODE (
+ EFI_PROGRESS_CODE,
+ EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_SELF_TEST
+ );
+
+ Status = KeyboardCommand (
+ BiosKeyboardPrivate,
+ KBC_CMDREG_VIA64_KBC_SLFTEST
+ );
+ if (EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ goto Exit;
+ }
+
+ Status = KeyboardWaitForValue (
+ BiosKeyboardPrivate,
+ KBC_CMDECHO_KBCSLFTEST_OK,
+ KEYBOARD_WAITFORVALUE_TIMEOUT
+ );
+ if (EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ goto Exit;
+ }
}
}
//
@@ -1321,14 +1322,16 @@ BiosKeyboardReset (
// Done for validating keyboard. Enable keyboard (via KBC)
// and recover the command byte to proper value
//
- Status = KeyboardCommand (
- BiosKeyboardPrivate,
- KBC_CMDREG_VIA64_KB_ENABLE
- );
-
- if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
- goto Exit;
+ if (!PcdGetBool (PcdFastPS2Detection)) {
+ Status = KeyboardCommand (
+ BiosKeyboardPrivate,
+ KBC_CMDREG_VIA64_KB_ENABLE
+ );
+
+ if (EFI_ERROR (Status)) {
+ Status = EFI_DEVICE_ERROR;
+ goto Exit;
+ }
}
//
@@ -1674,35 +1677,38 @@ CheckKeyboardConnect (
// enable keyboard itself and wait for its ack
// If can't receive ack, Keyboard should not be connected.
//
- Status = KeyboardWrite (
- BiosKeyboardPrivate,
- KBC_INPBUF_VIA60_KBEN
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Keyboard enable failed!\n"));
- REPORT_STATUS_CODE (
- EFI_ERROR_CODE | EFI_ERROR_MINOR,
- EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR
- );
- return FALSE;
- }
+ if (!PcdGetBool (PcdFastPS2Detection)) {
+ Status = KeyboardWrite (
+ BiosKeyboardPrivate,
+ KBC_INPBUF_VIA60_KBEN
+ );
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Keyboard enable failed!\n"));
+ REPORT_STATUS_CODE (
+ EFI_ERROR_CODE | EFI_ERROR_MINOR,
+ EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR
+ );
+ return FALSE;
+ }
- Status = KeyboardWaitForValue (
- BiosKeyboardPrivate,
- KBC_CMDECHO_ACK,
- KEYBOARD_WAITFORVALUE_TIMEOUT
- );
+ Status = KeyboardWaitForValue (
+ BiosKeyboardPrivate,
+ KBC_CMDECHO_ACK,
+ KEYBOARD_WAITFORVALUE_TIMEOUT
+ );
- if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Timeout!\n"));
- REPORT_STATUS_CODE (
- EFI_ERROR_CODE | EFI_ERROR_MINOR,
- EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR
- );
- return FALSE;
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "[KBD]CheckKeyboardConnect - Timeout!\n"));
+ REPORT_STATUS_CODE (
+ EFI_ERROR_CODE | EFI_ERROR_MINOR,
+ EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR
+ );
+ return FALSE;
+ }
+ return TRUE;
+ } else {
+ return TRUE;
}
-
- return TRUE;
}
/**
diff --git a/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf b/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf
index 28ef29bf1..ee79f6b60 100644
--- a/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf
+++ b/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf
@@ -68,4 +68,7 @@
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
[FeaturePcd]
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPs2KbdExtendedVerification|FALSE \ No newline at end of file
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPs2KbdExtendedVerification|FALSE
+
+[Pcd]
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFastPS2Detection \ No newline at end of file
diff --git a/edk2/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec b/edk2/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
index 6a6228837..1625fd5cc 100644
--- a/edk2/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
+++ b/edk2/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
@@ -144,8 +144,9 @@
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures|0x05|UINT8|0x00010040
[PcdsDynamic, PcdsDynamicEx]
- ## PCD is used to mark if the machine has complete one boot cycle before.
- # After the complete boot, the variable BootState will be set to TRUE.
+ ## The PCD is used to mark whether the machine is in first boot cycle.
+ # TRUE means the machine is in first boot cycle. After completing the first boot,
+ # the PCD's value will be updated to FALSE.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootState|TRUE|BOOLEAN|0x0001002f
## Timeout value for displaying progressing bar in before boot OS.
@@ -219,4 +220,7 @@
## The PCD is used to specify the high PMM (Post Memory Manager) size with bytes above 1MB.
# The value should be a multiple of 4KB.
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x3000000a
- \ No newline at end of file
+
+ ## This PCD specifies whether to use the optimized timing for best PS2 detection performance.
+ # Note this PCD could be set to TRUE for best boot performance and set to FALSE for best device compatibility.
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFastPS2Detection|FALSE|BOOLEAN|0x3000000b \ No newline at end of file
diff --git a/edk2/IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3Save.c b/edk2/IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3Save.c
index 5a021d2ca..afdfbf536 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3Save.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3Save.c
@@ -58,7 +58,7 @@ EFI_ACPI_S3_SAVE_PROTOCOL mS3Save = {
};
EFI_GUID mAcpiS3IdtrProfileGuid = {
- 0xdea652b0, 0xd587, 0x4c54, 0xb5, 0xb4, 0xc6, 0x82, 0xe7, 0xa0, 0xaa, 0x3d
+ 0xdea652b0, 0xd587, 0x4c54, { 0xb5, 0xb4, 0xc6, 0x82, 0xe7, 0xa0, 0xaa, 0x3d }
};
/**
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
index 008d13e41..0929f1d27 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
@@ -1,7 +1,7 @@
/** @file
Head file for BDS Architectural Protocol implementation
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -34,6 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Guid/StatusCodeDataTypeId.h>
#include <Guid/LegacyDevOrder.h>
#include <Guid/BdsHii.h>
+#include <Guid/ConnectConInEvent.h>
#include <Protocol/GenericMemoryTest.h>
#include <Protocol/FormBrowser2.h>
#include <Protocol/HiiConfigAccess.h>
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
index 0134f9b7d..a60738e94 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -116,7 +116,6 @@
## SOMETIMES_PRODUCES ## Variable:L"BootXX" (Boot option variable)
## SOMETIMES_PRODUCES ## Variable:L"PlatformLang" (Platform supported languange in Rfc4646 format)
## SOMETIMES_PRODUCES ## Variable:L"Lang" (Platform supported languange in Iso639 format)
- ## SOMETIMES_PRODUCES ## Variable:L"KeyOrder" (Number of hotkey)
## SOMETIMES_PRODUCES ## Variable:L"KeyXX" (Hotkey option variable)
## PRODUCES ## Variable:L"HwErrRecSupport" (The level of platform supported hardware Error Record Persistence)
## SOMETIMES_PRODUCES ## Variable:L"BootOptionSupport" (The feature supported in boot option menu, value could be: EFI_BOOT_OPTION_SUPPORT_KEY, EFI_BOOT_OPTION_SUPPORT_APP
@@ -141,6 +140,7 @@
gBootManagerFormSetGuid ## SOMETIMES_PRODUCES ## BootManager HII Package
gDeviceManagerFormSetGuid ## SOMETIMES_PRODUCES ## DeviceManager HII Package
gDriverHealthFormSetGuid ## SOMETIMES_PRODUCES ## DriverHealth HII Package
+ gConnectConInEventGuid ## CONSUMES ## GUID (Connect ConIn Event)
[Protocols]
gEfiSimpleFileSystemProtocolGuid ## PROTOCOL CONSUMES
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
index 7949d0995..a91962537 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -72,6 +72,24 @@ BdsInitialize (
return Status;
}
+
+/**
+ An empty function to pass error checking of CreateEventEx ().
+
+ @param Event Event whose notification function is being invoked.
+ @param Context Pointer to the notification function's context,
+ which is implementation-dependent.
+
+**/
+VOID
+EFIAPI
+BdsEmptyCallbackFunction (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+}
+
/**
This function attempts to boot for the boot order specified
@@ -93,12 +111,14 @@ BdsBootDeviceSelect (
CHAR16 Buffer[20];
BOOLEAN BootNextExist;
LIST_ENTRY *LinkBootNext;
+ EFI_EVENT ConnectConInEvent;
//
// Got the latest boot option
//
BootNextExist = FALSE;
LinkBootNext = NULL;
+ ConnectConInEvent = NULL;
InitializeListHead (&BootLists);
//
@@ -106,6 +126,23 @@ BdsBootDeviceSelect (
//
ZeroMem (Buffer, sizeof (Buffer));
+ //
+ // Create Event to signal ConIn connection request
+ //
+ if (PcdGetBool (PcdConInConnectOnDemand)) {
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ BdsEmptyCallbackFunction,
+ NULL,
+ &gConnectConInEventGuid,
+ &ConnectConInEvent
+ );
+ if (EFI_ERROR(Status)) {
+ ConnectConInEvent = NULL;
+ }
+ }
+
if (mBootNext != NULL) {
//
// Indicate we have the boot next variable, so this time
@@ -172,6 +209,13 @@ BdsBootDeviceSelect (
//
if (Link == &BootLists) {
//
+ // When LazyConIn enabled, signal connect ConIn event before enter UI
+ //
+ if (PcdGetBool (PcdConInConnectOnDemand) && ConnectConInEvent != NULL) {
+ gBS->SignalEvent (ConnectConInEvent);
+ }
+
+ //
// There are two ways to enter here:
// 1. There is no active boot option, give user chance to
// add new boot option
@@ -248,6 +292,14 @@ BdsBootDeviceSelect (
// Boot success, then stop process the boot order, and
// present the boot manager menu, front page
//
+
+ //
+ // When LazyConIn enabled, signal connect ConIn Event before enter UI
+ //
+ if (PcdGetBool (PcdConInConnectOnDemand) && ConnectConInEvent != NULL) {
+ gBS->SignalEvent (ConnectConInEvent);
+ }
+
Timeout = 0xffff;
PlatformBdsEnterFrontPage (Timeout, FALSE);
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
index ffa88b4d8..f216b4a03 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/ConsoleOption.c
@@ -1,7 +1,7 @@
/** @file
handles console redirection from boot manager
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -14,12 +14,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "BootMaint.h"
-UART_FLOW_CONTROL_DEVICE_PATH mFlowControlDevicePath =
-{
- MESSAGING_DEVICE_PATH,
- MSG_VENDOR_DP,
- (UINT8)(sizeof(UART_FLOW_CONTROL_DEVICE_PATH)),
- (UINT8)((sizeof(UART_FLOW_CONTROL_DEVICE_PATH)) >> 8),
+UART_FLOW_CONTROL_DEVICE_PATH mFlowControlDevicePath =
+{
+ {
+ MESSAGING_DEVICE_PATH,
+ MSG_VENDOR_DP,
+ {
+ (UINT8)(sizeof(UART_FLOW_CONTROL_DEVICE_PATH)),
+ (UINT8)((sizeof(UART_FLOW_CONTROL_DEVICE_PATH)) >> 8)
+ }
+ },
DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL,
UART_FLOW_CONTROL_HARDWARE
};
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
index 55b615d6d..1a3ec1ff8 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
@@ -65,241 +65,6 @@ IsKeyOptionValid (
}
/**
- Create Key#### for the given hotkey.
-
- @param KeyOption The Hot Key Option to be added.
- @param KeyOptionNumber The key option number for Key#### (optional).
-
- @retval EFI_SUCCESS Register hotkey successfully.
- @retval EFI_INVALID_PARAMETER The hotkey option is invalid.
- @retval EFI_OUT_OF_RESOURCES Fail to allocate memory resource.
-
-**/
-EFI_STATUS
-RegisterHotkey (
- IN EFI_KEY_OPTION *KeyOption,
- OUT UINT16 *KeyOptionNumber
-)
-{
- UINT16 KeyOptionName[10];
- UINT16 *KeyOrder;
- UINTN KeyOrderSize;
- UINT16 *NewKeyOrder;
- UINTN Index;
- UINT16 MaxOptionNumber;
- UINT16 RegisterOptionNumber;
- EFI_KEY_OPTION *TempOption;
- UINTN TempOptionSize;
- EFI_STATUS Status;
- UINTN KeyOptionSize;
- BOOLEAN UpdateBootOption;
-
- //
- // Validate the given key option
- //
- if (!IsKeyOptionValid (KeyOption)) {
- return EFI_INVALID_PARAMETER;
- }
-
- KeyOptionSize = sizeof (EFI_KEY_OPTION) + KEY_OPTION_INPUT_KEY_COUNT (KeyOption) * sizeof (EFI_INPUT_KEY);
- UpdateBootOption = FALSE;
-
- //
- // Check whether HotKey conflict with keys used by Setup Browser
- //
- KeyOrder = BdsLibGetVariableAndSize (
- VAR_KEY_ORDER,
- &gEfiGlobalVariableGuid,
- &KeyOrderSize
- );
- if (KeyOrder == NULL) {
- KeyOrderSize = 0;
- }
-
- //
- // Find free key option number
- //
- MaxOptionNumber = 0;
- TempOption = NULL;
- for (Index = 0; Index < KeyOrderSize / sizeof (UINT16); Index++) {
- if (MaxOptionNumber < KeyOrder[Index]) {
- MaxOptionNumber = KeyOrder[Index];
- }
-
- UnicodeSPrint (KeyOptionName, sizeof (KeyOptionName), L"Key%04x", KeyOrder[Index]);
- TempOption = BdsLibGetVariableAndSize (
- KeyOptionName,
- &gEfiGlobalVariableGuid,
- &TempOptionSize
- );
- ASSERT (TempOption != NULL);
-
- if (CompareMem (TempOption, KeyOption, TempOptionSize) == 0) {
- //
- // Got the option, so just return
- //
- FreePool (TempOption);
- FreePool (KeyOrder);
- return EFI_SUCCESS;
- }
-
- if (KeyOption->KeyData == TempOption->KeyData) {
- if (CompareMem (
- ((UINT8 *) TempOption) + sizeof (EFI_KEY_OPTION),
- ((UINT8 *) KeyOption) + sizeof (EFI_KEY_OPTION),
- KeyOptionSize - sizeof (EFI_KEY_OPTION)
- ) == 0) {
- //
- // Hotkey is the same but BootOption changed, need update
- //
- UpdateBootOption = TRUE;
- break;
- }
- }
-
- FreePool (TempOption);
- }
-
- if (UpdateBootOption) {
- RegisterOptionNumber = KeyOrder[Index];
- FreePool (TempOption);
- } else {
- RegisterOptionNumber = (UINT16) (MaxOptionNumber + 1);
- }
-
- if (KeyOptionNumber != NULL) {
- *KeyOptionNumber = RegisterOptionNumber;
- }
-
- //
- // Create variable Key####
- //
- UnicodeSPrint (KeyOptionName, sizeof (KeyOptionName), L"Key%04x", RegisterOptionNumber);
- Status = gRT->SetVariable (
- KeyOptionName,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
- KeyOptionSize,
- KeyOption
- );
- if (EFI_ERROR (Status)) {
- FreePool (KeyOrder);
- return Status;
- }
-
- //
- // Update the key order variable - "KeyOrder"
- //
- if (!UpdateBootOption) {
- Index = KeyOrderSize / sizeof (UINT16);
- KeyOrderSize += sizeof (UINT16);
- }
-
- NewKeyOrder = AllocatePool (KeyOrderSize);
- if (NewKeyOrder == NULL) {
- FreePool (KeyOrder);
- return EFI_OUT_OF_RESOURCES;
- }
-
- if (KeyOrder != NULL) {
- CopyMem (NewKeyOrder, KeyOrder, KeyOrderSize);
- }
-
- NewKeyOrder[Index] = RegisterOptionNumber;
-
- Status = gRT->SetVariable (
- VAR_KEY_ORDER,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
- KeyOrderSize,
- NewKeyOrder
- );
-
- FreePool (KeyOrder);
- FreePool (NewKeyOrder);
-
- return Status;
-}
-
-/**
-
- Delete Key#### for the given Key Option number.
-
- @param KeyOptionNumber Key option number for Key####
-
- @retval EFI_SUCCESS Unregister hotkey successfully.
- @retval EFI_NOT_FOUND No Key#### is found for the given Key Option number.
-
-**/
-EFI_STATUS
-UnregisterHotkey (
- IN UINT16 KeyOptionNumber
-)
-{
- UINT16 KeyOption[10];
- UINTN Index;
- EFI_STATUS Status;
- UINTN Index2Del;
- UINT16 *KeyOrder;
- UINTN KeyOrderSize;
-
- //
- // Delete variable Key####
- //
- UnicodeSPrint (KeyOption, sizeof (KeyOption), L"Key%04x", KeyOptionNumber);
- gRT->SetVariable (
- KeyOption,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
- 0,
- NULL
- );
-
- //
- // Adjust key order array
- //
- KeyOrder = BdsLibGetVariableAndSize (
- VAR_KEY_ORDER,
- &gEfiGlobalVariableGuid,
- &KeyOrderSize
- );
- if (KeyOrder == NULL) {
- return EFI_SUCCESS;
- }
-
- Index2Del = 0;
- for (Index = 0; Index < KeyOrderSize / sizeof (UINT16); Index++) {
- if (KeyOrder[Index] == KeyOptionNumber) {
- Index2Del = Index;
- break;
- }
- }
-
- if (Index != KeyOrderSize / sizeof (UINT16)) {
- //
- // KeyOptionNumber found in "KeyOrder", delete it
- //
- for (Index = Index2Del; Index < KeyOrderSize / sizeof (UINT16) - 1; Index++) {
- KeyOrder[Index] = KeyOrder[Index + 1];
- }
-
- KeyOrderSize -= sizeof (UINT16);
- }
-
- Status = gRT->SetVariable (
- VAR_KEY_ORDER,
- &gEfiGlobalVariableGuid,
- EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
- KeyOrderSize,
- KeyOrder
- );
-
- FreePool (KeyOrder);
-
- return Status;
-}
-
-/**
Try to boot the boot option triggered by hotkey.
@retval EFI_SUCCESS There is HotkeyBootOption & it is processed
@retval EFI_NOT_FOUND There is no HotkeyBootOption
@@ -635,11 +400,120 @@ HotkeyInsertList (
}
/**
+ Return TRUE when the variable pointed by Name and Guid is a Key#### variable.
+
+ @param Name The name of the variable.
+ @param Guid The GUID of the variable.
+ @param OptionNumber Return the option number parsed from the Name.
+
+ @retval TRUE The variable pointed by Name and Guid is a Key#### variable.
+ @retval FALSE The variable pointed by Name and Guid isn't a Key#### variable.
+**/
+BOOLEAN
+IsKeyOptionVariable (
+ CHAR16 *Name,
+ EFI_GUID *Guid,
+ UINT16 *OptionNumber
+ )
+{
+ UINTN Index;
+
+ if (!CompareGuid (Guid, &gEfiGlobalVariableGuid) ||
+ (StrSize (Name) != sizeof (L"Key####")) ||
+ (StrnCmp (Name, L"Key", 3) != 0)
+ ) {
+ return FALSE;
+ }
+
+ *OptionNumber = 0;
+ for (Index = 3; Index < 7; Index++) {
+ if ((Name[Index] >= L'0') && (Name[Index] <= L'9')) {
+ *OptionNumber = *OptionNumber * 10 + Name[Index] - L'0';
+ } else if ((Name[Index] >= L'A') && (Name[Index] <= L'F')) {
+ *OptionNumber = *OptionNumber * 10 + Name[Index] - L'A';
+ } else {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+/**
+ Return an array of key option numbers.
+
+ @param Count Return the count of key option numbers.
+
+ @return UINT16* Pointer to an array of key option numbers;
+**/
+UINT16 *
+EFIAPI
+HotkeyGetOptionNumbers (
+ OUT UINTN *Count
+ )
+{
+ EFI_STATUS Status;
+ UINTN Index;
+ CHAR16 *Name;
+ EFI_GUID Guid;
+ UINTN NameSize;
+ UINTN NewNameSize;
+ UINT16 *OptionNumbers;
+ UINT16 OptionNumber;
+
+ if (Count == NULL) {
+ return NULL;
+ }
+
+ *Count = 0;
+ OptionNumbers = NULL;
+
+ NameSize = sizeof (CHAR16);
+ Name = AllocateZeroPool (NameSize);
+ ASSERT (Name != NULL);
+ while (TRUE) {
+ NewNameSize = NameSize;
+ Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ Name = ReallocatePool (NameSize, NewNameSize, Name);
+ ASSERT (Name != NULL);
+ Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);
+ NameSize = NewNameSize;
+ }
+
+ if (Status == EFI_NOT_FOUND) {
+ break;
+ }
+ ASSERT_EFI_ERROR (Status);
+
+ if (IsKeyOptionVariable (Name ,&Guid, &OptionNumber)) {
+ OptionNumbers = ReallocatePool (
+ *Count * sizeof (UINT16),
+ (*Count + 1) * sizeof (UINT16),
+ OptionNumbers
+ );
+ ASSERT (OptionNumbers != NULL);
+ for (Index = 0; Index < *Count; Index++) {
+ if (OptionNumber < OptionNumbers[Index]) {
+ break;
+ }
+ }
+ CopyMem (&OptionNumbers[Index + 1], &OptionNumbers[Index], (*Count - Index) * sizeof (UINT16));
+ OptionNumbers[Index] = OptionNumber;
+ (*Count)++;
+ }
+ }
+
+ FreePool (Name);
+
+ return OptionNumbers;
+}
+
+/**
Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.
@retval EFI_SUCCESS Hotkey services successfully initialized.
- @retval EFI_NOT_FOUND Can not find the "KeyOrder" variable
**/
EFI_STATUS
InitializeHotkeyService (
@@ -648,11 +522,10 @@ InitializeHotkeyService (
{
EFI_STATUS Status;
UINT32 BootOptionSupport;
- UINT16 *KeyOrder;
- UINTN KeyOrderSize;
+ UINT16 *KeyOptionNumbers;
+ UINTN KeyOptionCount;
UINTN Index;
- UINT16 KeyOptionName[8];
- UINTN KeyOptionSize;
+ CHAR16 KeyOptionName[8];
EFI_KEY_OPTION *KeyOption;
//
@@ -673,33 +546,21 @@ InitializeHotkeyService (
sizeof (UINT32),
&BootOptionSupport
);
+ ASSERT_EFI_ERROR (Status);
- //
- // Get valid Key Option List from private EFI variable "KeyOrder"
- //
- KeyOrder = BdsLibGetVariableAndSize (
- VAR_KEY_ORDER,
- &gEfiGlobalVariableGuid,
- &KeyOrderSize
- );
-
- if (KeyOrder == NULL) {
- return EFI_NOT_FOUND;
- }
-
- for (Index = 0; Index < KeyOrderSize / sizeof (UINT16); Index ++) {
- UnicodeSPrint (KeyOptionName, sizeof (KeyOptionName), L"Key%04x", KeyOrder[Index]);
- KeyOption = BdsLibGetVariableAndSize (
- KeyOptionName,
- &gEfiGlobalVariableGuid,
- &KeyOptionSize
- );
-
- if (KeyOption == NULL || !IsKeyOptionValid (KeyOption)) {
- UnregisterHotkey (KeyOrder[Index]);
- } else {
+ KeyOptionNumbers = HotkeyGetOptionNumbers (&KeyOptionCount);
+ for (Index = 0; Index < KeyOptionCount; Index ++) {
+ UnicodeSPrint (KeyOptionName, sizeof (KeyOptionName), L"Key%04x", KeyOptionNumbers[Index]);
+ GetEfiGlobalVariable2 (KeyOptionName, (VOID **) &KeyOption, NULL);
+ ASSERT (KeyOption != NULL);
+ if (IsKeyOptionValid (KeyOption)) {
HotkeyInsertList (KeyOption);
}
+ FreePool (KeyOption);
+ }
+
+ if (KeyOptionNumbers != NULL) {
+ FreePool (KeyOptionNumbers);
}
//
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
index 5df601441..c67df160c 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
@@ -116,43 +116,6 @@ typedef struct {
#define BDS_HOTKEY_OPTION_FROM_LINK(a) CR (a, BDS_HOTKEY_OPTION, Link, BDS_HOTKEY_OPTION_SIGNATURE)
-#define VAR_KEY_ORDER L"KeyOrder"
-
-/**
-
- Create Key#### for the given hotkey.
-
-
- @param KeyOption - The Hot Key Option to be added.
- @param KeyOptionNumber - The key option number for Key#### (optional).
-
- @retval EFI_SUCCESS Register hotkey successfully.
- @retval EFI_INVALID_PARAMETER The hotkey option is invalid.
-
-**/
-EFI_STATUS
-RegisterHotkey (
- IN EFI_KEY_OPTION *KeyOption,
- OUT UINT16 *KeyOptionNumber
- );
-
-/**
-
- Delete Key#### for the given Key Option number.
-
-
- @param KeyOptionNumber - Key option number for Key####
-
- @retval EFI_SUCCESS Unregister hotkey successfully.
- @retval EFI_NOT_FOUND No Key#### is found for the given Key Option number.
-
-**/
-EFI_STATUS
-UnregisterHotkey (
- IN UINT16 KeyOptionNumber
- );
-
-
/**
Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.