use RT instead of RS

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-02-16 15:00:20 +03:00
parent d836611308
commit 60b6eb5c33
9 changed files with 74 additions and 55 deletions

View File

@ -352,7 +352,7 @@ BdsLibVariableToOption (
@retval EFI_SUCCESS The boot#### or driver#### have been successfully @retval EFI_SUCCESS The boot#### or driver#### have been successfully
registered. registered.
@retval EFI_STATUS Return the status of gRS->SetVariable (). @retval EFI_STATUS Return the status of gRT->SetVariable ().
**/ **/
EFI_STATUS EFI_STATUS

View File

@ -199,7 +199,7 @@ SetVariablesForOSX(LOADER_ENTRY *Entry)
// firmware Variables // firmware Variables
// //
if (RtVariablesNum > 0) { if (RtVariablesNum > 0) {
OvrRuntimeServices(gRS); OvrRuntimeServices(gRT);
} }
// As found on a real Mac, the system-id variable solely has the BS flag // As found on a real Mac, the system-id variable solely has the BS flag

View File

@ -701,7 +701,7 @@ EFI_STATUS bootPBRtest(REFIT_VOLUME* volume)
Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE*)(UINTN)(FadtPointer->FirmwareCtrl); Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE*)(UINTN)(FadtPointer->FirmwareCtrl);
Facs->FirmwareWakingVector = 0x7F00; Facs->FirmwareWakingVector = 0x7F00;
gRS->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL); gRT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
/* /*
@ -731,7 +731,7 @@ if (FadtPointer == NULL) {
Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE*)(UINTN)(FadtPointer->FirmwareCtrl); Facs = (EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE*)(UINTN)(FadtPointer->FirmwareCtrl);
Facs->FirmwareWakingVector = 0x7F00; Facs->FirmwareWakingVector = 0x7F00;
gRS->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL); gRT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
*/ */
#define EFI_CPU_EFLAGS_IF 0x200 #define EFI_CPU_EFLAGS_IF 0x200

View File

@ -1063,7 +1063,7 @@ PutNvramPlistToRtVars ()
} }
// set RT var: all vars visible in nvram.plist are gEfiAppleBootGuid // set RT var: all vars visible in nvram.plist are gEfiAppleBootGuid
/* Status = gRS->SetVariable ( /* Status = gRT->SetVariable (
KeyBuf, KeyBuf,
VendorGuid, VendorGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,

View File

@ -230,7 +230,7 @@ VOID UpdatePointer()
INTN ScreenRelX; INTN ScreenRelX;
INTN ScreenRelY; INTN ScreenRelY;
// Now = gRS->GetTime(&Now, NULL); // Now = gRT->GetTime(&Now, NULL);
Now = AsmReadTsc(); Now = AsmReadTsc();
Status = gPointer.SimplePointerProtocol->GetState(gPointer.SimplePointerProtocol, &tmpState); Status = gPointer.SimplePointerProtocol->GetState(gPointer.SimplePointerProtocol, &tmpState);
if (!EFI_ERROR(Status)) { if (!EFI_ERROR(Status)) {

View File

@ -76,7 +76,7 @@
extern EFI_HANDLE gImageHandle; extern EFI_HANDLE gImageHandle;
extern EFI_SYSTEM_TABLE* gST; extern EFI_SYSTEM_TABLE* gST;
extern EFI_BOOT_SERVICES* gBS; extern EFI_BOOT_SERVICES* gBS;
extern EFI_RUNTIME_SERVICES* gRS; extern EFI_RUNTIME_SERVICES* gRT;
#define TAG_ABOUT (1) #define TAG_ABOUT (1)
#define TAG_RESET (2) #define TAG_RESET (2)

View File

@ -86,7 +86,7 @@ BOOLEAN APFSSupport = FALSE;
//extern EFI_SYSTEM_TABLE* gST; //extern EFI_SYSTEM_TABLE* gST;
//extern EFI_BOOT_SERVICES* gBS; //extern EFI_BOOT_SERVICES* gBS;
//extern EFI_DXE_SERVICES* gDS; //extern EFI_DXE_SERVICES* gDS;
EFI_RUNTIME_SERVICES* gRS; //EFI_RUNTIME_SERVICES* gRS;
DRIVERS_FLAGS gDriversFlags; //the initializer is not needed for global variables DRIVERS_FLAGS gDriversFlags; //the initializer is not needed for global variables
@ -121,7 +121,9 @@ extern HDA_OUTPUTS AudioList[20];
extern CHAR8 *AudioOutputNames[]; extern CHAR8 *AudioOutputNames[];
extern EFI_AUDIO_IO_PROTOCOL *AudioIo; extern EFI_AUDIO_IO_PROTOCOL *AudioIo;
#ifdef __cplusplus
} }
#endif
static EFI_STATUS LoadEFIImageList(IN EFI_DEVICE_PATH **DevicePaths, static EFI_STATUS LoadEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
IN CHAR16 *ImageTitle, IN CHAR16 *ImageTitle,
@ -1774,9 +1776,9 @@ VOID ResetNvram ()
} }
// Attempt warm reboot // Attempt warm reboot
// gRS->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL); // gRT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
// Warm reboot may not be supported attempt cold reboot // Warm reboot may not be supported attempt cold reboot
// gRS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); // gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
// Terminate the screen and just exit // Terminate the screen and just exit
// TerminateScreen(); // TerminateScreen();
} }
@ -2071,13 +2073,13 @@ RefitMain (IN EFI_HANDLE ImageHandle,
gST = SystemTable; gST = SystemTable;
gImageHandle = ImageHandle; gImageHandle = ImageHandle;
gBS = SystemTable->BootServices; gBS = SystemTable->BootServices;
gRS = SystemTable->RuntimeServices; gRT = SystemTable->RuntimeServices;
/*Status = */EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS); /*Status = */EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS);
ConsoleInHandle = SystemTable->ConsoleInHandle; ConsoleInHandle = SystemTable->ConsoleInHandle;
gRS->GetTime(&Now, NULL); gRT->GetTime(&Now, NULL);
// firmware detection // firmware detection
gFirmwareClover = StrCmp(gST->FirmwareVendor, L"CLOVER") == 0; gFirmwareClover = StrCmp(gST->FirmwareVendor, L"CLOVER") == 0;
@ -2782,9 +2784,9 @@ destruct_globals_objects(NULL); // That should be done just before quitting clov
// } // }
} }
// Attempt warm reboot // Attempt warm reboot
gRS->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL); gRT->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
// Warm reboot may not be supported attempt cold reboot // Warm reboot may not be supported attempt cold reboot
gRS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
// Terminate the screen and just exit // Terminate the screen and just exit
TerminateScreen(); TerminateScreen();
MainLoopRunning = FALSE; MainLoopRunning = FALSE;
@ -2794,7 +2796,7 @@ destruct_globals_objects(NULL); // That should be done just before quitting clov
case TAG_SHUTDOWN: // It is not Shut Down, it is Exit from Clover case TAG_SHUTDOWN: // It is not Shut Down, it is Exit from Clover
TerminateScreen(); TerminateScreen();
// gRS->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL); // gRT->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
MainLoopRunning = FALSE; // just in case we get this far MainLoopRunning = FALSE; // just in case we get this far
ReinitDesktop = FALSE; ReinitDesktop = FALSE;
AfterTool = TRUE; AfterTool = TRUE;
@ -2983,7 +2985,7 @@ destruct_globals_objects(NULL); // That should be done just before quitting clov
// If we end up here, things have gone wrong. Try to reboot, and if that // If we end up here, things have gone wrong. Try to reboot, and if that
// fails, go into an endless loop. // fails, go into an endless loop.
//Slice - NO!!! Return to EFI GUI //Slice - NO!!! Return to EFI GUI
// gRS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); // gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
// EndlessIdleLoop(); // EndlessIdleLoop();
#ifdef ENABLE_SECURE_BOOT #ifdef ENABLE_SECURE_BOOT
@ -2997,3 +2999,5 @@ destruct_globals_objects(NULL); // That should be done just before quitting clov
} }
return EFI_SUCCESS; return EFI_SUCCESS;
} }

View File

@ -37,6 +37,16 @@
//#include "Platform.h" //#include "Platform.h"
#include "libegint.h" //this includes platform.h #include "libegint.h" //this includes platform.h
//#include "../include/scroll_images.h" //#include "../include/scroll_images.h"
//#include "../Platform/Platform.h"
#include "../cpp_util/XStringW.h"
#include "../cpp_util/globals_ctor.h"
#include "../cpp_util/globals_dtor.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "Version.h" #include "Version.h"
//#include "colors.h" //#include "colors.h"
@ -5704,3 +5714,8 @@ UINTN RunMainMenu(IN REFIT_MENU_SCREEN *Screen, IN INTN DefaultSelection, OUT RE
} }
return MenuExit; return MenuExit;
} }
#ifdef __cplusplus
}
#endif

View File

@ -39,7 +39,7 @@
refit/icns.c refit/icns.c
refit/lib.c refit/lib.c
refit/lib.h refit/lib.h
refit/menu.c refit/menu.cpp
refit/screen.c refit/screen.c
refit/IO.c refit/IO.c
refit/IO.h refit/IO.h