mrs x0, CurrentEL\r
ret\r
\r
-\r
- .macro __replace_entry, el\r
-\r
- // disable the MMU\r
- mrs x8, sctlr_el\el\r
- bic x9, x8, #CTRL_M_BIT\r
- msr sctlr_el\el, x9\r
- isb\r
-\r
- // write updated entry\r
- str x1, [x0]\r
-\r
- // invalidate again to get rid of stale clean cachelines that may\r
- // have been filled speculatively since the last invalidate\r
- dmb sy\r
- dc ivac, x0\r
-\r
- // flush the TLBs\r
- .if \el == 1\r
- tlbi vmalle1\r
- .else\r
- tlbi alle\el\r
- .endif\r
- dsb sy\r
-\r
- // re-enable the MMU\r
- msr sctlr_el\el, x8\r
- isb\r
- .endm\r
-\r
-//VOID\r
-//ArmReplaceLiveTranslationEntry (\r
-// IN UINT64 *Entry,\r
-// IN UINT64 Value\r
-// )\r
-ASM_PFX(ArmReplaceLiveTranslationEntry):\r
-\r
- // disable interrupts\r
- mrs x2, daif\r
- msr daifset, #0xf\r
- isb\r
-\r
- // clean and invalidate first so that we don't clobber\r
- // adjacent entries that are dirty in the caches\r
- dc civac, x0\r
- dsb ish\r
-\r
- EL1_OR_EL2_OR_EL3(x3)\r
-1:__replace_entry 1\r
- b 4f\r
-2:__replace_entry 2\r
- b 4f\r
-3:__replace_entry 3\r
-\r
-4:msr daif, x2\r
- ret\r
-\r
-ASM_PFX(ArmReplaceLiveTranslationEntrySize):\r
- .long . - ArmReplaceLiveTranslationEntry\r
-\r
ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
\r
#include <AsmMacroIoLibV8.h>\r
\r
+GCC_ASM_EXPORT(ArmReplaceLiveTranslationEntry)\r
+\r
.set CTRL_M_BIT, (1 << 0)\r
\r
.macro __replace_entry, el\r
4:msr daif, x2\r
ret\r
\r
+ASM_GLOBAL ASM_PFX(ArmReplaceLiveTranslationEntrySize)\r
+\r
ASM_PFX(ArmReplaceLiveTranslationEntrySize):\r
.long . - ArmReplaceLiveTranslationEntry\r