TianoCore EDK2 master
|
#include <Uefi.h>
#include <Library/ArmLib.h>
#include <Library/ArmMmuLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DxeServicesTableLib.h>
#include <Library/CacheMaintenanceLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/UefiLib.h>
#include <Library/CpuLib.h>
#include <Library/DefaultExceptionHandlerLib.h>
#include <Guid/DebugImageInfoTable.h>
#include <Protocol/Cpu.h>
#include <Protocol/DebugSupport.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/MemoryAttribute.h>
Go to the source code of this file.
Functions | |
EFI_STATUS | RegisterInterruptHandler (IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler) |
EFI_STATUS | RegisterDebuggerInterruptHandler (IN EFI_EXCEPTION_TYPE InterruptType, IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler) |
EFI_STATUS EFIAPI | CpuSetMemoryAttributes (IN EFI_CPU_ARCH_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes) |
EFI_STATUS | InitializeExceptions (IN EFI_CPU_ARCH_PROTOCOL *Cpu) |
EFI_STATUS | SyncCacheConfig (IN EFI_CPU_ARCH_PROTOCOL *CpuProtocol) |
UINT64 | EfiAttributeToArmAttribute (IN UINT64 EfiAttributes) |
EFI_STATUS | GetMemoryRegion (IN OUT UINTN *BaseAddress, OUT UINTN *RegionLength, OUT UINTN *RegionAttributes) |
EFI_STATUS | SetGcdMemorySpaceAttributes (IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap, IN UINTN NumberOfDescriptors, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes) |
UINT64 | RegionAttributeToGcdAttribute (IN UINTN PageAttributes) |
Variables | |
BOOLEAN | mIsFlushingGCD |
EFI_MEMORY_ATTRIBUTE_PROTOCOL | mMemoryAttribute |
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CpuDxe.h.
EFI_STATUS EFIAPI CpuSetMemoryAttributes | ( | IN EFI_CPU_ARCH_PROTOCOL * | This, |
IN EFI_PHYSICAL_ADDRESS | BaseAddress, | ||
IN UINT64 | Length, | ||
IN UINT64 | Attributes | ||
) |
This function modifies the attributes for the memory region specified by BaseAddress and Length from their current attributes to the attributes specified by Attributes.
This | The EFI_CPU_ARCH_PROTOCOL instance. |
BaseAddress | The physical address that is the start address of a memory region. |
Length | The size in bytes of the memory region. |
Attributes | The bit mask of attributes to set for the memory region. |
EFI_SUCCESS | The attributes were set for the memory region. |
EFI_ACCESS_DENIED | The attributes for the memory resource range specified by BaseAddress and Length cannot be modified. |
EFI_INVALID_PARAMETER | Length is zero. |
EFI_OUT_OF_RESOURCES | There are not enough system resources to modify the attributes of the memory resource range. |
EFI_UNSUPPORTED | The processor does not support one or more bytes of the memory resource range specified by BaseAddress and Length. The bit mask of attributes is not support for the memory resource range specified by BaseAddress and Length. |
Implementation of SetMemoryAttributes() service of CPU Architecture Protocol.
This function modifies the attributes for the memory region specified by BaseAddress and Length from their current attributes to the attributes specified by Attributes.
This | The EFI_CPU_ARCH_PROTOCOL instance. |
BaseAddress | The physical address that is the start address of a memory region. |
Length | The size in bytes of the memory region. |
Attributes | The bit mask of attributes to set for the memory region. |
EFI_SUCCESS | The attributes were set for the memory region. |
EFI_ACCESS_DENIED | The attributes for the memory resource range specified by BaseAddress and Length cannot be modified. |
EFI_INVALID_PARAMETER | Length is zero. Attributes specified an illegal combination of attributes that cannot be set together. |
EFI_OUT_OF_RESOURCES | There are not enough system resources to modify the attributes of the memory resource range. |
EFI_UNSUPPORTED | The processor does not support one or more bytes of the memory resource range specified by BaseAddress and Length. The bit mask of attributes is not support for the memory resource range specified by BaseAddress and Length. |
This function modifies the attributes for the memory region specified by BaseAddress and Length from their current attributes to the attributes specified by Attributes.
This | The EFI_CPU_ARCH_PROTOCOL instance. |
BaseAddress | The physical address that is the start address of a memory region. |
Length | The size in bytes of the memory region. |
EfiAttributes | The bit mask of attributes to set for the memory region. |
EFI_SUCCESS | The attributes were set for the memory region. |
EFI_ACCESS_DENIED | The attributes for the memory resource range specified by BaseAddress and Length cannot be modified. |
EFI_INVALID_PARAMETER | Length is zero. |
EFI_OUT_OF_RESOURCES | There are not enough system resources to modify the attributes of the memory resource range. |
EFI_UNSUPPORTED | The processor does not support one or more bytes of the memory resource range specified by BaseAddress and Length. The bit mask of attributes is not support for the memory resource range specified by BaseAddress and Length. |
Definition at line 228 of file CpuMmuCommon.c.
UINT64 EfiAttributeToArmAttribute | ( | IN UINT64 | EfiAttributes | ) |
EFI_STATUS GetMemoryRegion | ( | IN OUT UINTN * | BaseAddress, |
OUT UINTN * | RegionLength, | ||
OUT UINTN * | RegionAttributes | ||
) |
Retrieves a memory region from a given base address.
This function retrieves a memory region starting from a given base address.
[in,out] | BaseAddress | The base address from which to retrieve the memory region. On successful return, this is updated to the end address of the retrieved region. |
[out] | RegionLength | The length of the retrieved memory region. |
[out] | RegionAttributes | The attributes of the retrieved memory region. |
EFI_STATUS | Returns EFI_SUCCESS if the memory region is retrieved successfully, or the status of the recursive call to GetMemoryRegionRec. |
EFI_NOT_FOUND | The memory region was not found. |
EFI_NO_MAPPING | The translation table entry associated with BaseAddress is invalid. |
EFI_INVALID_PARAMETER | One of the input parameters was NULL. |
Get the memory region that contains the specified address. A memory region is defined as a contiguous set of pages with the same attributes.
RegionLength and RegionAttributes are only valid if EFI_SUCCESS is returned.
[in,out] | BaseAddress | On input, the address to search for. On output, the base address of the region found. |
[out] | RegionLength | The length of the region found. |
[out] | RegionAttributes | The attributes of the region found. |
EFI_SUCCESS | Region found |
EFI_NOT_FOUND | Region not found |
EFI_UNSUPPORTED | Large pages are unsupported |
EFI_NO_MAPPING | The page specified by BaseAddress is unmapped |
EFI_INVALID_PARAMETER | The BaseAddress exceeds the addressable range of the translation table. |
EFI_STATUS InitializeExceptions | ( | IN EFI_CPU_ARCH_PROTOCOL * | Cpu | ) |
Initialize interrupt handling for DXE phase.
Cpu | A pointer of EFI_CPU_ARCH_PROTOCOL instance. |
Definition at line 15 of file Exception.c.
Convert an arch specific set of page attributes into a mask of EFI_MEMORY_xx constants.
PageAttributes | The set of page attributes. |
The | mask of EFI_MEMORY_xx constants. |
Convert an arch specific set of page attributes into a mask of EFI_MEMORY_xx constants.
[in] | PageAttributes | The set of page attributes. |
EFI_SUCCESS | The attributes were converted successfully. |
EFI_UNSUPPORTED | The section attributes did not have a GCD transation. |
EFI_STATUS RegisterDebuggerInterruptHandler | ( | IN EFI_EXCEPTION_TYPE | InterruptType, |
IN EFI_CPU_INTERRUPT_HANDLER | InterruptHandler | ||
) |
This function registers and enables the handler specified by InterruptHandler for a processor interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the handler for the processor interrupt or exception type specified by InterruptType is uninstalled. The installed handler is called once for each processor interrupt or exception.
InterruptType | A pointer to the processor's current interrupt state. Set to TRUE if interrupts are enabled and FALSE if interrupts are disabled. |
InterruptHandler | A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs. If this parameter is NULL, then the handler will be uninstalled. |
EFI_SUCCESS | The handler for the processor interrupt was successfully installed or uninstalled. |
EFI_ALREADY_STARTED | InterruptHandler is not NULL, and a handler for InterruptType was previously installed. |
EFI_INVALID_PARAMETER | InterruptHandler is NULL, and a handler for InterruptType was not previously installed. |
EFI_UNSUPPORTED | The interrupt specified by InterruptType is not supported. |
EFI_STATUS RegisterInterruptHandler | ( | IN EFI_EXCEPTION_TYPE | InterruptType, |
IN EFI_CPU_INTERRUPT_HANDLER | InterruptHandler | ||
) |
This function registers and enables the handler specified by InterruptHandler for a processor interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the handler for the processor interrupt or exception type specified by InterruptType is uninstalled. The installed handler is called once for each processor interrupt or exception.
InterruptType | A pointer to the processor's current interrupt state. Set to TRUE if interrupts are enabled and FALSE if interrupts are disabled. |
InterruptHandler | A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs. If this parameter is NULL, then the handler will be uninstalled. |
EFI_SUCCESS | The handler for the processor interrupt was successfully installed or uninstalled. |
EFI_ALREADY_STARTED | InterruptHandler is not NULL, and a handler for InterruptType was previously installed. |
EFI_INVALID_PARAMETER | InterruptHandler is NULL, and a handler for InterruptType was not previously installed. |
EFI_UNSUPPORTED | The interrupt specified by InterruptType is not supported. |
Definition at line 93 of file Exception.c.
EFI_STATUS SetGcdMemorySpaceAttributes | ( | IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR * | MemorySpaceMap, |
IN UINTN | NumberOfDescriptors, | ||
IN EFI_PHYSICAL_ADDRESS | BaseAddress, | ||
IN UINT64 | Length, | ||
IN UINT64 | Attributes | ||
) |
Sets the attributes for a specified range in Gcd Memory Space Map.
This function sets the attributes for a specified range in Gcd Memory Space Map.
MemorySpaceMap | Gcd Memory Space Map as array |
NumberOfDescriptors | Number of descriptors in map |
BaseAddress | BaseAddress for the range |
Length | Length for the range |
Attributes | Attributes to set |
EFI_SUCCESS | Memory attributes set successfully |
EFI_NOT_FOUND | The specified range does not exist in Gcd Memory Space |
Definition at line 79 of file CpuMmuCommon.c.
EFI_STATUS SyncCacheConfig | ( | IN EFI_CPU_ARCH_PROTOCOL * | CpuProtocol | ) |
Sync the GCD memory space attributes with the translation table.
[in] | CpuProtocol | The CPU architectural protocol instance. |
EFI_SUCCESS | The GCD memory space attributes are synced with the MMU page table. |
Others | The return value of GetMemorySpaceMap(). |
|
extern |
Definition at line 290 of file MemoryAttribute.c.