]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Include/AsmMacroIoLib.h
ArmPlatformPkg: Updated the stack setup to have the same geometry between the Secure...
[mirror_edk2.git] / ArmPkg / Include / AsmMacroIoLib.h
index 644c65466508df7974fb73f105ceb46986c3ded7..a4ae22dca03e4df6555f27a492f64b4a5f8a2284 100644 (file)
@@ -2,6 +2,7 @@
   Macros to work around lack of Apple support for LDR register, =expr\r
 \r
   Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
+  Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   and     Tmp, GlobalSize, #7         ;             \\r
   rsbne   Tmp, Tmp, #8                ;             \\r
   add     GlobalSize, GlobalSize, Tmp ;             \\r
-  sub     sp, StackTop, GlobalSize\r
+  sub     sp, StackTop, GlobalSize    ;             \\r
+                                      ;             \\r
+  mov     Tmp, sp                     ;             \\r
+  mov     GlobalSize, #0x0            ;             \\r
+_SetPrimaryStackInitGlobals:          ;             \\r
+  cmp     Tmp, StackTop               ;             \\r
+  beq     _SetPrimaryStackEnd         ;             \\r
+  str     GlobalSize, [Tmp], #4       ;             \\r
+  b       _SetPrimaryStackInitGlobals ;             \\r
+_SetPrimaryStackEnd:\r
 \r
 \r
 #elif defined (__GNUC__)\r
   and     Tmp, GlobalSize, #7         ;             \\r
   rsbne   Tmp, Tmp, #8                ;             \\r
   add     GlobalSize, GlobalSize, Tmp ;             \\r
-  sub     sp, StackTop, GlobalSize\r
+  sub     sp, StackTop, GlobalSize    ;             \\r
+                                      ;             \\r
+  mov     Tmp, sp                     ;             \\r
+  mov     GlobalSize, #0x0            ;             \\r
+_SetPrimaryStackInitGlobals:          ;             \\r
+  cmp     Tmp, StackTop               ;             \\r
+  beq     _SetPrimaryStackEnd         ;             \\r
+  str     GlobalSize, [Tmp], #4       ;             \\r
+  b       _SetPrimaryStackInitGlobals ;             \\r
+_SetPrimaryStackEnd:\r
 \r
 #else\r
 \r