]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Include/AsmMacroIoLib.h
ArmPkg/AsmMacroIoLib: remove unused obsolete MMIO and other asm macros
[mirror_edk2.git] / ArmPkg / Include / AsmMacroIoLib.h
CommitLineData
2ef2b01e
A
1/** @file\r
2 Macros to work around lack of Apple support for LDR register, =expr\r
3\r
d6ebcab7 4 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
1377db63 5 Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>\r
2ef2b01e 6\r
d6ebcab7 7 This program and the accompanying materials\r
2ef2b01e
A
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17\r
18#ifndef __MACRO_IO_LIB_H__\r
19#define __MACRO_IO_LIB_H__\r
20\r
21#if defined(__APPLE__)\r
22\r
23//\r
24// ldr reg, =expr does not work with current Apple tool chain. So do the work our selves\r
25//\r
26\r
2ef2b01e
A
27// load _Reg with _Data\r
28#define LoadConstantToReg(_Data, _Reg) \\r
29 ldr _Reg, [pc, #0] ; \\r
30 b 1f ; \\r
31 .long (_Data) ; \\r
321:\r
33\r
2ef2b01e
A
34#elif defined (__GNUC__)\r
35\r
2ef2b01e
A
36#define LoadConstantToReg(Data, Reg) \\r
37 ldr Reg, =Data\r
bebda7ce 38\r
2ef2b01e
A
39#else\r
40\r
41//\r
3402aac7 42// Use ARM assembly macros, form armasam\r
2ef2b01e
A
43//\r
44// Less magic in the macros if ldr reg, =expr works\r
45//\r
46\r
2ef2b01e
A
47// load _Reg with _Data\r
48\r
49\r
50#define LoadConstantToReg(Data, Reg) LoadConstantToRegMacro Data, Reg\r
51\r
2dbcb8f0 52#endif\r
2ef2b01e
A
53\r
54#endif\r