ArmPkg/ArmMmuLib: Fix ArmReplaceLiveTranslationEntry alignment

This commit is contained in:
Marvin Häuser 2023-04-08 20:46:18 +02:00
parent d477fd49b1
commit 53f2af3ad5
2 changed files with 19 additions and 10 deletions

View File

@ -34,14 +34,25 @@
cbnz SAFE_XREG, 1f ;\
b . ;// We should never get here
#define _ASM_FUNC(Name, Section) \
#define _ASM_FUNC_HDR(Name, Section) \
.global Name ; \
.section #Section, "ax" ; \
.type Name, %function ; \
.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

View File

@ -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