]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PrePiHobListPointerLib: use thread ID register
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 27 Nov 2015 17:04:59 +0000 (17:04 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Fri, 27 Nov 2015 17:04:59 +0000 (17:04 +0000)
This updates the PrePiHobListPointerLib implementation in ArmPlatformPkg
to move away from ArmPlatformGlobalVariableLib and instead use the thread
ID CPU registers (TPIDRURW and TPIDR_EL0 for v7 and v8, respectively)
for storing the HobList pointer.

Since PrePiHobListPointerLib is specific to PrePi (where PEI core is skipped)
we can share these registers with the PEI services table pointer. By the
same reasoning, the PEI services table pointer and the HobList pointer
already shared the same offset in the ArmPlatformGlobalVariable array.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18982 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmPlatformPkg.dec
ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf

index 45aeaeee75f9cac897fa6872397e67c4e2756bfa..cb95516881c75a52924499527cfa9c14cc8151f8 100644 (file)
@@ -87,7 +87,8 @@
   # PeiServicePtr and HobListPtr shares the same location in the PEI Global Variable list\r
   # PeiServicePtr is only valid with PEI Core and HobListPtr only when the PEI Core is skipped.\r
   gArmPlatformTokenSpaceGuid.PcdPeiServicePtrGlobalOffset|0x0|UINT32|0x00000017\r
-  gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset|0x0|UINT32|0x00000018\r
+  ## TO BE REMOVED\r
+  ## gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset|0x0|UINT32|0x00000018\r
 \r
   # Size to reserve in the primary core stack for SEC Global Variables\r
   gArmPlatformTokenSpaceGuid.PcdSecGlobalVariableSize|0x0|UINT32|0x00000031\r
index 8932e1004970b9bda515826779b4b6b0635360f5..23e366db2fab372d6f8bd67bd69fc09b0da3214f 100755 (executable)
 **/\r
 \r
 #include <PiPei.h>\r
-#include <Library/ArmPlatformGlobalVariableLib.h>\r
+#include <Library/ArmLib.h>\r
 #include <Library/PrePiHobListPointerLib.h>\r
 #include <Library/DebugLib.h>\r
-#include <Library/PcdLib.h>\r
 \r
 /**\r
   Returns the pointer to the HOB list.\r
@@ -32,11 +31,7 @@ PrePeiGetHobList (
   VOID\r
   )\r
 {\r
-  VOID* HobList;\r
-\r
-  ArmPlatformGetGlobalVariable (PcdGet32 (PcdHobListPtrGlobalOffset), sizeof(VOID*), &HobList);\r
-\r
-  return HobList;\r
+  return (VOID *)ArmReadTpidrurw();\r
 }\r
 \r
 \r
@@ -53,8 +48,7 @@ PrePeiSetHobList (
   IN  VOID      *HobList\r
   )\r
 {\r
-  ArmPlatformSetGlobalVariable (PcdGet32 (PcdHobListPtrGlobalOffset), sizeof(VOID*), &HobList);\r
+  ArmWriteTpidrurw((UINTN)HobList);\r
 \r
   return EFI_SUCCESS;\r
 }\r
-\r
index 16b201e8f6f0fcbe279165889a38d9d13019053e..0b98f6ffda8b67c501a3445b91de9e10a492e436 100755 (executable)
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
-  ArmPlatformPkg/ArmPlatformPkg.dec\r
+  ArmPkg/ArmPkg.dec\r
   EmbeddedPkg/EmbeddedPkg.dec\r
 \r
 [LibraryClasses]\r
-  ArmPlatformGlobalVariableLib\r
-\r
-[FixedPcd.common]\r
-  gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset\r
+  ArmLib\r