/** @file\r
Include file that supports UEFI.\r
\r
- This include file must contain things defined in the UEFI 2.4 specification.\r
- If a code construct is defined in the UEFI 2.4 specification it must be included\r
+ This include file must contain things defined in the UEFI 2.5 specification.\r
+ If a code construct is defined in the UEFI 2.5 specification it must be included\r
by this include file.\r
\r
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
//\r
// Memory cacheability attributes\r
//\r
-#define EFI_MEMORY_UC 0x0000000000000001ULL\r
-#define EFI_MEMORY_WC 0x0000000000000002ULL\r
-#define EFI_MEMORY_WT 0x0000000000000004ULL\r
-#define EFI_MEMORY_WB 0x0000000000000008ULL\r
-#define EFI_MEMORY_UCE 0x0000000000000010ULL\r
+#define EFI_MEMORY_UC 0x0000000000000001ULL\r
+#define EFI_MEMORY_WC 0x0000000000000002ULL\r
+#define EFI_MEMORY_WT 0x0000000000000004ULL\r
+#define EFI_MEMORY_WB 0x0000000000000008ULL\r
+#define EFI_MEMORY_UCE 0x0000000000000010ULL\r
//\r
// Physical memory protection attributes\r
//\r
-#define EFI_MEMORY_WP 0x0000000000001000ULL\r
-#define EFI_MEMORY_RP 0x0000000000002000ULL\r
-#define EFI_MEMORY_XP 0x0000000000004000ULL\r
+// Note: UEFI spec 2.5 and following: use EFI_MEMORY_RO as write-protected physical memory\r
+// protection attribute. Also, EFI_MEMORY_WP means cacheability attribute.\r
+//\r
+#define EFI_MEMORY_WP 0x0000000000001000ULL\r
+#define EFI_MEMORY_RP 0x0000000000002000ULL\r
+#define EFI_MEMORY_XP 0x0000000000004000ULL\r
+#define EFI_MEMORY_RO 0x0000000000020000ULL\r
//\r
// Physical memory persistence attribute. \r
// The memory region supports byte-addressable non-volatility.\r
//\r
-#define EFI_MEMORY_NV 0x0000000000008000ULL\r
+#define EFI_MEMORY_NV 0x0000000000008000ULL\r
+//\r
+// The memory region provides higher reliability relative to other memory in the system.\r
+// If all memory has the same reliability, then this bit is not used.\r
+//\r
+#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000ULL\r
//\r
// Runtime memory attribute\r
//\r
-#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL\r
+#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL\r
\r
///\r
/// Memory descriptor version number.\r
\r
@param[in] Type The type of allocation to perform.\r
@param[in] MemoryType The type of memory to allocate.\r
+ MemoryType values in the range 0x70000000..0x7FFFFFFF\r
+ are reserved for OEM use. MemoryType values in the range\r
+ 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders\r
+ that are provided by operating system vendors. The only illegal\r
+ memory type values are those in the range EfiMaxMemoryType..0x6FFFFFFF.\r
@param[in] Pages The number of contiguous 4 KB pages to allocate.\r
@param[in, out] Memory The pointer to a physical address. On input, the way in which the address is\r
used depends on the value of Type.\r
@retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or\r
AllocateMaxAddress or AllocateAddress.\r
2) MemoryType is in the range\r
+ EfiMaxMemoryType..0x6FFFFFFF.\r
3) Memory is NULL.\r
4) MemoryType was EfiPersistentMemory.\r
- EfiMaxMemoryType..0x7FFFFFFF.\r
@retval EFI_OUT_OF_RESOURCES The pages could not be allocated.\r
@retval EFI_NOT_FOUND The requested pages could not be found.\r
\r
Allocates pool memory.\r
\r
@param[in] PoolType The type of pool to allocate.\r
+ MemoryType values in the range 0x70000000..0x7FFFFFFF\r
+ are reserved for OEM use. MemoryType values in the range\r
+ 0x80000000..0xFFFFFFFF are reserved for use by UEFI OS loaders\r
+ that are provided by operating system vendors. The only illegal\r
+ memory type values are those in the range EfiMaxMemoryType..0x6FFFFFFF.\r
@param[in] Size The number of bytes to allocate from the pool.\r
@param[out] Buffer A pointer to a pointer to the allocated buffer if the call succeeds;\r
undefined otherwise.\r
IN CHAR16 *WatchdogData OPTIONAL\r
);\r
\r
-///\r
-/// Enumeration of reset types.\r
-///\r
-typedef enum {\r
- ///\r
- /// Used to induce a system-wide reset. This sets all circuitry within the \r
- /// system to its initial state. This type of reset is asynchronous to system\r
- /// operation and operates withgout regard to cycle boundaries. EfiColdReset \r
- /// is tantamount to a system power cycle.\r
- ///\r
- EfiResetCold,\r
- ///\r
- /// Used to induce a system-wide initialization. The processors are set to their\r
- /// initial state, and pending cycles are not corrupted. If the system does \r
- /// not support this reset type, then an EfiResetCold must be performed.\r
- ///\r
- EfiResetWarm,\r
- ///\r
- /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3\r
- /// state. If the system does not support this reset type, then when the system\r
- /// is rebooted, it should exhibit the EfiResetCold attributes.\r
- ///\r
- EfiResetShutdown,\r
- ///\r
- /// Used to induce a system-wide reset. The exact type of the reset is defined by\r
- /// the EFI_GUID that follows the Null-terminated Unicode string passed into\r
- /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the \r
- /// platform must pick a supported reset type to perform. The platform may\r
- /// optionally log the parameters from any non-normal reset that occurs.\r
- ///\r
- EfiResetPlatformSpecific\r
-} EFI_RESET_TYPE;\r
-\r
/**\r
Resets the entire platform.\r
\r
// EFI Runtime Services Table\r
//\r
#define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')\r
+#define EFI_2_50_SYSTEM_TABLE_REVISION ((2 << 16) | (50))\r
#define EFI_2_40_SYSTEM_TABLE_REVISION ((2 << 16) | (40))\r
#define EFI_2_31_SYSTEM_TABLE_REVISION ((2 << 16) | (31))\r
#define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))\r
#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))\r
#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))\r
#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))\r
-#define EFI_SYSTEM_TABLE_REVISION EFI_2_40_SYSTEM_TABLE_REVISION\r
+#define EFI_SYSTEM_TABLE_REVISION EFI_2_50_SYSTEM_TABLE_REVISION\r
#define EFI_SPECIFICATION_VERSION EFI_SYSTEM_TABLE_REVISION\r
\r
#define EFI_RUNTIME_SERVICES_SIGNATURE SIGNATURE_64 ('R','U','N','T','S','E','R','V')\r
);\r
\r
//\r
-// EFI Load Options Attributes\r
+// EFI Load Option. This data structure describes format of UEFI boot option variables.\r
//\r
-#define LOAD_OPTION_ACTIVE 0x00000001\r
-#define LOAD_OPTION_FORCE_RECONNECT 0x00000002\r
-#define LOAD_OPTION_HIDDEN 0x00000008\r
-#define LOAD_OPTION_CATEGORY 0x00001F00\r
-\r
-#define LOAD_OPTION_CATEGORY_BOOT 0x00000000\r
-#define LOAD_OPTION_CATEGORY_APP 0x00000100\r
+// NOTE: EFI Load Option is a byte packed buffer of variable length fields.\r
+// The first two fields have fixed length. They are declared as members of the\r
+// EFI_LOAD_OPTION structure. All the other fields are variable length fields.\r
+// They are listed in the comment block below for reference purposes.\r
+//\r
+#pragma pack(1)\r
+typedef struct _EFI_LOAD_OPTION {\r
+ ///\r
+ /// The attributes for this load option entry. All unused bits must be zero\r
+ /// and are reserved by the UEFI specification for future growth.\r
+ ///\r
+ UINT32 Attributes;\r
+ ///\r
+ /// Length in bytes of the FilePathList. OptionalData starts at offset\r
+ /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength\r
+ /// of the EFI_LOAD_OPTION descriptor.\r
+ ///\r
+ UINT16 FilePathListLength;\r
+ ///\r
+ /// The user readable description for the load option.\r
+ /// This field ends with a Null character.\r
+ ///\r
+ // CHAR16 Description[];\r
+ ///\r
+ /// A packed array of UEFI device paths. The first element of the array is a\r
+ /// device path that describes the device and location of the Image for this\r
+ /// load option. The FilePathList[0] is specific to the device type. Other\r
+ /// device paths may optionally exist in the FilePathList, but their usage is\r
+ /// OSV specific. Each element in the array is variable length, and ends at\r
+ /// the device path end structure. Because the size of Description is\r
+ /// arbitrary, this data structure is not guaranteed to be aligned on a\r
+ /// natural boundary. This data structure may have to be copied to an aligned\r
+ /// natural boundary before it is used.\r
+ ///\r
+ // EFI_DEVICE_PATH_PROTOCOL FilePathList[];\r
+ ///\r
+ /// The remaining bytes in the load option descriptor are a binary data buffer\r
+ /// that is passed to the loaded image. If the field is zero bytes long, a\r
+ /// NULL pointer is passed to the loaded image. The number of bytes in\r
+ /// OptionalData can be computed by subtracting the starting offset of\r
+ /// OptionalData from total size in bytes of the EFI_LOAD_OPTION.\r
+ ///\r
+ // UINT8 OptionalData[];\r
+} EFI_LOAD_OPTION;\r
+#pragma pack()\r
\r
-#define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001\r
-#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002\r
-#define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300\r
+//\r
+// EFI Load Options Attributes\r
+//\r
+#define LOAD_OPTION_ACTIVE 0x00000001\r
+#define LOAD_OPTION_FORCE_RECONNECT 0x00000002\r
+#define LOAD_OPTION_HIDDEN 0x00000008\r
+#define LOAD_OPTION_CATEGORY 0x00001F00\r
+\r
+#define LOAD_OPTION_CATEGORY_BOOT 0x00000000\r
+#define LOAD_OPTION_CATEGORY_APP 0x00000100\r
+\r
+#define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001\r
+#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002\r
+#define EFI_BOOT_OPTION_SUPPORT_SYSPREP 0x00000010\r
+#define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300\r
\r
///\r
/// EFI Boot Key Data\r