MdePkg: Move AsmMacroIoLib*.h from ArmPkg

AsmMacroIoLib.h and AsmMacroIoLibV8.h are used by the
CompilerIntrinsicsLib, which is moving to MdePkg. These
functions provide standard definitions for ARM/AARCH64
assembly code, respectively, and so are moved to the arch
directories in MdePkg to avoid MdePkg having a
dependency on ArmPkg.

Now that the files are in Arm/ and AArch64/ directories,
the filenames are changed to AsmMacroLib.h as we can
distinguish the architecture from the path.

AsmMacroIoLib.inc is unused and so is removed.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
This commit is contained in:
Oliver Smith-Denny 2024-08-06 15:19:23 -07:00 committed by mergify[bot]
parent 656665d289
commit 734e71f428
68 changed files with 65 additions and 98 deletions

View File

@ -5,7 +5,7 @@
# #
# #
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
#if !defined(__clang__) #if !defined(__clang__)

View File

@ -5,7 +5,7 @@
# #
# #
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
#include <Library/ArmLib.h> #include <Library/ArmLib.h>
// For the moment we assume this will run in SVC mode on ARMv7 // For the moment we assume this will run in SVC mode on ARMv7

View File

@ -7,7 +7,7 @@
.text .text
.align 3 .align 3
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
#include <IndustryStandard/ArmStdSmc.h> #include <IndustryStandard/ArmStdSmc.h>
#include <Library/ArmLib.h> #include <Library/ArmLib.h>

View File

@ -1,33 +0,0 @@
;%HEADER%
;/** @file
; Macros to work around lack of Apple support for LDR register, =expr
;
; Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
; Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
;
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
;**/
MACRO
adrll $Reg, $Symbol
add $Reg, pc, #-8
RELOC R_ARM_ALU_PC_G0_NC, $Symbol
add $Reg, $Reg, #-4
RELOC R_ARM_ALU_PC_G1_NC, $Symbol
add $Reg, $Reg, #0
RELOC R_ARM_ALU_PC_G2, $Symbol
MEND
MACRO
ldrl $Reg, $Symbol
add $Reg, pc, #-8
RELOC R_ARM_ALU_PC_G0_NC, $Symbol
add $Reg, $Reg, #-4
RELOC R_ARM_ALU_PC_G1_NC, $Symbol
ldr $Reg, [$Reg, #0]
RELOC R_ARM_LDR_PC_G2, $Symbol
MEND
END

View File

@ -9,7 +9,7 @@
#include <AArch64/AArch64.h> #include <AArch64/AArch64.h>
#include <Library/PcdLib.h> #include <Library/PcdLib.h>
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
#include <Protocol/DebugSupport.h> // for exception type definitions #include <Protocol/DebugSupport.h> // for exception type definitions
/* /*

View File

@ -6,7 +6,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(ArmCallHvc) ASM_FUNC(ArmCallHvc)
// Push x0 on the stack - The stack must always be quad-word aligned // Push x0 on the stack - The stack must always be quad-word aligned

View File

@ -6,7 +6,7 @@
// //
// //
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.arch_extension virt .arch_extension virt

View File

@ -7,7 +7,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(ArmReadCntFrq) ASM_FUNC(ArmReadCntFrq)
mrs x0, cntfrq_el0 // Read CNTFRQ mrs x0, cntfrq_el0 // Read CNTFRQ

View File

@ -10,7 +10,7 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AArch64/AArch64.h> #include <AArch64/AArch64.h>
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
.set CTRL_M_BIT, (1 << 0) .set CTRL_M_BIT, (1 << 0)
.set CTRL_A_BIT, (1 << 1) .set CTRL_A_BIT, (1 << 1)

View File

@ -8,7 +8,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
.set DAIF_RD_FIQ_BIT, (1 << 6) .set DAIF_RD_FIQ_BIT, (1 << 6)
.set DAIF_RD_IRQ_BIT, (1 << 7) .set DAIF_RD_IRQ_BIT, (1 << 7)

View File

@ -8,7 +8,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
.set MPIDR_U_BIT, (30) .set MPIDR_U_BIT, (30)
.set MPIDR_U_MASK, (1 << MPIDR_U_BIT) .set MPIDR_U_MASK, (1 << MPIDR_U_BIT)

View File

@ -8,7 +8,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(ArmReadMidr) ASM_FUNC(ArmReadMidr)
mrc p15,0,R0,c0,c0,0 mrc p15,0,R0,c0,c0,0

View File

@ -8,7 +8,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(ArmIsMpCore) ASM_FUNC(ArmIsMpCore)
mrc p15,0,R0,c0,c0,5 mrc p15,0,R0,c0,c0,5

View File

@ -7,7 +7,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(ArmReadCntFrq) ASM_FUNC(ArmReadCntFrq)
mrc p15, 0, r0, c14, c0, 0 @ Read CNTFRQ mrc p15, 0, r0, c14, c0, 0 @ Read CNTFRQ

View File

@ -8,7 +8,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.set DC_ON, (0x1<<2) .set DC_ON, (0x1<<2)
.set IC_ON, (0x1<<12) .set IC_ON, (0x1<<12)

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
.set CTRL_M_BIT, (1 << 0) .set CTRL_M_BIT, (1 << 0)

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.text .text
.align 2 .align 2

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
/** Monitor call. /** Monitor call.

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
/** Monitor call. /** Monitor call.

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(ArmCallSmc) ASM_FUNC(ArmCallSmc)
// Push x0 on the stack - The stack must always be quad-word aligned // Push x0 on the stack - The stack must always be quad-word aligned

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.arch_extension sec .arch_extension sec

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
.text .text
.align 3 .align 3

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(__ashlti3) ASM_FUNC(__ashlti3)
# return if shift is 0 # return if shift is 0

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__ashldi3) ASM_FUNC(__ashldi3)
cmp r2, #31 cmp r2, #31

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__ashrdi3) ASM_FUNC(__ashrdi3)
cmp r2, #31 cmp r2, #31

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__clzsi2) ASM_FUNC(__clzsi2)
@ frame_needed = 1, uses_anonymous_args = 0 @ frame_needed = 1, uses_anonymous_args = 0

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__ctzsi2) ASM_FUNC(__ctzsi2)
uxth r3, r0 uxth r3, r0

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__divdi3) ASM_FUNC(__divdi3)
@ args = 0, pretend = 0, frame = 0 @ args = 0, pretend = 0, frame = 0

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__divsi3) ASM_FUNC(__divsi3)
eor r3, r0, r0, asr #31 eor r3, r0, r0, asr #31

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
# #
#UINT64 #UINT64

View File

@ -6,7 +6,7 @@
// //
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
// //
// A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}}, // A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}},

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
# #
#VOID #VOID

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
#VOID #VOID
#EFIAPI #EFIAPI

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__lshrdi3) ASM_FUNC(__lshrdi3)
cmp r2, #31 cmp r2, #31

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
# VOID # VOID
# EFIAPI # EFIAPI

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__moddi3) ASM_FUNC(__moddi3)
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__modsi3) ASM_FUNC(__modsi3)
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__muldi3) ASM_FUNC(__muldi3)
stmfd sp!, {r4, r5, r6, r7, lr} stmfd sp!, {r4, r5, r6, r7, lr}

View File

@ -7,7 +7,7 @@
#**/ #**/
# #
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.syntax unified .syntax unified

View File

@ -7,7 +7,7 @@
#**/ #**/
# #
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.syntax unified .syntax unified

View File

@ -7,7 +7,7 @@
#**/ #**/
# #
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.syntax unified .syntax unified

View File

@ -7,7 +7,7 @@
#**/ #**/
# #
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.syntax unified .syntax unified

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__ucmpdi2) ASM_FUNC(__ucmpdi2)
stmfd sp!, {r4, r5, r8, lr} stmfd sp!, {r4, r5, r8, lr}

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__udivdi3) ASM_FUNC(__udivdi3)
stmfd sp!, {r7, lr} stmfd sp!, {r7, lr}

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.syntax unified .syntax unified

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
.syntax unified .syntax unified

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__umoddi3) ASM_FUNC(__umoddi3)
stmfd sp!, {r7, lr} stmfd sp!, {r7, lr}

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(__umodsi3) ASM_FUNC(__umodsi3)
stmfd sp!, {r4, r5, r7, lr} stmfd sp!, {r4, r5, r7, lr}

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
# #
#UINT32 #UINT32

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
# #
#UINT32 #UINT32

View File

@ -7,7 +7,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(GccSemihostCall) ASM_FUNC(GccSemihostCall)
hlt #0xf000 hlt #0xf000

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
/* /*
Semihosting operation request mechanism Semihosting operation request mechanism

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
#include <Library/ArmLib.h> #include <Library/ArmLib.h>
ASM_FUNC(ArmPlatformPeiBootAction) ASM_FUNC(ArmPlatformPeiBootAction)

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
#include <Library/ArmLib.h> #include <Library/ArmLib.h>
ASM_FUNC(ArmPlatformPeiBootAction) ASM_FUNC(ArmPlatformPeiBootAction)

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(_ModuleEntryPoint) ASM_FUNC(_ModuleEntryPoint)
// Do early platform specific actions // Do early platform specific actions

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
#include <Arm/AArch32.h> #include <Arm/AArch32.h>

View File

@ -6,7 +6,7 @@
# #
#include <AArch64/AArch64.h> #include <AArch64/AArch64.h>
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
#include <Base.h> #include <Base.h>
#include <AutoGen.h> #include <AutoGen.h>

View File

@ -5,7 +5,7 @@
# #
#======================================================================================= #=======================================================================================
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
#include <AArch64/AArch64.h> #include <AArch64/AArch64.h>
// Setup EL1 while in EL1 // Setup EL1 while in EL1

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(_ModuleEntryPoint) ASM_FUNC(_ModuleEntryPoint)
// Do early platform specific actions // Do early platform specific actions

View File

@ -8,7 +8,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
#/** #/**
# This allows the caller to switch the stack and return # This allows the caller to switch the stack and return

View File

@ -5,7 +5,7 @@
# #
# #
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
#include <Base.h> #include <Base.h>
#include <AutoGen.h> #include <AutoGen.h>

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(_ModuleEntryPoint) ASM_FUNC(_ModuleEntryPoint)
// Do early platform specific actions // Do early platform specific actions

View File

@ -6,7 +6,7 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
#/** #/**
# This allows the caller to switch the stack and return # This allows the caller to switch the stack and return

View File

@ -5,7 +5,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
.macro mov_i, reg:req, imm:req .macro mov_i, reg:req, imm:req
movz \reg, :abs_g1:\imm movz \reg, :abs_g1:\imm

View File

@ -6,7 +6,7 @@
// //
// //
#include <AsmMacroIoLibV8.h> #include <AsmMacroLib.h>
ASM_FUNC(_ModuleEntryPoint) ASM_FUNC(_ModuleEntryPoint)
// //

View File

@ -6,7 +6,7 @@
// //
// //
#include <AsmMacroIoLib.h> #include <AsmMacroLib.h>
ASM_FUNC(_ModuleEntryPoint) ASM_FUNC(_ModuleEntryPoint)
// Do early platform specific actions // Do early platform specific actions