Revision: 18982
          http://sourceforge.net/p/edk2/code/18982
Author:   abiesheuvel
Date:     2015-11-27 17:04:59 +0000 (Fri, 27 Nov 2015)
Log Message:
-----------
ArmPlatformPkg/PrePiHobListPointerLib: use thread ID register

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 <[email protected]>
Reviewed-by: Leif Lindholm <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPlatformPkg/ArmPlatformPkg.dec
    
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
    
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf

Modified: trunk/edk2/ArmPlatformPkg/ArmPlatformPkg.dec
===================================================================
--- trunk/edk2/ArmPlatformPkg/ArmPlatformPkg.dec        2015-11-27 13:48:12 UTC 
(rev 18981)
+++ trunk/edk2/ArmPlatformPkg/ArmPlatformPkg.dec        2015-11-27 17:04:59 UTC 
(rev 18982)
@@ -87,7 +87,8 @@
   # PeiServicePtr and HobListPtr shares the same location in the PEI Global 
Variable list
   # PeiServicePtr is only valid with PEI Core and HobListPtr only when the PEI 
Core is skipped.
   gArmPlatformTokenSpaceGuid.PcdPeiServicePtrGlobalOffset|0x0|UINT32|0x00000017
-  gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset|0x0|UINT32|0x00000018
+  ## TO BE REMOVED
+  ## gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset|0x0|UINT32|0x00000018
 
   # Size to reserve in the primary core stack for SEC Global Variables
   gArmPlatformTokenSpaceGuid.PcdSecGlobalVariableSize|0x0|UINT32|0x00000031

Modified: 
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c
===================================================================
--- 
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c  
    2015-11-27 13:48:12 UTC (rev 18981)
+++ 
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointer.c  
    2015-11-27 17:04:59 UTC (rev 18982)
@@ -13,10 +13,9 @@
 **/
 
 #include <PiPei.h>
-#include <Library/ArmPlatformGlobalVariableLib.h>
+#include <Library/ArmLib.h>
 #include <Library/PrePiHobListPointerLib.h>
 #include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
 
 /**
   Returns the pointer to the HOB list.
@@ -32,11 +31,7 @@
   VOID
   )
 {
-  VOID* HobList;
-
-  ArmPlatformGetGlobalVariable (PcdGet32 (PcdHobListPtrGlobalOffset), 
sizeof(VOID*), &HobList);
-
-  return HobList;
+  return (VOID *)ArmReadTpidrurw();
 }
 
 
@@ -53,8 +48,7 @@
   IN  VOID      *HobList
   )
 {
-  ArmPlatformSetGlobalVariable (PcdGet32 (PcdHobListPtrGlobalOffset), 
sizeof(VOID*), &HobList);
+  ArmWriteTpidrurw((UINTN)HobList);
 
   return EFI_SUCCESS;
 }
-

Modified: 
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
===================================================================
--- 
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
 2015-11-27 13:48:12 UTC (rev 18981)
+++ 
trunk/edk2/ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
 2015-11-27 17:04:59 UTC (rev 18982)
@@ -25,11 +25,8 @@
 
 [Packages]
   MdePkg/MdePkg.dec
-  ArmPlatformPkg/ArmPlatformPkg.dec
+  ArmPkg/ArmPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
 
 [LibraryClasses]
-  ArmPlatformGlobalVariableLib
-
-[FixedPcd.common]
-  gArmPlatformTokenSpaceGuid.PcdHobListPtrGlobalOffset
+  ArmLib


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to