]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Include/AsmMacroIoLib.inc
Update for NetworkPkg.
[mirror_edk2.git] / ArmPkg / Include / AsmMacroIoLib.inc
index 23f3c44d6bb789d2754776955efd196686c60007..5644bf9b3076f02ae16fd4ddb7ccd8bcd1d3f36d 100644 (file)
@@ -2,7 +2,14 @@
 ;/** @file\r
 ;  Macros to work around lack of Apple support for LDR register, =expr\r
 ;\r
 ;/** @file\r
 ;  Macros to work around lack of Apple support for LDR register, =expr\r
 ;\r
-;  Copyright (c) 2009, Apple, Inc.  All rights reserved.\r
+;  Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
+;  This program and the accompanying materials                          \r
+;  are licensed and made available under the terms and conditions of the BSD License         \r
+;  which accompanies this distribution.  The full text of the license may be found at        \r
+;  http://opensource.org/licenses/bsd-license.php                                            \r
+;                                                                                            \r
+;  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+;  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.  \r
 ;\r
 ;**/\r
 \r
 ;\r
 ;**/\r
 \r
   LoadConstantToRegMacro $Data, $Reg \r
   ldr  $Reg, =($Data) \r
   MEND \r
   LoadConstantToRegMacro $Data, $Reg \r
   ldr  $Reg, =($Data) \r
   MEND \r
+  \r
+  MACRO\r
+  GetCorePositionInStack $Pos, $MpId, $Tmp\r
+  lsr   $Pos, $MpId, #6\r
+  and   $Tmp, $MpId, #3\r
+  add   $Pos, $Pos, $Tmp\r
+  MEND\r
+  \r
+  ; The reserved place must be 8-bytes aligned for pushing 64-bit variable on the stack\r
+  MACRO\r
+  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
+  MEND\r
 \r
   END\r
 \r
   END\r