TianoCore EDK2 master
Loading...
Searching...
No Matches
CpuMmuCommon.c File Reference
#include "CpuDxe.h"

Go to the source code of this file.

Functions

EFI_STATUS SearchGcdMemorySpaces (IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap, IN UINTN NumberOfDescriptors, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, OUT UINTN *StartIndex, OUT UINTN *EndIndex)
 
EFI_STATUS SetGcdMemorySpaceAttributes (IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR *MemorySpaceMap, IN UINTN NumberOfDescriptors, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes)
 
EFI_STATUS EFIAPI CpuSetMemoryAttributes (IN EFI_CPU_ARCH_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 EfiAttributes)
 

Detailed Description

Copyright (c) 2013, ARM Limited. All rights reserved. Copyright (c) 2017, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CpuMmuCommon.c.

Function Documentation

◆ CpuSetMemoryAttributes()

EFI_STATUS EFIAPI CpuSetMemoryAttributes ( IN EFI_CPU_ARCH_PROTOCOL This,
IN EFI_PHYSICAL_ADDRESS  BaseAddress,
IN UINT64  Length,
IN UINT64  EfiAttributes 
)

This function modifies the attributes for the memory region specified by BaseAddress and Length from their current attributes to the attributes specified by Attributes.

Parameters
ThisThe EFI_CPU_ARCH_PROTOCOL instance.
BaseAddressThe physical address that is the start address of a memory region.
LengthThe size in bytes of the memory region.
AttributesThe bit mask of attributes to set for the memory region.
Return values
EFI_SUCCESSThe attributes were set for the memory region.
EFI_ACCESS_DENIEDThe attributes for the memory resource range specified by BaseAddress and Length cannot be modified.
EFI_INVALID_PARAMETERLength is zero.
EFI_OUT_OF_RESOURCESThere are not enough system resources to modify the attributes of the memory resource range.
EFI_UNSUPPORTEDThe 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.

◆ SearchGcdMemorySpaces()

EFI_STATUS SearchGcdMemorySpaces ( IN EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemorySpaceMap,
IN UINTN  NumberOfDescriptors,
IN EFI_PHYSICAL_ADDRESS  BaseAddress,
IN UINT64  Length,
OUT UINTN StartIndex,
OUT UINTN EndIndex 
)

Searches memory descriptors covered by given memory range.

This function searches into the Gcd Memory Space for descriptors (from StartIndex to EndIndex) that contains the memory range specified by BaseAddress and Length.

Parameters
MemorySpaceMapGcd Memory Space Map as array.
NumberOfDescriptorsNumber of descriptors in map.
BaseAddressBaseAddress for the requested range.
LengthLength for the requested range.
StartIndexStart index into the Gcd Memory Space Map.
EndIndexEnd index into the Gcd Memory Space Map.
Return values
EFI_SUCCESSSearch successfully.
EFI_NOT_FOUNDThe requested descriptors does not exist.

Definition at line 31 of file CpuMmuCommon.c.

◆ SetGcdMemorySpaceAttributes()

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.

Parameters
MemorySpaceMapGcd Memory Space Map as array
NumberOfDescriptorsNumber of descriptors in map
BaseAddressBaseAddress for the range
LengthLength for the range
AttributesAttributes to set
Return values
EFI_SUCCESSMemory attributes set successfully
EFI_NOT_FOUNDThe specified range does not exist in Gcd Memory Space

Definition at line 79 of file CpuMmuCommon.c.