44 for (Index = 0; Index < NumberOfDescriptors; Index++) {
45 if ((BaseAddress >= MemorySpaceMap[Index].BaseAddress) &&
46 (BaseAddress < (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length)))
51 if (((BaseAddress + Length - 1) >= MemorySpaceMap[Index].BaseAddress) &&
52 ((BaseAddress + Length - 1) < (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length)))
96 "SetGcdMemorySpaceAttributes[0x%lX; 0x%lX] = 0x%lX\n",
103 if ((Length & EFI_PAGE_MASK) != 0) {
106 "Warning: We do not support smaller granularity than 4KB on ARM Architecture (passed length: 0x%lX).\n",
122 if (EFI_ERROR (Status)) {
129 for (Index = StartIndex; Index <= EndIndex; Index++) {
137 if (BaseAddress >= MemorySpaceMap[Index].BaseAddress) {
138 RegionStart = BaseAddress;
140 RegionStart = MemorySpaceMap[Index].BaseAddress;
143 if ((BaseAddress + Length - 1) < (MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length)) {
144 RegionLength = BaseAddress + Length - RegionStart;
146 RegionLength = MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - RegionStart;
152 gDS->SetMemorySpaceAttributes (
155 (MemorySpaceMap[Index].Attributes & ~EFI_MEMORY_CACHETYPE_MASK) | (MemorySpaceMap[Index].Capabilities & Attributes)
189 IN UINT64 EfiAttributes
194 UINTN RegionBaseAddress;
196 UINTN RegionArmAttributes;
198 if (mIsFlushingGCD) {
202 if ((BaseAddress & (SIZE_4KB - 1)) != 0) {
204 DEBUG ((DEBUG_PAGE,
"CpuSetMemoryAttributes(%lx, %lx, %lx): Minimum granularity is SIZE_4KB\n", BaseAddress, Length, EfiAttributes));
205 return EFI_UNSUPPORTED;
209 ArmAttributes = EfiAttributeToArmAttribute (EfiAttributes);
212 RegionBaseAddress = BaseAddress;
213 Status = GetMemoryRegion (&RegionBaseAddress, &RegionLength, &RegionArmAttributes);
217 if (EFI_ERROR (Status) || (RegionArmAttributes != ArmAttributes) ||
218 ((BaseAddress + Length) > (RegionBaseAddress + RegionLength)))
EFI_STATUS ArmSetMemoryAttributes(IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length, IN UINT64 Attributes, IN UINT64 AttributeMask)
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)
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)
#define DEBUG(Expression)
@ EfiGcdMemoryTypeNonExistent
UINT64 EFI_PHYSICAL_ADDRESS