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