mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-22 16:08:07 +01:00
apply revision 5064 from sf
Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
parent
15dada20e6
commit
7a0d3948dc
@ -84,6 +84,9 @@ Headers collection for procedures
|
||||
#define CLOVER_SIGN SIGNATURE_32('C','l','v','r')
|
||||
#define NON_APPLE_SMC_SIGNATURE SIGNATURE_64('S','M','C','H','E','L','P','E')
|
||||
|
||||
#define PCAT_RTC_ADDRESS_REGISTER 0x70
|
||||
#define PCAT_RTC_DATA_REGISTER 0x71
|
||||
|
||||
|
||||
/* XML Tags */
|
||||
#define kXMLTagPList "plist"
|
||||
|
@ -71,6 +71,12 @@ EFI_GUID GPT_EMPTY_PARTITION = \
|
||||
// 56 10 8C BD 36 9F EC 44 92 A8 A6 33 7F 81 79 86 ==
|
||||
// BD8C1056-9F36-44EC-92A8-A6337F817986 gEfiEdidActiveProtocolGuid
|
||||
// 26baccba-6f42-11d4-bce7-008081883cc7
|
||||
// 63FAECF2-E7EE-4CB9-8A0C-11CE5E89E33C protocol at FinalizeBootStruct or DrawBootGraphics
|
||||
// 03B99B90-ECCF-451D-809E-8341FCB830AC RestartData protocol
|
||||
// 24B73556-2197-4702-82A8-3E1337DAFBF2 before Firmware password
|
||||
// 24B73556-2197-4702-82A8-3E1337DAFBF3
|
||||
// 1BAD711C-D451-4241-B1F3-8537812E0C70 GUID for MeBiosExtensionSetup variable
|
||||
// 36C28AB5-6566-4C50-9EBD-CBB920F83843:preferred-networks gAppleWirelessNetworkVariableGuid
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Apple Inc. All rights reserved.
|
||||
|
@ -87,7 +87,7 @@ EMU_VARIABLE_CONTROL_PROTOCOL *gEmuVariableControl = NULL;
|
||||
|
||||
EFI_HANDLE ConsoleInHandle;
|
||||
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL* SimpleTextEx;
|
||||
|
||||
EFI_KEY_DATA KeyData;
|
||||
|
||||
extern VOID HelpRefit(VOID);
|
||||
extern VOID AboutRefit(VOID);
|
||||
@ -2081,7 +2081,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
if ( EFI_ERROR (Status) ) {
|
||||
SimpleTextEx = NULL;
|
||||
}
|
||||
DBG("SimpleTextEx Status=%x\n", Status);
|
||||
DBG("SimpleTextEx Status=%r\n", Status);
|
||||
|
||||
PrepatchSmbios();
|
||||
|
||||
@ -2647,15 +2647,23 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
switch (ChosenEntry->Tag) {
|
||||
|
||||
case TAG_RESET: // Restart
|
||||
if (SimpleTextEx) {
|
||||
EFI_KEY_DATA KeyData = 0;
|
||||
SimpleTextEx->ReadKeyStrokeEx (SimpleTextEx, &KeyData);
|
||||
if ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) {
|
||||
//do clear cmos
|
||||
break; //to test
|
||||
}
|
||||
}
|
||||
if (MenuExit == MENU_EXIT_DETAILS) {
|
||||
// EFI_KEY_DATA KeyData;
|
||||
// ZeroMem(&KeyData, sizeof KeyData);
|
||||
// SimpleTextEx->ReadKeyStrokeEx (SimpleTextEx, &KeyData);
|
||||
// if ((KeyData.KeyState.KeyShiftState & (EFI_LEFT_CONTROL_PRESSED | EFI_RIGHT_CONTROL_PRESSED)) != 0) {
|
||||
//do clear cmos as for AMI BIOS
|
||||
// not sure for more robust method
|
||||
IoWrite8 (PCAT_RTC_ADDRESS_REGISTER, 0x10);
|
||||
IoWrite8 (PCAT_RTC_DATA_REGISTER, 0x0);
|
||||
IoWrite8 (PCAT_RTC_ADDRESS_REGISTER, 0x11);
|
||||
IoWrite8 (PCAT_RTC_DATA_REGISTER, 0x0);
|
||||
// or may be
|
||||
// IoWrite8 (PCAT_RTC_ADDRESS_REGISTER, 0x17);
|
||||
// IoWrite8 (PCAT_RTC_DATA_REGISTER, 0x17);
|
||||
|
||||
// }
|
||||
}
|
||||
// Attempt warm reboot
|
||||
gRS->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
|
||||
// Warm reboot may not be supported attempt cold reboot
|
||||
|
Loading…
Reference in New Issue
Block a user