Checked in the Protocols introduced in UEFI/PI.
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jun 2007 10:12:02 +0000 (10:12 +0000)
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jun 2007 10:12:02 +0000 (10:12 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2674 6f19259b-4bc3-4df7-8a09-765794883524

93 files changed:
MdePkg/Include/Ipf/PalApi.h
MdePkg/Include/Protocol/AbsolutePointer.h [new file with mode: 0644]
MdePkg/Include/Protocol/AcpiTable.h [new file with mode: 0644]
MdePkg/Include/Protocol/Arp.h [new file with mode: 0644]
MdePkg/Include/Protocol/AuthenticationInfo.h [new file with mode: 0644]
MdePkg/Include/Protocol/Bds.h [new file with mode: 0644]
MdePkg/Include/Protocol/Bis.h [new file with mode: 0644]
MdePkg/Include/Protocol/BlockIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/BusSpecificDriverOverride.h [new file with mode: 0644]
MdePkg/Include/Protocol/ComponentName.h [new file with mode: 0644]
MdePkg/Include/Protocol/ComponentName2.h [new file with mode: 0644]
MdePkg/Include/Protocol/Cpu.h [new file with mode: 0644]
MdePkg/Include/Protocol/DebugPort.h [new file with mode: 0644]
MdePkg/Include/Protocol/DebugSupport.h [new file with mode: 0644]
MdePkg/Include/Protocol/Decompress.h [new file with mode: 0644]
MdePkg/Include/Protocol/DeviceIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/DevicePath.h [new file with mode: 0644]
MdePkg/Include/Protocol/DevicePathFromText.h [new file with mode: 0644]
MdePkg/Include/Protocol/DevicePathToText.h [new file with mode: 0644]
MdePkg/Include/Protocol/DevicePathUtilities.h [new file with mode: 0644]
MdePkg/Include/Protocol/Dhcp4.h [new file with mode: 0644]
MdePkg/Include/Protocol/DiskIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/DriverBinding.h [new file with mode: 0644]
MdePkg/Include/Protocol/DriverConfiguration.h [new file with mode: 0644]
MdePkg/Include/Protocol/DriverDiagnostics.h [new file with mode: 0644]
MdePkg/Include/Protocol/DriverSupportedEfiVersion.h [new file with mode: 0644]
MdePkg/Include/Protocol/Ebc.h [new file with mode: 0644]
MdePkg/Include/Protocol/EdidActive.h [new file with mode: 0644]
MdePkg/Include/Protocol/EdidDiscovered.h [new file with mode: 0644]
MdePkg/Include/Protocol/EdidOverride.h [new file with mode: 0644]
MdePkg/Include/Protocol/FirmwareVolume2.h [new file with mode: 0644]
MdePkg/Include/Protocol/FirmwareVolumeBlock.h [new file with mode: 0644]
MdePkg/Include/Protocol/FormBrowser.h [new file with mode: 0644]
MdePkg/Include/Protocol/GraphicsOutput.h [new file with mode: 0644]
MdePkg/Include/Protocol/GuidedSectionExtaction.h [new file with mode: 0644]
MdePkg/Include/Protocol/Hash.h [new file with mode: 0644]
MdePkg/Include/Protocol/HiiConfigAccess.h [new file with mode: 0644]
MdePkg/Include/Protocol/HiiConfigRouting.h [new file with mode: 0644]
MdePkg/Include/Protocol/HiiDatabase.h [new file with mode: 0644]
MdePkg/Include/Protocol/HiiFont.h [new file with mode: 0644]
MdePkg/Include/Protocol/HiiImage.h [new file with mode: 0644]
MdePkg/Include/Protocol/HiiString.h [new file with mode: 0644]
MdePkg/Include/Protocol/IP4.h [new file with mode: 0644]
MdePkg/Include/Protocol/IP4Config.h [new file with mode: 0644]
MdePkg/Include/Protocol/IScsiInitatorName.h [new file with mode: 0644]
MdePkg/Include/Protocol/LoadFile.h [new file with mode: 0644]
MdePkg/Include/Protocol/ManagedNetwork.h [new file with mode: 0644]
MdePkg/Include/Protocol/Metronome.h [new file with mode: 0644]
MdePkg/Include/Protocol/MonotonicCounter.h [new file with mode: 0644]
MdePkg/Include/Protocol/Mtftp4.h [new file with mode: 0644]
MdePkg/Include/Protocol/NetworkInterfaceIdentifier.h [new file with mode: 0644]
MdePkg/Include/Protocol/Pcd.h [new file with mode: 0644]
MdePkg/Include/Protocol/PciIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/PciRootBridgeIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/PlatformDriverOverride.h [new file with mode: 0644]
MdePkg/Include/Protocol/PlatformToDriverConfiguration.h [new file with mode: 0644]
MdePkg/Include/Protocol/PxeBaseCode.h [new file with mode: 0644]
MdePkg/Include/Protocol/PxeBaseCodeCallBack.h [new file with mode: 0644]
MdePkg/Include/Protocol/RealTimeClock.h [new file with mode: 0644]
MdePkg/Include/Protocol/Reset.h [new file with mode: 0644]
MdePkg/Include/Protocol/Runtime.h [new file with mode: 0644]
MdePkg/Include/Protocol/ScsiIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/ScsiPassThru.h [new file with mode: 0644]
MdePkg/Include/Protocol/ScsiPassThruExt.h [new file with mode: 0644]
MdePkg/Include/Protocol/Security.h [new file with mode: 0644]
MdePkg/Include/Protocol/SecurityPolicy.h [new file with mode: 0644]
MdePkg/Include/Protocol/SerialIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/ServiceBinding.h [new file with mode: 0644]
MdePkg/Include/Protocol/SimpleFileSystem.h [new file with mode: 0644]
MdePkg/Include/Protocol/SimpleNetwork.h [new file with mode: 0644]
MdePkg/Include/Protocol/SimplePointer.h [new file with mode: 0644]
MdePkg/Include/Protocol/SimpleTextIn.h [new file with mode: 0644]
MdePkg/Include/Protocol/SimpleTextInEx.h [new file with mode: 0644]
MdePkg/Include/Protocol/SimpleTextOut.h [new file with mode: 0644]
MdePkg/Include/Protocol/SmbusHc.h [new file with mode: 0644]
MdePkg/Include/Protocol/StatusCode.h [new file with mode: 0644]
MdePkg/Include/Protocol/TapeIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/Tcp4.h [new file with mode: 0644]
MdePkg/Include/Protocol/Timer.h [new file with mode: 0644]
MdePkg/Include/Protocol/Udp4.h [new file with mode: 0644]
MdePkg/Include/Protocol/UgaDraw.h [new file with mode: 0644]
MdePkg/Include/Protocol/UgaIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/UnicodeCollation.h [new file with mode: 0644]
MdePkg/Include/Protocol/Usb2HostController.h [new file with mode: 0644]
MdePkg/Include/Protocol/UsbHostController.h [new file with mode: 0644]
MdePkg/Include/Protocol/UsbIo.h [new file with mode: 0644]
MdePkg/Include/Protocol/Variable.h [new file with mode: 0644]
MdePkg/Include/Protocol/VariableWrite.h [new file with mode: 0644]
MdePkg/Include/Protocol/WatchdogTimer.h [new file with mode: 0644]
MdePkg/Include/Uefi/UefiBaseType.h
MdePkg/Include/Uefi/UefiDevicePath.h [deleted file]
MdePkg/Include/Uefi/UefiInternalFormRepresentation.h
MdePkg/Include/Uefi/UefiSpec.h

index 0afa3d3..4f079ad 100644 (file)
@@ -28,4 +28,820 @@ typedef struct {
   UINT64                    r11;\r
 } PAL_CALL_RETURN;\r
 \r
+\r
+\r
+//\r
+// CacheType of PAL_CACHE_FLUSH.\r
+//\r
+#define PAL_CACHE_FLUSH_INSTRUCTION_ALL        1\r
+#define PAL_CACHE_FLUSH_DATA_ALL                                       2\r
+#define PAL_CACHE_FLUSH_ALL                                                            3\r
+#define PAL_CACHE_FLUSH_SYNC_TO_DATA                   4\r
+\r
+\r
+//\r
+// Bitmask of Opearation of PAL_CACHE_FLUSH.\r
+// \r
+#define PAL_CACHE_FLUSH_INVIDED_LINES                  BIT0\r
+#define PAL_CACHE_FLUSH_PROBE_INTERRUPT                BIT1\r
+\r
+/**\r
+   \r
+  Flush the instruction or data caches. It is required by IPF.\r
+  The PAL procedure supports the Static Registers calling\r
+  convention. It could be called at virtual mode and physical\r
+  mode.\r
+\r
+  @param Index                                                         Index of PAL_CACHE_FLUSH within the\r
+                                                                                                               list of PAL procedures.\r
+  \r
+  @param CacheType                                     Unsigned 64-bit integer indicating\r
+                                                                                                               which cache to flush.\r
+\r
+  @param Operation                                     Formatted bit vector indicating the\r
+                                                                                                               operation of this call.\r
+\r
+  @param ProgressIndicator  Unsigned 64-bit integer specifying\r
+                            the starting position of the flush\r
+                            operation.\r
+  \r
+  @return R9                   Unsigned 64-bit integer specifying the vector\r
+                                                                       number of the pending interrupt.\r
+  \r
+  @return R10                  Unsigned 64-bit integer specifying the\r
+                  starting position of the flush operation.\r
+  \r
+  @return R11                  Unsigned 64-bit integer specifying the vector\r
+                                                                       number of the pending interrupt.\r
+  \r
+  @return Status       2 - Call completed without error, but a PMI\r
+                  was taken during the execution of this\r
+                  procedure.\r
+\r
+  @return Status       1 - Call has not completed flushing due to\r
+                  a pending interrupt.\r
+\r
+  @return Status  0 - Call completed without error\r
+\r
+  @return Status  -2 - Invalid argument\r
+\r
+  @return Status  -3 - Call completed with error\r
+   \r
+**/\r
+#define PAL_CACHE_FLUSH        1\r
+\r
+\r
+//\r
+// Attributes of PAL_CACHE_CONFIG_INFO1\r
+// \r
+#define PAL_CACHE_ATTR_WT      0\r
+#define PAL_CACHE_ATTR_WB              1\r
+\r
+//\r
+// PAL_CACHE_CONFIG_INFO1.StoreHint\r
+// \r
+#define PAL_CACHE_STORE_TEMPORAL                       0\r
+#define PAL_CACHE_STORE_NONE_TEMPORAL  3\r
+\r
+//\r
+// PAL_CACHE_CONFIG_INFO1.StoreHint\r
+// \r
+#define PAL_CACHE_STORE_TEMPORAL_LVL_1                         0\r
+#define PAL_CACHE_STORE_NONE_TEMPORAL_LVL_ALL  3\r
+\r
+//\r
+// PAL_CACHE_CONFIG_INFO1.StoreHint\r
+// \r
+#define PAL_CACHE_LOAD_TEMPORAL_LVL_1                                  0\r
+#define PAL_CACHE_LOAD_NONE_TEMPORAL_LVL_1             1\r
+#define PAL_CACHE_LOAD_NONE_TEMPORAL_LVL_ALL   3\r
+\r
+//\r
+// Detail the characteristics of a given processor controlled\r
+// cache in the cache hierarchy.\r
+// \r
+typedef struct {\r
+       UINT64  IsUnified       : 1;\r
+       UINT64  Attributes      :       2;\r
+       UINT64  Associativity:8;\r
+       UINT64  LineSize:8;\r
+       UINT64  Stride:8;\r
+       UINT64  StoreLatency:8;\r
+       UINT64  StoreHint:8;\r
+       UINT64  LoadHint:8;\r
+} PAL_CACHE_INFO_RETURN1;\r
+\r
+//\r
+// Detail the characteristics of a given processor controlled\r
+// cache in the cache hierarchy.\r
+// \r
+typedef struct {\r
+       UINT64  CacheSize:32;\r
+       UINT64  AliasBoundary:8;\r
+       UINT64  TagLsBits:8;\r
+       UINT64  TagMsBits:8;\r
+} PAL_CACHE_INFO_RETURN2;\r
+\r
+/**\r
+   \r
+  Return detailed instruction or data cache information. It is\r
+  required by IPF. The PAL procedure supports the Static\r
+  Registers calling convention. It could be called at virtual\r
+  mode and physical mode.\r
+  \r
+  @param Index                                 Index of PAL_CACHE_INFO within the list of\r
+                                                                                       PAL procedures.\r
+  \r
+  @param CacheLevel            Unsigned 64-bit integer specifying the\r
+                      level in the cache hierarchy for which\r
+                      information is requested. This value must\r
+                      be between 0 and one less than the value\r
+                      returned in the cache_levels return value\r
+                      from PAL_CACHE_SUMMARY.\r
+  \r
+  @param CacheType    Unsigned 64-bit integer with a value of 1\r
+                      for instruction cache and 2 for data or\r
+                      unified cache. All other values are\r
+                      reserved.\r
+  \r
+  @param Reserved              Should be 0.\r
+  \r
+  \r
+  @return R9                   Detail the characteristics of a given\r
+                  processor controlled cache in the cache\r
+                  hierarchy. See PAL_CACHE_INFO_RETURN1.\r
+  \r
+  @return R10                  Detail the characteristics of a given\r
+                  processor controlled cache in the cache\r
+                  hierarchy. See PAL_CACHE_INFO_RETURN2.\r
+  \r
+  @return R11                  Reserved with 0.\r
+  \r
+  \r
+  @return Status  0 - Call completed without error\r
+\r
+  @return Status  -2 - Invalid argument\r
+\r
+  @return Status  -3 - Call completed with error\r
+   \r
+**/\r
+#define PAL_CACHE_INFO                 2\r
+\r
+\r
+\r
+//\r
+// Level of PAL_CACHE_INIT.\r
+// \r
+#define PAL_CACHE_INIT_ALL     0xffffffffffffffffULL\r
+\r
+//\r
+// Restrict of PAL_CACHE_INIT.\r
+// \r
+#define PAL_CACHE_INIT_NO_RESTRICT     0\r
+#define PAL_CACHE_INIT_RESTRICTED              1\r
+\r
+/**\r
+   \r
+  Initialize the instruction or data caches. It is required by\r
+  IPF. The PAL procedure supports the Static Registers calling\r
+  convention. It could be called at physical mode.\r
+\r
+  @param Index         Index of PAL_CACHE_INIT within the list of PAL\r
+                procedures.\r
+  \r
+  @param Level         Unsigned 64-bit integer containing the level of\r
+                cache to initialize. If the cache level can be\r
+                initialized independently, only that level will\r
+                be initialized. Otherwise\r
+                implementation-dependent side-effects will\r
+                occur.\r
+  \r
+  @param CacheType     Unsigned 64-bit integer with a value of 1 to\r
+                    initialize the instruction cache, 2 to\r
+                    initialize the data cache, or 3 to\r
+                    initialize both. All other values are\r
+                    reserved.\r
+\r
+  @param Restrict      Unsigned 64-bit integer with a value of 0 or\r
+                    1. All other values are reserved. If\r
+                    restrict is 1 and initializing the specified\r
+                    level and cache_type of the cache would\r
+                    cause side-effects, PAL_CACHE_INIT will\r
+                    return -4 instead of initializing the cache.\r
\r
+  \r
+  @return Status  0 - Call completed without error\r
+\r
+  @return Status  -2 - Invalid argument\r
+\r
+  @return Status  -3 - Call completed with error.\r
+  \r
+  @return Status  -4 - Call could not initialize the specified\r
+                  level and cache_type of the cache without\r
+                                                                       side-effects and restrict was 1.  \r
+   \r
+**/\r
+#define PAL_CACHE_INIT                 3 \r
+\r
+\r
+//\r
+// PAL_CACHE_PROTECTION.Method.\r
+// \r
+#define PAL_CACHE_PROTECTION_NONE_PROTECT              0\r
+#define PAL_CACHE_PROTECTION_ODD_PROTECT               1\r
+#define PAL_CACHE_PROTECTION_EVEN_PROTECT              2\r
+#define PAL_CACHE_PROTECTION_ECC_PROTECT               3\r
+\r
+\r
+\r
+//\r
+// PAL_CACHE_PROTECTION.TagOrData.\r
+// \r
+#define PAL_CACHE_PROTECTION_PROTECT_DATA              0\r
+#define PAL_CACHE_PROTECTION_PROTECT_TAG               1\r
+#define PAL_CACHE_PROTECTION_PROTECT_TAG_ANDTHEN_DATA          2\r
+#define PAL_CACHE_PROTECTION_PROTECT_DATA_ANDTHEN_TAG          3\r
+\r
+//\r
+// 32-bit protection information structures.\r
+// \r
+typedef struct {\r
+       UINT32  DataBits:8;\r
+       UINT32  TagProtLsb:6;\r
+       UINT32  TagProtMsb:6;\r
+       UINT32  ProtBits:6;\r
+       UINT32  Method:4;\r
+       UINT32  TagOrData:2;\r
+} PAL_CACHE_PROTECTION;\r
+\r
+/**\r
+   \r
+  Return instruction or data cache protection information. It is\r
+  required by IPF. The PAL procedure supports the Static\r
+  Registers calling convention. It could be called at physical\r
+  mode and Virtual mode.\r
+\r
+  @param Index         Index of PAL_CACHE_PROT_INFO within the list of\r
+                PAL procedures.\r
+\r
+  @param CacheLevel    Unsigned 64-bit integer specifying the level\r
+                    in the cache hierarchy for which information\r
+                    is requested. This value must be between 0\r
+                    and one less than the value returned in the\r
+                    cache_levels return value from\r
+                    PAL_CACHE_SUMMARY.\r
+\r
+  @param CacheType     Unsigned 64-bit integer with a value of 1\r
+                    for instruction cache and 2 for data or\r
+                    unified cache. All other values are\r
+                    reserved.\r
+  \r
+  @return R9                   Detail the characteristics of a given\r
+                  processor controlled cache in the cache\r
+                  hierarchy. See PAL_CACHE_PROTECTION[0..1].\r
+  \r
+  @return R10                  Detail the characteristics of a given\r
+                  processor controlled cache in the cache\r
+                  hierarchy. See PAL_CACHE_PROTECTION[2..3].\r
+  \r
+  @return R11                  Detail the characteristics of a given\r
+                  processor controlled cache in the cache\r
+                  hierarchy. See PAL_CACHE_PROTECTION[4..5].\r
+  \r
+  \r
+  @return Status  0 - Call completed without error\r
+\r
+  @return Status  -2 - Invalid argument\r
+\r
+  @return Status  -3 - Call completed with error.\r
+   \r
+**/\r
+#define PAL_CACHE_PROT_INFO            38\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+///\r
+// ?????????\r
+\r
+\r
+\r
+/**\r
+   \r
+  Returns information on which logical processors share caches.\r
+  It is optional.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_CACHE_SHARED_INFO  43\r
+\r
+\r
+/**\r
+   \r
+  Return a summary of the cache hierarchy. It is required by\r
+  IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_CACHE_SUMMARY              4\r
+\r
+/**\r
+   \r
+  Return a list of supported memory attributes.. It is required\r
+  by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_MEM_ATTRIB                         5\r
+\r
+/**\r
+   \r
+  Used in architected sequence to transition pages from a\r
+  cacheable, speculative attribute to an uncacheable attribute.\r
+  It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_PREFETCH_VISIBILITY        41\r
+\r
+/**\r
+   \r
+  Return information needed for ptc.e instruction to purge\r
+  entire TC. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_PTCE_INFO          6\r
+\r
+/**\r
+   \r
+  Return detailed information about virtual memory features\r
+  supported in the processor. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_VM_INFO                    7\r
+\r
+\r
+/**\r
+   \r
+  Return virtual memory TC and hardware walker page sizes\r
+  supported in the processor. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_VM_PAGE_SIZE 34\r
+\r
+/**\r
+   \r
+  Return summary information about virtual memory features\r
+  supported in the processor. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_VM_SUMMARY         8\r
+\r
+/**\r
+   \r
+  Read contents of a translation register. It is required by\r
+  IPF.\r
+\r
+  @param CallingConvention  Stacked Register\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_VM_TR_READ         261 \r
+\r
+/**\r
+   \r
+  Return configurable processor bus interface features and their\r
+  current settings. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_BUS_GET_FEATURES 9\r
+\r
+\r
+/**\r
+   \r
+  Enable or disable configurable features in processor bus\r
+  interface. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_BUS_SET_FEATURES 10\r
+\r
+\r
+/**\r
+   \r
+  Return the number of instruction and data breakpoint\r
+  registers. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_DEBUG_INFO         11\r
+\r
+/**\r
+   \r
+  Return the fixed component of a processor¡¯s directed address.\r
+  It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_FIXED_ADDR 12\r
+\r
+/**\r
+   \r
+  Return the frequency of the output clock for use by the\r
+  platform, if generated by the processor. It is optinal.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_FREQ_BASE 13\r
+\r
+/**\r
+   \r
+  Return ratio of processor, bus, and interval time counter to\r
+  processor input clock or output clock for platform use, if\r
+  generated by the processor. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_FREQ_RATIOS 14\r
+\r
+/**\r
+   \r
+  Return information on which logical processors map to a\r
+  physical processor die. It is optinal.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_LOGICAL_TO_PHYSICAL 42\r
+\r
+/**\r
+   \r
+  Return the number and type of performance monitors. It is\r
+  required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_PERF_MON_INFO 15\r
+\r
+/**\r
+   \r
+  Specify processor interrupt block address and I/O port space\r
+  address. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_PLATFORM_ADDR 16\r
+\r
+\r
+/**\r
+   \r
+  Return configurable processor features and their current\r
+  setting. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_PROC_GET_FEATURES 17\r
+\r
+\r
+/**\r
+   \r
+  Enable or disable configurable processor features. It is\r
+  required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_PROC_SET_FEATURES 18\r
+\r
+/**\r
+   \r
+  Return AR and CR register information. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_REGISTER_INFO 39 \r
+\r
+/**\r
+   \r
+  Return RSE information. It is required by\r
+  IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_RSE_INFO 19\r
+\r
+/**\r
+   \r
+  Return version of PAL code. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_VERSION 20\r
+\r
+/**\r
+   \r
+  Clear all error information from processor error logging\r
+  registers. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_MC_CLEAR_LOG 21 \r
+\r
+/**\r
+   \r
+  Ensure that all operations that could cause an MCA have\r
+  completed. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_MC_DRAIN 22\r
+\r
+/**\r
+   \r
+  Return Processor Dynamic State for logging by SAL. It is\r
+  optional.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_MC_DYNAMIC_STATE 24 \r
+\r
+/**\r
+   \r
+  Return Processor Machine Check Information and Processor\r
+  Static State for logging by SAL. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_MC_ERROR_INFO 25 Req. Static Both \r
+\r
+/**\r
+   \r
+  Set/Reset Expected Machine Check Indicator. It is required by\r
+  IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_MC_EXPECTED 23 \r
+\r
+/**\r
+   \r
+  Register min-state save area with PAL for machine checks and\r
+  inits. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_MC_REGISTER_MEM 27 \r
+\r
+/**\r
+   \r
+  Restore minimal architected state and return to interrupted\r
+  process. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_MC_RESUME 26 \r
+\r
+/**\r
+   \r
+  Enter the low-power HALT state or an implementation-dependent\r
+  low-power state. It is optinal.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_HALT 28\r
+\r
+\r
+/**\r
+   \r
+  Return the low power capabilities of the processor. It is\r
+  required by IPF.\r
+\r
+  @param CallingConvention  Stacked Register\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_HALT_INFO 257\r
+\r
+\r
+/**\r
+   \r
+  Enter the low power LIGHT HALT state. It is required by\r
+  IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical/Virtual\r
+   \r
+**/\r
+#define PAL_HALT_LIGHT 29 \r
+\r
+/**\r
+   \r
+  Initialize tags and data of a cache line for processor\r
+  testing. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_CACHE_LINE_INIT 31\r
+\r
+/**\r
+   \r
+  Read tag and data of a cache line for diagnostic testing. It\r
+  is optional.\r
+\r
+  @param CallingConvention  Satcked Register\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_CACHE_READ 259 \r
+\r
+/**\r
+   \r
+  Write tag and data of a cache for diagnostic testing. It is\r
+  optional.\r
+\r
+  @param CallingConvention  Satcked Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_CACHE_WRITE 260\r
+\r
+/**\r
+   \r
+  Returns alignment and size requirements needed for the memory\r
+  buffer passed to the PAL_TEST_PROC procedure as well as\r
+  information on self-test control words for the processor self\r
+  tests. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_TEST_INFO 37\r
+\r
+/**\r
+   \r
+  Perform late processor self test. It is required by\r
+  IPF.\r
+\r
+  @param CallingConvention  Stacked Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_TEST_PROC 258\r
+\r
+/**\r
+   \r
+  Return information needed to relocate PAL procedures and PAL\r
+  PMI code to memory. It is required by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_COPY_INFO 30\r
+\r
+/**\r
+   \r
+  Relocate PAL procedures and PAL PMI code to memory. It is\r
+  required by IPF.\r
+\r
+  @param CallingConvention  Stacked Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_COPY_PAL 256\r
+\r
+/**\r
+   \r
+  Enter IA-32 System environment. It is optional.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_ENTER_IA_32_ENV 33\r
+\r
+/**\r
+   \r
+  Register PMI memory entrypoints with processor. It is required\r
+  by IPF.\r
+\r
+  @param CallingConvention  Static Registers\r
+\r
+  @param Mode               Physical\r
+   \r
+**/\r
+#define PAL_PMI_ENTRYPOINT 32\r
+\r
+\r
+\r
 #endif\r
diff --git a/MdePkg/Include/Protocol/AbsolutePointer.h b/MdePkg/Include/Protocol/AbsolutePointer.h
new file mode 100644 (file)
index 0000000..df90fc1
--- /dev/null
@@ -0,0 +1,246 @@
+/** @file\r
+  The file provides services that allow information about a\r
+  absolute pointer device to be retrieved.\r
+  \r
+  Copyright (c) 2006 - 2007, Intel Corporation\r
+  All rights reserved. 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
+  Module Name: AbsolutePointer.h\r
+\r
+**/\r
+\r
+#ifndef __ABSOLUTE_POINTER_H__\r
+#define __ABSOLUTE_POINTER_H__\r
+\r
+\r
+#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \\r
+  { 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }\r
+\r
+\r
+typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL;\r
+\r
+\r
+//*******************************************************\r
+// EFI_ABSOLUTE_POINTER_MODE\r
+//*******************************************************\r
+\r
+\r
+/**\r
+  The following data values in the EFI_ABSOLUTE_POINTER_MODE\r
+  interface are read-only and are changed by using the appropriate\r
+  interface functions:\r
+  Attributes The following bits are set as needed (or'd\r
+  together) to indicate the capabilities of the device\r
+  supported. The remaining bits are undefined and should be\r
+  returned as 0.\r
+\r
+  \r
+  @param AbsoluteMinX The Absolute Minimum of the device on the\r
+                      x-axis.\r
+\r
+  @param AbsoluteMinY The Absolute Minimum of the device on the\r
+                      y axis.\r
+\r
+  @param AbsoluteMinZ The Absolute Minimum of the device on the\r
+                      z-axis.\r
+\r
+  @param AbsoluteMaxX The Absolute Maximum of the device on the\r
+                      x-axis. If 0, and the AbsoluteMinX is 0,\r
+                      then the pointer device does not support a\r
+                      xaxis.\r
+\r
+  @param AbsoluteMaxY The Absolute Maximum of the device on the\r
+                      y -axis. If 0,, and the AbsoluteMinX is 0,\r
+                      then the pointer device does not support a\r
+                      yaxis.\r
+\r
+  @param AbsoluteMaxZ The Absolute Maximum of the device on the\r
+                      z-axis. If 0 , and the AbsoluteMinX is 0,\r
+                      then the pointer device does not support a\r
+                      zaxis. \r
+\r
+**/\r
+typedef struct {\r
+  UINT64 AbsoluteMinX;\r
+  UINT64 AbsoluteMinY;\r
+  UINT64 AbsoluteMinZ;\r
+  UINT64 AbsoluteMaxX;\r
+  UINT64 AbsoluteMaxY;\r
+  UINT64 AbsoluteMaxZ;\r
+  UINT32 Attributes;\r
+} EFI_ABSOLUTE_POINTER_MODE;\r
+\r
+//\r
+// If set, indicates this device supports an alternate button input. \r
+// \r
+#define EFI_ABSP_SupportsAltActive    0x00000001\r
+\r
+//\r
+// If set, indicates this device returns pressure data in parameter CurrentZ.\r
+// \r
+#define EFI_ABSP_SupportsPressureAsZ  0x00000002\r
+\r
+\r
+/**\r
+  This function resets the pointer device hardware. As part of\r
+  initialization process, the firmware/device will make a quick\r
+  but reasonable attempt to verify that the device is\r
+  functioning. If the ExtendedVerification flag is TRUE the\r
+  firmware may take an extended amount of time to verify the\r
+  device is operating on reset. Otherwise the reset operation is\r
+  to occur as quickly as possible. The hardware verification\r
+  process is not defined by this specification and is left up to\r
+  the platform firmware or driver to implement.\r
+\r
+  @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL\r
+              instance.\r
+\r
+  @param ExtendedVerification Indicates that the driver may\r
+                              perform a more exhaustive\r
+                              verification operation of the\r
+                              device during reset.\r
+\r
+  @retval EFI_SUCCESS The device was reset.\r
+  \r
+  @retval EFI_DEVICE_ERROR  The device is not functioning\r
+                            correctly and could not be reset.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ABSOLUTE_POINTER_RESET) (\r
+  IN CONST  EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
+  IN CONST  BOOLEAN                       ExtendedVerification\r
+);\r
+\r
+\r
+\r
+\r
+/**\r
+  Definitions of bits within ActiveButtons.\r
+  \r
+  @param EFI_ABSP_TouchActive This bit is set if the touch\r
+                              sensor is active.\r
+  \r
+  @param EFI_ABS_AltActive    This bit is set if the alt sensor,\r
+                              such as pen-side button, is\r
+                              active.\r
+**/\r
+#define EFI_ABSP_TouchActive  0x00000001\r
+#define EFI_ABS_AltActive     0x00000002\r
+\r
+\r
+/**\r
+  Definition of EFI_ABSOLUTE_POINTER_STATE.\r
+  \r
+  @param CurrentX The unsigned position of the activation on the\r
+                  x axis If the AboluteMinX and the AboluteMaxX\r
+                  fields of the EFI_ABSOLUTE_POINTER_MODE\r
+                  structure are both 0, then this pointer device\r
+                  does not support an x-axis, and this field\r
+                  must be ignored.\r
+\r
+  @param CurrentY The unsigned position of the activation on the\r
+                  x axis If the AboluteMinY and the AboluteMaxY\r
+                  fields of the EFI_ABSOLUTE_POINTER_MODE\r
+                  structure are both 0, then this pointer device\r
+                  does not support an y-axis, and this field\r
+                  must be ignored.\r
+\r
+  @param CurrentZ The unsigned position of the activation on the\r
+                  x axis, or the pressure measurement. If the\r
+                  AboluteMinZ and the AboluteMaxZ fields of the\r
+                  EFI_ABSOLUTE_POINTER_MODE structure are\r
+                  both 0, then this pointer device does not\r
+                  support an z-axis, and this field must be\r
+                  ignored.\r
+\r
+  @param ActiveButtons  Bits are set to 1 in this structure item\r
+                       to indicate that device buttons are\r
+                       active.\r
+\r
+**/\r
+typedef struct {\r
+  UINT64 CurrentX;\r
+  UINT64 CurrentY;\r
+  UINT64 CurrentZ;\r
+  UINT32 ActiveButtons;\r
+} EFI_ABSOLUTE_POINTER_STATE;\r
+\r
+/**\r
+  The GetState() function retrieves the current state of a pointer\r
+  device. This includes information on the active state associated\r
+  with the pointer device and the current position of the axes\r
+  associated with the pointer device. If the state of the pointer\r
+  device has not changed since the last call to GetState(), then\r
+  EFI_NOT_READY is returned. If the state of the pointer device\r
+  has changed since the last call to GetState(), then the state\r
+  information is placed in State, and EFI_SUCCESS is returned. If\r
+  a device error occurs while attempting to retrieve the state\r
+  information, then EFI_DEVICE_ERROR is returned.\r
+\r
+\r
+  @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL\r
+              instance.\r
+\r
+  @param State  A pointer to the state information on the\r
+                pointer device.\r
+\r
+  @retval EFI_SUCCESS The state of the pointer device was\r
+                      returned in State.\r
+\r
+  @retval EFI_NOT_READY The state of the pointer device has not\r
+                        changed since the last call to GetState().\r
+\r
+  @retval EFI_DEVICE_ERROR  A device error occurred while\r
+                            attempting to retrieve the pointer\r
+                            device's current state.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE) (\r
+  IN CONST  EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
+  IN OUT    EFI_ABSOLUTE_POINTER_STATE    *State\r
+);\r
+\r
+\r
+/**\r
+  The EFI_ABSOLUTE_POINTER_PROTOCOL provides a set of services\r
+  for a pointer device that can be used as an input device from an\r
+  application written to this specification. The services include\r
+  the ability to reset the pointer device, retrieve the state of\r
+  the pointer device, and retrieve the capabilities of the pointer\r
+  device. In addition certain data items describing the device are\r
+  provided.\r
+\r
+\r
+  @param Reset  Resets the pointer device.\r
+\r
+  @param GetState Retrieves the current state of the pointer\r
+                  device.\r
+\r
+  @param WaitForInput Event to use with WaitForEvent() to wait\r
+                      for input from the pointer device.\r
+  @param Mode Pointer to EFI_ABSOLUTE_POINTER_MODE data.\r
+\r
+**/\r
+struct _EFI_ABSOLUTE_POINTER_PROTOCOL {\r
+  EFI_ABSOLUTE_POINTER_RESET      Reset;\r
+  EFI_ABSOLUTE_POINTER_GET_STATE  GetState;\r
+  EFI_EVENT                       WaitForInput;\r
+  EFI_ABSOLUTE_POINTER_MODE       *Mode;\r
+};\r
+\r
+\r
+extern EFI_GUID gEfiAbsolutePointerProtocolGuid;\r
+\r
+\r
+#endif\r
+\r
diff --git a/MdePkg/Include/Protocol/AcpiTable.h b/MdePkg/Include/Protocol/AcpiTable.h
new file mode 100644 (file)
index 0000000..b1335ef
--- /dev/null
@@ -0,0 +1,129 @@
+/** @file\r
+  The file provides the protocol to install or remove an ACPI\r
+  table from a platform. \r
+  \r
+  Copyright (c) 2006 - 2007, Intel Corporation\r
+  All rights reserved. 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
+  Module Name: AcpiTable.h\r
+\r
+**/\r
+\r
+#ifndef __ACPI_TABLE_H___\r
+#define __ACPI_TABLE_H___\r
+\r
+#define EFI_ACPI_TABLE_PROTOCOL_GUID \\r
+  { 0xffe06bdd, 0x6107, 0x46a6, { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c }}\r
+\r
+\r
+typedef struct _EFI_ACPI_TABLE_PROTOCOL EFI_ACPI_TABLE_PROTOCOL;\r
+\r
+/**\r
+\r
+  The InstallAcpiTable() function allows a caller to install an   \r
+  ACPI table. When successful, the table will be linked by the   \r
+  RSDT/XSDT. AcpiTableBuffer specifies the table to be installed.   \r
+  InstallAcpiTable() will make a copy of the table and insert the   \r
+  copy into the RSDT/XSDT. InstallAcpiTable() must insert the new   \r
+  table at the end of the RSDT/XSDT. To prevent namespace   \r
+  collision, ACPI tables may be created using UEFI ACPI table   \r
+  format. See Appendix O. On successful output, TableKey is   \r
+  initialized with a unique key. Its value may be used in a   \r
+  subsequent call to UninstallAcpiTable to remove an ACPI table.   \r
+  If an EFI application is running at the time of this call, the   \r
+  relevant EFI_CONFIGURATION_TABLE pointer to the RSDT is no   \r
+  longer considered valid.   \r
+\r
+\r
+  @param This A pointer to a EFI_ACPI_TABLE_PROTOCOL.\r
+\r
+  @param AcpiTableBuffer  A pointer to a buffer containing the\r
+                          ACPI table to be installed.\r
+\r
+  @param AcpiTableBufferSize  Specifies the size, in bytes, of\r
+                              the AcpiTableBuffer buffer.\r
+\r
+\r
+  @param TableKey   Returns a key to refer to the ACPI table.\r
+  \r
+  @retval EFI_SUCCESS The table was successfully inserted\r
+  \r
+  @retval EFI_INVALID_PARAMETER Either AcpiTableBuffer is NULL,\r
+                                TableKey is NULL, or\r
+                                AcpiTableBufferSize and the size\r
+                                field embedded in the ACPI table\r
+                                pointed to by AcpiTableBuffer\r
+                                are not in sync.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES  Insufficient resources exist to\r
+                                complete the request.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE) (\r
+  IN CONST  EFI_ACPI_TABLE_PROTOCOL *This,\r
+  IN CONST  VOID                    *AcpiTableBuffer,\r
+  IN CONST  UINTN                   AcpiTableBufferSize,\r
+  OUT       UINTN                   *TableKey\r
+);\r
+\r
+\r
+/**\r
+  \r
+  The UninstallAcpiTable() function allows a caller to remove an\r
+  ACPI table. The routine will remove its reference from the\r
+  RSDT/XSDT. A table is referenced by the TableKey parameter\r
+  returned from a prior call to InstallAcpiTable(). If an EFI\r
+  application is running at the time of this call, the relevant\r
+  EFI_CONFIGURATION_TABLE pointer to the RSDT is no longer\r
+  considered valid.\r
+\r
+  @param This A pointer to a EFI_ACPI_TABLE_PROTOCOL.\r
+\r
+  @param TableKey Specifies the table to uninstall. The key was\r
+                  returned from InstallAcpiTable().\r
+\r
+  @retval EFI_SUCCESS The table was successfully inserted\r
+\r
+  @retval EFI_NOT_FOUND TableKey does not refer to a valid key\r
+                        for a table entry.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  Insufficient resources exist to\r
+                                complete the request.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE) (\r
+  IN CONST  EFI_ACPI_TABLE_PROTOCOL *This,\r
+  IN CONST  UINTN                   TableKey\r
+);\r
+\r
+/**\r
+  The EFI_ACPI_TABLE_PROTOCOL provides the ability for a component\r
+  to install and uninstall ACPI tables from a platform.\r
+\r
+\r
+  @param InstallAcpiTable Installs an ACPI table into the\r
+                          system.\r
+\r
+  @param UninstallAcpiTable Removes a previously installed ACPI\r
+                            table from the system.\r
+\r
+**/   \r
+struct _EFI_ACPI_TABLE_PROTOCOL {\r
+  EFI_ACPI_TABLE_INSTALL_ACPI_TABLE   InstallAcpiTable;\r
+  EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE UninstallAcpiTable;\r
+};\r
+\r
+extern EFI_GUID gEfiAcpiTableProtocolGuid;\r
+\r
+#endif\r
+\r
diff --git a/MdePkg/Include/Protocol/Arp.h b/MdePkg/Include/Protocol/Arp.h
new file mode 100644 (file)
index 0000000..ddcc740
--- /dev/null
@@ -0,0 +1,259 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  Arp.h\r
+  \r
+**/\r
+\r
+#ifndef __EFI_ARP_PROTOCOL_H__\r
+#define __EFI_ARP_PROTOCOL_H__\r
+\r
+#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \\r
+  }\r
+\r
+#define EFI_ARP_PROTOCOL_GUID \\r
+  { \\r
+    0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \\r
+  }\r
+\r
+typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;\r
+\r
+typedef struct {\r
+UINT32                      Size;\r
+BOOLEAN                     DenyFlag;\r
+BOOLEAN                     StaticFlag;\r
+UINT16                      HwAddressType;\r
+UINT16                      SwAddressType;\r
+UINT8                       HwAddressLength;\r
+UINT8                       SwAddressLength;\r
+} EFI_ARP_FIND_DATA;\r
+\r
+typedef struct {\r
+  UINT16                    SwAddressType;      // Host byte order\r
+  UINT8                     SwAddressLength;\r
+  VOID                      *StationAddress;    // Network byte order\r
+  UINT32                    EntryTimeOut;\r
+  UINT32                    RetryCount;\r
+  UINT32                    RetryTimeOut;\r
+} EFI_ARP_CONFIG_DATA;\r
+\r
+\r
+/**\r
+  Assigns a station address (protocol type and network address) to this instance of the ARP cache.\r
+\r
+  @param  This                   A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  ConfigData             A pointer to the EFI_ARP_CONFIG_DATA structure.Buffer\r
+\r
+  @retval EFI_SUCCESS           The new station address was successfully registered.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_ACCESS_DENIED     The SwAddressType, SwAddressLength, or\r
+                                StationAddress is different from the one that is already\r
+                                registered.\r
+  @retval EFI_OUT_OF_RESOURCES  Storage for the new StationAddress could not be allocated.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_CONFIGURE) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN EFI_ARP_CONFIG_DATA    *ConfigData   OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Inserts an entry to the ARP cache.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.  \r
+  @param  DenyFlag        Set to TRUE if this entry is a "deny" entry. Set to FALSE if this\r
+                          entry is a "normal" entry.\r
+  @param  TargetSwAddress Pointer to a protocol address to add (or deny). May be set to\r
+                          NULL if DenyFlag is TRUE.\r
+  @param  TargetHwAddress Pointer to a hardware address to add (or deny). May be set to\r
+                          NULL if DenyFlag is TRUE.\r
+  @param  TimeoutValue    Time in 100-ns units that this entry will remain in the ARP\r
+                          cache. A value of zero means that the entry is permanent. A\r
+                          nonzero value will override the one given by Configure() if\r
+                          the entry to be added is dynamic entry.\r
+  @param  Overwrite       If TRUE, the matching cache entry will be overwritten with the\r
+                          supplied parameters. If FALSE, EFI_ACCESS_DENIED\r
+\r
+  @retval EFI_SUCCESS           The entry has been added or updated.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_OUT_OF_RESOURCES  The new ARP cache entry could not be allocated.\r
+  @retval EFI_ACCESS_DENIED     The ARP cache entry already exists and Overwrite is not true.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_ADD) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN BOOLEAN                DenyFlag,\r
+  IN VOID                   *TargetSwAddress  OPTIONAL,\r
+  IN VOID                   *TargetHwAddress  OPTIONAL,\r
+  IN UINT32                 TimeoutValue,\r
+  IN BOOLEAN                Overwrite\r
+  )\r
+;  \r
+\r
+/**\r
+  Locates one or more entries in the ARP cache.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress     Set to TRUE to look for matching software protocol addresses.\r
+                          Set to FALSE to look for matching hardware protocol addresses.\r
+  @param  AddressBuffer   Pointer to address buffer. Set to NULL to match all addresses.\r
+  @param  EntryLength     The size of an entry in the entries buffer. To keep the\r
+                          EFI_ARP_FIND_DATA structure properly aligned, this field\r
+                          may be longer than sizeof(EFI_ARP_FIND_DATA) plus\r
+                          the length of the software and hardware addresses.\r
+  @param  EntryCount      The number of ARP cache entries that are found by the specified criteria.\r
+  @param  Entries         Pointer to the buffer that will receive the ARP cache entries.\r
+  @param  Refresh         Set to TRUE to refresh the timeout value of the matching ARP\r
+                          cache entry.\r
+\r
+  @retval EFI_SUCCESS           The requested ARP cache entries were copied into the buffer.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_NOT_FOUND         No matching entries were found.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_FIND) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN BOOLEAN                BySwAddress,\r
+  IN VOID                   *AddressBuffer    OPTIONAL,\r
+  OUT UINT32                *EntryLength      OPTIONAL,\r
+  OUT UINT32                *EntryCount       OPTIONAL,\r
+  OUT EFI_ARP_FIND_DATA     **Entries         OPTIONAL,\r
+  IN BOOLEAN                Refresh\r
+  )\r
+;  \r
+\r
+\r
+/**\r
+  Removes entries from the ARP cache.\r
+\r
+  @param  This          A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress   Set to TRUE to delete matching protocol addresses.\r
+                        Set to FALSE to delete matching hardware addresses.\r
+  @param  AddressBuffer Pointer to the address buffer that is used as a key to look for the\r
+                        cache entry. Set to NULL to delete all entries.\r
+\r
+  @retval EFI_SUCCESS           The entry was removed from the ARP cache.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_FOUND         The specified deletion key was not found.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_DELETE) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN BOOLEAN                BySwAddress,\r
+  IN VOID                   *AddressBuffer   OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Removes all dynamic ARP cache entries that were added by this interface.\r
+\r
+  @param  This                   A pointer to the EFI_ARP_PROTOCOL instance.\r
+                                 \r
+  @retval EFI_SUCCESS           The cache has been flushed.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_FOUND         There are no matching dynamic cache entries.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_FLUSH) (\r
+  IN EFI_ARP_PROTOCOL       *This\r
+  )\r
+;  \r
+\r
+/**\r
+  Starts an ARP request session.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress Pointer to the protocol address to resolve.\r
+  @param  ResolvedEvent   Pointer to the event that will be signaled when the address is\r
+                          resolved or some error occurs.\r
+  @param  TargetHwAddress Pointer to the buffer for the resolved hardware address in\r
+                          network byte order. The buffer must be large enough to hold the\r
+                          resulting hardware address. TargetHwAddress must not be\r
+                          NULL.\r
+\r
+  @retval EFI_SUCCESS           The data was copied from the ARP cache into the\r
+                                TargetHwAddress buffer.\r
+  @retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.\r
+  @retval EFI_ACCESS_DENIED     The requested address is not present in the normal ARP cache but\r
+                                is present in the deny address list. Outgoing traffic to that address is\r
+                                forbidden.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  @retval EFI_NOT_READY         The request has been started and is not finished.\r
+  @retval EFI_UNSUPPORTED       The requested conversion is not supported in this implementation or\r
+                                configuration.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_REQUEST) (\r
+  IN EFI_ARP_PROTOCOL       *This, \r
+  IN VOID                   *TargetSwAddress  OPTIONAL,\r
+  IN EFI_EVENT              ResolvedEvent     OPTIONAL,\r
+  OUT VOID                  *TargetHwAddress  \r
+  )\r
+;  \r
+\r
+/**\r
+  Cancels an ARP request session.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress Pointer to the protocol address in previous request session.\r
+  @param  ResolvedEvent   Pointer to the event that is used as the notification event in\r
+                          previous request session.\r
+\r
+  @retval EFI_SUCCESS           The pending request session(s) is/are aborted and corresponding\r
+                                event(s) is/are signaled.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  @retval EFI_NOT_FOUND         The request is not issued by\r
+                                EFI_ARP_PROTOCOL.Request().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_CANCEL) (\r
+  IN EFI_ARP_PROTOCOL       *This, \r
+  IN VOID                   *TargetSwAddress  OPTIONAL,\r
+  IN EFI_EVENT              ResolvedEvent     OPTIONAL\r
+  )\r
+;  \r
+\r
+struct _EFI_ARP_PROTOCOL {\r
+  EFI_ARP_CONFIGURE         Configure;\r
+  EFI_ARP_ADD               Add;\r
+  EFI_ARP_FIND              Find;\r
+  EFI_ARP_DELETE            Delete;\r
+  EFI_ARP_FLUSH             Flush;\r
+  EFI_ARP_REQUEST           Request;\r
+  EFI_ARP_CANCEL            Cancel;\r
+};\r
+\r
+\r
+extern EFI_GUID gEfiArpServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiArpProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/AuthenticationInfo.h b/MdePkg/Include/Protocol/AuthenticationInfo.h
new file mode 100644 (file)
index 0000000..f80dbf3
--- /dev/null
@@ -0,0 +1,125 @@
+/** @file\r
+  EFI_AUTHENTICATION_INFO_PROTOCOL as defined in UEFI 2.0.\r
+  This protocol is used on any device handle to obtain authentication information \r
+  associated with the physical or logical device.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  AuthenticationInfo.h\r
+\r
+**/\r
+\r
+#ifndef __AUTHENTICATION_INFO_H__\r
+#define __AUTHENTICATION_INFO_H__\r
+\r
+#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \\r
+  { \\r
+    0x7671d9d0, 0x53db, 0x4173, {0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } \\r
+  }\r
+  \r
+#define EFI_AUTHENTICATION_CHAP_RADIUS_GUID \\r
+  { \\r
+    0xd6062b50, 0x15ca, 0x11da, {0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \\r
+  }\r
+\r
+#define EFI_AUTHENTICATION_CHAP_LOCAL_GUID \\r
+  { \\r
+    0xc280c73e, 0x15ca, 0x11da, {0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;\r
+\r
+typedef struct {\r
+  EFI_GUID         Guid;\r
+  UINT16           Length;\r
+} AUTH_NODE_HEADER;\r
+\r
+typedef struct {\r
+  AUTH_NODE_HEADER Header;\r
+  EFI_IPv6_ADDRESS RadiusIpAddr;             // IPv4 or IPv6 address\r
+  UINT16           Reserved;\r
+  EFI_IPv6_ADDRESS NasIpAddr;                // IPv4 or IPv6 address\r
+  UINT16           NasSecretLength; \r
+  UINT8            *NasSecret;      \r
+  UINT16           ChapSecretLength;\r
+  UINT8            *ChapSecret;\r
+  UINT16           ChapNameLength;\r
+  UINT8            *ChapName;\r
+} CHAP_RADIUS_AUTH_NODE;\r
+\r
+typedef struct {\r
+  AUTH_NODE_HEADER Header;\r
+  UINT16           Reserved;\r
+  UINT16           UserSecretLength;\r
+  UINT8            *UserSecret;     \r
+  UINT16           UserNameLength;\r
+  UINT8            *UserName;\r
+  UINT16           ChapSecretLength;\r
+  UINT8            *ChapSecret;\r
+  UINT16           ChapNameLength;\r
+  UINT8            *ChapName;\r
+} CHAP_LOCAL_AUTH_NODE;\r
+\r
+/**\r
+  Retrieves the Authentication information associated with a particular controller handle.\r
+\r
+  @param  This                   Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL\r
+  @param  ControllerHandle       Handle to the Controller\r
+  @param  Buffer                 Pointer to the authentication information.\r
+\r
+  @retval EFI_SUCCESS           Successfully retrieved Authentication information for the given ControllerHandle\r
+  @retval EFI_INVALID_PARAMETER No matching Authentication information found for the given ControllerHandle\r
+  @retval EFI_DEVICE_ERROR      The authentication information could not be retrieved due to a\r
+                                hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_GET) (\r
+  IN  EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
+  IN  EFI_HANDLE                       *ControllerHandle,\r
+  OUT VOID                             *Buffer\r
+  )\r
+;  \r
+\r
+/**\r
+  Set the Authentication information for a given controller handle.\r
+\r
+  @param  This                  Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL\r
+  @param  ControllerHandle      Handle to the Controller\r
+  @param  Buffer                Pointer to the authentication information.\r
+                                \r
+  @retval EFI_SUCCESS          Successfully set Authentication information for the given ControllerHandle\r
+  @retval EFI_UNSUPPORTED      If the platform policies do not allow setting of the Authentication\r
+                               information.\r
+  @retval EFI_DEVICE_ERROR     The authentication information could not be configured due to a\r
+                               hardware error.\r
+  @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_SET) (\r
+  IN EFI_AUTHENTICATION_INFO_PROTOCOL  *This,\r
+  IN EFI_HANDLE                        *ControllerHandle,\r
+  IN VOID                              *Buffer\r
+  )\r
+;  \r
+\r
+struct _EFI_AUTHENTICATION_INFO_PROTOCOL {\r
+  EFI_AUTHENTICATION_PROTOCOL_INFO_GET Get;\r
+  EFI_AUTHENTICATION_PROTOCOL_INFO_SET Set;\r
+};\r
+\r
+extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;\r
+extern EFI_GUID gEfiAuthenticationChapRadiusGuid;\r
+extern EFI_GUID gEfiAuthenticationChapLocalGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/Bds.h b/MdePkg/Include/Protocol/Bds.h
new file mode 100644 (file)
index 0000000..d060eb9
--- /dev/null
@@ -0,0 +1,87 @@
+/** @file\r
+  Boot Device Selection Architectural Protocol as defined in DXE CIS\r
+\r
+  When the DXE core is done it calls the BDS via this protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  Bds.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_BDS_H__\r
+#define __ARCH_PROTOCOL_BDS_H__\r
+\r
+//\r
+// Global ID for the BDS Architectural Protocol\r
+//\r
+#define EFI_BDS_ARCH_PROTOCOL_GUID \\r
+  { 0x665E3FF6, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }\r
+\r
+//\r
+// Declare forward reference for the BDS Architectural Protocol\r
+//\r
+typedef struct _EFI_BDS_ARCH_PROTOCOL   EFI_BDS_ARCH_PROTOCOL;\r
+\r
+/**\r
+  This function uses policy data from the platform to determine what operating \r
+  system or system utility should be loaded and invoked.  This function call \r
+  also optionally make the use of user input to determine the operating system \r
+  or system utility to be loaded and invoked.  When the DXE Core has dispatched \r
+  all the drivers on the dispatch queue, this function is called.  This \r
+  function will attempt to connect the boot devices required to load and invoke \r
+  the selected operating system or system utility.  During this process, \r
+  additional firmware volumes may be discovered that may contain addition DXE \r
+  drivers that can be dispatched by the DXE Core.   If a boot device cannot be \r
+  fully connected, this function calls the DXE Service Dispatch() to allow the \r
+  DXE drivers from any newly discovered firmware volumes to be dispatched.  \r
+  Then the boot device connection can be attempted again.  If the same boot \r
+  device connection operation fails twice in a row, then that boot device has \r
+  failed, and should be skipped.  This function should never return.\r
+\r
+  @param  This             The EFI_BDS_ARCH_PROTOCOL instance.\r
+\r
+  @return None.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_BDS_ENTRY) (\r
+  IN EFI_BDS_ARCH_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Interface stucture for the BDS Architectural Protocol.\r
+\r
+  @par Protocol Description:\r
+  The EFI_BDS_ARCH_PROTOCOL transfers control from DXE to an operating \r
+  system or a system utility.  If there are not enough drivers initialized \r
+  when this protocol is used to access the required boot device(s), then \r
+  this protocol should add drivers to the dispatch queue and return control \r
+  back to the dispatcher.  Once the required boot devices are available, then \r
+  the boot device can be used to load and invoke an OS or a system utility.\r
+\r
+  @par Protocol Parameters:\r
+  Entry - The entry point to BDS.  This call does not take any parameters, \r
+  and the return value can be ignored.  If it returns, then the \r
+  dispatcher must be invoked again, if it never returns, then an \r
+  operating system or a system utility have been invoked.\r
+\r
+**/\r
+struct _EFI_BDS_ARCH_PROTOCOL {\r
+  EFI_BDS_ENTRY Entry;\r
+};\r
+\r
+extern EFI_GUID gEfiBdsArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/Bis.h b/MdePkg/Include/Protocol/Bis.h
new file mode 100644 (file)
index 0000000..37d1952
--- /dev/null
@@ -0,0 +1,418 @@
+/** @file\r
+  This file defines the BIS protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  Bis.h\r
+\r
+**/\r
+\r
+#ifndef __BIS_H__\r
+#define __BIS_H__\r
+\r
+#define EFI_BIS_PROTOCOL_GUID \\r
+  { \\r
+    0x0b64aab0, 0x5429, 0x11d4, {0x98, 0x16, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } \\r
+  }\r
+\r
+typedef struct _EFI_BIS_PROTOCOL  EFI_BIS_PROTOCOL;\r
+\r
+\r
+//\r
+// Basic types\r
+//\r
+typedef VOID    *BIS_APPLICATION_HANDLE;\r
+typedef UINT16  BIS_ALG_ID;\r
+typedef UINT32  BIS_CERT_ID;\r
+\r
+//\r
+// EFI_BIS_DATA type.\r
+//\r
+// EFI_BIS_DATA instances obtained from BIS must be freed by calling Free( ).\r
+//\r
+typedef struct {\r
+  UINT32  Length; // Length of Data in 8 bit bytes.\r
+  UINT8   *Data;  // 32 Bit Flat Address of data.\r
+} EFI_BIS_DATA;\r
+\r
+//\r
+// EFI_BIS_VERSION type.\r
+//\r
+typedef struct {\r
+  UINT32  Major;  // BIS Interface version number.\r
+  UINT32  Minor;  // Build number.\r
+} EFI_BIS_VERSION;\r
+\r
+//\r
+// ----------------------------------------------------//\r
+// Use these values to initialize EFI_BIS_VERSION.Major\r
+// and to interpret results of Initialize.\r
+// ----------------------------------------------------//\r
+//\r
+#define BIS_CURRENT_VERSION_MAJOR BIS_VERSION_1\r
+#define BIS_VERSION_1             1\r
+\r
+//\r
+// EFI_BIS_SIGNATURE_INFO type.\r
+//\r
+typedef struct {\r
+  BIS_CERT_ID CertificateID;  // Truncated hash of platform Boot Object\r
+  //  authorization certificate.\r
+  //\r
+  BIS_ALG_ID  AlgorithmID;  // A signature algorithm number.\r
+  UINT16      KeyLength;    // Length of alg. keys in bits.\r
+} EFI_BIS_SIGNATURE_INFO;\r
+\r
+//\r
+// Currently defined values for EFI_BIS_SIGNATURE_INFO.AlgorithmID.\r
+// The exact numeric values come from\r
+//    "Common Data Security Architecture (CDSA) Specification".\r
+//\r
+#define BIS_ALG_DSA     (41)  // CSSM_ALGID_DSA\r
+#define BIS_ALG_RSA_MD5 (42)  // CSSM_ALGID_MD5_WITH_RSA\r
+// Currently defined values for EFI_BIS_SIGNATURE_INFO.CertificateId.\r
+//\r
+#define BIS_CERT_ID_DSA     BIS_ALG_DSA     // CSSM_ALGID_DSA\r
+#define BIS_CERT_ID_RSA_MD5 BIS_ALG_RSA_MD5 // CSSM_ALGID_MD5_WITH_RSA\r
+// The  following  is a mask value that gets applied to the truncated hash of a\r
+// platform  Boot Object Authorization Certificate to create the certificateID.\r
+// A certificateID must not have any bits set to the value 1 other than bits in\r
+// this mask.\r
+//\r
+#define BIS_CERT_ID_MASK  (0xFF7F7FFF)\r
+\r
+//\r
+// Macros for dealing with the EFI_BIS_DATA object obtained\r
+// from BIS_GetSignatureInfo()\r
+// BIS_GET_SIGINFO_COUNT - tells how many EFI_BIS_SIGNATURE_INFO\r
+//  elements are contained in a EFI_BIS_DATA struct pointed to\r
+//  by the provided EFI_BIS_DATA*.\r
+//\r
+#define BIS_GET_SIGINFO_COUNT(BisDataPtr) ((BisDataPtr)->Length / sizeof (EFI_BIS_SIGNATURE_INFO))\r
+\r
+//\r
+// BIS_GET_SIGINFO_ARRAY - produces a EFI_BIS_SIGNATURE_INFO*\r
+//  from a given EFI_BIS_DATA*.\r
+//\r
+#define BIS_GET_SIGINFO_ARRAY(BisDataPtr) ((EFI_BIS_SIGNATURE_INFO *) (BisDataPtr)->Data)\r
+\r
+//\r
+// Binary Value of "X-Intel-BIS-ParameterSet" Attribute.\r
+// (Value is Base64 encoded in actual signed manifest).\r
+// {EDD35E31-07B9-11d2-83A3-00A0C91FADCF}\r
+//\r
+#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID \\r
+  { \\r
+    0xedd35e31, 0x7b9, 0x11d2, \\r
+    { \\r
+      0x83, 0xa3, 0x0, 0xa0, 0xc9, 0x1f, 0xad, 0xcf \\r
+    } \\r
+  }\r
+\r
+//\r
+// Support old name for backward compatible\r
+//\r
+#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE \\r
+        BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID\r
+\r
+/**                                                                 \r
+  Initializes the BIS service, checking that it is compatible with the version requested by the caller.\r
+  After this call, other BIS functions may be invoked.                                                 \r
+    \r
+  @param  This                     A pointer to the EFI_BIS_PROTOCOL object.\r
+  @param  AppHandle                The function writes the new BIS_APPLICATION_HANDLE if           \r
+                                   successful, otherwise it writes NULL. The caller must eventually\r
+                                   destroy this handle by calling Shutdown().                      \r
+  @param  InterfaceVersion         On input, the caller supplies the major version number of the\r
+                                   interface version desired.                                   \r
+                                   On output, both the major and minor                         \r
+                                   version numbers are updated with the major and minor version\r
+                                   numbers of the interface                                    \r
+  @param  TargetAddress            Indicates a network or device address of the BIS platform to connect to.                                                                 \r
+\r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_INCOMPATIBLE_VERSION The InterfaceVersion.Major requested by the                \r
+                                   caller was not compatible with the interface version of the\r
+  @retval EFI_UNSUPPORTED          This is a local-platform implementation and        \r
+                                   TargetAddress.Data was not NULL, or                \r
+                                   TargetAddress.Data was any other value that was not\r
+                                   supported by the implementation.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                              \r
+  @retval EFI_DEVICE_ERROR         The function encountered an unexpected internal failure.\r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.\r
+                                          \r
+**/                                       \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_INITIALIZE) (\r
+  IN     EFI_BIS_PROTOCOL        *This,              \r
+  OUT    BIS_APPLICATION_HANDLE  *AppHandle,         \r
+  IN OUT EFI_BIS_VERSION         *InterfaceVersion,  \r
+  IN     EFI_BIS_DATA            *TargetAddress      \r
+  );\r
+\r
+/**                                                                 \r
+  Frees memory structures allocated and returned by other functions in the EFI_BIS protocol.  \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                         \r
+  @param  ToFree                   An EFI_BIS_DATA* and associated memory block to be freed.\r
+\r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                     \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The ToFree parameter is not or is no longer a memory resource\r
+                                   associated with this AppHandle.                              \r
+                                           \r
+**/     \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_FREE) (\r
+  IN BIS_APPLICATION_HANDLE  AppHandle,               \r
+  IN EFI_BIS_DATA            *ToFree                  \r
+  );\r
+\r
+/**                                                                 \r
+  Shuts down an application's instance of the BIS service, invalidating the application handle. After\r
+  this call, other BIS functions may no longer be invoked using the application handle value.         \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+\r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                     \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_DEVICE_ERROR         The function encountered an unexpected internal failure.  \r
+                                           \r
+**/   \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_SHUTDOWN) (\r
+  IN BIS_APPLICATION_HANDLE  AppHandle               \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the certificate that has been configured as the identity of the organization designated as\r
+  the source of authorization for signatures of boot objects.\r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  Certificate              The function writes an allocated EFI_BIS_DATA* containing the Boot\r
+                                   Object Authorization Certificate object.                            \r
+\r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                     \r
+  @retval EFI_NOT_FOUND            There is no Boot Object Authorization Certificate currently installed.                        \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The Certificate parameter supplied by the caller is NULL or\r
+                                   an invalid memory reference.                                       \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,              \r
+  OUT EFI_BIS_DATA            **Certificate           \r
+  );\r
+\r
+/**                                                                 \r
+  Verifies the integrity and authorization of the indicated data object according to the\r
+  indicated credentials.                                                                \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  Credentials              A Signed Manifest containing verification information for the indicated\r
+                                   data object.                                                            \r
+  @param  DataObject               An in-memory copy of the raw data object to be verified.\r
+  @param  IsVerified               The function writes TRUE if the verification succeeded, otherwise\r
+                                   FALSE.                                                           \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                       \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.\r
+  @retval EFI_SECURITY_VIOLATION   The signed manifest supplied as the Credentials parameter\r
+                                   was invalid (could not be parsed) or Platform-specific authorization failed, etc.\r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                           \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_VERIFY_BOOT_OBJECT) (\r
+  IN  BIS_APPLICATION_HANDLE AppHandle,               \r
+  IN  EFI_BIS_DATA           *Credentials,            \r
+  IN  EFI_BIS_DATA           *DataObject,             \r
+  OUT BOOLEAN                *IsVerified              \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the current status of the Boot Authorization Check Flag.\r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  CheckIsRequired          The function writes the value TRUE if a Boot Authorization Check is\r
+                                   currently required on this platform, otherwise the function writes \r
+                                   FALSE.                                                             \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                       \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The CheckIsRequired parameter supplied by the caller is\r
+                                   NULL or an invalid memory reference.                   \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,             \r
+  OUT BOOLEAN                 *CheckIsRequired       \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves a unique token value to be included in the request credential for the next update of any\r
+  parameter in the Boot Object Authorization set                                                    \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  UpdateToken              The function writes an allocated EFI_BIS_DATA* containing the new\r
+                                   unique update token value.                                                                          \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                       \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The UpdateToken parameter supplied by the caller is NULL or\r
+                                   an invalid memory reference.        \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                            \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,              \r
+  OUT EFI_BIS_DATA            **UpdateToken           \r
+  );\r
+\r
+/**                                                                 \r
+  Updates one of the configurable parameters of the Boot Object Authorization set.\r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  RequestCredential        This is a Signed Manifest with embedded attributes that carry the details\r
+                                   of the requested update.                                                 \r
+  @param  NewUpdateToken           The function writes an allocated EFI_BIS_DATA* containing the new                        \r
+                                   unique update token value.                                       \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.                                                \r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid                              \r
+                                   application instance handle associated with the EFI_BIS protocol.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                       \r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.                                                 \r
+  @retval EFI_SECURITY_VIOLATION   The signed manifest supplied as the RequestCredential parameter                           \r
+                                   was invalid (could not be parsed) or Platform-specific authorization failed, etc.   \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                                                                                                                                   \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION) (\r
+  IN  BIS_APPLICATION_HANDLE AppHandle,               \r
+  IN  EFI_BIS_DATA           *RequestCredential,      \r
+  OUT EFI_BIS_DATA           **NewUpdateToken         \r
+  );\r
+\r
+/**                                                                 \r
+  Verifies the integrity and authorization of the indicated data object according to the indicated\r
+  credentials and authority certificate.                                                          \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  Credentials              A Signed Manifest containing verification information for the\r
+                                   indicated data object.                                       \r
+  @param  DataObject               An in-memory copy of the raw data object to be verified.\r
+  @param  SectionName              An ASCII (not Unicode) string giving the section name in the  \r
+                                   manifest holding the verification information (in other words,\r
+                                   hash value) that corresponds to DataObject.                             \r
+  @param  AuthorityCertificate     A digital certificate whose public key must match the signer's                              \r
+                                   public key which is found in the credentials.                  \r
+  @param  IsVerified               The function writes TRUE if the verification was successful.\r
+                                   Otherwise, the function writes FALSE.                       \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.                                                \r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid                              \r
+                                   application instance handle associated with the EFI_BIS protocol.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                       \r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.                                                 \r
+  @retval EFI_SECURITY_VIOLATION   The Credentials.Data supplied by the caller is NULL,\r
+                                   or the AuthorityCertificate supplied by the caller was \r
+                                   invalid (could not be parsed),                      \r
+                                   or Platform-specific authorization failed, etc.   \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                                                                                                                                   \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL) (\r
+  IN  BIS_APPLICATION_HANDLE AppHandle,              \r
+  IN  EFI_BIS_DATA           *Credentials,           \r
+  IN  EFI_BIS_DATA           *DataObject,            \r
+  IN  EFI_BIS_DATA           *SectionName,           \r
+  IN  EFI_BIS_DATA           *AuthorityCertificate,  \r
+  OUT BOOLEAN                *IsVerified             \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves a list of digital certificate identifier, digital signature algorithm, hash algorithm, and keylength\r
+  combinations that the platform supports.                                                                      \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller's instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  SignatureInfo            The function writes an allocated EFI_BIS_DATA* containing the array\r
+                                   of EFI_BIS_SIGNATURE_INFO structures representing the supported    \r
+                                   digital certificate identifier, algorithm, and key length combinations.                                   \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.                                                \r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid                              \r
+                                   application instance handle associated with the EFI_BIS protocol.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                       \r
+  @retval EFI_INVALID_PARAMETER    The SignatureInfo parameter supplied by the caller is NULL\r
+                                   or an invalid memory reference.                           \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                                                                                                                                   \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_SIGNATURE_INFO) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,           \r
+  OUT EFI_BIS_DATA            **SignatureInfo      \r
+  );\r
+\r
+struct _EFI_BIS_PROTOCOL {\r
+  EFI_BIS_INITIALIZE                                  Initialize;\r
+  EFI_BIS_SHUTDOWN                                    Shutdown;\r
+  EFI_BIS_FREE                                        Free;\r
+  EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE   GetBootObjectAuthorizationCertificate;\r
+  EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG     GetBootObjectAuthorizationCheckFlag;\r
+  EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN  GetBootObjectAuthorizationUpdateToken;\r
+  EFI_BIS_GET_SIGNATURE_INFO                          GetSignatureInfo;\r
+  EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION            UpdateBootObjectAuthorization;\r
+  EFI_BIS_VERIFY_BOOT_OBJECT                          VerifyBootObject;\r
+  EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL               VerifyObjectWithCredential;\r
+};\r
+\r
+extern EFI_GUID gEfiBisProtocolGuid;\r
+extern EFI_GUID gBootObjectAuthorizationParmsetGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/BlockIo.h b/MdePkg/Include/Protocol/BlockIo.h
new file mode 100644 (file)
index 0000000..4c7e8b4
--- /dev/null
@@ -0,0 +1,173 @@
+/** @file\r
+  Block IO protocol as defined in the EFI 1.0 specification.\r
+\r
+  The Block IO protocol is used to abstract block devices like hard drives,\r
+  DVD-ROMs and floppy drives.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  BlockIo.h\r
+\r
+**/\r
+\r
+#ifndef __BLOCK_IO_H__\r
+#define __BLOCK_IO_H__\r
+\r
+#define EFI_BLOCK_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_BLOCK_IO_PROTOCOL  EFI_BLOCK_IO_PROTOCOL;\r
+\r
+/**\r
+  Reset the Block Device.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ExtendedVerification Driver may perform diagnostics on reset.\r
+\r
+  @retval EFI_SUCCESS          The device was reset.\r
+  @retval EFI_DEVICE_ERROR     The device is not functioning properly and could\r
+                               not be reset.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_RESET) (\r
+  IN EFI_BLOCK_IO_PROTOCOL          *This,\r
+  IN BOOLEAN                        ExtendedVerification\r
+  )\r
+;\r
+\r
+/**\r
+  Read BufferSize bytes from Lba into Buffer.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Lba        The starting Logical Block Address to read from\r
+  @param  BufferSize Size of Buffer, must be a multiple of device block size.\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was read correctly from the device.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHANGED     The MediaId does not matched the current device.\r
+  @retval EFI_BAD_BUFFER_SIZE   The Buffer was not a multiple of the block size of the device.\r
+  @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
+                                valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_READ) (\r
+  IN EFI_BLOCK_IO_PROTOCOL          *This,\r
+  IN UINT32                         MediaId,\r
+  IN EFI_LBA                        Lba,\r
+  IN UINTN                          BufferSize,\r
+  OUT VOID                          *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Write BufferSize bytes from Lba into Buffer.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Lba        The starting Logical Block Address to read from\r
+  @param  BufferSize Size of Buffer, must be a multiple of device block size.\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was written correctly to the device.\r
+  @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_BAD_BUFFER_SIZE   The Buffer was not a multiple of the block size of the device.\r
+  @retval EFI_INVALID_PARAMETER The write request contains a LBA that is not\r
+                                valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_WRITE) (\r
+  IN EFI_BLOCK_IO_PROTOCOL          *This,\r
+  IN UINT32                         MediaId,\r
+  IN EFI_LBA                        Lba,\r
+  IN UINTN                          BufferSize,\r
+  IN VOID                           *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Flush the Block Device.\r
+\r
+  @param  This              Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS       All outstanding data was written to the device\r
+  @retval EFI_DEVICE_ERROR  The device reported an error while writting back the data\r
+  @retval EFI_NO_MEDIA      There is no media in the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_FLUSH) (\r
+  IN EFI_BLOCK_IO_PROTOCOL  *This\r
+  )\r
+;\r
+\r
+/**\r
+  Block IO read only mode data and updated only via members of BlockIO\r
+\r
+**/\r
+typedef struct {\r
+  UINT32  MediaId;    ///< The curent media Id. If the media changes, this value is changed.\r
+  BOOLEAN RemovableMedia;  ///< TRUE if the media is removable; otherwise, FALSE.\r
+  BOOLEAN MediaPresent;    /**< TRUE if there is a media currently present in the device;\r
+             othersise, FALSE. THis field shows the media present status\r
+             as of the most recent ReadBlocks() or WriteBlocks() call.\r
+        **/\r
+  BOOLEAN LogicalPartition;  /**< TRUE if LBA 0 is the first block of a partition; otherwise\r
+             FALSE. For media with only one partition this would be TRUE.\r
+        **/\r
+  BOOLEAN ReadOnly;    /**< TRUE if the media is marked read-only otherwise, FALSE.\r
+             This field shows the read-only status as of the most recent WriteBlocks () call.\r
+        **/\r
+  BOOLEAN WriteCaching;    ///< TRUE if the WriteBlock () function caches write data.\r
+\r
+  UINT32  BlockSize;    /**< The intrinsic block size of the device. If the media changes, then\r
+             this field is updated.\r
+        **/\r
+  UINT32  IoAlign;    ///< Supplies the alignment requirement for any buffer to read or write block(s).\r
+\r
+  EFI_LBA LastBlock;    /**< The last logical block address on the device.\r
+             If the media changes, then this field is updated.\r
+        **/\r
+} EFI_BLOCK_IO_MEDIA;\r
+\r
+#define EFI_BLOCK_IO_PROTOCOL_REVISION  0x00010000\r
+\r
+struct _EFI_BLOCK_IO_PROTOCOL {\r
+  UINT64              Revision;\r
+\r
+  EFI_BLOCK_IO_MEDIA  *Media;\r
+\r
+  EFI_BLOCK_RESET     Reset;\r
+  EFI_BLOCK_READ      ReadBlocks;\r
+  EFI_BLOCK_WRITE     WriteBlocks;\r
+  EFI_BLOCK_FLUSH     FlushBlocks;\r
+\r
+};\r
+\r
+extern EFI_GUID gEfiBlockIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/BusSpecificDriverOverride.h b/MdePkg/Include/Protocol/BusSpecificDriverOverride.h
new file mode 100644 (file)
index 0000000..c446940
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  Bus Specific Driver Override protocol as defined in the EFI 1.1 specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  BusSpecificDriverOverride.h\r
+\r
+**/\r
+\r
+#ifndef _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_\r
+#define _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_\r
+\r
+//\r
+// Global ID for the Bus Specific Driver Override Protocol\r
+//\r
+#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \\r
+  { \\r
+    0x3bc1b285, 0x8a15, 0x4a82, {0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65 } \\r
+  }\r
+\r
+typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL  EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;\r
+\r
+//\r
+// Prototypes for the Bus Specific Driver Override Protocol\r
+//\r
+\r
+/**                                                                   \r
+  Uses a bus specific algorithm to retrieve a driver image handle for a controller.\r
+    \r
+  @param  This                  A pointer to the EFI_BUS_SPECIFIC_DRIVER_\r
+                                OVERRIDE_PROTOCOL instance.              \r
+  @param  DriverImageHandle     On input, a pointer to the previous driver image handle returned\r
+                                by GetDriver(). On output, a pointer to the next driver         \r
+                                image handle. Passing in a NULL, will return the first driver   \r
+                                image handle.                                                     \r
+                                \r
+  @retval EFI_SUCCESS           A bus specific override driver is returned in DriverImageHandle.\r
+  @retval EFI_NOT_FOUND         The end of the list of override drivers was reached.\r
+  @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a\r
+                                previous call to GetDriver().                           \r
+                                   \r
+**/   \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) (\r
+  IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL              *This,\r
+  IN OUT EFI_HANDLE                                         *DriverImageHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the Bus Specific Driver Override Protocol\r
+//\r
+struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {\r
+  EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver;\r
+};\r
+\r
+extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/ComponentName.h b/MdePkg/Include/Protocol/ComponentName.h
new file mode 100644 (file)
index 0000000..68fd31b
--- /dev/null
@@ -0,0 +1,123 @@
+/** @file\r
+  EFI Component Name Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  ComponentName.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_COMPONENT_NAME_H__\r
+#define __EFI_COMPONENT_NAME_H__\r
+\r
+//\r
+// Global ID for the Component Name Protocol\r
+//\r
+#define EFI_COMPONENT_NAME_PROTOCOL_GUID \\r
+  { \\r
+    0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_COMPONENT_NAME_PROTOCOL  EFI_COMPONENT_NAME_PROTOCOL;\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
+\r
+  @param  This       A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  Language   A pointer to a three character ISO 639-2 language identifier.\r
+                     This is the language of the driver name that that the caller\r
+                     is requesting, and it must match one of the languages specified\r
+                     in SupportedLanguages.  The number of languages supported by a\r
+                     driver is up to the driver writer.\r
+  @param  DriverName A pointer to the Unicode string to return.  This Unicode string\r
+                     is the name of the driver specified by This in the language\r
+                     specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by This\r
+                                and the language specified by Language was returned\r
+                                in DriverName.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (\r
+  IN EFI_COMPONENT_NAME_PROTOCOL           *This,\r
+  IN  CHAR8                                *Language,\r
+  OUT CHAR16                               **DriverName\r
+  );\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by an EFI Driver.\r
+\r
+  @param  This             A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  ControllerHandle The handle of a controller that the driver specified by\r
+                           This is managing.  This handle specifies the controller\r
+                           whose name is to be returned.\r
+  @param  ChildHandle      The handle of the child controller to retrieve the name\r
+                           of.  This is an optional parameter that may be NULL.  It\r
+                           will be NULL for device drivers.  It will also be NULL\r
+                           for a bus drivers that wish to retrieve the name of the\r
+                           bus controller.  It will not be NULL for a bus driver\r
+                           that wishes to retrieve the name of a child controller.\r
+  @param  Language         A pointer to a three character ISO 639-2 language\r
+                           identifier.  This is the language of the controller name\r
+                           that that the caller is requesting, and it must match one\r
+                           of the languages specified in SupportedLanguages.  The\r
+                           number of languages supported by a driver is up to the\r
+                           driver writer.\r
+  @param  ControllerName   A pointer to the Unicode string to return.  This Unicode\r
+                           string is the name of the controller specified by\r
+                           ControllerHandle and ChildHandle in the language specified\r
+                           by Language from the point of view of the driver specified\r
+                           by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in the\r
+                                language specified by Language for the driver\r
+                                specified by This was returned in DriverName.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently managing\r
+                                the controller specified by ControllerHandle and\r
+                                ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (\r
+  IN EFI_COMPONENT_NAME_PROTOCOL                              *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                                   *Language,\r
+  OUT CHAR16                                                  **ControllerName\r
+  );\r
+\r
+//\r
+// Interface structure for the Component Name Protocol\r
+//\r
+struct _EFI_COMPONENT_NAME_PROTOCOL {\r
+  EFI_COMPONENT_NAME_GET_DRIVER_NAME      GetDriverName;\r
+  EFI_COMPONENT_NAME_GET_CONTROLLER_NAME  GetControllerName;\r
+  CHAR8                                   *SupportedLanguages;\r
+};\r
+\r
+extern EFI_GUID gEfiComponentNameProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/ComponentName2.h b/MdePkg/Include/Protocol/ComponentName2.h
new file mode 100644 (file)
index 0000000..243490d
--- /dev/null
@@ -0,0 +1,165 @@
+/** @file\r
+  EFI Component Name 2 Protocol\r
+\r
+  Copyright (c) 2006 - 2007, Intel Corporation\r
+  All rights reserved. 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
+  Module Name:  ComponentName.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_COMPONENT_NAME2_H__\r
+#define __EFI_COMPONENT_NAME2_H__\r
+\r
+//\r
+// Global ID for the Component Name Protocol\r
+//\r
+#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \\r
+  {0x6a7a5cff, 0xe8d9, 0x4f70, { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } }\r
+\r
+typedef struct _EFI_COMPONENT_NAME2_PROTOCOL  EFI_COMPONENT_NAME2_PROTOCOL;\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of\r
+  the EFI Driver.\r
+\r
+  @param  This       A pointer to the\r
+                     EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  \r
+  @param  Language   A pointer to a Null-terminated ASCII string\r
+                     array indicating the language. This is the\r
+                     language of the driver name that the caller\r
+                     is requesting, and it must match one of the\r
+                     languages specified in SupportedLanguages.\r
+                     The number of languages supported by a\r
+                     driver is up to the driver writer. Language\r
+                     is specified in RFC 3066 language code\r
+                     format.\r
+  \r
+  @param  DriverName A pointer to the Unicode string to return.\r
+                     This Unicode string is the name of the\r
+                     driver specified by This in the language\r
+                     specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the\r
+                                Driver specified by This and the\r
+                                language specified by Language\r
+                                was returned in DriverName.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  \r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+  \r
+  @retval EFI_UNSUPPORTED       The driver specified by This\r
+                                does not support the language\r
+                                specified by Language.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME) (\r
+  IN EFI_COMPONENT_NAME2_PROTOCOL          *This,\r
+  IN  CHAR8                                *Language,\r
+  OUT CHAR16                               **DriverName\r
+  );\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of\r
+  the controller that is being managed by an EFI Driver.\r
+\r
+  @param  This             A pointer to the\r
+                           EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle The handle of a controller that the\r
+                           driver specified by This is managing.\r
+                           This handle specifies the controller\r
+                           whose name is to be returned.\r
+\r
+  @param ChildHandle      The handle of the child controller to\r
+                           retrieve the name of.  This is an\r
+                           optional parameter that may be NULL.\r
+                           It will be NULL for device drivers.\r
+                           It will also be NULL for a bus\r
+                           drivers that wish to retrieve the\r
+                           name of the bus controller.  It will\r
+                           not be NULL for a bus driver that\r
+                           wishes to retrieve the name of a\r
+                           child controller.\r
+\r
+  @param  Language         A pointer to a Null-terminated ASCII\r
+                           string array indicating the language.\r
+                           This is the language of the driver\r
+                           name that the caller is requesting,\r
+                           and it must match one of the\r
+                           languages specified in\r
+                           SupportedLanguages. The number of\r
+                           languages supported by a driver is up\r
+                           to the driver writer. Language is\r
+                           specified in RFC 3066 language code\r
+                           format.\r
+\r
+  @param  ControllerName   A pointer to the Unicode string to\r
+                           return.  This Unicode string is the\r
+                           name of the controller specified by\r
+                           ControllerHandle and ChildHandle in\r
+                           the language specified by Language\r
+                           from the point of view of the driver\r
+                           specified by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user\r
+                                readable name in the language\r
+                                specified by Language for the\r
+                                driver specified by This was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid\r
+                                EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it\r
+                                is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is\r
+                                not currently managing the\r
+                                controller specified by\r
+                                ControllerHandle and\r
+                                ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This\r
+                                does not support the language\r
+                                specified by Language.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) (\r
+  IN EFI_COMPONENT_NAME2_PROTOCOL *This,\r
+  IN  EFI_HANDLE                  ControllerHandle,\r
+  IN  EFI_HANDLE                  ChildHandle        OPTIONAL,\r
+  IN  CHAR8                       *Language,\r
+  OUT CHAR16                      **ControllerName\r
+  );\r
+\r
+//\r
+// Interface structure for the Component Name Protocol\r
+//\r
+struct _EFI_COMPONENT_NAME2_PROTOCOL {\r
+  EFI_COMPONENT_NAME2_GET_DRIVER_NAME      GetDriverName;\r
+  EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME  GetControllerName;\r
+  CHAR8                                    *SupportedLanguages;\r
+};\r
+\r
+extern EFI_GUID gEfiComponentName2ProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/Cpu.h b/MdePkg/Include/Protocol/Cpu.h
new file mode 100644 (file)
index 0000000..5dd4ffc
--- /dev/null
@@ -0,0 +1,331 @@
+/** @file\r
+  CPU Architectural Protocol as defined in DXE CIS\r
+\r
+  This code abstracts the DXE core from processor implementation details.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  Cpu.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_CPU_H__\r
+#define __ARCH_PROTOCOL_CPU_H__\r
+\r
+#include <Protocol/DebugSupport.h>\r
+\r
+#define EFI_CPU_ARCH_PROTOCOL_GUID \\r
+  { 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
+\r
+typedef struct _EFI_CPU_ARCH_PROTOCOL   EFI_CPU_ARCH_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiCpuFlushTypeWriteBackInvalidate,\r
+  EfiCpuFlushTypeWriteBack,\r
+  EfiCpuFlushTypeInvalidate,\r
+  EfiCpuMaxFlushType\r
+} EFI_CPU_FLUSH_TYPE;\r
+\r
+typedef enum {\r
+  EfiCpuInit,\r
+  EfiCpuMaxInitType\r
+} EFI_CPU_INIT_TYPE;\r
+\r
+/**\r
+  EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs.\r
+\r
+  @param  InterruptType    Defines the type of interrupt or exception that\r
+                           occurred on the processor.This parameter is processor architecture specific.\r
+  @param  SystemContext    A pointer to the processor context when\r
+                           the interrupt occurred on the processor.\r
+\r
+  @return None\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_CPU_INTERRUPT_HANDLER) (\r
+  IN CONST  EFI_EXCEPTION_TYPE  InterruptType,\r
+  IN CONST  EFI_SYSTEM_CONTEXT  SystemContext\r
+  );\r
+\r
+/**\r
+  This function flushes the range of addresses from Start to Start+Length \r
+  from the processor's data cache. If Start is not aligned to a cache line \r
+  boundary, then the bytes before Start to the preceding cache line boundary \r
+  are also flushed. If Start+Length is not aligned to a cache line boundary, \r
+  then the bytes past Start+Length to the end of the next cache line boundary \r
+  are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
+  supported. If the data cache is fully coherent with all DMA operations, then \r
+  this function can just return EFI_SUCCESS. If the processor does not support \r
+  flushing a range of the data cache, then the entire data cache can be flushed.\r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  Start            The beginning physical address to flush from the processor's data\r
+                           cache.\r
+  @param  Length           The number of bytes to flush from the processor's data cache. This\r
+                           function may flush more bytes than Length specifies depending upon\r
+                           the granularity of the flush operation that the processor supports.\r
+  @param  FlushType        Specifies the type of flush operation to perform.\r
+\r
+  @retval EFI_SUCCESS           The address range from Start to Start+Length was flushed from\r
+                                the processor's data cache.\r
+  @retval EFI_UNSUPPORTEDT      The processor does not support the cache flush type specified\r
+                                by FlushType.\r
+  @retval EFI_DEVICE_ERROR      The address range from Start to Start+Length could not be flushed\r
+                                from the processor's data cache.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_FLUSH_DATA_CACHE) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN EFI_PHYSICAL_ADDRESS               Start,\r
+  IN UINT64                             Length,\r
+  IN EFI_CPU_FLUSH_TYPE                 FlushType\r
+  );\r
+\r
+\r
+/**\r
+  This function enables interrupt processing by the processor. \r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS           Interrupts are enabled on the processor.\r
+  @retval EFI_DEVICE_ERROR      Interrupts could not be enabled on the processor.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_ENABLE_INTERRUPT) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This\r
+  );\r
+\r
+\r
+/**\r
+  This function disables interrupt processing by the processor.\r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS           Interrupts are disabled on the processor.\r
+  @retval EFI_DEVICE_ERROR      Interrupts could not be disabled on the processor.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_DISABLE_INTERRUPT) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This\r
+  );\r
+\r
+\r
+/**\r
+  This function retrieves the processor's current interrupt state a returns it in \r
+  State. If interrupts are currently enabled, then TRUE is returned. If interrupts \r
+  are currently disabled, then FALSE is returned.\r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  State            A pointer to the processor's current interrupt state. Set to TRUE if\r
+                           interrupts are enabled and FALSE if interrupts are disabled.\r
+\r
+  @retval EFI_SUCCESS           The processor's current interrupt state was returned in State.\r
+  @retval EFI_INVALID_PARAMETER State is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_GET_INTERRUPT_STATE) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  OUT BOOLEAN                           *State\r
+  );\r
+\r
+\r
+/**\r
+  This function generates an INIT on the processor. If this function succeeds, then the\r
+  processor will be reset, and control will not be returned to the caller. If InitType is \r
+  not supported by this processor, or the processor cannot programmatically generate an \r
+  INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error \r
+  occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned.\r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  InitType         The type of processor INIT to perform.\r
+\r
+  @retval EFI_SUCCESS           The processor INIT was performed. This return code should never be seen.\r
+  @retval EFI_UNSUPPORTED       The processor INIT operation specified by InitType is not supported\r
+                                by this processor.\r
+  @retval EFI_DEVICE_ERROR      The processor INIT failed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_INIT) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN EFI_CPU_INIT_TYPE                  InitType\r
+  );\r
+\r
+\r
+/**\r
+  This function registers and enables the handler specified by InterruptHandler for a processor \r
+  interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
+  handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
+  The installed handler is called once for each processor interrupt or exception.\r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  InterruptType    A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
+                           are enabled and FALSE if interrupts are disabled.\r
+  @param  InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
+                           when a processor interrupt occurs. If this parameter is NULL, then the handler\r
+                           will be uninstalled.\r
+\r
+  @retval EFI_SUCCESS           The handler for the processor interrupt was successfully installed or uninstalled.\r
+  @retval EFI_ALREADY_STARTED   InterruptHandler is not NULL, and a handler for InterruptType was\r
+                                previously installed.\r
+  @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
+                                previously installed.\r
+  @retval EFI_UNSUPPORTED       The interrupt specified by InterruptType is not supported.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN EFI_EXCEPTION_TYPE                 InterruptType,\r
+  IN EFI_CPU_INTERRUPT_HANDLER          InterruptHandler\r
+  );\r
+\r
+\r
+/**\r
+  This function reads the processor timer specified by TimerIndex and returns it in TimerValue.\r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  TimerIndex       Specifies which processor timer is to be returned in TimerValue. This parameter\r
+                           must be between 0 and NumberOfTimers-1.\r
+  @param  TimerValue       Pointer to the returned timer value.\r
+  @param  TimerPeriod      A pointer to the amount of time that passes in femtoseconds for each increment\r
+                           of TimerValue.\r
+\r
+  @retval EFI_SUCCESS           The processor timer value specified by TimerIndex was returned in TimerValue.\r
+  @retval EFI_DEVICE_ERROR      An error occurred attempting to read one of the processor's timers.\r
+  @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.\r
+  @retval EFI_UNSUPPORTED       The processor does not have any readable timers.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_GET_TIMER_VALUE) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN UINT32                             TimerIndex,\r
+  OUT UINT64                            *TimerValue,\r
+  OUT UINT64                            *TimerPeriod OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  This function modifies the attributes for the memory region specified by BaseAddress and\r
+  Length from their current attributes to the attributes specified by Attributes.\r
+\r
+  @param  This             The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  BaseAddress      The physical address that is the start address of a memory region.\r
+  @param  Length           The size in bytes of the memory region.\r
+  @param  Attributes       The bit mask of attributes to set for the memory region.\r
+\r
+  @retval EFI_SUCCESS           The attributes were set for the memory region.\r
+  @retval EFI_ACCESS_DENIED     The attributes for the memory resource range specified by\r
+                                BaseAddress and Length cannot be modified.\r
+  @retval EFI_INVALID_PARAMETER Length is zero.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the attributes of\r
+                                the memory resource range.\r
+  @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the memory\r
+                                resource range specified by BaseAddress and Length.\r
+                                The bit mask of attributes is not support for the memory resource\r
+                                range specified by BaseAddress and Length.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN  EFI_PHYSICAL_ADDRESS              BaseAddress,\r
+  IN  UINT64                            Length,\r
+  IN  UINT64                            Attributes\r
+  );\r
+\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_CPU_ARCH_PROTOCOL is used to abstract processor-specific functions from the DXE\r
+  Foundation. This includes flushing caches, enabling and disabling interrupts, hooking interrupt\r
+  vectors and exception vectors, reading internal processor timers, resetting the processor, and\r
+  determining the processor frequency.\r
+\r
+  @param FlushDataCache\r
+  Flushes a range of the processor's data cache. If the processor does \r
+  not contain a data cache, or the data cache is fully coherent, then this \r
+  function can just return EFI_SUCCESS. If the processor does not support \r
+  flushing a range of addresses from the data cache, then the entire data \r
+  cache must be flushed. \r
+\r
+  @param EnableInterrupt   \r
+  Enables interrupt processing by the processor.\r
+\r
+  @param DisableInterrupt  \r
+  Disables interrupt processing by the processor.\r
+\r
+  @param GetInterruptState \r
+  Retrieves the processor's current interrupt state.\r
+\r
+  @param Init\r
+  Generates an INIT on the processor. If a processor cannot programmatically \r
+  generate an INIT without help from external hardware, then this function \r
+  returns EFI_UNSUPPORTED.\r
+\r
+  @param RegisterInterruptHandler\r
+  Associates an interrupt service routine with one of the processor's interrupt \r
+  vectors. This function is typically used by the EFI_TIMER_ARCH_PROTOCOL to \r
+  hook the timer interrupt in a system. It can also be used by the debugger to \r
+  hook exception vectors.\r
+\r
+  @param GetTimerValue       \r
+  Returns the value of one of the processor's internal timers.\r
+\r
+  @param SetMemoryAttributes \r
+  Attempts to set the attributes of a memory region.\r
+\r
+  @param NumberOfTimers\r
+  The number of timers that are available in a processor. The value in this \r
+  field is a constant that must not be modified after the CPU Architectural \r
+  Protocol is installed. All consumers must treat this as a read-only field.\r
+\r
+  @param DmaBufferAlignment\r
+  The size, in bytes, of the alignment required for DMA buffer allocations. \r
+  This is typically the size of the largest data cache line in the platform. \r
+  The value in this field is a constant that must not be modified after the \r
+  CPU Architectural Protocol is installed. All consumers must treat this as \r
+  a read-only field.\r
+\r
+**/\r
+struct _EFI_CPU_ARCH_PROTOCOL {\r
+  EFI_CPU_FLUSH_DATA_CACHE            FlushDataCache;\r
+  EFI_CPU_ENABLE_INTERRUPT            EnableInterrupt;\r
+  EFI_CPU_DISABLE_INTERRUPT           DisableInterrupt;\r
+  EFI_CPU_GET_INTERRUPT_STATE         GetInterruptState;\r
+  EFI_CPU_INIT                        Init;\r
+  EFI_CPU_REGISTER_INTERRUPT_HANDLER  RegisterInterruptHandler;\r
+  EFI_CPU_GET_TIMER_VALUE             GetTimerValue;\r
+  EFI_CPU_SET_MEMORY_ATTRIBUTES       SetMemoryAttributes;\r
+  UINT32                              NumberOfTimers;\r
+  UINT32                              DmaBufferAlignment;\r
+};\r
+\r
+extern EFI_GUID gEfiCpuArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DebugPort.h b/MdePkg/Include/Protocol/DebugPort.h
new file mode 100644 (file)
index 0000000..ceffaf6
--- /dev/null
@@ -0,0 +1,141 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DebugPort.h\r
+\r
+**/\r
+\r
+#ifndef __DEBUG_PORT_H__\r
+#define __DEBUG_PORT_H__\r
+\r
+\r
+//\r
+// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}\r
+//\r
+#define EFI_DEBUGPORT_PROTOCOL_GUID \\r
+  { \\r
+    0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \\r
+  }\r
+\r
+extern EFI_GUID gEfiDebugPortProtocolGuid;\r
+\r
+typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;\r
+\r
+//\r
+// DebugPort member functions\r
+//\r
+\r
+/**                                                                 \r
+  Resets the debugport.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+                                \r
+  @retval EFI_SUCCESS           The debugport device was reset and is in usable state.\r
+  @retval EFI_DEVICE_ERROR      The debugport device could not be reset and is unusable.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_RESET) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This\r
+  );\r
+\r
+/**                                                                 \r
+  Writes data to the debugport.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+  @param  Timeout               The number of microseconds to wait before timing out a write operation.\r
+  @param  BufferSize            On input, the requested number of bytes of data to write. On output, the\r
+                                number of bytes of data actually written.\r
+  @param  Buffer                A pointer to a buffer containing the data to write.                                \r
+                                  \r
+  @retval EFI_SUCCESS           The data was written.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error.\r
+  @retval EFI_TIMEOUT           The data write was stopped due to a timeout.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_WRITE) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This,\r
+  IN UINT32                               Timeout,\r
+  IN OUT UINTN                            *BufferSize,\r
+  IN VOID                                 *Buffer\r
+  );\r
+\r
+/**                                                                 \r
+  Reads data from the debugport.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+  @param  Timeout               The number of microseconds to wait before timing out a read operation.\r
+  @param  BufferSize            On input, the requested number of bytes of data to read. On output, the\r
+                                number of bytes of data actually number of bytes\r
+                                of data read and returned in Buffer.\r
+  @param  Buffer                A pointer to a buffer into which the data read will be saved.\r
+                                  \r
+  @retval EFI_SUCCESS           The data was read.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error.\r
+  @retval EFI_TIMEOUT           The operation was stopped due to a timeout or overrun.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_READ) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This,\r
+  IN UINT32                               Timeout,\r
+  IN OUT UINTN                            *BufferSize,\r
+  OUT VOID                                *Buffer\r
+  );\r
+\r
+/**                                                                 \r
+  Checks to see if any data is available to be read from the debugport device.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+                                  \r
+  @retval EFI_SUCCESS           At least one byte of data is available to be read.\r
+  @retval EFI_DEVICE_ERROR      The debugport device is not functioning correctly.\r
+  @retval EFI_NOT_READY         No data is available to be read.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_POLL) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This\r
+  );\r
+\r
+//\r
+// DebugPort protocol definition\r
+//\r
+struct _EFI_DEBUGPORT_PROTOCOL {\r
+  EFI_DEBUGPORT_RESET Reset;\r
+  EFI_DEBUGPORT_WRITE Write;\r
+  EFI_DEBUGPORT_READ  Read;\r
+  EFI_DEBUGPORT_POLL  Poll;\r
+};\r
+\r
+//\r
+// DEBUGPORT variable definitions...\r
+//\r
+#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"\r
+#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID\r
+#define gEfiDebugPortVariableGuid   gEfiDebugPortProtocolGuid\r
+\r
+//\r
+// DebugPort device path definitions...\r
+//\r
+#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID\r
+#define gEfiDebugPortDevicePathGuid     gEfiDebugPortProtocolGuid\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL  Header;\r
+  EFI_GUID                  Guid;\r
+} DEBUGPORT_DEVICE_PATH;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DebugSupport.h b/MdePkg/Include/Protocol/DebugSupport.h
new file mode 100644 (file)
index 0000000..5c2c1cf
--- /dev/null
@@ -0,0 +1,660 @@
+/** @file\r
+  DebugSupport protocol and supporting definitions as defined in the UEFI2.0\r
+  specification.\r
+\r
+  The DebugSupport protocol is used by source level debuggers to abstract the\r
+  processor and handle context save and restore operations.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DebugSupport.h\r
+\r
+**/\r
+\r
+#ifndef __DEBUG_SUPPORT_H__\r
+#define __DEBUG_SUPPORT_H__\r
+\r
+#include <IndustryStandard/PeImage.h>\r
+\r
+typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;\r
+\r
+//\r
+// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}\r
+//\r
+#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \\r
+  { \\r
+    0x2755590C, 0x6F3C, 0x42FA, {0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \\r
+  }\r
+\r
+//\r
+// Debug Support definitions\r
+//\r
+typedef INTN  EFI_EXCEPTION_TYPE;\r
+\r
+//\r
+//  IA-32 processor exception types\r
+//\r
+#define EXCEPT_IA32_DIVIDE_ERROR    0\r
+#define EXCEPT_IA32_DEBUG           1\r
+#define EXCEPT_IA32_NMI             2\r
+#define EXCEPT_IA32_BREAKPOINT      3\r
+#define EXCEPT_IA32_OVERFLOW        4\r
+#define EXCEPT_IA32_BOUND           5\r
+#define EXCEPT_IA32_INVALID_OPCODE  6\r
+#define EXCEPT_IA32_DOUBLE_FAULT    8\r
+#define EXCEPT_IA32_INVALID_TSS     10\r
+#define EXCEPT_IA32_SEG_NOT_PRESENT 11\r
+#define EXCEPT_IA32_STACK_FAULT     12\r
+#define EXCEPT_IA32_GP_FAULT        13\r
+#define EXCEPT_IA32_PAGE_FAULT      14\r
+#define EXCEPT_IA32_FP_ERROR        16\r
+#define EXCEPT_IA32_ALIGNMENT_CHECK 17\r
+#define EXCEPT_IA32_MACHINE_CHECK   18\r
+#define EXCEPT_IA32_SIMD            19\r
+\r
+//\r
+//  IA-32 processor context definition\r
+//\r
+//\r
+// FXSAVE_STATE\r
+// FP / MMX / XMM registers (see fxrstor instruction definition)\r
+//\r
+typedef struct {\r
+  UINT16  Fcw;\r
+  UINT16  Fsw;\r
+  UINT16  Ftw;\r
+  UINT16  Opcode;\r
+  UINT32  Eip;\r
+  UINT16  Cs;\r
+  UINT16  Reserved1;\r
+  UINT32  DataOffset;\r
+  UINT16  Ds;\r
+  UINT8   Reserved2[10];\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  UINT8   St0Mm0[10], Reserved3[6];\r
+  UINT8   St1Mm1[10], Reserved4[6];\r
+  UINT8   St2Mm2[10], Reserved5[6];\r
+  UINT8   St3Mm3[10], Reserved6[6];\r
+  UINT8   St4Mm4[10], Reserved7[6];\r
+  UINT8   St5Mm5[10], Reserved8[6];\r
+  UINT8   St6Mm6[10], Reserved9[6];\r
+  UINT8   St7Mm7[10], Reserved10[6];\r
+  UINT8   Xmm0[16];\r
+  UINT8   Xmm1[16];\r
+  UINT8   Xmm2[16];\r
+  UINT8   Xmm3[16];\r
+  UINT8   Xmm4[16];\r
+  UINT8   Xmm5[16];\r
+  UINT8   Xmm6[16];\r
+  UINT8   Xmm7[16];\r
+  UINT8   Reserved11[14 * 16];\r
+} EFI_FX_SAVE_STATE_IA32;\r
+#else\r
+  UINT8   St0Mm0[10], Reserved3[6];\r
+  UINT8   St0Mm1[10], Reserved4[6];\r
+  UINT8   St0Mm2[10], Reserved5[6];\r
+  UINT8   St0Mm3[10], Reserved6[6];\r
+  UINT8   St0Mm4[10], Reserved7[6];\r
+  UINT8   St0Mm5[10], Reserved8[6];\r
+  UINT8   St0Mm6[10], Reserved9[6];\r
+  UINT8   St0Mm7[10], Reserved10[6];\r
+  UINT8   Reserved11[22 * 16];\r
+} EFI_FX_SAVE_STATE;\r
+#endif\r
+\r
+typedef struct {\r
+  UINT32                 ExceptionData;\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  EFI_FX_SAVE_STATE_IA32 FxSaveState;\r
+#else\r
+  EFI_FX_SAVE_STATE      FxSaveState;\r
+#endif\r
+  UINT32                 Dr0;\r
+  UINT32                 Dr1;\r
+  UINT32                 Dr2;\r
+  UINT32                 Dr3;\r
+  UINT32                 Dr6;\r
+  UINT32                 Dr7;\r
+  UINT32                 Cr0;\r
+  UINT32                 Cr1;  /* Reserved */\r
+  UINT32                 Cr2;\r
+  UINT32                 Cr3;\r
+  UINT32                 Cr4;\r
+  UINT32                 Eflags;\r
+  UINT32                 Ldtr;\r
+  UINT32                 Tr;\r
+  UINT32                 Gdtr[2];\r
+  UINT32                 Idtr[2];\r
+  UINT32                 Eip;\r
+  UINT32                 Gs;\r
+  UINT32                 Fs;\r
+  UINT32                 Es;\r
+  UINT32                 Ds;\r
+  UINT32                 Cs;\r
+  UINT32                 Ss;\r
+  UINT32                 Edi;\r
+  UINT32                 Esi;\r
+  UINT32                 Ebp;\r
+  UINT32                 Esp;\r
+  UINT32                 Ebx;\r
+  UINT32                 Edx;\r
+  UINT32                 Ecx;\r
+  UINT32                 Eax;\r
+} EFI_SYSTEM_CONTEXT_IA32;\r
+\r
+//\r
+//  X64 processor exception types\r
+//\r
+#define EXCEPT_X64_DIVIDE_ERROR    0\r
+#define EXCEPT_X64_DEBUG           1\r
+#define EXCEPT_X64_NMI             2\r
+#define EXCEPT_X64_BREAKPOINT      3\r
+#define EXCEPT_X64_OVERFLOW        4\r
+#define EXCEPT_X64_BOUND           5\r
+#define EXCEPT_X64_INVALID_OPCODE  6\r
+#define EXCEPT_X64_DOUBLE_FAULT    8\r
+#define EXCEPT_X64_INVALID_TSS     10\r
+#define EXCEPT_X64_SEG_NOT_PRESENT 11\r
+#define EXCEPT_X64_STACK_FAULT     12\r
+#define EXCEPT_X64_GP_FAULT        13\r
+#define EXCEPT_X64_PAGE_FAULT      14\r
+#define EXCEPT_X64_FP_ERROR        16\r
+#define EXCEPT_X64_ALIGNMENT_CHECK 17\r
+#define EXCEPT_X64_MACHINE_CHECK   18\r
+#define EXCEPT_X64_SIMD            19\r
+\r
+//\r
+//  X64 processor context definition\r
+//\r
+// FXSAVE_STATE\r
+// FP / MMX / XMM registers (see fxrstor instruction definition)\r
+//\r
+typedef struct {\r
+  UINT16  Fcw;\r
+  UINT16  Fsw;\r
+  UINT16  Ftw;\r
+  UINT16  Opcode;\r
+  UINT64  Rip;\r
+  UINT64  DataOffset;\r
+  UINT8   Reserved1[8];\r
+  UINT8   St0Mm0[10], Reserved2[6];\r
+  UINT8   St1Mm1[10], Reserved3[6];\r
+  UINT8   St2Mm2[10], Reserved4[6];\r
+  UINT8   St3Mm3[10], Reserved5[6];\r
+  UINT8   St4Mm4[10], Reserved6[6];\r
+  UINT8   St5Mm5[10], Reserved7[6];\r
+  UINT8   St6Mm6[10], Reserved8[6];\r
+  UINT8   St7Mm7[10], Reserved9[6];\r
+  UINT8   Xmm0[16];\r
+  UINT8   Xmm1[16];\r
+  UINT8   Xmm2[16];\r
+  UINT8   Xmm3[16];\r
+  UINT8   Xmm4[16];\r
+  UINT8   Xmm5[16];\r
+  UINT8   Xmm6[16];\r
+  UINT8   Xmm7[16];\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  //\r
+  // NOTE: UEFI 2.0 spec definition as follows. It should be updated \r
+  // after spec update.\r
+  //\r
+  UINT8   Reserved11[14 * 16];\r
+#else\r
+  UINT8   Xmm8[16];\r
+  UINT8   Xmm9[16];\r
+  UINT8   Xmm10[16];\r
+  UINT8   Xmm11[16];\r
+  UINT8   Xmm12[16];\r
+  UINT8   Xmm13[16];\r
+  UINT8   Xmm14[16];\r
+  UINT8   Xmm15[16];\r
+  UINT8   Reserved10[6 * 16];\r
+#endif\r
+} EFI_FX_SAVE_STATE_X64;\r
+\r
+typedef struct {\r
+  UINT64                ExceptionData;\r
+  EFI_FX_SAVE_STATE_X64 FxSaveState;\r
+  UINT64                Dr0;\r
+  UINT64                Dr1;\r
+  UINT64                Dr2;\r
+  UINT64                Dr3;\r
+  UINT64                Dr6;\r
+  UINT64                Dr7;\r
+  UINT64                Cr0;\r
+  UINT64                Cr1;  /* Reserved */\r
+  UINT64                Cr2;\r
+  UINT64                Cr3;\r
+  UINT64                Cr4;\r
+  UINT64                Cr8;\r
+  UINT64                Rflags;\r
+  UINT64                Ldtr;\r
+  UINT64                Tr;\r
+  UINT64                Gdtr[2];\r
+  UINT64                Idtr[2];\r
+  UINT64                Rip;\r
+  UINT64                Gs;\r
+  UINT64                Fs;\r
+  UINT64                Es;\r
+  UINT64                Ds;\r
+  UINT64                Cs;\r
+  UINT64                Ss;\r
+  UINT64                Rdi;\r
+  UINT64                Rsi;\r
+  UINT64                Rbp;\r
+  UINT64                Rsp;\r
+  UINT64                Rbx;\r
+  UINT64                Rdx;\r
+  UINT64                Rcx;\r
+  UINT64                Rax;\r
+  UINT64                R8;\r
+  UINT64                R9;\r
+  UINT64                R10;\r
+  UINT64                R11;\r
+  UINT64                R12;\r
+  UINT64                R13;\r
+  UINT64                R14;\r
+  UINT64                R15;\r
+} EFI_SYSTEM_CONTEXT_X64;\r
+\r
+//\r
+//  IPF processor exception types\r
+//\r
+#define EXCEPT_IPF_VHTP_TRANSLATION       0\r
+#define EXCEPT_IPF_INSTRUCTION_TLB        1\r
+#define EXCEPT_IPF_DATA_TLB               2\r
+#define EXCEPT_IPF_ALT_INSTRUCTION_TLB    3\r
+#define EXCEPT_IPF_ALT_DATA_TLB           4\r
+#define EXCEPT_IPF_DATA_NESTED_TLB        5\r
+#define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6\r
+#define EXCEPT_IPF_DATA_KEY_MISSED        7\r
+#define EXCEPT_IPF_DIRTY_BIT              8\r
+#define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9\r
+#define EXCEPT_IPF_DATA_ACCESS_BIT        10\r
+#define EXCEPT_IPF_BREAKPOINT             11\r
+#define EXCEPT_IPF_EXTERNAL_INTERRUPT     12\r
+//\r
+// 13 - 19 reserved\r
+//\r
+#define EXCEPT_IPF_PAGE_NOT_PRESENT           20\r
+#define EXCEPT_IPF_KEY_PERMISSION             21\r
+#define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS  22\r
+#define EXCEPT_IPF_DATA_ACCESS_RIGHTS         23\r
+#define EXCEPT_IPF_GENERAL_EXCEPTION          24\r
+#define EXCEPT_IPF_DISABLED_FP_REGISTER       25\r
+#define EXCEPT_IPF_NAT_CONSUMPTION            26\r
+#define EXCEPT_IPF_SPECULATION                27\r
+//\r
+// 28 reserved\r
+//\r
+#define EXCEPT_IPF_DEBUG                          29\r
+#define EXCEPT_IPF_UNALIGNED_REFERENCE            30\r
+#define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE     31\r
+#define EXCEPT_IPF_FP_FAULT                       32\r
+#define EXCEPT_IPF_FP_TRAP                        33\r
+#define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP  34\r
+#define EXCEPT_IPF_TAKEN_BRANCH                   35\r
+#define EXCEPT_IPF_SINGLE_STEP                    36\r
+//\r
+// 37 - 44 reserved\r
+//\r
+#define EXCEPT_IPF_IA32_EXCEPTION 45\r
+#define EXCEPT_IPF_IA32_INTERCEPT 46\r
+#define EXCEPT_IPF_IA32_INTERRUPT 47\r
+\r
+//\r
+//  IPF processor context definition\r
+//\r
+typedef struct {\r
+  //\r
+  // The first reserved field is necessary to preserve alignment for the correct\r
+  // bits in UNAT and to insure F2 is 16 byte aligned..\r
+  //\r
+  UINT64  Reserved;\r
+  UINT64  R1;\r
+  UINT64  R2;\r
+  UINT64  R3;\r
+  UINT64  R4;\r
+  UINT64  R5;\r
+  UINT64  R6;\r
+  UINT64  R7;\r
+  UINT64  R8;\r
+  UINT64  R9;\r
+  UINT64  R10;\r
+  UINT64  R11;\r
+  UINT64  R12;\r
+  UINT64  R13;\r
+  UINT64  R14;\r
+  UINT64  R15;\r
+  UINT64  R16;\r
+  UINT64  R17;\r
+  UINT64  R18;\r
+  UINT64  R19;\r
+  UINT64  R20;\r
+  UINT64  R21;\r
+  UINT64  R22;\r
+  UINT64  R23;\r
+  UINT64  R24;\r
+  UINT64  R25;\r
+  UINT64  R26;\r
+  UINT64  R27;\r
+  UINT64  R28;\r
+  UINT64  R29;\r
+  UINT64  R30;\r
+  UINT64  R31;\r
+\r
+  UINT64  F2[2];\r
+  UINT64  F3[2];\r
+  UINT64  F4[2];\r
+  UINT64  F5[2];\r
+  UINT64  F6[2];\r
+  UINT64  F7[2];\r
+  UINT64  F8[2];\r
+  UINT64  F9[2];\r
+  UINT64  F10[2];\r
+  UINT64  F11[2];\r
+  UINT64  F12[2];\r
+  UINT64  F13[2];\r
+  UINT64  F14[2];\r
+  UINT64  F15[2];\r
+  UINT64  F16[2];\r
+  UINT64  F17[2];\r
+  UINT64  F18[2];\r
+  UINT64  F19[2];\r
+  UINT64  F20[2];\r
+  UINT64  F21[2];\r
+  UINT64  F22[2];\r
+  UINT64  F23[2];\r
+  UINT64  F24[2];\r
+  UINT64  F25[2];\r
+  UINT64  F26[2];\r
+  UINT64  F27[2];\r
+  UINT64  F28[2];\r
+  UINT64  F29[2];\r
+  UINT64  F30[2];\r
+  UINT64  F31[2];\r
+\r
+  UINT64  Pr;\r
+\r
+  UINT64  B0;\r
+  UINT64  B1;\r
+  UINT64  B2;\r
+  UINT64  B3;\r
+  UINT64  B4;\r
+  UINT64  B5;\r
+  UINT64  B6;\r
+  UINT64  B7;\r
+\r
+  //\r
+  // application registers\r
+  //\r
+  UINT64  ArRsc;\r
+  UINT64  ArBsp;\r
+  UINT64  ArBspstore;\r
+  UINT64  ArRnat;\r
+\r
+  UINT64  ArFcr;\r
+\r
+  UINT64  ArEflag;\r
+  UINT64  ArCsd;\r
+  UINT64  ArSsd;\r
+  UINT64  ArCflg;\r
+  UINT64  ArFsr;\r
+  UINT64  ArFir;\r
+  UINT64  ArFdr;\r
+\r
+  UINT64  ArCcv;\r
+\r
+  UINT64  ArUnat;\r
+\r
+  UINT64  ArFpsr;\r
+\r
+  UINT64  ArPfs;\r
+  UINT64  ArLc;\r
+  UINT64  ArEc;\r
+\r
+  //\r
+  // control registers\r
+  //\r
+  UINT64  CrDcr;\r
+  UINT64  CrItm;\r
+  UINT64  CrIva;\r
+  UINT64  CrPta;\r
+  UINT64  CrIpsr;\r
+  UINT64  CrIsr;\r
+  UINT64  CrIip;\r
+  UINT64  CrIfa;\r
+  UINT64  CrItir;\r
+  UINT64  CrIipa;\r
+  UINT64  CrIfs;\r
+  UINT64  CrIim;\r
+  UINT64  CrIha;\r
+\r
+  //\r
+  // debug registers\r
+  //\r
+  UINT64  Dbr0;\r
+  UINT64  Dbr1;\r
+  UINT64  Dbr2;\r
+  UINT64  Dbr3;\r
+  UINT64  Dbr4;\r
+  UINT64  Dbr5;\r
+  UINT64  Dbr6;\r
+  UINT64  Dbr7;\r
+\r
+  UINT64  Ibr0;\r
+  UINT64  Ibr1;\r
+  UINT64  Ibr2;\r
+  UINT64  Ibr3;\r
+  UINT64  Ibr4;\r
+  UINT64  Ibr5;\r
+  UINT64  Ibr6;\r
+  UINT64  Ibr7;\r
+\r
+  //\r
+  // virtual registers - nat bits for R1-R31\r
+  //\r
+  UINT64  IntNat;\r
+\r
+} EFI_SYSTEM_CONTEXT_IPF;\r
+\r
+//\r
+//  EBC processor exception types\r
+//\r
+#define EXCEPT_EBC_UNDEFINED            0\r
+#define EXCEPT_EBC_DIVIDE_ERROR         1\r
+#define EXCEPT_EBC_DEBUG                2\r
+#define EXCEPT_EBC_BREAKPOINT           3\r
+#define EXCEPT_EBC_OVERFLOW             4\r
+#define EXCEPT_EBC_INVALID_OPCODE       5   // opcode out of range\r
+#define EXCEPT_EBC_STACK_FAULT          6\r
+#define EXCEPT_EBC_ALIGNMENT_CHECK      7\r
+#define EXCEPT_EBC_INSTRUCTION_ENCODING 8   // malformed instruction\r
+#define EXCEPT_EBC_BAD_BREAK            9   // BREAK 0 or undefined BREAK\r
+#define EXCEPT_EBC_STEP                 10  // to support debug stepping\r
+//\r
+// For coding convenience, define the maximum valid EBC exception.\r
+//\r
+#define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP\r
+\r
+//\r
+//  EBC processor context definition\r
+//\r
+typedef struct {\r
+  UINT64  R0;\r
+  UINT64  R1;\r
+  UINT64  R2;\r
+  UINT64  R3;\r
+  UINT64  R4;\r
+  UINT64  R5;\r
+  UINT64  R6;\r
+  UINT64  R7;\r
+  UINT64  Flags;\r
+  UINT64  ControlFlags;\r
+  UINT64  Ip;\r
+} EFI_SYSTEM_CONTEXT_EBC;\r
+\r
+//\r
+// Universal EFI_SYSTEM_CONTEXT definition\r
+//\r
+typedef union {\r
+  EFI_SYSTEM_CONTEXT_EBC  *SystemContextEbc;\r
+  EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;\r
+  EFI_SYSTEM_CONTEXT_X64  *SystemContextX64;\r
+  EFI_SYSTEM_CONTEXT_IPF  *SystemContextIpf;\r
+} EFI_SYSTEM_CONTEXT;\r
+\r
+//\r
+// DebugSupport callback function prototypes\r
+//\r
+\r
+/**                                                                 \r
+  Registers and enables an exception callback function for the specified exception.\r
+    \r
+  @param  ExceptionType         Exception types in EBC, IA-32, X64, or IPF\r
+  @param  SystemContext         Exception content.\r
+                                   \r
+**/\r
+typedef\r
+VOID\r
+(*EFI_EXCEPTION_CALLBACK) (\r
+  IN     EFI_EXCEPTION_TYPE               ExceptionType,\r
+  IN OUT EFI_SYSTEM_CONTEXT               SystemContext\r
+  );\r
+\r
+/**                                                                 \r
+  Registers and enables the on-target debug agent's periodic entry point.\r
+      \r
+  @param  SystemContext         Exception content.\r
+                                   \r
+**/\r
+typedef\r
+VOID\r
+(*EFI_PERIODIC_CALLBACK) (\r
+  IN OUT EFI_SYSTEM_CONTEXT               SystemContext\r
+  );\r
+\r
+//\r
+// Machine type definition\r
+//\r
+typedef enum {\r
+  IsaIa32 = IMAGE_FILE_MACHINE_I386, // 0x014C\r
+  IsaX64  = IMAGE_FILE_MACHINE_X64,   // 0x8664\r
+  IsaIpf  = IMAGE_FILE_MACHINE_IA64,  // 0x0200\r
+  IsaEbc  = IMAGE_FILE_MACHINE_EBC    // 0x0EBC\r
+} EFI_INSTRUCTION_SET_ARCHITECTURE;\r
+\r
+\r
+//\r
+// DebugSupport member function definitions\r
+//\r
+\r
+/**                                                                 \r
+  Returns the maximum value that may be used for the ProcessorIndex parameter in\r
+  RegisterPeriodicCallback() and RegisterExceptionCallback().                   \r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  MaxProcessorIndex     Pointer to a caller-allocated UINTN in which the maximum supported\r
+                                processor index is returned.                                      \r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  OUT UINTN                              *MaxProcessorIndex\r
+  );\r
+\r
+/**                                                                 \r
+  Registers a function to be called back periodically in interrupt context.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  ProcessorIndex        Specifies which processor the callback function applies to.\r
+  @param  PeriodicCallback      A pointer to a function of type PERIODIC_CALLBACK that is the main\r
+                                periodic entry point of the debug agent.\r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+  @retval EFI_ALREADY_STARTED   Non-NULL PeriodicCallback parameter when a callback\r
+                                function was previously registered.                \r
+  @retval EFI_OUT_OF_RESOURCES  System has insufficient memory resources to register new callback                               \r
+                                function.                                                           \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  IN UINTN                               ProcessorIndex,\r
+  IN EFI_PERIODIC_CALLBACK               PeriodicCallback\r
+  );\r
+\r
+/**                                                                 \r
+  Registers a function to be called when a given processor exception occurs.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  ProcessorIndex        Specifies which processor the callback function applies to.\r
+  @param  PeriodicCallback      A pointer to a function of type EXCEPTION_CALLBACK that is called\r
+                                when the processor exception specified by ExceptionType occurs.  \r
+  @param  ExceptionType         Specifies which processor exception to hook.                       \r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+  @retval EFI_ALREADY_STARTED   Non-NULL PeriodicCallback parameter when a callback\r
+                                function was previously registered.                \r
+  @retval EFI_OUT_OF_RESOURCES  System has insufficient memory resources to register new callback                               \r
+                                function.                                                           \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  IN UINTN                               ProcessorIndex,\r
+  IN EFI_EXCEPTION_CALLBACK              ExceptionCallback,\r
+  IN EFI_EXCEPTION_TYPE                  ExceptionType\r
+  );\r
+\r
+/**                                                                 \r
+  Invalidates processor instruction cache for a memory range. Subsequent execution in this range\r
+  causes a fresh memory fetch to retrieve code to be executed.                                  \r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  ProcessorIndex        Specifies which processor's instruction cache is to be invalidated.\r
+  @param  Start                 Specifies the physical base of the memory range to be invalidated.                                \r
+  @param  Length                Specifies the minimum number of bytes in the processor's instruction\r
+                                cache to invalidate.                                                 \r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  IN UINTN                               ProcessorIndex,\r
+  IN VOID                                *Start,\r
+  IN UINT64                              Length\r
+  );\r
+\r
+//\r
+// DebugSupport protocol definition\r
+//\r
+struct _EFI_DEBUG_SUPPORT_PROTOCOL {\r
+  EFI_INSTRUCTION_SET_ARCHITECTURE  Isa;\r
+  EFI_GET_MAXIMUM_PROCESSOR_INDEX   GetMaximumProcessorIndex;\r
+  EFI_REGISTER_PERIODIC_CALLBACK    RegisterPeriodicCallback;\r
+  EFI_REGISTER_EXCEPTION_CALLBACK   RegisterExceptionCallback;\r
+  EFI_INVALIDATE_INSTRUCTION_CACHE  InvalidateInstructionCache;\r
+};\r
+\r
+extern EFI_GUID gEfiDebugSupportProtocolGuid;\r
+\r
+#endif \r
diff --git a/MdePkg/Include/Protocol/Decompress.h b/MdePkg/Include/Protocol/Decompress.h
new file mode 100644 (file)
index 0000000..7c295f3
--- /dev/null
@@ -0,0 +1,121 @@
+/** @file\r
+  The Decompress Protocol Interface\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  Decompress.h\r
+\r
+**/\r
+\r
+#ifndef __DECOMPRESS_H__\r
+#define __DECOMPRESS_H__\r
+\r
+#define EFI_DECOMPRESS_PROTOCOL_GUID \\r
+  { \\r
+    0xd8117cfe, 0x94a6, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_DECOMPRESS_PROTOCOL  EFI_DECOMPRESS_PROTOCOL;\r
+\r
+/**\r
+  The GetInfo() function retrieves the size of the uncompressed buffer \r
+  and the temporary scratch buffer required to decompress the buffer \r
+  specified by Source and SourceSize.  If the size of the uncompressed\r
+  buffer or the size of the scratch buffer cannot be determined from \r
+  the compressed data specified by Source and SourceData, then \r
+  EFI_INVALID_PARAMETER is returned.  Otherwise, the size of the uncompressed\r
+  buffer is returned in DestinationSize, the size of the scratch buffer is \r
+  returned in ScratchSize, and EFI_SUCCESS is returned.\r
+\r
+  The GetInfo() function does not have scratch buffer available to perform \r
+  a thorough checking of the validity of the source data. It just retrieves\r
+  the 'Original Size' field from the beginning bytes of the source data and\r
+  output it as DestinationSize.  And ScratchSize is specific to the decompression\r
+  implementation.\r
+\r
+  @param  This            The protocol instance pointer\r
+  @param  Source          The source buffer containing the compressed data.\r
+  @param  SourceSize      The size, in bytes, of source buffer.\r
+  @param  DestinationSize A pointer to the size, in bytes, of the uncompressed buffer\r
+                          that will be generated when the compressed buffer specified\r
+                          by Source and SourceSize is decompressed.\r
+  @param  ScratchSize     A pointer to the size, in bytes, of the scratch buffer that\r
+                          is required to decompress the compressed buffer specified by\r
+                          Source and SourceSize.\r
+\r
+  @retval  EFI_SUCCESS           The size of the uncompressed data was returned in DestinationSize\r
+                                 and the size of the scratch buffer was returned in ScratchSize.\r
+  @retval  EFI_INVALID_PARAMETER The size of the uncompressed data or the size of the scratch\r
+                                 buffer cannot be determined from the compressed data specified by\r
+                                 Source and SourceData.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DECOMPRESS_GET_INFO) (\r
+  IN EFI_DECOMPRESS_PROTOCOL            *This,\r
+  IN   VOID                             *Source,\r
+  IN   UINT32                           SourceSize,\r
+  OUT  UINT32                           *DestinationSize,\r
+  OUT  UINT32                           *ScratchSize\r
+  );\r
+\r
+/**\r
+  The Decompress() function extracts decompressed data to its original form.\r
+\r
+  This protocol is designed so that the decompression algorithm can be \r
+  implemented without using any memory services.  As a result, the \r
+  Decompress() function is not allowed to call AllocatePool() or \r
+  AllocatePages() in its implementation.  It is the caller's responsibility \r
+  to allocate and free the Destination and Scratch buffers.\r
+\r
+  If the compressed source data specified by Source and SourceSize is \r
+  sucessfully decompressed into Destination, then EFI_SUCCESS is returned.  \r
+  If the compressed source data specified by Source and SourceSize is not in \r
+  a valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  @param  This            The protocol instance pointer\r
+  @param  Source          The source buffer containing the compressed data.\r
+  @param  SourceSize      The size of source data.\r
+  @param  Destination     On output, the destination buffer that contains\r
+                          the uncompressed data.\r
+  @param  DestinationSize The size of destination buffer. The size of destination\r
+                          buffer needed is obtained from GetInfo().\r
+  @param  Scratch         A temporary scratch buffer that is used to perform the\r
+                          decompression.          \r
+  @param  ScratchSize     The size of scratch buffer. The size of scratch buffer needed\r
+                          is obtained from GetInfo().\r
+\r
+  @retval  EFI_SUCCESS          Decompression completed successfully, and the uncompressed\r
+                                buffer is returned in Destination.\r
+  @retval EFI_INVALID_PARAMETER The source buffer specified by Source and SourceSize is\r
+                                corrupted (not in a valid compressed format).\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DECOMPRESS_DECOMPRESS) (\r
+  IN EFI_DECOMPRESS_PROTOCOL              *This,\r
+  IN     VOID                             *Source,\r
+  IN     UINT32                           SourceSize,\r
+  IN OUT VOID                             *Destination,\r
+  IN     UINT32                           DestinationSize,\r
+  IN OUT VOID                             *Scratch,\r
+  IN     UINT32                           ScratchSize\r
+  );\r
+\r
+struct _EFI_DECOMPRESS_PROTOCOL {\r
+  EFI_DECOMPRESS_GET_INFO   GetInfo;\r
+  EFI_DECOMPRESS_DECOMPRESS Decompress;\r
+};\r
+\r
+extern EFI_GUID gEfiDecompressProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DeviceIo.h b/MdePkg/Include/Protocol/DeviceIo.h
new file mode 100644 (file)
index 0000000..643c810
--- /dev/null
@@ -0,0 +1,222 @@
+/** @file\r
+  Device IO protocol as defined in the EFI 1.0 specification.\r
+\r
+  Device IO is used to abstract hardware access to devices. It includes\r
+  memory mapped IO, IO, PCI Config space, and DMA.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DeviceIo.h\r
+\r
+**/\r
+\r
+#ifndef __DEVICE_IO_H__\r
+#define __DEVICE_IO_H__\r
+\r
+#define EFI_DEVICE_IO_PROTOCOL_GUID \\r
+  { \\r
+    0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+typedef struct _EFI_DEVICE_IO_PROTOCOL EFI_DEVICE_IO_PROTOCOL;\r
+\r
+typedef enum {\r
+  IO_UINT8,\r
+  IO_UINT16,\r
+  IO_UINT32,\r
+  IO_UINT64,\r
+  MMIO_COPY_UINT8,\r
+  MMIO_COPY_UINT16,\r
+  MMIO_COPY_UINT32,\r
+  MMIO_COPY_UINT64\r
+} EFI_IO_WIDTH;\r
+\r
+/**                                                                 \r
+  Enables a driver to access device registers in the appropriate memory or I/O space.\r
+    \r
+  @param  This                  A pointer to the EFI_DEVICE_IO_INTERFACE instance.\r
+  @param  Width                 Signifies the width of the I/O operations.                                                                   \r
+  @param  Address               The base address of the I/O operations. \r
+  @param  Count                 The number of I/O operations to perform.\r
+  @param  Buffer                For read operations, the destination buffer to store the results. For write\r
+                                operations, the source buffer to write data from.                \r
+\r
+  @retval EFI_SUCCESS           The data was read from or written to the device.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.      \r
+  @retval EFI_INVALID_PARAMETER Width is invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEVICE_IO) (\r
+  IN EFI_DEVICE_IO_PROTOCOL         *This,\r
+  IN EFI_IO_WIDTH                   Width,\r
+  IN UINT64                         Address,\r
+  IN UINTN                          Count,\r
+  IN OUT VOID                       *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  EFI_DEVICE_IO Read;\r
+  EFI_DEVICE_IO Write;\r
+} EFI_IO_ACCESS;\r
+\r
+/**                                                                 \r
+  Provides an EFI Device Path for a PCI device with the given PCI configuration space address.\r
+    \r
+  @param  This                  A pointer to the EFI_DEVICE_IO_INTERFACE instance.\r
+  @param  PciAddress            The PCI configuration space address of the device whose Device Path\r
+                                is going to be returned.  \r
+  @param  PciDevicePath         A pointer to the pointer for the EFI Device Path for PciAddress.\r
+                                Memory for the Device Path is allocated from the pool.          \r
+\r
+  @retval EFI_SUCCESS           The PciDevicePath returns a pointer to a valid EFI Device Path.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.      \r
+  @retval EFI_UNSUPPORTED       The PciAddress does not map to a valid EFI Device Path.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_DEVICE_PATH) (\r
+  IN EFI_DEVICE_IO_PROTOCOL           *This,\r
+  IN UINT64                           PciAddress,\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL     **PciDevicePath\r
+  );\r
+\r
+typedef enum {\r
+  EfiBusMasterRead,\r
+  EfiBusMasterWrite,\r
+  EfiBusMasterCommonBuffer\r
+} EFI_IO_OPERATION_TYPE;\r
+\r
+/**                                                                 \r
+  Provides the device-specific addresses needed to access system memory.\r
+    \r
+  @param  This                  A pointer to the EFI_DEVICE_IO_INTERFACE instance.\r
+  @param  Operation             Indicates if the bus master is going to read or write to system memory.\r
+  @param  HostAddress           The system memory address to map to the device.\r
+  @param  NumberOfBytes         On input the number of bytes to map.\r
+  @param  DeviceAddress         The resulting map address for the bus master device to use to access the\r
+                                hosts HostAddress.\r
+  @param  Mapping               A resulting value to pass to Unmap().\r
+\r
+  @retval EFI_SUCCESS           The range was mapped for the returned NumberOfBytes.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.      \r
+  @retval EFI_UNSUPPORTED       The HostAddress cannot be mapped as a common buffer.\r
+  @retval EFI_INVALID_PARAMETER The Operation or HostAddress is undefined.\r
+  @retval EFI_DEVICE_ERROR      The system hardware could not map the requested address.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IO_MAP) (\r
+  IN EFI_DEVICE_IO_PROTOCOL           *This,\r
+  IN EFI_IO_OPERATION_TYPE            Operation,\r
+  IN EFI_PHYSICAL_ADDRESS             *HostAddress,\r
+  IN OUT UINTN                        *NumberOfBytes,\r
+  OUT EFI_PHYSICAL_ADDRESS            *DeviceAddress,\r
+  OUT VOID                            **Mapping\r
+  );\r
+\r
+/**                                                                 \r
+  Completes the Map() operation and releases any corresponding resources.\r
+    \r
+  @param  This                  A pointer to the EFI_DEVICE_IO_INTERFACE instance.\r
+  @param  Mapping               A resulting value to pass to Unmap().\r
+\r
+  @retval EFI_SUCCESS           The range was mapped for the returned NumberOfBytes.\r
+  @retval EFI_DEVICE_ERROR      The system hardware could not map the requested address.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IO_UNMAP) (\r
+  IN EFI_DEVICE_IO_PROTOCOL           *This,\r
+  IN VOID                             *Mapping\r
+  );\r
+\r
+/**                                                                 \r
+  Allocates pages that are suitable for an EFIBusMasterCommonBuffer mapping.\r
+    \r
+  @param  This                  A pointer to the EFI_DEVICE_IO_INTERFACE instance.\r
+  @param  Type                  The type allocation to perform.\r
+  @param  MemoryType            The type of memory to allocate, EfiBootServicesData or\r
+                                EfiRuntimeServicesData.\r
+  @param  Pages                 The number of pages to allocate.\r
+  @param  HostAddress           A pointer to store the base address of the allocated range.                                \r
+\r
+  @retval EFI_SUCCESS           The requested memory pages were allocated.\r
+  @retval EFI_OUT_OF_RESOURCES  The memory pages could not be allocated.\r
+  @retval EFI_INVALID_PARAMETER The requested memory type is invalid.\r
+  @retval EFI_UNSUPPORTED       The requested HostAddress is not supported on\r
+                                this platform.                               \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IO_ALLOCATE_BUFFER) (\r
+  IN EFI_DEVICE_IO_PROTOCOL           *This,\r
+  IN EFI_ALLOCATE_TYPE                Type,\r
+  IN EFI_MEMORY_TYPE                  MemoryType,\r
+  IN UINTN                            Pages,\r
+  IN OUT EFI_PHYSICAL_ADDRESS         *HostAddress\r
+  );\r
+\r
+/**                                                                 \r
+  Flushes any posted write data to the device.\r
+    \r
+  @param  This                  A pointer to the EFI_DEVICE_IO_INTERFACE instance.\r
+\r
+  @retval EFI_SUCCESS           The buffers were flushed.\r
+  @retval EFI_DEVICE_ERROR      The buffers were not flushed due to a hardware error.                                 \r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IO_FLUSH) (\r
+  IN EFI_DEVICE_IO_PROTOCOL  *This\r
+  );\r
+\r
+/**                                                                 \r
+  Frees pages that were allocated with AllocateBuffer().\r
+    \r
+  @param  This                  A pointer to the EFI_DEVICE_IO_INTERFACE instance.  \r
+  @param  Pages                 The number of pages to free.\r
+  @param  HostAddress           The base address of the range to free.\r
+\r
+  @retval EFI_SUCCESS           The requested memory pages were allocated.\r
+  @retval EFI_NOT_FOUND         The requested memory pages were not allocated with\r
+                                AllocateBuffer().  \r
+  @retval EFI_INVALID_PARAMETER HostAddress is not page aligned or Pages is invalid.\r
+  \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IO_FREE_BUFFER) (\r
+  IN EFI_DEVICE_IO_PROTOCOL           *This,\r
+  IN UINTN                            Pages,\r
+  IN EFI_PHYSICAL_ADDRESS             HostAddress\r
+  );\r
+\r
+struct _EFI_DEVICE_IO_PROTOCOL {\r
+  EFI_IO_ACCESS           Mem;\r
+  EFI_IO_ACCESS           Io;\r
+  EFI_IO_ACCESS           Pci;\r
+  EFI_IO_MAP              Map;\r
+  EFI_PCI_DEVICE_PATH     PciDevicePath;\r
+  EFI_IO_UNMAP            Unmap;\r
+  EFI_IO_ALLOCATE_BUFFER  AllocateBuffer;\r
+  EFI_IO_FLUSH            Flush;\r
+  EFI_IO_FREE_BUFFER      FreeBuffer;\r
+};\r
+\r
+extern EFI_GUID gEfiDeviceIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DevicePath.h b/MdePkg/Include/Protocol/DevicePath.h
new file mode 100644 (file)
index 0000000..6ff0050
--- /dev/null
@@ -0,0 +1,529 @@
+/** @file\r
+  The device path protocol as defined in EFI 1.0.\r
+\r
+  The device path represents a programatic path to a device. It's the view\r
+  from a software point of view. It also must persist from boot to boot, so \r
+  it can not contain things like PCI bus numbers that change from boot to boot.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DevicePath.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__\r
+#define __EFI_DEVICE_PATH_PROTOCOL_H__\r
+\r
+//\r
+// Device Path protocol\r
+//\r
+#define EFI_DEVICE_PATH_PROTOCOL_GUID \\r
+  { \\r
+    0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+//\r
+// Device Path information\r
+//\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT8 Type;\r
+  UINT8 SubType;\r
+  UINT8 Length[2];\r
+} EFI_DEVICE_PATH_PROTOCOL;\r
+\r
+//\r
+// Hardware Device Paths\r
+//\r
+#define HARDWARE_DEVICE_PATH      0x01\r
+\r
+#define HW_PCI_DP                 0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           Function;\r
+  UINT8                           Device;\r
+} PCI_DEVICE_PATH;\r
+\r
+#define HW_PCCARD_DP              0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           FunctionNumber;\r
+} PCCARD_DEVICE_PATH;\r
+\r
+#define HW_MEMMAP_DP              0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          MemoryType;\r
+  EFI_PHYSICAL_ADDRESS            StartingAddress;\r
+  EFI_PHYSICAL_ADDRESS            EndingAddress;\r
+} MEMMAP_DEVICE_PATH;\r
+\r
+#define HW_VENDOR_DP              0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Guid;\r
+} VENDOR_DEVICE_PATH;\r
+\r
+#define HW_CONTROLLER_DP          0x05\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ControllerNumber;\r
+} CONTROLLER_DEVICE_PATH;\r
+\r
+//\r
+// ACPI Device Paths\r
+//\r
+#define ACPI_DEVICE_PATH          0x02\r
+\r
+#define ACPI_DP                   0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          HID;\r
+  UINT32                          UID;\r
+} ACPI_HID_DEVICE_PATH;\r
+\r
+#define ACPI_EXTENDED_DP          0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          HID;\r
+  UINT32                          UID;\r
+  UINT32                          CID;\r
+  //\r
+  // Optional variable length _HIDSTR\r
+  // Optional variable length _UIDSTR\r
+  //\r
+} ACPI_EXTENDED_HID_DEVICE_PATH;\r
+\r
+//\r
+//  EISA ID Macro\r
+//  EISA ID Definition 32-bits\r
+//   bits[15:0] - three character compressed ASCII EISA ID.\r
+//   bits[31:16] - binary number\r
+//    Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'\r
+//\r
+#define PNP_EISA_ID_CONST         0x41d0\r
+#define EISA_ID(_Name, _Num)      ((UINT32) ((_Name) | (_Num) << 16))\r
+#define EISA_PNP_ID(_PNPId)       (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
+#define EFI_PNP_ID(_PNPId)        (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
+\r
+#define PNP_EISA_ID_MASK          0xffff\r
+#define EISA_ID_TO_NUM(_Id)       ((_Id) >> 16)\r
+\r
+\r
+#define ACPI_ADR_DP               0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ADR;\r
+} ACPI_ADR_DEVICE_PATH;\r
+\r
+\r
+//\r
+// Messaging Device Paths\r
+//\r
+#define MESSAGING_DEVICE_PATH     0x03\r
+\r
+#define MSG_ATAPI_DP              0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           PrimarySecondary;\r
+  UINT8                           SlaveMaster;\r
+  UINT16                          Lun;\r
+} ATAPI_DEVICE_PATH;\r
+\r
+#define MSG_SCSI_DP               0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          Pun;\r
+  UINT16                          Lun;\r
+} SCSI_DEVICE_PATH;\r
+\r
+#define MSG_FIBRECHANNEL_DP       0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          WWN;\r
+  UINT64                          Lun;\r
+} FIBRECHANNEL_DEVICE_PATH;\r
+\r
+#define MSG_1394_DP               0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          Guid;\r
+} F1394_DEVICE_PATH;\r
+\r
+#define MSG_USB_DP                0x05\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT8                         ParentPortNumber;\r
+    UINT8                         InterfaceNumber;\r
+} USB_DEVICE_PATH;\r
+\r
+#define MSG_USB_CLASS_DP          0x0f\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT16                        VendorId;\r
+    UINT16                        ProductId;\r
+    UINT8                         DeviceClass;\r
+    UINT8                         DeviceSubClass;\r
+    UINT8                         DeviceProtocol;\r
+} USB_CLASS_DEVICE_PATH;\r
+\r
+#define MSG_USB_WWID_DP           0x10\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT16                        InterfaceNumber;\r
+    UINT16                        VendorId;\r
+    UINT16                        ProductId;\r
+    // CHAR16                     SerialNumber[...];\r
+} USB_WWID_DEVICE_PATH;\r
+\r
+\r
+#define MSG_DEVICE_LOGICAL_UNIT_DP  0x11\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT8                         Lun;\r
+} DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
+\r
+#define MSG_SATA_DP               0x12\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          HbaPortNumber;\r
+  UINT16                          PortMultiplierPort;\r
+  UINT16                          LogicalUnitNumber;\r
+} SATA_DEVICE_PATH;\r
+\r
+#define MSG_I2O_DP                0x06\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Tid;\r
+} I2O_DEVICE_PATH;\r
+\r
+#define MSG_MAC_ADDR_DP           0x0b\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_MAC_ADDRESS                 MacAddress;\r
+  UINT8                           IfType;\r
+} MAC_ADDR_DEVICE_PATH;\r
+\r
+#define MSG_IPv4_DP               0x0c\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_IPv4_ADDRESS                LocalIpAddress;\r
+  EFI_IPv4_ADDRESS                RemoteIpAddress;\r
+  UINT16                          LocalPort;\r
+  UINT16                          RemotePort;\r
+  UINT16                          Protocol;\r
+  BOOLEAN                         StaticIpAddress;\r
+} IPv4_DEVICE_PATH;\r
+\r
+#define MSG_IPv6_DP               0x0d\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_IPv6_ADDRESS                LocalIpAddress;\r
+  EFI_IPv6_ADDRESS                RemoteIpAddress;\r
+  UINT16                          LocalPort;\r
+  UINT16                          RemotePort;\r
+  UINT16                          Protocol;\r
+  BOOLEAN                         StaticIpAddress;\r
+} IPv6_DEVICE_PATH;\r
+\r
+#define MSG_INFINIBAND_DP         0x09\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ResourceFlags;\r
+  UINT8                           PortGid[16];\r
+  UINT64                          ServiceId;\r
+  UINT64                          TargetPortId;\r
+  UINT64                          DeviceId;\r
+} INFINIBAND_DEVICE_PATH;\r
+\r
+#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE                0x01\r
+#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT  0x02\r
+#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL           0x04\r
+#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL           0x08\r
+#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL           0x10\r
+\r
+#define MSG_UART_DP               0x0e\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          BaudRate;\r
+  UINT8                           DataBits;\r
+  UINT8                           Parity;\r
+  UINT8                           StopBits;\r
+} UART_DEVICE_PATH;\r
+\r
+//\r
+// Use VENDOR_DEVICE_PATH struct\r
+//\r
+#define MSG_VENDOR_DP             0x0a\r
+typedef VENDOR_DEVICE_PATH        VENDOR_DEFINED_DEVICE_PATH;\r
+\r
+#define DEVICE_PATH_MESSAGING_PC_ANSI     EFI_PC_ANSI_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_100      EFI_VT_100_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_UTF8     EFI_VT_UTF8_GUID\r
+\r
+#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL   EFI_UART_DEVICE_PATH_GUID\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Guid;\r
+  UINT32                          FlowControlMap;\r
+} UART_FLOW_CONTROL_DEVICE_PATH;\r
+\r
+#define DEVICE_PATH_MESSAGING_SAS                 EFI_SAS_DEVICE_PATH_GUID\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Guid;\r
+  UINT32                          Reserved;\r
+  UINT64                          SasAddress;\r
+  UINT64                          Lun;\r
+  UINT16                          DeviceTopology;\r
+  UINT16                          RelativeTargetPort;\r
+} SAS_DEVICE_PATH;\r
+\r
+#define MSG_ISCSI_DP              0x13\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          NetworkProtocol;\r
+  UINT16                          LoginOption;\r
+  UINT16                          Reserved;\r
+  UINT16                          TargetPortalGroupTag;\r
+  UINT64                          LUN;\r
+  // CHAR8                        iSCSI Target Name\r
+} ISCSI_DEVICE_PATH;\r
+\r
+#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST             0x0000\r
+#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C   0x0002\r
+#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST               0x0000\r
+#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C     0x0008\r
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP              0x0000\r
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON               0x1000\r
+#define ISCSI_LOGIN_OPTION_CHAP_BI                      0x0000\r
+#define ISCSI_LOGIN_OPTION_CHAP_UNI                     0x2000\r
+\r
+//\r
+// Media Device Path\r
+//\r
+#define MEDIA_DEVICE_PATH         0x04\r
+\r
+#define MEDIA_HARDDRIVE_DP        0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          PartitionNumber;\r
+  UINT64                          PartitionStart;\r
+  UINT64                          PartitionSize;\r
+  UINT8                           Signature[16];\r
+  UINT8                           MBRType;\r
+  UINT8                           SignatureType;\r
+} HARDDRIVE_DEVICE_PATH;\r
+\r
+#define MBR_TYPE_PCAT             0x01\r
+#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02\r
+\r
+#define SIGNATURE_TYPE_MBR        0x01\r
+#define SIGNATURE_TYPE_GUID       0x02\r
+\r
+#define MEDIA_CDROM_DP            0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          BootEntry;\r
+  UINT64                          PartitionStart;\r
+  UINT64                          PartitionSize;\r
+} CDROM_DEVICE_PATH;\r
+\r
+//\r
+// Use VENDOR_DEVICE_PATH struct\r
+//\r
+#define MEDIA_VENDOR_DP           0x03\r
+\r
+#define MEDIA_FILEPATH_DP         0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  CHAR16                          PathName[1];\r
+} FILEPATH_DEVICE_PATH;\r
+\r
+#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)\r
+\r
+#define MEDIA_PROTOCOL_DP         0x05\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Protocol;\r
+} MEDIA_PROTOCOL_DEVICE_PATH;\r
+\r
+\r
+#define MEDIA_PIWG_FW_VOL_DP      0x6\r
+typedef MEDIA_PROTOCOL_DEVICE_PATH MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
+\r
+\r
+#define MEDIA_PIWG_FW_FILE_DP     0x7\r
+typedef MEDIA_PROTOCOL_DEVICE_PATH MEDIA_FW_VOL_DEVICE_PATH;\r
+\r
+//\r
+// BBS Device Path\r
+//\r
+#define BBS_DEVICE_PATH           0x05\r
+#define BBS_BBS_DP                0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          DeviceType;\r
+  UINT16                          StatusFlag;\r
+  CHAR8                           String[1];\r
+} BBS_BBS_DEVICE_PATH;\r
+\r
+//\r
+// DeviceType definitions - from BBS specification\r
+//\r
+#define BBS_TYPE_FLOPPY           0x01\r
+#define BBS_TYPE_HARDDRIVE        0x02\r
+#define BBS_TYPE_CDROM            0x03\r
+#define BBS_TYPE_PCMCIA           0x04\r
+#define BBS_TYPE_USB              0x05\r
+#define BBS_TYPE_EMBEDDED_NETWORK 0x06\r
+#define BBS_TYPE_BEV              0x80\r
+#define BBS_TYPE_UNKNOWN          0xFF\r
+\r
+\r
+//\r
+// Union of all possible Device Paths and pointers to Device Paths\r
+//\r
+\r
+typedef union {\r
+  EFI_DEVICE_PATH_PROTOCOL             DevPath;\r
+  PCI_DEVICE_PATH                      Pci;\r
+  PCCARD_DEVICE_PATH                   PcCard;\r
+  MEMMAP_DEVICE_PATH                   MemMap;\r
+  VENDOR_DEVICE_PATH                   Vendor;\r
+\r
+  CONTROLLER_DEVICE_PATH               Controller;\r
+  ACPI_HID_DEVICE_PATH                 Acpi;\r
+\r
+  ATAPI_DEVICE_PATH                    Atapi;\r
+  SCSI_DEVICE_PATH                     Scsi;\r
+  FIBRECHANNEL_DEVICE_PATH             FibreChannel;\r
+\r
+  F1394_DEVICE_PATH                    F1394;\r
+  USB_DEVICE_PATH                      Usb;\r
+  SATA_DEVICE_PATH                     Sata;\r
+  USB_CLASS_DEVICE_PATH                UsbClass;\r
+  I2O_DEVICE_PATH                      I2O;\r
+  MAC_ADDR_DEVICE_PATH                 MacAddr;\r
+  IPv4_DEVICE_PATH                     Ipv4;\r
+  IPv6_DEVICE_PATH                     Ipv6;\r
+  INFINIBAND_DEVICE_PATH               InfiniBand;\r
+  UART_DEVICE_PATH                     Uart;\r
+\r
+  HARDDRIVE_DEVICE_PATH                HardDrive;\r
+  CDROM_DEVICE_PATH                    CD;\r
+\r
+  FILEPATH_DEVICE_PATH                 FilePath;\r
+  MEDIA_PROTOCOL_DEVICE_PATH           MediaProtocol;\r
+\r
+  BBS_BBS_DEVICE_PATH                  Bbs;\r
+} EFI_DEV_PATH;\r
+\r
+\r
+\r
+typedef union {\r
+  EFI_DEVICE_PATH_PROTOCOL             *DevPath;\r
+  PCI_DEVICE_PATH                      *Pci;\r
+  PCCARD_DEVICE_PATH                   *PcCard;\r
+  MEMMAP_DEVICE_PATH                   *MemMap;\r
+  VENDOR_DEVICE_PATH                   *Vendor;\r
+\r
+  CONTROLLER_DEVICE_PATH               *Controller;\r
+  ACPI_HID_DEVICE_PATH                 *Acpi;\r
+  ACPI_EXTENDED_HID_DEVICE_PATH        *ExtendedAcpi;\r
+\r
+  ATAPI_DEVICE_PATH                    *Atapi;\r
+  SCSI_DEVICE_PATH                     *Scsi;\r
+  FIBRECHANNEL_DEVICE_PATH             *FibreChannel;\r
+\r
+  F1394_DEVICE_PATH                    *F1394;\r
+  USB_DEVICE_PATH                      *Usb;\r
+  SATA_DEVICE_PATH                     *Sata;\r
+  USB_CLASS_DEVICE_PATH                *UsbClass;\r
+  I2O_DEVICE_PATH                      *I2O;\r
+  MAC_ADDR_DEVICE_PATH                 *MacAddr;\r
+  IPv4_DEVICE_PATH                     *Ipv4;\r
+  IPv6_DEVICE_PATH                     *Ipv6;\r
+  INFINIBAND_DEVICE_PATH               *InfiniBand;\r
+  UART_DEVICE_PATH                     *Uart;\r
+\r
+  HARDDRIVE_DEVICE_PATH                *HardDrive;\r
+  CDROM_DEVICE_PATH                    *CD;\r
+\r
+  FILEPATH_DEVICE_PATH                 *FilePath;\r
+  MEDIA_PROTOCOL_DEVICE_PATH           *MediaProtocol;\r
+\r
+  BBS_BBS_DEVICE_PATH                  *Bbs;\r
+  UINT8                                *Raw;\r
+} EFI_DEV_PATH_PTR;\r
+\r
+#pragma pack()\r
+                                             \r
+#define EFI_DP_TYPE_MASK                     0x7F\r
+#define EFI_DP_TYPE_UNPACKED                 0x80\r
+#define END_DEVICE_PATH_TYPE                 0x7f\r
+                                             \r
+#define EFI_END_ENTIRE_DEVICE_PATH           0xff\r
+#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE   0xff\r
+#define EFI_END_INSTANCE_DEVICE_PATH         0x01\r
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE       EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE\r
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE     EFI_END_INSTANCE_DEVICE_PATH\r
+                                             \r
+#define EFI_END_DEVICE_PATH_LENGTH           (sizeof (EFI_DEVICE_PATH_PROTOCOL))\r
+#define END_DEVICE_PATH_LENGTH               EFI_END_DEVICE_PATH_LENGTH\r
+                                             \r
+#define DP_IS_END_TYPE(a)                    \r
+#define DP_IS_END_SUBTYPE(a)                 (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
+#define DevicePathSubType(a)                 ((a)->SubType)\r
+#define IsDevicePathUnpacked(a)              ((a)->Type & EFI_DP_TYPE_UNPACKED)\r
+                                             \r
+#define EfiDevicePathNodeLength(a)           (((a)->Length[0]) | ((a)->Length[1] << 8))\r
+#define DevicePathNodeLength(a)              (EfiDevicePathNodeLength(a))\r
+#define EfiNextDevicePathNode(a)             ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))\r
+#define NextDevicePathNode(a)                (EfiNextDevicePathNode(a)) \r
+                                             \r
+#define EfiDevicePathType(a)                 (((a)->Type) & EFI_DP_TYPE_MASK)\r
+#define DevicePathType(a)                    (EfiDevicePathType(a))\r
+#define EfiIsDevicePathEndType(a)            (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)\r
+#define IsDevicePathEndType(a)               (EfiIsDevicePathEndType(a)) \r
+                                             \r
+                                             \r
+#define EfiIsDevicePathEndSubType(a)         ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
+#define IsDevicePathEndSubType(a)            (EfiIsDevicePathEndSubType(a))\r
+#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)\r
+                                             \r
+#define EfiIsDevicePathEnd(a)                (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))\r
+#define IsDevicePathEnd(a)                   (EfiIsDevicePathEnd(a))\r
+#define EfiIsDevicePathEndInstance(a)        (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))\r
+\r
+\r
+#define SetDevicePathNodeLength(a,l) {                           \\r
+          (a)->Length[0] = (UINT8) (l);                          \\r
+          (a)->Length[1] = (UINT8) ((l) >> 8);                   \\r
+          }\r
+\r
+#define SetDevicePathEndNode(a)  {                               \\r
+          (a)->Type = END_DEVICE_PATH_TYPE;                      \\r
+          (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;         \\r
+          (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL);     \\r
+          (a)->Length[1] = 0;                                    \\r
+          }\r
+\r
+extern EFI_GUID gEfiDevicePathProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DevicePathFromText.h b/MdePkg/Include/Protocol/DevicePathFromText.h
new file mode 100644 (file)
index 0000000..31b2e06
--- /dev/null
@@ -0,0 +1,75 @@
+/** @file\r
+  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL as defined in UEFI 2.0.  \r
+  This protocol provides service to convert text to device paths and device nodes.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DevicePathFromText.h\r
+\r
+**/\r
+\r
+#ifndef __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__\r
+#define __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__\r
+\r
+#include <Protocol/DevicePath.h>\r
+\r
+//\r
+// Device Path From Text protocol\r
+//\r
+#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \\r
+  { \\r
+    0x5c99a21, 0xc70f, 0x4ad2, {0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e  } \\r
+  }\r
+\r
+/**\r
+  Convert text to the binary representation of a device node.\r
+\r
+  @param  TextDeviceNode TextDeviceNode points to the text representation of a device\r
+                         node. Conversion starts with the first character and continues\r
+                         until the first non-device node character.\r
+\r
+  @retval a_pointer      Pointer to the EFI device node.\r
+  @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (\r
+  IN CONST CHAR16                 *TextDeviceNode\r
+  )\r
+;    \r
+  \r
+\r
+/**\r
+  Convert text to the binary representation of a device node.\r
+\r
+  @param  TextDeviceNode TextDevicePath points to the text representation of a device\r
+                         path. Conversion starts with the first character and continues\r
+                         until the first non-device path character.\r
+\r
+  @retval a_pointer      Pointer to the allocated device path.\r
+  @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) (\r
+  IN CONST CHAR16                 *TextDevicePath\r
+  )\r
+;  \r
+  \r
+typedef struct {\r
+  EFI_DEVICE_PATH_FROM_TEXT_NODE  ConvertTextToDeviceNode;\r
+  EFI_DEVICE_PATH_FROM_TEXT_PATH  ConvertTextToDevicePath;\r
+} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DevicePathToText.h b/MdePkg/Include/Protocol/DevicePathToText.h
new file mode 100644 (file)
index 0000000..0b01412
--- /dev/null
@@ -0,0 +1,88 @@
+/** @file\r
+  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0.  \r
+  This protocol provides service to convert device nodes and paths to text.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DevicePathToText.h\r
+\r
+**/\r
+\r
+#ifndef __DEVICE_PATH_TO_TEXT_PROTOCOL_H__\r
+#define __DEVICE_PATH_TO_TEXT_PROTOCOL_H__\r
+\r
+#include <Protocol/DevicePath.h>\r
+\r
+//\r
+// Device Path To Text protocol\r
+//\r
+#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \\r
+  { \\r
+    0x8b843e20, 0x8132, 0x4852, {0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \\r
+  }\r
+\r
+/**\r
+  Convert a device node to its text representation.\r
+\r
+  @param  DeviceNode     Points to the device node to be converted.\r
+  @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param  AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+  @retval a_pointer      a pointer to the allocated text representation of the device node data\r
+  @retval NULL           if DeviceNode is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+CHAR16*\r
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DeviceNode,\r
+  IN BOOLEAN                          DisplayOnly,\r
+  IN BOOLEAN                          AllowShortcuts\r
+  )\r
+;      \r
+\r
+/**\r
+  Convert a device path to its text representation.\r
+\r
+  @param  DevicePath     Points to the device path to be converted.\r
+  @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.  \r
+  @param  AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of\r
+                         text representation for a device node cannot be used.\r
+\r
+  @retval a_pointer      a pointer to the allocated text representation of the device node.\r
+  @retval NULL           if DevicePath is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+CHAR16*\r
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
+  IN BOOLEAN                          DisplayOnly,\r
+  IN BOOLEAN                          AllowShortcuts\r
+  )\r
+;    \r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_TO_TEXT_NODE        ConvertDeviceNodeToText;\r
+  EFI_DEVICE_PATH_TO_TEXT_PATH        ConvertDevicePathToText;\r
+} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDevicePathToTextProtocolGuid;\r
+\r
+#endif\r
+\r
+\r
diff --git a/MdePkg/Include/Protocol/DevicePathUtilities.h b/MdePkg/Include/Protocol/DevicePathUtilities.h
new file mode 100644 (file)
index 0000000..3959456
--- /dev/null
@@ -0,0 +1,197 @@
+/** @file\r
+  EFI_DEVICE_PATH_UTILITIES_PROTOCOL as defined in UEFI 2.0.  \r
+  Use to create and manipulate device paths and device nodes.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DevicePathUtilities.h\r
+\r
+**/\r
+\r
+#ifndef __DEVICE_PATH_UTILITIES_PROTOCOL_H__\r
+#define __DEVICE_PATH_UTILITIES_PROTOCOL_H__\r
+\r
+\r
+#include <Protocol/DevicePath.h>\r
+\r
+//\r
+// Device Path Utilities protocol\r
+//\r
+#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \\r
+  { \\r
+    0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \\r
+  }\r
+\r
+/**\r
+  Returns the size of the device path, in bytes.\r
+\r
+  @param  DevicePath Points to the start of the EFI device path.\r
+\r
+  @revtal Size       Size of the specified device path, in bytes, including the end-of-path tag.\r
+\r
+**/\r
+typedef\r
+UINTN\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
+  )\r
+;    \r
+  \r
+\r
+/**\r
+  Create a duplicate of the specified path.\r
+\r
+  @param  DevicePath Points to the source EFI device path.\r
+\r
+  @retval Pointer    A pointer to the duplicate device path.\r
+  @retval NULL       insufficient memory\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
+  )\r
+;      \r
+\r
+/**\r
+  Create a new path by appending the second device path to the first.\r
+\r
+  @param  Src1 Points to the first device path. If NULL, then it is ignored.\r
+  @param  Src2 Points to the second device path. If NULL, then it is ignored.\r
+\r
+  @retval Pointer  A pointer to the newly created device path.\r
+  @retval NULL     Memory could not be allocated\r
+                   or either DevicePath or DeviceNode is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2\r
+  )\r
+;     \r
+  \r
+/**\r
+  Creates a new path by appending the device node to the device path.\r
+\r
+  @param  DevicePath Points to the device path.\r
+  @param  DeviceNode Points to the device node.\r
+\r
+  @retval Pointer    A pointer to the allocated device node.\r
+  @retval NULL       Memory could not be allocated\r
+                     or either DevicePath or DeviceNode is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode\r
+  )\r
+;\r
+\r
+/**\r
+  Creates a new path by appending the specified device path instance to the specified device path.\r
+\r
+  @param  DevicePath         Points to the device path. If NULL, then ignored.\r
+  @param  DevicePathInstance Points to the device path instance.\r
+\r
+  @retval Pointer            A pointer to the newly created device path\r
+  @retval NULL               Memory could not be allocated or DevicePathInstance is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance\r
+  )\r
+;  \r
+\r
+/**\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  @param  DevicePathInstance     On input, this holds the pointer to the current device path\r
+                                 instance. On output, this holds the pointer to the next\r
+                                 device path instance or NULL if there are no more device\r
+                                 path instances in the device path.  \r
+  @param  DevicePathInstanceSize On output, this holds the size of the device path instance,\r
+                                 in bytes or zero, if DevicePathInstance is zero.\r
+\r
+  @retval Pointer                A pointer to the copy of the current device path instance.\r
+  @retval NULL                   DevicePathInstace was NULL on entry or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE) (\r
+  IN  OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePathInstance,\r
+  OUT UINTN                         *DevicePathInstanceSize\r
+  )\r
+;  \r
+\r
+/**\r
+  Creates a device node\r
+\r
+  @param  NodeType    NodeType is the device node type (EFI_DEVICE_PATH.Type) for\r
+                      the new device node.\r
+  @param  NodeSubType NodeSubType is the device node sub-type\r
+                      EFI_DEVICE_PATH.SubType) for the new device node.\r
+  @param  NodeLength  NodeLength is the length of the device node\r
+                      (EFI_DEVICE_PATH.Length) for the new device node.\r
+\r
+  @retval Pointer     A pointer to the newly created device node.\r
+  @retval NULL        NodeLength is less than\r
+                      the size of the header or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_CREATE_NODE) (\r
+  IN UINT8                          NodeType,\r
+  IN UINT8                          NodeSubType,\r
+  IN UINT16                         NodeLength\r
+)\r
+;   \r
+\r
+/**\r
+  Returns whether a device path is multi-instance.\r
+\r
+  @param  DevicePath Points to the device path. If NULL, then ignored.\r
+\r
+  @retval TRUE       The device path has more than one instance\r
+  @retval FALSE      The device path is empty or contains only a single instance.\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL         *DevicePath\r
+  )\r
+;                                                                                                       \r
+  \r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;\r
+  EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH      DuplicateDevicePath;\r
+  EFI_DEVICE_PATH_UTILS_APPEND_PATH          AppendDevicePath;\r
+  EFI_DEVICE_PATH_UTILS_APPEND_NODE          AppendDeviceNode;\r
+  EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE      AppendDevicePathInstance;\r
+  EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE    GetNextDevicePathInstance;\r
+  EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE    IsDevicePathMultiInstance;\r
+  EFI_DEVICE_PATH_CREATE_NODE                CreateDeviceNode;\r
+} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid; \r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/Dhcp4.h b/MdePkg/Include/Protocol/Dhcp4.h
new file mode 100644 (file)
index 0000000..3adce1a
--- /dev/null
@@ -0,0 +1,442 @@
+/** @file\r
+  EFI_DHCP4_PROTOCOL as defined in UEFI 2.0.\r
+  EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.\r
+  These protocols are used to collect configuration information for the EFI IPv4 Protocol \r
+  drivers and to provide DHCPv4 server and PXE boot server discovery services.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DHCP4.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DHCP4_PROTOCOL_H__\r
+#define __EFI_DHCP4_PROTOCOL_H__\r
+\r
+#define EFI_DHCP4_PROTOCOL_GUID \\r
+  { \\r
+    0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \\r
+  }\r
+\r
+#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \\r
+  }\r
+  \r
+typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL;\r
+\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT8               OpCode;\r
+  UINT8               Length;\r
+  UINT8               Data[1];\r
+} EFI_DHCP4_PACKET_OPTION;\r
+#pragma pack()\r
+\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+    UINT8             OpCode;\r
+    UINT8             HwType;\r
+    UINT8             HwAddrLen;\r
+    UINT8             Hops;\r
+    UINT32            Xid;\r
+    UINT16            Seconds;\r
+    UINT16            Reserved;\r
+    EFI_IPv4_ADDRESS  ClientAddr;       //Client IP address from client\r
+    EFI_IPv4_ADDRESS  YourAddr;         //Client IP address from server\r
+    EFI_IPv4_ADDRESS  ServerAddr;       //IP address of next server in bootstrap \r
+    EFI_IPv4_ADDRESS  GatewayAddr;      //Relay agent IP address\r
+    UINT8             ClientHwAddr[16]; //Client hardware address\r
+    CHAR8             ServerName[64];   \r
+    CHAR8             BootFileName[128];\r
+}EFI_DHCP4_HEADER;\r
+#pragma pack()\r
+\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT32              Size;\r
+  UINT32              Length;\r
+\r
+  struct {\r
+    EFI_DHCP4_HEADER  Header;\r
+    UINT32            Magik;\r
+    UINT8             Option[1];\r
+  } Dhcp4;\r
+} EFI_DHCP4_PACKET;\r
+#pragma pack()\r
+\r
+\r
+typedef enum {\r
+  Dhcp4Stopped        = 0x0,\r
+  Dhcp4Init           = 0x1,\r
+  Dhcp4Selecting      = 0x2,\r
+  Dhcp4Requesting     = 0x3,\r
+  Dhcp4Bound          = 0x4,\r
+  Dhcp4Renewing       = 0x5,\r
+  Dhcp4Rebinding      = 0x6,\r
+  Dhcp4InitReboot     = 0x7,\r
+  Dhcp4Rebooting      = 0x8\r
+} EFI_DHCP4_STATE;\r
+\r
+\r
+typedef enum{\r
+  Dhcp4SendDiscover   = 0x01,\r
+  Dhcp4RcvdOffer      = 0x02,\r
+  Dhcp4SelectOffer    = 0x03,\r
+  Dhcp4SendRequest    = 0x04,\r
+  Dhcp4RcvdAck        = 0x05,\r
+  Dhcp4RcvdNak        = 0x06,\r
+  Dhcp4SendDecline    = 0x07,\r
+  Dhcp4BoundCompleted = 0x08,\r
+  Dhcp4EnterRenewing  = 0x09,\r
+  Dhcp4EnterRebinding = 0x0a,\r
+  Dhcp4AddressLost    = 0x0b,\r
+  Dhcp4Fail           = 0x0c\r
+} EFI_DHCP4_EVENT;\r
+\r
+/**                                                                 \r
+  Callback routine \r
+    \r
+  @param  This                  Pointer to the EFI DHCPv4 Protocol instance that is used to\r
+                                configure this callback function.                          \r
+  @param  Context               Pointer to the context that is initialized by\r
+                                EFI_DHCP4_PROTOCOL.Configure().                                              \r
+  @param  CurrentState          The current operational state of the EFI DHCPv4 Protocol\r
+                                driver.                                                 \r
+  @param  Dhcp4Event            The event that occurs in the current state, which usually means a\r
+                                state transition.                                                \r
+  @param  Packet                The DHCP packet that is going to be sent or already received.                \r
+  @param  NewPacket             The packet that is used to replace the above Packet.\r
+                                \r
+  @retval EFI_SUCCESS           Tells the EFI DHCPv4 Protocol driver to continue the DHCP process.\r
+  @retval EFI_NOT_READY         Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol         \r
+                                driver will continue to wait for more DHCPOFFER packets until the retry\r
+                                timeout expires.                                                       \r
+  @retval EFI_ABORTED           Tells the EFI DHCPv4 Protocol driver to abort the current process and\r
+                                return to the Dhcp4Init or Dhcp4InitReboot state.                    \r
+                                   \r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_DHCP4_CALLBACK) (\r
+  IN  EFI_DHCP4_PROTOCOL         *This,\r
+  IN  VOID                       *Context,\r
+  IN  EFI_DHCP4_STATE            CurrentState,\r
+  IN  EFI_DHCP4_EVENT            Dhcp4Event,\r
+  IN  EFI_DHCP4_PACKET           *Packet     OPTIONAL, \r
+  OUT EFI_DHCP4_PACKET           **NewPacket OPTIONAL\r
+  );\r
+\r
+\r
+typedef struct {\r
+  UINT32                      DiscoverTryCount;      \r
+  UINT32                      *DiscoverTimeout;\r
+  UINT32                      RequestTryCount;\r
+  UINT32                      *RequestTimeout;\r
+  EFI_IPv4_ADDRESS            ClientAddress;\r
+  EFI_DHCP4_CALLBACK          Dhcp4Callback;\r
+  void                        *CallbackContext;\r
+  UINT32                      OptionCount;\r
+  EFI_DHCP4_PACKET_OPTION     **OptionList;\r
+} EFI_DHCP4_CONFIG_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_DHCP4_STATE             State;\r
+  EFI_DHCP4_CONFIG_DATA       ConfigData;\r
+  EFI_IPv4_ADDRESS            ClientAddress;\r
+  EFI_MAC_ADDRESS             ClientMacAddress;\r
+  EFI_IPv4_ADDRESS            ServerAddress;\r
+  EFI_IPv4_ADDRESS            RouterAddress;\r
+  EFI_IPv4_ADDRESS            SubnetMask;\r
+  UINT32                      LeaseTime;\r
+  EFI_DHCP4_PACKET            *ReplyPacket;\r
+} EFI_DHCP4_MODE_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS            ListenAddress;\r
+  EFI_IPv4_ADDRESS            SubnetMask;\r
+  UINT16                      ListenPort;\r
+} EFI_DHCP4_LISTEN_POINT;\r
+\r
+\r
+typedef struct {\r
+  OUT EFI_STATUS              Status;\r
+  IN  EFI_EVENT               CompletionEvent;\r
+  IN  EFI_IPv4_ADDRESS        RemoteAddress;\r
+  IN  UINT16                  RemotePort;\r
+  IN  EFI_IPv4_ADDRESS        GatewayAddress;\r
+  IN  UINT32                  ListenPointCount;\r
+  IN  EFI_DHCP4_LISTEN_POINT  *ListenPoints;\r
+  IN  UINT32                  TimeoutValue;\r
+  IN  EFI_DHCP4_PACKET        *Packet;\r
+  OUT UINT32                  ResponseCount;\r
+  OUT EFI_DHCP4_PACKET        *ResponseList;\r
+} EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;\r
+\r
+\r
+/**\r
+  Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r
+\r
+  @param  This          Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r
+\r
+  @retval EFI_SUCCESS           The mode data was returned.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(\r
+  IN  EFI_DHCP4_PROTOCOL      *This,\r
+  OUT EFI_DHCP4_MODE_DATA     *Dhcp4ModeData\r
+  )\r
+;\r
+\r
+/**\r
+  Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.\r
+\r
+  @param  This                   Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Dhcp4CfgData           Pointer to the EFI_DHCP4_CONFIG_DATA.\r
+\r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or\r
+                                Dhcp4InitReboot state, if the original state of this driver\r
+                                was Dhcp4Stopped and the value of Dhcp4CfgData was\r
+                                not NULL. Otherwise, the state was left unchanged.\r
+  @retval EFI_ACCESS_DENIED     This instance of the EFI DHCPv4 Protocol driver was not in the\r
+                                Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state;\r
+                                Or onother instance of this EFI DHCPv4 Protocol driver is already\r
+                                in a valid configured state.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_CONFIGURE) (\r
+  IN EFI_DHCP4_PROTOCOL       *This,\r
+  IN EFI_DHCP4_CONFIG_DATA    *Dhcp4CfgData  OPTIONAL\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Starts the DHCP configuration process.\r
+\r
+  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
+                          EFI DHCPv4 Protocol driver is transferred into the\r
+                          Dhcp4Bound state or when the DHCP process is aborted.\r
+                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                          check the completion status. If NULL,\r
+                          EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r
+                          is transferred into the Dhcp4Bound state or the process fails.\r
+\r
+  @retval EFI_SUCCESS           The DHCP configuration process has started, or it has completed\r
+                                when CompletionEvent is NULL.\r
+  @retval EFI_NOT_STARTED       The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r
+                                state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_TIMEOUT           The DHCP configuration process failed because no response was\r
+                                received from the server within the specified timeout value.\r
+  @retval EFI_ABORTED           The user aborted the DHCP process.\r
+  @retval EFI_ALREADY_STARTED   Some other EFI DHCPv4 Protocol instance already started the\r
+                                DHCP process.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_START) (\r
+  IN EFI_DHCP4_PROTOCOL       *This,\r
+  IN EFI_EVENT                CompletionEvent   OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Extends the lease time by sending a request packet.\r
+\r
+  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  RebindRequest   If TRUE, this function broadcasts the request packets and enters\r
+                          the Dhcp4Rebinding state. Otherwise, it sends a unicast\r
+                          request packet and enters the Dhcp4Renewing state.\r
+  @param  CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r
+                          completes or some error occurs.\r
+                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                          check the completion status. If NULL,\r
+                          EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r
+                          until the DHCP process finishes.\r
+\r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the\r
+                                Dhcp4Renewing state or is back to the Dhcp4Bound state.\r
+  @retval EFI_NOT_STARTED       The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r
+                                state. EFI_DHCP4_PROTOCOL.Configure() needs to\r
+                                be called.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_TIMEOUT           There was no response from the server when the try count was\r
+                                exceeded.\r
+  @retval EFI_ACCESS_DENIED     The driver is not in the Dhcp4Bound state.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_RENEW_REBIND) (\r
+  IN EFI_DHCP4_PROTOCOL       *This,\r
+  IN BOOLEAN                  RebindRequest,\r
+  IN EFI_EVENT                CompletionEvent  OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Releases the current address configuration.\r
+\r
+  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_ACCESS_DENIED     The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_RELEASE) (\r
+  IN EFI_DHCP4_PROTOCOL       *This\r
+  )\r
+;  \r
+\r
+/**\r
+  Stops the current address configuration.\r
+\r
+  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+                                 \r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_STOP) (\r
+  IN EFI_DHCP4_PROTOCOL       *This\r
+  )\r
+; \r
+\r
+/**\r
+  Builds a DHCP packet, given the options to be appended or deleted or replaced.\r
+\r
+  @param  This        Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  SeedPacket  Initial packet to be used as a base for building new packet.\r
+  @param  DeleteCount Number of opcodes in the DeleteList.\r
+  @param  DeleteList  List of opcodes to be deleted from the seed packet.\r
+                      Ignored if DeleteCount is zero.\r
+  @param  AppendCount Number of entries in the OptionList.\r
+  @param  AppendList  Pointer to a DHCP option list to be appended to SeedPacket.\r
+                      If SeedPacket also contains options in this list, they are\r
+                      replaced by new options (except pad option). Ignored if\r
+                      AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r
+  @param  NewPacket   Pointer to storage for the pointer to the new allocated packet.\r
+                      Use the EFI Boot Service FreePool() on the resulting pointer\r
+                      when done with the packet.\r
+\r
+  @retval EFI_SUCCESS           The new packet was built.\r
+  @retval EFI_OUT_OF_RESOURCES  Storage for the new packet could not be allocated.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_BUILD) (\r
+  IN  EFI_DHCP4_PROTOCOL      *This,\r
+  IN  EFI_DHCP4_PACKET        *SeedPacket,\r
+  IN  UINT32                  DeleteCount,\r
+  IN  UINT8                   *DeleteList         OPTIONAL,\r
+  IN  UINT32                  AppendCount,\r
+  IN  EFI_DHCP4_PACKET_OPTION *AppendList[]       OPTIONAL,\r
+  OUT EFI_DHCP4_PACKET        **NewPacket\r
+  );\r
+;   \r
+\r
+/**\r
+  Transmits a DHCP formatted packet and optionally waits for responses.\r
+\r
+  @param  This    Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Token   Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
+\r
+  @retval EFI_SUCCESS           The packet was successfully queued for transmission.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+  @retval EFI_NOT_READY         The previous call to this function has not finished yet. Try to call\r
+                                this function after collection process completes.\r
+  @retval EFI_NO_MAPPING        The default station address is not available yet.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval Others                Some other unexpected error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE) (\r
+  IN EFI_DHCP4_PROTOCOL                *This,\r
+  IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN  *Token\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Parses the packed DHCP option data.\r
+\r
+  @param  This             Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Packet           Pointer to packet to be parsed.\r
+  @param  OptionCount      On input, the number of entries in the PacketOptionList.\r
+                           On output, the number of entries that were written into the\r
+                           PacketOptionList.\r
+  @param  PacketOptionList List of packet option entries to be filled in. End option or pad\r
+                           options are not included.\r
+\r
+  @retval EFI_SUCCESS           The packet was successfully parsed.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL  One or more of the following conditions is TRUE:\r
+                                1) *OptionCount is smaller than the number of options that\r
+                                were found in the Packet.\r
+                                2) PacketOptionList is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_PARSE) (\r
+  IN EFI_DHCP4_PROTOCOL        *This,\r
+  IN EFI_DHCP4_PACKET          *Packet,\r
+  IN OUT UINT32                *OptionCount,\r
+  OUT EFI_DHCP4_PACKET_OPTION  *PacketOptionList[]  OPTIONAL\r
+  )\r
+;\r
+\r
+\r
+struct _EFI_DHCP4_PROTOCOL {\r
+  EFI_DHCP4_GET_MODE_DATA      GetModeData;\r
+  EFI_DHCP4_CONFIGURE          Configure;\r
+  EFI_DHCP4_START              Start;\r
+  EFI_DHCP4_RENEW_REBIND       RenewRebind;\r
+  EFI_DHCP4_RELEASE            Release;\r
+  EFI_DHCP4_STOP               Stop;\r
+  EFI_DHCP4_BUILD              Build;\r
+  EFI_DHCP4_TRANSMIT_RECEIVE   TransmitReceive;\r
+  EFI_DHCP4_PARSE              Parse;\r
+};\r
+\r
+extern EFI_GUID gEfiDhcp4ProtocolGuid;\r
+extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DiskIo.h b/MdePkg/Include/Protocol/DiskIo.h
new file mode 100644 (file)
index 0000000..e36792c
--- /dev/null
@@ -0,0 +1,98 @@
+/** @file\r
+  Disk IO protocol as defined in the EFI 1.0 specification.\r
+\r
+  The Disk IO protocol is used to convert block oriented devices into byte\r
+  oriented devices. The Disk IO protocol is intended to layer on top of the\r
+  Block IO protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DiskIo.h\r
+\r
+**/\r
+\r
+#ifndef __DISK_IO_H__\r
+#define __DISK_IO_H__\r
+\r
+#define EFI_DISK_IO_PROTOCOL_GUID \\r
+  { \\r
+    0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;\r
+\r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  MediaId               Id of the media, changes every time the media is replaced.\r
+  @param  Offset                The starting byte offset to read from\r
+  @param  BufferSize            Size of Buffer\r
+  @param  Buffer                Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was read correctly from the device.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
+                                valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISK_READ) (\r
+  IN EFI_DISK_IO_PROTOCOL         *This,\r
+  IN UINT32                       MediaId,\r
+  IN UINT64                       Offset,\r
+  IN UINTN                        BufferSize,\r
+  OUT VOID                        *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Offset     The starting byte offset to read from\r
+  @param  BufferSize Size of Buffer\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was written correctly to the device.\r
+  @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r
+                                 valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISK_WRITE) (\r
+  IN EFI_DISK_IO_PROTOCOL         *This,\r
+  IN UINT32                       MediaId,\r
+  IN UINT64                       Offset,\r
+  IN UINTN                        BufferSize,\r
+  IN VOID                         *Buffer\r
+  )\r
+;\r
+\r
+#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r
+\r
+struct _EFI_DISK_IO_PROTOCOL {\r
+  UINT64          Revision;\r
+  EFI_DISK_READ   ReadDisk;\r
+  EFI_DISK_WRITE  WriteDisk;\r
+};\r
+\r
+extern EFI_GUID gEfiDiskIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DriverBinding.h b/MdePkg/Include/Protocol/DriverBinding.h
new file mode 100644 (file)
index 0000000..5f5d909
--- /dev/null
@@ -0,0 +1,111 @@
+/** @file\r
+  EFI ControllerHandle Driver Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DriverBinding.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DRIVER_BINDING_H__\r
+#define __EFI_DRIVER_BINDING_H__\r
+\r
+//\r
+// Global ID for the ControllerHandle Driver Protocol\r
+//\r
+#define EFI_DRIVER_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \\r
+  }\r
+\r
+typedef struct _EFI_DRIVER_BINDING_PROTOCOL  EFI_DRIVER_BINDING_PROTOCOL;\r
+\r
+/**\r
+  Test to see if this driver supports ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device\r
+  @retval EFI_ALREADY_STARTED This driver is already running on this device\r
+  @retval other               This driver does not support this device\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
+  IN EFI_HANDLE                             ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL               *RemainingDevicePath OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Start this driver on ControllerHandle.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_BINDING_START) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
+  IN EFI_HANDLE                             ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL               *RemainingDevicePath OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Stop this driver on ControllerHandle.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_BINDING_STOP) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                            ControllerHandle,\r
+  IN  UINTN                                 NumberOfChildren,\r
+  IN  EFI_HANDLE                            *ChildHandleBuffer OPTIONAL\r
+  )\r
+;\r
+\r
+//\r
+// Interface structure for the ControllerHandle Driver Protocol\r
+//\r
+struct _EFI_DRIVER_BINDING_PROTOCOL {\r
+  EFI_DRIVER_BINDING_SUPPORTED  Supported;\r
+  EFI_DRIVER_BINDING_START      Start;\r
+  EFI_DRIVER_BINDING_STOP       Stop;\r
+  UINT32                        Version;\r
+  EFI_HANDLE                    ImageHandle;\r
+  EFI_HANDLE                    DriverBindingHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiDriverBindingProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DriverConfiguration.h b/MdePkg/Include/Protocol/DriverConfiguration.h
new file mode 100644 (file)
index 0000000..f4f0c7a
--- /dev/null
@@ -0,0 +1,203 @@
+/** @file\r
+  EFI Driver Configuration Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DriverConfiguration.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DRIVER_CONFIGURATION_H__\r
+#define __EFI_DRIVER_CONFIGURATION_H__\r
+\r
+//\r
+// Global ID for the Driver Configuration Protocol defined in EFI 1.10\r
+//\r
+#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \\r
+  { \\r
+    0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+//\r
+// Global ID for the Driver Configuration Protocol defined in UEFI 2.0\r
+//\r
+#define UEFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \\r
+  { \\r
+    0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } \\r
+  }\r
+  \r
+typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL  EFI_DRIVER_CONFIGURATION_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiDriverConfigurationActionNone              = 0,\r
+  EfiDriverConfigurationActionStopController    = 1,\r
+  EfiDriverConfigurationActionRestartController = 2,\r
+  EfiDriverConfigurationActionRestartPlatform   = 3,\r
+  EfiDriverConfigurationActionMaximum\r
+} EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED;\r
+\r
+#define EFI_DRIVER_CONFIGURATION_SAFE_DEFAULTS          0x00000000\r
+#define EFI_DRIVER_CONFIGURATION_MANUFACTURING_DEFAULTS 0x00000001\r
+#define EFI_DRIVER_CONFIGURATION_CUSTOM_DEFAULTS        0x00000002\r
+#define EFI_DRIVER_CONFIGURATION_PERORMANCE_DEFAULTS    0x00000003\r
+\r
+/**\r
+  Allows the user to set controller specific options for a controller that a \r
+  driver is currently managing.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to set options on.\r
+  @param  ChildHandle      The handle of the child controller to set options on.  This\r
+                           is an optional parameter that may be NULL.  It will be NULL\r
+                           for device drivers, and for a bus drivers that wish to set\r
+                           options for the bus controller.  It will not be NULL for a\r
+                           bus driver that wishes to set options for one of its child\r
+                           controllers.\r
+  @param  Language         A pointer to a three character ISO 639-2 language identifier.\r
+                           This is the language of the user interface that should be\r
+                           presented to the user, and it must match one of the languages\r
+                           specified in SupportedLanguages.  The number of languages\r
+                           supported by a driver is up to the driver writer.\r
+  @param  ActionRequired   A pointer to the action that the calling agent is required\r
+                           to perform when this function returns.  See "Related\r
+                           Definitions" for a list of the actions that the calling\r
+                           agent is required to perform prior to accessing\r
+                           ControllerHandle again.\r
+\r
+  @retval EFI_SUCCESS           The driver specified by This successfully set the\r
+                                configuration options for the controller specified\r
+                                by ControllerHandle..\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support setting\r
+                                configuration options for the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempt to set the\r
+                                configuration options for the controller specified\r
+                                by ControllerHandle and ChildHandle.\r
+  @retval EFI_OUT_RESOURCES     There are not enough resources available to set the\r
+                                configuration options for the controller specified\r
+                                by ControllerHandle and ChildHandle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_CONFIGURATION_SET_OPTIONS) (\r
+  IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle  OPTIONAL,\r
+  IN  CHAR8                                                   *Language,\r
+  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED                *ActionRequired\r
+  );\r
+\r
+/**\r
+  Tests to see if a controller's current configuration options are valid.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to test if it's current\r
+                           configuration options are valid.\r
+  @param  ChildHandle      The handle of the child controller to test if it's current\r
+                           configuration options are valid.  This is an optional\r
+                           parameter that may be NULL.  It will be NULL for device\r
+                           drivers.  It will also be NULL for a bus drivers that wish\r
+                           to test the configuration options for the bus controller.\r
+                           It will not be NULL for a bus driver that wishes to test\r
+                           configuration options for one of its child controllers.\r
+\r
+  @retval EFI_SUCCESS           The controller specified by ControllerHandle and\r
+                                ChildHandle that is being managed by the driver\r
+                                specified by This has a valid set of  configuration\r
+                                options.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by ControllerHandle\r
+                                and ChildHandle.\r
+  @retval EFI_DEVICE_ERROR      The controller specified by ControllerHandle and\r
+                                ChildHandle that is being managed by the driver\r
+                                specified by This has an invalid set of configuration\r
+                                options.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_CONFIGURATION_OPTIONS_VALID) (\r
+  IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Forces a driver to set the default configuration options for a controller.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to force default configuration options on.\r
+  @param  ChildHandle      The handle of the child controller to force default configuration options on  This is an optional parameter that may be NULL.  It will be NULL for device drivers.  It will also be NULL for a bus drivers that wish to force default configuration options for the bus controller.  It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.\r
+  @param  DefaultType      The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle.  See Table 9-1 for legal values.  A DefaultType of 0x00000000 must be supported by this protocol.\r
+  @param  ActionRequired   A pointer to the action that the calling agent is required to perform when this function returns.  See "Related Definitions" in Section 9.1for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.\r
+\r
+  @retval EFI_SUCCESS           The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the configuration type specified by DefaultType.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempt to force the default configuration options on the controller specified by  ControllerHandle and ChildHandle.\r
+  @retval EFI_OUT_RESOURCES     There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS) (\r
+  IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle  OPTIONAL,\r
+  IN  UINT32                                                  DefaultType,\r
+  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED                *ActionRequired\r
+  );\r
+\r
+\r
+//\r
+//\r
+struct _EFI_DRIVER_CONFIGURATION_PROTOCOL {\r
+  EFI_DRIVER_CONFIGURATION_SET_OPTIONS    SetOptions;\r
+  EFI_DRIVER_CONFIGURATION_OPTIONS_VALID  OptionsValid;\r
+  EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS ForceDefaults;\r
+  CHAR8                                   *SupportedLanguages;\r
+};\r
+\r
+/**\r
+  Interface structure for the Driver Configuration Protocol.\r
+\r
+  @par Protocol Description:  \r
+  Used to set configuration options for a controller that an EFI Driver is managing.\r
+\r
+  @param SetOptions          Allows the use to set drivers specific configuration \r
+                             options for a controller that the driver is currently managing.\r
+                             \r
+  @param OptionsValid        Tests to see if a controller's current configuration \r
+                             options are valid. \r
+                             \r
+  @param ForceDefaults       Forces a driver to set the default configuration options \r
+                             for a controller.\r
+\r
+  @param SupportedLanguages  A Null-terminated ASCII string that contains one or more \r
+                             ISO 639-2 language codes.  This is the list of language \r
+                             codes that this protocol supports.\r
+\r
+**/\r
+\r
+extern EFI_GUID gEfiDriverConfigurationProtocolGuid;\r
+extern EFI_GUID gUefiDriverConfigurationProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DriverDiagnostics.h b/MdePkg/Include/Protocol/DriverDiagnostics.h
new file mode 100644 (file)
index 0000000..c0a0cbc
--- /dev/null
@@ -0,0 +1,134 @@
+/** @file\r
+  EFI Driver Diagnostics Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  DriverDiagnostics.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DRIVER_DIAGNOSTICS_H__\r
+#define __EFI_DRIVER_DIAGNOSTICS_H__\r
+\r
+//\r
+// Global ID for the Driver Diagnostics Protocol as defined in EFI 1.10.\r
+//\r
+#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \\r
+  { \\r
+    0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+//\r
+// Global ID for the Driver Diagnostics Protocol as defined in UEFI 2.0.\r
+//\r
+#define UEFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \\r
+  { \\r
+    0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } \\r
+  }\r
+  \r
+typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL  EFI_DRIVER_DIAGNOSTICS_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiDriverDiagnosticTypeStandard     = 0,\r
+  EfiDriverDiagnosticTypeExtended     = 1,\r
+  EfiDriverDiagnosticTypeManufacturing= 2,\r
+  EfiDriverDiagnosticTypeMaximum\r
+} EFI_DRIVER_DIAGNOSTIC_TYPE;\r
+\r
+/**\r
+  Runs diagnostics on a controller.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to run diagnostics on.\r
+  @param  ChildHandle      The handle of the child controller to run diagnostics on\r
+                           This is an optional parameter that may be NULL.  It will\r
+                           be NULL for device drivers.  It will also be NULL for a\r
+                           bus drivers that wish to run diagnostics on the bus\r
+                           controller.  It will not be NULL for a bus driver that\r
+                           wishes to run diagnostics on one of its child controllers.\r
+  @param  DiagnosticType   Indicates type of diagnostics to perform on the controller\r
+                           specified by ControllerHandle and ChildHandle.   See\r
+                           "Related Definitions" for the list of supported types.\r
+  @param  Language         A pointer to a three character ISO 639-2 language\r
+                           identifier.  This is the language in which the optional\r
+                           error message should be returned in Buffer, and it must\r
+                           match one of the languages specified in SupportedLanguages.\r
+                           The number of languages supported by a driver is up to\r
+                           the driver writer.\r
+  @param  ErrorType        A GUID that defines the format of the data returned in Buffer.\r
+  @param  BufferSize       The size, in bytes, of the data returned in Buffer.\r
+  @param  Buffer           A buffer that contains a Null-terminated Unicode string\r
+                           plus some additional data whose format is defined by\r
+                           ErrorType.  Buffer is allocated by this function with\r
+                           AllocatePool(), and it is the caller's responsibility\r
+                           to free it with a call to FreePool().\r
+\r
+  @retval EFI_SUCCESS           The controller specified by ControllerHandle and\r
+                                ChildHandle passed the diagnostic.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER ErrorType is NULL.\r
+  @retval EFI_INVALID_PARAMETER BufferType is NULL.\r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                running diagnostics for the controller specified\r
+                                by ControllerHandle and ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                type of diagnostic specified by DiagnosticType.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to complete\r
+                                the diagnostics.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to return\r
+                                the status information in ErrorType, BufferSize,\r
+                                and Buffer.\r
+  @retval EFI_DEVICE_ERROR      The controller specified by ControllerHandle and\r
+                                ChildHandle did not pass the diagnostic.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS) (\r
+  IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                            ControllerHandle,\r
+  IN  EFI_HANDLE                                            ChildHandle  OPTIONAL,\r
+  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                            DiagnosticType,\r
+  IN  CHAR8                                                 *Language,\r
+  OUT EFI_GUID                                              **ErrorType,\r
+  OUT UINTN                                                 *BufferSize,\r
+  OUT CHAR16                                                **Buffer\r
+  );\r
+\r
+\r
+//\r
+//\r
+\r
+/**\r
+  Interface structure for the Driver Diagnostics Protocol.\r
+\r
+  @par Protocol Description:\r
+  Used to perform diagnostics on a controller that an EFI Driver is managing.\r
+\r
+  @param RunDiagnostics      Runs diagnostics on a controller.\r
+  @param SupportedLanguages  A Null-terminated ASCII string that contains one or more\r
+                             ISO 639-2 language codes.  This is the list of language \r
+                             codes that this protocol supports.\r
+\r
+**/\r
+struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {\r
+  EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS  RunDiagnostics;\r
+  CHAR8                                   *SupportedLanguages;\r
+};\r
+\r
+extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;\r
+extern EFI_GUID gUefiDriverDiagnosticsProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/DriverSupportedEfiVersion.h b/MdePkg/Include/Protocol/DriverSupportedEfiVersion.h
new file mode 100644 (file)
index 0000000..84e30ef
--- /dev/null
@@ -0,0 +1,52 @@
+/** @file\r
+  The file provides information about the version of the EFI\r
+  specification that a driver is following. This protocol is\r
+  required for EFI drivers that are on PCI and other plug in\r
+  cards.\r
+\r
+  Copyright (c) 2006 - 2007, Intel Corporation\r
+  All rights reserved. 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
+  Module Name: DriverSupportedEfiVesrion.h\r
+\r
+**/\r
+\r
+#ifndef __DRIVER_SUPPORTED_EFI_VERSION_H__\r
+#define __DRIVER_SUPPORTED_EFI_VERSION_H__\r
+\r
+#define EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL_GUID  \\r
+  { 0x5c198761, 0x16a8, 0x4e69, { 0x97, 0x2c, 0x89, 0xd6, 0x79, 0x54, 0xf8, 0x1d } }\r
+\r
+\r
+/**\r
+  \r
+  The EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL provides a\r
+  mechanism for an EFI driver to publish the version of the EFI   \r
+  specification it conforms to. This protocol must be placed on   \r
+  the drivers image handle when the driver????s entry point is   \r
+  called.\r
+  \r
+  @param Length The size, in bytes, of the entire structure.\r
+                Future versions of this specification may grow\r
+                the size of the structure.\r
+  \r
+  @param irmwareVersion The version of the EFI specification\r
+                        that this driver conforms to.\r
+                        EFI_2_10_SYSTEM_TABLE_REVISION for this\r
+                        version of this specification.\r
+\r
+**/ \r
+typedef struct _EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL {\r
+  UINT32 Length;\r
+  UINT32 FirmwareVersion;\r
+} EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDriverSupportedEfiVersionProtocolGuid;\r
+\r
+#endif\r
diff --git a/MdePkg/Include/Protocol/Ebc.h b/MdePkg/Include/Protocol/Ebc.h
new file mode 100644 (file)
index 0000000..c1abcba
--- /dev/null
@@ -0,0 +1,148 @@
+/** @file\r
+  Describes the protocol interface to the EBC interpreter.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. 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
+  Module Name:  Ebc.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_EBC_PROTOCOL_H__\r
+#define __EFI_EBC_PROTOCOL_H__\r
+\r
+#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \\r
+  { \\r
+    0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 } \\r
+  }\r
+\r
+//\r
+// Protocol Guid Name defined in spec.\r
+//\r
+#define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID\r
+\r
+//\r
+// Define for forward reference.\r
+//\r
+typedef struct _EFI_EBC_PROTOCOL EFI_EBC_PROTOCOL;\r
+\r
+/**\r
+  Create a thunk for an image entry point. In short, given the physical address\r
+  of the entry point for a loaded image, create a thunk that does some \r
+  fixup of arguments (and perform any other necessary overhead) and then\r
+  calls the original entry point. The caller can then use the returned pointer\r
+  to the created thunk as the new entry point to image.\r
+\r
+  @param  This          protocol instance pointer\r
+  @param  ImageHandle   handle to the image. The EBC interpreter may use this to keep\r
+                        track of any resource allocations performed in loading and\r
+                        executing the image.\r
+  @param  EbcEntryPoint the entry point for the image (as defined in the file header)\r
+  @param  Thunk pointer to thunk pointer where the address of the created\r
+                        thunk is returned.\r
+\r
+  @return Standard EFI_STATUS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EBC_CREATE_THUNK) (\r
+  IN EFI_EBC_PROTOCOL           *This,\r
+  IN EFI_HANDLE                 ImageHandle,\r
+  IN VOID                       *EbcEntryPoint,\r
+  OUT VOID                      **Thunk\r
+  );\r
+\r
+/**\r
+  Perform any cleanup necessary when an image is unloaded. Basically it gives\r
+  the EBC interpreter the chance to free up any resources allocated during\r
+  load and execution of an EBC image.\r
+\r
+  @param  This        protocol instance pointer\r
+  @param  ImageHandle the handle of the image being unloaded.\r
+\r
+  @return Standard EFI_STATUS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EBC_UNLOAD_IMAGE) (\r
+  IN EFI_EBC_PROTOCOL           *This,\r
+  IN EFI_HANDLE                 ImageHandle\r
+  );\r
+\r
+/**\r
+  The I-Cache-flush registration service takes a pointer to a function to\r
+  call to flush the I-Cache. Here's the prototype for that function pointer.\r
+\r
+  @param  Start  physical start address of CPU instruction cache to flush.\r
+  @param  Length how many bytes to flush of the instruction cache.\r
+\r
+  @return Standard EFI_STATUS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EBC_ICACHE_FLUSH) (\r
+  IN EFI_PHYSICAL_ADDRESS     Start,\r
+  IN UINT64                   Length\r
+  );\r
+\r
+/**\r
+  This routine is called by the core firmware to provide the EBC driver with\r
+  a function to call to flush the CPU's instruction cache following creation\r
+  of a thunk. It is not required.\r
+\r
+  @param  This  protocol instance pointer\r
+  @param  Flush pointer to the function to call to flush the CPU instruction\r
+  cache.\r
+\r
+  @return Standard EFI_STATUS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH) (\r
+  IN EFI_EBC_PROTOCOL           *This,\r
+  IN EBC_ICACHE_FLUSH           Flush\r
+  );\r
+\r
+/**\r
+  This routine can be called to get the VM revision. It returns the same