]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmLib: remove ArmReplaceLiveTranslationEntry() implementation
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 10 Aug 2016 11:43:17 +0000 (13:43 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 11 Aug 2016 10:29:31 +0000 (12:29 +0200)
The function ArmReplaceLiveTranslationEntry() has been moved to
ArmMmuLib, so remove the old implementation from ArmLib.

Note that the new implementation was not exported from the object file,
and so references to it were satisfied by the old version residing in
ArmLib. Since we are removing that one, we need to export the new one
at the same time to prevent the linker from bailing with undefined
reference errors.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
ArmPkg/Library/ArmLib/AArch64/AArch64Support.S
ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S

index 9441f47e30bae46332ae4a7c3de171ddac753e0b..5cef98fd42a0c3a9528382dd096855ced2340567 100644 (file)
@@ -488,64 +488,4 @@ ASM_PFX(ArmReadCurrentEL):
   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
index 7c5d205d940b3094d79a4912beae12dab8d35fed..3834da7bfedd2c192813a0a3027b16e6f1106740 100644 (file)
@@ -14,6 +14,8 @@
 \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
@@ -72,5 +74,7 @@ ASM_PFX(ArmReplaceLiveTranslationEntry):
 4:msr   daif, x2\r
   ret\r
 \r
+ASM_GLOBAL ASM_PFX(ArmReplaceLiveTranslationEntrySize)\r
+\r
 ASM_PFX(ArmReplaceLiveTranslationEntrySize):\r
   .long   . - ArmReplaceLiveTranslationEntry\r