2016-06-15 17:54:10 +02:00
|
|
|
/** @file
|
|
|
|
|
|
|
|
Copyright (c) 2015 - 2016, Linaro Ltd. All rights reserved.<BR>
|
|
|
|
|
2019-04-04 01:03:18 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2016-06-15 17:54:10 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
2021-04-20 13:00:23 +02:00
|
|
|
#ifndef ARM_MMU_LIB_H_
|
|
|
|
#define ARM_MMU_LIB_H_
|
2016-06-15 17:54:10 +02:00
|
|
|
|
|
|
|
#include <Uefi/UefiBaseType.h>
|
|
|
|
|
|
|
|
#include <Library/ArmLib.h>
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ArmConfigureMmu (
|
|
|
|
IN ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable,
|
|
|
|
OUT VOID **TranslationTableBase OPTIONAL,
|
|
|
|
OUT UINTN *TranslationTableSize OPTIONAL
|
|
|
|
);
|
|
|
|
|
2023-02-07 16:09:56 +01:00
|
|
|
/**
|
|
|
|
Convert a region of memory to read-protected, by clearing the access flag.
|
|
|
|
|
|
|
|
@param BaseAddress The start of the region.
|
|
|
|
@param Length The size of the region.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The attributes were set successfully.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES The operation failed due to insufficient memory.
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ArmSetMemoryRegionNoAccess (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
|
|
|
IN UINT64 Length
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Convert a region of memory to read-enabled, by setting the access flag.
|
|
|
|
|
|
|
|
@param BaseAddress The start of the region.
|
|
|
|
@param Length The size of the region.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The attributes were set successfully.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES The operation failed due to insufficient memory.
|
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ArmClearMemoryRegionNoAccess (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
|
|
|
IN UINT64 Length
|
|
|
|
);
|
|
|
|
|
2016-06-15 17:54:10 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ArmSetMemoryRegionNoExec (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
|
|
|
IN UINT64 Length
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ArmClearMemoryRegionNoExec (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
|
|
|
IN UINT64 Length
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ArmSetMemoryRegionReadOnly (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
|
|
|
IN UINT64 Length
|
|
|
|
);
|
|
|
|
|
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
ArmClearMemoryRegionReadOnly (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
|
|
|
IN UINT64 Length
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ArmReplaceLiveTranslationEntry (
|
2022-09-24 18:26:19 +02:00
|
|
|
IN UINT64 *Entry,
|
|
|
|
IN UINT64 Value,
|
|
|
|
IN UINT64 RegionStart,
|
|
|
|
IN BOOLEAN DisableMmu
|
2016-06-15 17:54:10 +02:00
|
|
|
);
|
|
|
|
|
2017-03-01 17:31:40 +01:00
|
|
|
EFI_STATUS
|
|
|
|
ArmSetMemoryAttributes (
|
|
|
|
IN EFI_PHYSICAL_ADDRESS BaseAddress,
|
|
|
|
IN UINT64 Length,
|
2017-03-01 17:31:41 +01:00
|
|
|
IN UINT64 Attributes
|
2017-03-01 17:31:40 +01:00
|
|
|
);
|
|
|
|
|
2021-04-20 13:00:23 +02:00
|
|
|
#endif // ARM_MMU_LIB_H_
|