]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Include/AsmMacroIoLib.h
Arm Packages: Fix builds for XCODE32 toolchain
[mirror_edk2.git] / ArmPkg / Include / AsmMacroIoLib.h
index 9ef3430aaaa596d7ecd9e4c6afd697556a95944c..644c65466508df7974fb73f105ceb46986c3ded7 100644 (file)
   .long (_Data)           ;                 \\r
 1:\r
 \r
+// Convert the (ClusterId,CoreId) into a Core Position\r
+// We assume there are 4 cores per cluster\r
+#define GetCorePositionInStack(Pos, MpId, Tmp) \\r
+  lsr   Pos, MpId, #6 ;                        \\r
+  and   Tmp, MpId, #3 ;                        \\r
+  add   Pos, Pos, Tmp\r
+\r
+// Reserve a region at the top of the Primary Core stack\r
+// for Global variables for the XIP phase\r
+#define SetPrimaryStack(StackTop, GlobalSize, Tmp)  \\r
+  and     Tmp, GlobalSize, #7         ;             \\r
+  rsbne   Tmp, Tmp, #8                ;             \\r
+  add     GlobalSize, GlobalSize, Tmp ;             \\r
+  sub     sp, StackTop, GlobalSize\r
+\r
 \r
 #elif defined (__GNUC__)\r
 \r