TianoCore EDK2 master
Loading...
Searching...
No Matches
AsmMacroLib.h File Reference

Go to the source code of this file.

Macros

#define _ASM_FUNC(Name, Section)
 
#define ASM_FUNC(Name)   _ASM_FUNC(ASM_PFX(Name), .text. ## Name)
 
#define MOV32(Reg, Val)
 
#define ADRL(Reg, Sym)
 
#define LDRL(Reg, Sym)
 

Detailed Description

Macros to work around lack of Apple support for LDR register, =expr

Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2011-2012, ARM Ltd. All rights reserved.
Copyright (c) 2016, Linaro Ltd. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AsmMacroLib.h.

Macro Definition Documentation

◆ _ASM_FUNC

#define _ASM_FUNC (   Name,
  Section 
)
Value:
.global Name ; \
.section #Section, "ax" ; \
.type Name, %function ; \
.p2align 2 ; \
Name:

Definition at line 15 of file AsmMacroLib.h.

◆ ADRL

#define ADRL (   Reg,
  Sym 
)
Value:
movw Reg, #:lower16:(Sym) - (. + 16) ; \
movt Reg, #:upper16:(Sym) - (. + 12) ; \
add Reg, Reg, pc

Definition at line 28 of file AsmMacroLib.h.

◆ ASM_FUNC

#define ASM_FUNC (   Name)    _ASM_FUNC(ASM_PFX(Name), .text. ## Name)

Definition at line 22 of file AsmMacroLib.h.

◆ LDRL

#define LDRL (   Reg,
  Sym 
)
Value:
movw Reg, #:lower16:(Sym) - (. + 16) ; \
movt Reg, #:upper16:(Sym) - (. + 12) ; \
ldr Reg, [pc, Reg]

Definition at line 33 of file AsmMacroLib.h.

◆ MOV32

#define MOV32 (   Reg,
  Val 
)
Value:
movw Reg, #(Val) & 0xffff ; \
movt Reg, #(Val) >> 16

Definition at line 24 of file AsmMacroLib.h.