]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: introduce ArmMmuLib library class
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 15 Jun 2016 15:54:10 +0000 (17:54 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 7 Jul 2016 12:33:47 +0000 (14:33 +0200)
Introduce the library class ArmMmuLib, which encapsulates the functionality
to set up and modify page table entries.

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/ArmPkg.dec
ArmPkg/Include/Library/ArmMmuLib.h [new file with mode: 0644]

index 75c238aa1e3d580318b941dc4d2eb7cbcb537cc2..c189117c674d5a4c400883d20e8dd4cab3ef5ade 100644 (file)
@@ -34,6 +34,7 @@
 \r
 [LibraryClasses.common]\r
   ArmLib|Include/Library/ArmLib.h\r
+  ArmMmuLib|Include/Library/ArmMmuLib.h\r
   SemihostLib|Include/Library/Semihosting.h\r
   UncachedMemoryAllocationLib|Include/Library/UncachedMemoryAllocationLib.h\r
   DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h\r
diff --git a/ArmPkg/Include/Library/ArmMmuLib.h b/ArmPkg/Include/Library/ArmMmuLib.h
new file mode 100644 (file)
index 0000000..c1d4387
--- /dev/null
@@ -0,0 +1,65 @@
+/** @file\r
+\r
+  Copyright (c) 2015 - 2016, Linaro Ltd. All rights reserved.<BR>\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __ARM_MMU_LIB__\r
+#define __ARM_MMU_LIB__\r
+\r
+#include <Uefi/UefiBaseType.h>\r
+\r
+#include <Library/ArmLib.h>\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+ArmConfigureMmu (\r
+  IN  ARM_MEMORY_REGION_DESCRIPTOR  *MemoryTable,\r
+  OUT VOID                          **TranslationTableBase OPTIONAL,\r
+  OUT UINTN                         *TranslationTableSize  OPTIONAL\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+ArmSetMemoryRegionNoExec (\r
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,\r
+  IN  UINT64                    Length\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+ArmClearMemoryRegionNoExec (\r
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,\r
+  IN  UINT64                    Length\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+ArmSetMemoryRegionReadOnly (\r
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,\r
+  IN  UINT64                    Length\r
+  );\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+ArmClearMemoryRegionReadOnly (\r
+  IN  EFI_PHYSICAL_ADDRESS      BaseAddress,\r
+  IN  UINT64                    Length\r
+  );\r
+\r
+VOID\r
+EFIAPI\r
+ArmReplaceLiveTranslationEntry (\r
+  IN  UINT64  *Entry,\r
+  IN  UINT64  Value\r
+  );\r
+\r
+#endif\r