]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Include/AsmMacroIoLib.inc
ArmPkg RVCT: add ADRL/LDRL macro equivalents
[mirror_edk2.git] / ArmPkg / Include / AsmMacroIoLib.inc
CommitLineData
2ef2b01e
A
1;%HEADER%\r
2;/** @file\r
3; Macros to work around lack of Apple support for LDR register, =expr\r
4;\r
d6ebcab7 5; Copyright (c) 2009, Apple Inc. All rights reserved.<BR>\r
1377db63 6; Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
7;\r
3402aac7
RC
8; This program and the accompanying materials\r
9; are licensed and made available under the terms and conditions of the BSD License\r
10; which accompanies this distribution. The full text of the license may be found at\r
11; http://opensource.org/licenses/bsd-license.php\r
12;\r
13; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
2ef2b01e
A
15;\r
16;**/\r
17\r
18\r
3402aac7
RC
19 MACRO\r
20 LoadConstantMacro $Data\r
21 ldr r0, =($Data)\r
2ef2b01e
A
22 MEND\r
23\r
3402aac7
RC
24 MACRO\r
25 LoadConstantToRegMacro $Data, $Reg\r
26 ldr $Reg, =($Data)\r
2ef2b01e
A
27 MEND\r
28\r
4101c875
AB
29 MACRO\r
30 adrll $Reg, $Symbol\r
31 add $Reg, pc, #-8\r
32 RELOC R_ARM_ALU_PC_G0_NC, $Symbol\r
33 add $Reg, $Reg, #-4\r
34 RELOC R_ARM_ALU_PC_G1_NC, $Symbol\r
35 add $Reg, $Reg, #0\r
36 RELOC R_ARM_ALU_PC_G2, $Symbol\r
37 MEND\r
38\r
39 MACRO\r
40 ldrl $Reg, $Symbol\r
41 add $Reg, pc, #-8\r
42 RELOC R_ARM_ALU_PC_G0_NC, $Symbol\r
43 add $Reg, $Reg, #-4\r
44 RELOC R_ARM_ALU_PC_G1_NC, $Symbol\r
45 ldr $Reg, [$Reg, #0]\r
46 RELOC R_ARM_LDR_PC_G2, $Symbol\r
47 MEND\r
48\r
2ef2b01e 49 END\r