]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PL031RealTimeClockLib: remove local copy of gRT pointer
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 13 Apr 2016 08:07:55 +0000 (10:07 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 11 May 2016 14:57:23 +0000 (16:57 +0200)
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>
ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c

index 516b45675c69b10245ef2b77a51f25f60ee48044..4aa448b528ed13795462607a780fb26a108221ff 100644 (file)
@@ -43,7 +43,6 @@ STATIC CONST CHAR16           mDaylightVariableName[] = L"PL031RtcDaylight";
 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
@@ -293,7 +292,7 @@ LibGetTime (
 \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
@@ -311,7 +310,7 @@ LibGetTime (
     // 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
@@ -345,7 +344,7 @@ LibGetTime (
 \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
@@ -363,7 +362,7 @@ LibGetTime (
     // 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
@@ -497,7 +496,7 @@ LibSetTime (
   // 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
@@ -515,7 +514,7 @@ LibSetTime (
   }\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
@@ -608,7 +607,6 @@ LibRtcVirtualNotifyEvent (
   // runtime calls will be made in virtual mode.\r
   //\r
   EfiConvertPointer (0x0, (VOID**)&mPL031RtcBase);\r
-  EfiConvertPointer (0x0, (VOID**)&mRT);\r
   return;\r
 }\r
 \r
@@ -650,8 +648,6 @@ LibRtcInitialize (
     return Status;\r
   }\r
 \r
-  mRT = gRT;\r
-\r
   // Install the protocol\r
   Handle = NULL;\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r