## Include/Ppi/ArmMpCoreInfo.h\r
gArmMpCoreInfoPpiGuid = { 0x6847cc74, 0xe9ec, 0x4f8f, {0xa2, 0x9d, 0xab, 0x44, 0xe7, 0x54, 0xa8, 0xfc} }\r
\r
-[Protocols.common]\r
- gVirtualUncachedPagesProtocolGuid = { 0xAD651C7D, 0x3C22, 0x4DBF, { 0x92, 0xe8, 0x38, 0xa7, 0xcd, 0xae, 0x87, 0xb2 } }\r
-\r
[PcdsFeatureFlag.common]\r
gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE|BOOLEAN|0x00000001\r
\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&mCpuHandle,\r
&gEfiCpuArchProtocolGuid, &mCpu,\r
- &gVirtualUncachedPagesProtocolGuid, &gVirtualUncachedPages,\r
NULL\r
);\r
\r
#include <Protocol/Cpu.h>\r
#include <Protocol/DebugSupport.h>\r
#include <Protocol/DebugSupportPeriodicCallback.h>\r
-#include <Protocol/VirtualUncachedPages.h>\r
#include <Protocol/LoadedImage.h>\r
\r
\r
IN UINT64 Attributes\r
);\r
\r
-extern VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages;\r
-\r
#endif // __CPU_DXE_ARM_EXCEPTION_H__\r
[Protocols]\r
gEfiCpuArchProtocolGuid\r
gEfiDebugSupportPeriodicCallbackProtocolGuid\r
- gVirtualUncachedPagesProtocolGuid\r
\r
[Guids]\r
gEfiDebugImageInfoTableGuid\r
return EFI_SUCCESS;\r
}\r
}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuConvertPagesToUncachedVirtualAddress (\r
- IN VIRTUAL_UNCACHED_PAGES_PROTOCOL *This,\r
- IN EFI_PHYSICAL_ADDRESS Address,\r
- IN UINTN Length,\r
- IN EFI_PHYSICAL_ADDRESS VirtualMask,\r
- OUT UINT64 *Attributes OPTIONAL\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_GCD_MEMORY_SPACE_DESCRIPTOR GcdDescriptor;\r
-\r
- if (Attributes != NULL) {\r
- Status = gDS->GetMemorySpaceDescriptor (Address, &GcdDescriptor);\r
- if (!EFI_ERROR (Status)) {\r
- *Attributes = GcdDescriptor.Attributes;\r
- }\r
- }\r
-\r
- //\r
- // Make this address range page fault if accessed. If it is a DMA buffer than this would\r
- // be the PCI address. Code should always use the CPU address, and we will or in VirtualMask\r
- // to that address.\r
- //\r
- Status = SetMemoryAttributes (Address, Length, EFI_MEMORY_RO, 0);\r
- if (!EFI_ERROR (Status)) {\r
- Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_UC, VirtualMask);\r
- }\r
-\r
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuConvertPagesToUncachedVirtualAddress()\n Unmapped 0x%08lx Mapped 0x%08lx 0x%x bytes\n", Address, Address | VirtualMask, Length));\r
-\r
- return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CpuReconvertPages (\r
- IN VIRTUAL_UNCACHED_PAGES_PROTOCOL *This,\r
- IN EFI_PHYSICAL_ADDRESS Address,\r
- IN UINTN Length,\r
- IN EFI_PHYSICAL_ADDRESS VirtualMask,\r
- IN UINT64 Attributes\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
- DEBUG ((DEBUG_INFO | DEBUG_LOAD, "CpuReconvertPages(%lx, %x, %lx, %lx)\n", Address, Length, VirtualMask, Attributes));\r
-\r
- //\r
- // Unmap the aliased Address\r
- //\r
- Status = SetMemoryAttributes (Address | VirtualMask, Length, EFI_MEMORY_RO, 0);\r
- if (!EFI_ERROR (Status)) {\r
- //\r
- // Restore atttributes\r
- //\r
- Status = SetMemoryAttributes (Address, Length, Attributes, 0);\r
- }\r
-\r
- return Status;\r
-}\r
-\r
-\r
-VIRTUAL_UNCACHED_PAGES_PROTOCOL gVirtualUncachedPages = {\r
- CpuConvertPagesToUncachedVirtualAddress,\r
- CpuReconvertPages\r
-};\r
+++ /dev/null
-/** @file\r
-\r
- Copyright (c) 2008 - 2010, Apple Inc. 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 __VIRTUAL_UNCACHED_PAGES_ROTOCOL_H__\r
-#define __VIRTUAL_UNCACHED_PAGES_ROTOCOL_H__\r
-\r
-//\r
-// Protocol GUID\r
-//\r
-#define VIRTUAL_UNCACHED_PAGES_PROTOCOL_GUID { 0xAD651C7D, 0x3C22, 0x4DBF, { 0x92, 0xe8, 0x38, 0xa7, 0xcd, 0xae, 0x87, 0xb2 } }\r
-\r
-\r
-\r
-//\r
-// Protocol interface structure\r
-//\r
-typedef struct _VIRTUAL_UNCACHED_PAGES_PROTOCOL VIRTUAL_UNCACHED_PAGES_PROTOCOL;\r
-\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *CONVERT_PAGES_TO_UNCACHED_VIRTUAL_ADDRESS) (\r
- IN VIRTUAL_UNCACHED_PAGES_PROTOCOL *This,\r
- IN EFI_PHYSICAL_ADDRESS Address,\r
- IN UINTN Length,\r
- IN EFI_PHYSICAL_ADDRESS VirtualMask,\r
- OUT UINT64 *Attributes OPTIONAL\r
- );\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *FREE_CONVERTED_PAGES) (\r
- IN VIRTUAL_UNCACHED_PAGES_PROTOCOL *This,\r
- IN EFI_PHYSICAL_ADDRESS Address,\r
- IN UINTN Length,\r
- IN EFI_PHYSICAL_ADDRESS VirtualMask,\r
- IN UINT64 Attributes\r
- );\r
-\r
-\r
-\r
-struct _VIRTUAL_UNCACHED_PAGES_PROTOCOL {\r
- CONVERT_PAGES_TO_UNCACHED_VIRTUAL_ADDRESS ConvertPages;\r
- FREE_CONVERTED_PAGES RevertPages;\r
-};\r
-\r
-extern EFI_GUID gVirtualUncachedPagesProtocolGuid;\r
-\r
-#endif\r