#pragma once #include typedef enum { /// /// Not used. /// EfiReservedMemoryType, /// /// The code portions of a loaded application. /// (Note that UEFI OS loaders are UEFI applications.) /// EfiLoaderCode, /// /// The data portions of a loaded application and the default data allocation /// type used by an application to allocate pool memory. /// EfiLoaderData, /// /// The code portions of a loaded Boot Services Driver. /// EfiBootServicesCode, /// /// The data portions of a loaded Boot Serves Driver, and the default data /// allocation type used by a Boot Services Driver to allocate pool memory. /// EfiBootServicesData, /// /// The code portions of a loaded Runtime Services Driver. /// EfiRuntimeServicesCode, /// /// The data portions of a loaded Runtime Services Driver and the default /// data allocation type used by a Runtime Services Driver to allocate pool memory. /// EfiRuntimeServicesData, /// /// Free (unallocated) memory. /// EfiConventionalMemory, /// /// Memory in which errors have been detected. /// EfiUnusableMemory, /// /// Memory that holds the ACPI tables. /// EfiACPIReclaimMemory, /// /// Address space reserved for use by the firmware. /// EfiACPIMemoryNVS, /// /// Used by system firmware to request that a memory-mapped IO region /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services. /// EfiMemoryMappedIO, /// /// System memory-mapped IO region that is used to translate memory /// cycles to IO cycles by the processor. /// EfiMemoryMappedIOPortSpace, /// /// Address space reserved by the firmware for code that is part of the processor. /// EfiPalCode, /// /// A memory region that operates as EfiConventionalMemory, /// however it happens to also support byte-addressable non-volatility. /// EfiPersistentMemory, /// /// A memory region that describes system memory that has not been accepted /// by a corresponding call to the underlying isolation architecture. /// EfiUnacceptedMemoryType, EfiMaxMemoryType, // // +---------------------------------------------------+ // | 0..(EfiMaxMemoryType - 1) - Normal memory type | // +---------------------------------------------------+ // | EfiMaxMemoryType..0x6FFFFFFF - Invalid | // +---------------------------------------------------+ // | 0x70000000..0x7FFFFFFF - OEM reserved | // +---------------------------------------------------+ // | 0x80000000..0xFFFFFFFF - OS reserved | // +---------------------------------------------------+ // MEMORY_TYPE_OEM_RESERVED_MIN = 0x70000000, MEMORY_TYPE_OEM_RESERVED_MAX = 0x7FFFFFFF, MEMORY_TYPE_OS_RESERVED_MIN = 0x80000000, MEMORY_TYPE_OS_RESERVED_MAX = 0xFFFFFFFF } EFI_MEMORY_TYPE; typedef struct __attribute__((packed)) { uint32_t type; uint64_t physicalStart; uint64_t virtualStart; uint64_t numberOfPages; uint64_t Attribute; } EFI_MEMORY_DESCRIPTOR;