Last change
on this file since 109091 was 99464, checked in by vboxsync, 2 years ago |
Devices/EFI/Firmware: Restore ArmPkg, ArmVirtPkg, ArmPlatformPkg in order to be able to build Aarch64 and Aarch32 firmware images for the virt platform, bugref:10400
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | /** @file
|
---|
2 | Macros to work around lack of Apple support for LDR register, =expr
|
---|
3 |
|
---|
4 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
---|
5 | Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
|
---|
6 | Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
|
---|
7 |
|
---|
8 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
9 |
|
---|
10 | **/
|
---|
11 |
|
---|
12 | #ifndef ASM_MACRO_IO_LIB_H_
|
---|
13 | #define ASM_MACRO_IO_LIB_H_
|
---|
14 |
|
---|
15 | #define _ASM_FUNC(Name, Section) \
|
---|
16 | .global Name ; \
|
---|
17 | .section #Section, "ax" ; \
|
---|
18 | .type Name, %function ; \
|
---|
19 | .p2align 2 ; \
|
---|
20 | Name:
|
---|
21 |
|
---|
22 | #define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name)
|
---|
23 |
|
---|
24 | #define MOV32(Reg, Val) \
|
---|
25 | movw Reg, #(Val) & 0xffff ; \
|
---|
26 | movt Reg, #(Val) >> 16
|
---|
27 |
|
---|
28 | #define ADRL(Reg, Sym) \
|
---|
29 | movw Reg, #:lower16:(Sym) - (. + 16) ; \
|
---|
30 | movt Reg, #:upper16:(Sym) - (. + 12) ; \
|
---|
31 | add Reg, Reg, pc
|
---|
32 |
|
---|
33 | #define LDRL(Reg, Sym) \
|
---|
34 | movw Reg, #:lower16:(Sym) - (. + 16) ; \
|
---|
35 | movt Reg, #:upper16:(Sym) - (. + 12) ; \
|
---|
36 | ldr Reg, [pc, Reg]
|
---|
37 |
|
---|
38 | #endif // ASM_MACRO_IO_LIB_H_
|
---|
Note:
See
TracBrowser
for help on using the repository browser.