Since the only reason for keeping a local copy mRT of the gRT pointer
is to be able to call GetVariable/SetVariable at runtime, use the
UefiRuntimeLib helpers instead, so that we can drop mRT altogether.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
STATIC BOOLEAN mPL031Initialized = FALSE;\r
STATIC EFI_EVENT mRtcVirtualAddrChangeEvent;\r
STATIC UINTN mPL031RtcBase;\r
STATIC BOOLEAN mPL031Initialized = FALSE;\r
STATIC EFI_EVENT mRtcVirtualAddrChangeEvent;\r
STATIC UINTN mPL031RtcBase;\r
-STATIC EFI_RUNTIME_SERVICES *mRT;\r
\r
EFI_STATUS\r
IdentifyPL031 (\r
\r
EFI_STATUS\r
IdentifyPL031 (\r
\r
// Get the current time zone information from non-volatile storage\r
Size = sizeof (TimeZone);\r
\r
// Get the current time zone information from non-volatile storage\r
Size = sizeof (TimeZone);\r
- Status = mRT->GetVariable (\r
+ Status = EfiGetVariable (\r
(CHAR16 *)mTimeZoneVariableName,\r
&gEfiCallerIdGuid,\r
NULL,\r
(CHAR16 *)mTimeZoneVariableName,\r
&gEfiCallerIdGuid,\r
NULL,\r
// The time zone variable does not exist in non-volatile storage, so create it.\r
Time->TimeZone = EFI_UNSPECIFIED_TIMEZONE;\r
// Store it\r
// The time zone variable does not exist in non-volatile storage, so create it.\r
Time->TimeZone = EFI_UNSPECIFIED_TIMEZONE;\r
// Store it\r
- Status = mRT->SetVariable (\r
+ Status = EfiSetVariable (\r
(CHAR16 *)mTimeZoneVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
(CHAR16 *)mTimeZoneVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
\r
// Get the current daylight information from non-volatile storage\r
Size = sizeof (Daylight);\r
\r
// Get the current daylight information from non-volatile storage\r
Size = sizeof (Daylight);\r
- Status = mRT->GetVariable (\r
+ Status = EfiGetVariable (\r
(CHAR16 *)mDaylightVariableName,\r
&gEfiCallerIdGuid,\r
NULL,\r
(CHAR16 *)mDaylightVariableName,\r
&gEfiCallerIdGuid,\r
NULL,\r
// The daylight variable does not exist in non-volatile storage, so create it.\r
Time->Daylight = 0;\r
// Store it\r
// The daylight variable does not exist in non-volatile storage, so create it.\r
Time->Daylight = 0;\r
// Store it\r
- Status = mRT->SetVariable (\r
+ Status = EfiSetVariable (\r
(CHAR16 *)mDaylightVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
(CHAR16 *)mDaylightVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
// Do this after having set the RTC.\r
\r
// Save the current time zone information into non-volatile storage\r
// Do this after having set the RTC.\r
\r
// Save the current time zone information into non-volatile storage\r
- Status = mRT->SetVariable (\r
+ Status = EfiSetVariable (\r
(CHAR16 *)mTimeZoneVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
(CHAR16 *)mTimeZoneVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
}\r
\r
// Save the current daylight information into non-volatile storage\r
}\r
\r
// Save the current daylight information into non-volatile storage\r
- Status = mRT->SetVariable (\r
+ Status = EfiSetVariable (\r
(CHAR16 *)mDaylightVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
(CHAR16 *)mDaylightVariableName,\r
&gEfiCallerIdGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
// runtime calls will be made in virtual mode.\r
//\r
EfiConvertPointer (0x0, (VOID**)&mPL031RtcBase);\r
// runtime calls will be made in virtual mode.\r
//\r
EfiConvertPointer (0x0, (VOID**)&mPL031RtcBase);\r
- EfiConvertPointer (0x0, (VOID**)&mRT);\r
// Install the protocol\r
Handle = NULL;\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
// Install the protocol\r
Handle = NULL;\r
Status = gBS->InstallMultipleProtocolInterfaces (\r