]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain.h
MdeModulePkg DxeCore: Fix issue to print GUID value %g without pointer
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain.h
index ae35fbb5664e5eb084c0a0a9b6d71cfb4e73285c..1a0babba713aa06fc15fdfa40dc9a0852451c30d 100644 (file)
@@ -123,31 +123,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 ///\r
 #define DEPEX_STACK_SIZE_INCREMENT  0x1000\r
 \r
-#if defined (MDE_CPU_IPF)\r
-///\r
-/// For Itanium machines make the default allocations 8K aligned\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (EFI_PAGE_SIZE * 2)\r
-#define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE * 2)\r
-\r
-#elif defined (MDE_CPU_AARCH64)\r
-///\r
-/// 64-bit ARM systems allow the OS to execute with 64 KB page size,\r
-/// so for improved interoperability with the firmware, align the\r
-/// runtime regions to 64 KB as well\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (SIZE_64KB)\r
-#define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE)\r
-\r
-#else\r
-///\r
-/// For generic EFI machines make the default allocations 4K aligned\r
-///\r
-#define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (EFI_PAGE_SIZE)\r
-#define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE)\r
-\r
-#endif\r
-\r
 typedef struct {\r
   EFI_GUID                    *ProtocolGuid;\r
   VOID                        **Protocol;\r
@@ -267,6 +242,26 @@ typedef struct {
 #define LOADED_IMAGE_PRIVATE_DATA_FROM_THIS(a) \\r
           CR(a, LOADED_IMAGE_PRIVATE_DATA, Info, LOADED_IMAGE_PRIVATE_DATA_SIGNATURE)\r
 \r
+#define IMAGE_PROPERTIES_RECORD_CODE_SECTION_SIGNATURE SIGNATURE_32 ('I','P','R','C')\r
+\r
+typedef struct {\r
+  UINT32                 Signature;\r
+  LIST_ENTRY             Link;\r
+  EFI_PHYSICAL_ADDRESS   CodeSegmentBase;\r
+  UINT64                 CodeSegmentSize;\r
+} IMAGE_PROPERTIES_RECORD_CODE_SECTION;\r
+\r
+#define IMAGE_PROPERTIES_RECORD_SIGNATURE SIGNATURE_32 ('I','P','R','D')\r
+\r
+typedef struct {\r
+  UINT32                 Signature;\r
+  LIST_ENTRY             Link;\r
+  EFI_PHYSICAL_ADDRESS   ImageBase;\r
+  UINT64                 ImageSize;\r
+  UINTN                  CodeSegmentCount;\r
+  LIST_ENTRY             CodeSegmentList;\r
+} IMAGE_PROPERTIES_RECORD;\r
+\r
 //\r
 // DXE Core Global Variables\r
 //\r
@@ -2858,6 +2853,15 @@ CoreInitializeMemoryAttributesTable (
   VOID\r
   );\r
 \r
+/**\r
+  Initialize Memory Protection support.\r
+**/\r
+VOID\r
+EFIAPI\r
+CoreInitializeMemoryProtection (\r
+  VOID\r
+  );\r
+\r
 /**\r
   Install MemoryAttributesTable on memory allocation.\r
 \r
@@ -2888,4 +2892,60 @@ RemoveImageRecord (
   IN EFI_RUNTIME_IMAGE_ENTRY  *RuntimeImage\r
   );\r
 \r
+/**\r
+  Protect UEFI image.\r
+\r
+  @param[in]  LoadedImage              The loaded image protocol\r
+  @param[in]  LoadedImageDevicePath    The loaded image device path protocol\r
+**/\r
+VOID\r
+ProtectUefiImage (\r
+  IN EFI_LOADED_IMAGE_PROTOCOL   *LoadedImage,\r
+  IN EFI_DEVICE_PATH_PROTOCOL    *LoadedImageDevicePath\r
+  );\r
+\r
+/**\r
+  Unprotect UEFI image.\r
+\r
+  @param[in]  LoadedImage              The loaded image protocol\r
+  @param[in]  LoadedImageDevicePath    The loaded image device path protocol\r
+**/\r
+VOID\r
+UnprotectUefiImage (\r
+  IN EFI_LOADED_IMAGE_PROTOCOL   *LoadedImage,\r
+  IN EFI_DEVICE_PATH_PROTOCOL    *LoadedImageDevicePath\r
+  );\r
+\r
+/**\r
+  ExitBootServices Callback function for memory protection.\r
+**/\r
+VOID\r
+MemoryProtectionExitBootServicesCallback (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Manage memory permission attributes on a memory range, according to the\r
+  configured DXE memory protection policy.\r
+\r
+  @param  OldType           The old memory type of the range\r
+  @param  NewType           The new memory type of the range\r
+  @param  Memory            The base address of the range\r
+  @param  Length            The size of the range (in bytes)\r
+\r
+  @return EFI_SUCCESS       If the the CPU arch protocol is not installed yet\r
+  @return EFI_SUCCESS       If no DXE memory protection policy has been configured\r
+  @return EFI_SUCCESS       If OldType and NewType use the same permission attributes\r
+  @return other             Return value of gCpu->SetMemoryAttributes()\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ApplyMemoryProtectionPolicy (\r
+  IN  EFI_MEMORY_TYPE       OldType,\r
+  IN  EFI_MEMORY_TYPE       NewType,\r
+  IN  EFI_PHYSICAL_ADDRESS  Memory,\r
+  IN  UINT64                Length\r
+  );\r
+\r
 #endif\r