diff --git a/ArmPkg/Include/AsmMacroIoLibV8.h b/ArmPkg/Include/AsmMacroIoLibV8.h index 2c2b1cabd0..3ec3f7a065 100644 --- a/ArmPkg/Include/AsmMacroIoLibV8.h +++ b/ArmPkg/Include/AsmMacroIoLibV8.h @@ -34,14 +34,25 @@ cbnz SAFE_XREG, 1f ;\ b . ;// We should never get here -#define _ASM_FUNC(Name, Section) \ - .global Name ; \ - .section #Section, "ax" ; \ - .type Name, %function ; \ +#define _ASM_FUNC_HDR(Name, Section) \ + .global Name ; \ + .section #Section, "ax" ; \ + .type Name, %function ; + +#define _ASM_FUNC(Name, Section) \ + _ASM_FUNC_HDR(Name, Section) \ + Name: + +#define _ASM_FUNC_ALIGN(Name, Section, Align) \ + _ASM_FUNC_HDR(Name, Section) \ + .balign Align ; \ Name: #define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name) +#define ASM_FUNC_ALIGN(Name, Align) \ + _ASM_FUNC_ALIGN(ASM_PFX(Name), .text. ## Name, Align) + #define MOV32(Reg, Val) \ movz Reg, (Val) >> 16, lsl #16 ; \ movk Reg, (Val) & 0xffff diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S index e936a5be4e..240881cf98 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S @@ -69,18 +69,16 @@ .L2_\@: .endm - // Align this routine to a log2 upper bound of its size, so that it is - // guaranteed not to cross a page or block boundary. - .balign 0x200 - //VOID //ArmReplaceLiveTranslationEntry ( // IN UINT64 *Entry, // IN UINT64 Value, // IN UINT64 Address // ) -ASM_FUNC(ArmReplaceLiveTranslationEntry) - +// +// Align this routine to a log2 upper bound of its size, so that it is +// guaranteed not to cross a page or block boundary. +ASM_FUNC_ALIGN(ArmReplaceLiveTranslationEntry, 0x200) // disable interrupts mrs x4, daif msr daifset, #0xf