diff options
Diffstat (limited to 'gpxe/src/include/gpxe/efi')
44 files changed, 0 insertions, 14326 deletions
diff --git a/gpxe/src/include/gpxe/efi/Base.h b/gpxe/src/include/gpxe/efi/Base.h deleted file mode 100644 index b2552d80..00000000 --- a/gpxe/src/include/gpxe/efi/Base.h +++ /dev/null @@ -1,329 +0,0 @@ -/** @file - Root include file for Mde Package Base type modules - - This is the include file for any module of type base. Base modules only use - types defined via this include file and can be ported easily to any - environment. There are a set of base libraries in the Mde Package that can - be used to implement base modules. - -Copyright (c) 2006 - 2008, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - - -#ifndef __BASE_H__ -#define __BASE_H__ - -// -// Include processor specific binding -// -#include <gpxe/efi/ProcessorBind.h> - -typedef struct { - UINT32 Data1; - UINT16 Data2; - UINT16 Data3; - UINT8 Data4[8]; -} GUID; - -typedef UINT64 PHYSICAL_ADDRESS; - -/// -/// LIST_ENTRY definition -/// -typedef struct _LIST_ENTRY LIST_ENTRY; - -struct _LIST_ENTRY { - LIST_ENTRY *ForwardLink; - LIST_ENTRY *BackLink; -}; - -// -// Modifiers to absract standard types to aid in debug of problems -// -#define CONST const -#define STATIC static -#define VOID void - -// -// Modifiers for Data Types used to self document code. -// This concept is borrowed for UEFI specification. -// -#define IN -#define OUT -#define OPTIONAL - -// -// UEFI specification claims 1 and 0. We are concerned about the -// complier portability so we did it this way. -// -#define TRUE ((BOOLEAN)(1==1)) -#define FALSE ((BOOLEAN)(0==1)) - -#define NULL ((VOID *) 0) - -#define BIT0 0x00000001 -#define BIT1 0x00000002 -#define BIT2 0x00000004 -#define BIT3 0x00000008 -#define BIT4 0x00000010 -#define BIT5 0x00000020 -#define BIT6 0x00000040 -#define BIT7 0x00000080 -#define BIT8 0x00000100 -#define BIT9 0x00000200 -#define BIT10 0x00000400 -#define BIT11 0x00000800 -#define BIT12 0x00001000 -#define BIT13 0x00002000 -#define BIT14 0x00004000 -#define BIT15 0x00008000 -#define BIT16 0x00010000 -#define BIT17 0x00020000 -#define BIT18 0x00040000 -#define BIT19 0x00080000 -#define BIT20 0x00100000 -#define BIT21 0x00200000 -#define BIT22 0x00400000 -#define BIT23 0x00800000 -#define BIT24 0x01000000 -#define BIT25 0x02000000 -#define BIT26 0x04000000 -#define BIT27 0x08000000 -#define BIT28 0x10000000 -#define BIT29 0x20000000 -#define BIT30 0x40000000 -#define BIT31 0x80000000 -#define BIT32 0x0000000100000000UL -#define BIT33 0x0000000200000000UL -#define BIT34 0x0000000400000000UL -#define BIT35 0x0000000800000000UL -#define BIT36 0x0000001000000000UL -#define BIT37 0x0000002000000000UL -#define BIT38 0x0000004000000000UL -#define BIT39 0x0000008000000000UL -#define BIT40 0x0000010000000000UL -#define BIT41 0x0000020000000000UL -#define BIT42 0x0000040000000000UL -#define BIT43 0x0000080000000000UL -#define BIT44 0x0000100000000000UL -#define BIT45 0x0000200000000000UL -#define BIT46 0x0000400000000000UL -#define BIT47 0x0000800000000000UL -#define BIT48 0x0001000000000000UL -#define BIT49 0x0002000000000000UL -#define BIT50 0x0004000000000000UL -#define BIT51 0x0008000000000000UL -#define BIT52 0x0010000000000000UL -#define BIT53 0x0020000000000000UL -#define BIT54 0x0040000000000000UL -#define BIT55 0x0080000000000000UL -#define BIT56 0x0100000000000000UL -#define BIT57 0x0200000000000000UL -#define BIT58 0x0400000000000000UL -#define BIT59 0x0800000000000000UL -#define BIT60 0x1000000000000000UL -#define BIT61 0x2000000000000000UL -#define BIT62 0x4000000000000000UL -#define BIT63 0x8000000000000000UL - -// -// Support for variable length argument lists using the ANSI standard. -// -// Since we are using the ANSI standard we used the standard nameing and -// did not folow the coding convention -// -// VA_LIST - typedef for argument list. -// VA_START (VA_LIST Marker, argument before the ...) - Init Marker for use. -// VA_END (VA_LIST Marker) - Clear Marker -// VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argumnet from -// the ... list. You must know the size and pass it in this macro. -// -// example: -// -// UINTN -// ExampleVarArg ( -// IN UINTN NumberOfArgs, -// ... -// ) -// { -// VA_LIST Marker; -// UINTN Index; -// UINTN Result; -// -// // -// // Initialize the Marker -// // -// VA_START (Marker, NumberOfArgs); -// for (Index = 0, Result = 0; Index < NumberOfArgs; Index++) { -// // -// // The ... list is a series of UINTN values, so average them up. -// // -// Result += VA_ARG (Marker, UINTN); -// } -// -// VA_END (Marker); -// return Result -// } -// - -#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1)) - -// -// Also support coding convention rules for var arg macros -// -typedef CHAR8 *VA_LIST; -#define VA_START(ap, v) (ap = (VA_LIST) & (v) + _INT_SIZE_OF (v)) -#define VA_ARG(ap, t) (*(t *) ((ap += _INT_SIZE_OF (t)) - _INT_SIZE_OF (t))) -#define VA_END(ap) (ap = (VA_LIST) 0) - -// -// Macro that returns the byte offset of a field in a data structure. -// -#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field)) - -/// -/// CONTAINING_RECORD - returns a pointer to the structure -/// from one of it's elements. -/// -#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field))) - -/// -/// ALIGN_VALUE - aligns a value up to the next boundary of the given alignment. -/// -#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) & ((Alignment) - 1))) - -/// -/// ALIGN_POINTER - aligns a pointer to the lowest boundry -/// -#define ALIGN_POINTER(Pointer, Alignment) ((VOID *) (ALIGN_VALUE ((UINTN)(Pointer), (Alignment)))) - -/// -/// ALIGN_VARIABLE - aligns a variable up to the next natural boundry for int size of a processor -/// -#define ALIGN_VARIABLE(Value) ALIGN_VALUE ((Value), sizeof (UINTN)) - - -// -// Return the maximum of two operands. -// This macro returns the maximum of two operand specified by a and b. -// Both a and b must be the same numerical types, signed or unsigned. -// -#define MAX(a, b) \ - (((a) > (b)) ? (a) : (b)) - - -// -// Return the minimum of two operands. -// This macro returns the minimal of two operand specified by a and b. -// Both a and b must be the same numerical types, signed or unsigned. -// -#define MIN(a, b) \ - (((a) < (b)) ? (a) : (b)) - - -// -// EFI Error Codes common to all execution phases -// - -typedef INTN RETURN_STATUS; - -/// -/// Set the upper bit to indicate EFI Error. -/// -#define ENCODE_ERROR(a) (MAX_BIT | (a)) - -#define ENCODE_WARNING(a) (a) -#define RETURN_ERROR(a) ((INTN) (a) < 0) - -#define RETURN_SUCCESS 0 -#define RETURN_LOAD_ERROR ENCODE_ERROR (1) -#define RETURN_INVALID_PARAMETER ENCODE_ERROR (2) -#define RETURN_UNSUPPORTED ENCODE_ERROR (3) -#define RETURN_BAD_BUFFER_SIZE ENCODE_ERROR (4) -#define RETURN_BUFFER_TOO_SMALL ENCODE_ERROR (5) -#define RETURN_NOT_READY ENCODE_ERROR (6) -#define RETURN_DEVICE_ERROR ENCODE_ERROR (7) -#define RETURN_WRITE_PROTECTED ENCODE_ERROR (8) -#define RETURN_OUT_OF_RESOURCES ENCODE_ERROR (9) -#define RETURN_VOLUME_CORRUPTED ENCODE_ERROR (10) -#define RETURN_VOLUME_FULL ENCODE_ERROR (11) -#define RETURN_NO_MEDIA ENCODE_ERROR (12) -#define RETURN_MEDIA_CHANGED ENCODE_ERROR (13) -#define RETURN_NOT_FOUND ENCODE_ERROR (14) -#define RETURN_ACCESS_DENIED ENCODE_ERROR (15) -#define RETURN_NO_RESPONSE ENCODE_ERROR (16) -#define RETURN_NO_MAPPING ENCODE_ERROR (17) -#define RETURN_TIMEOUT ENCODE_ERROR (18) -#define RETURN_NOT_STARTED ENCODE_ERROR (19) -#define RETURN_ALREADY_STARTED ENCODE_ERROR (20) -#define RETURN_ABORTED ENCODE_ERROR (21) -#define RETURN_ICMP_ERROR ENCODE_ERROR (22) -#define RETURN_TFTP_ERROR ENCODE_ERROR (23) -#define RETURN_PROTOCOL_ERROR ENCODE_ERROR (24) -#define RETURN_INCOMPATIBLE_VERSION ENCODE_ERROR (25) -#define RETURN_SECURITY_VIOLATION ENCODE_ERROR (26) -#define RETURN_CRC_ERROR ENCODE_ERROR (27) -#define RETURN_END_OF_MEDIA ENCODE_ERROR (28) -#define RETURN_END_OF_FILE ENCODE_ERROR (31) -#define RETURN_INVALID_LANGUAGE ENCODE_ERROR (32) - - -#define RETURN_WARN_UNKNOWN_GLYPH ENCODE_WARNING (1) -#define RETURN_WARN_DELETE_FAILURE ENCODE_WARNING (2) -#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3) -#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4) - -/** - Returns a 16-bit signature built from 2 ASCII characters. - - @param A The first ASCII character. - @param B The second ASCII character. - - @return A 16-bit value built from the two ASCII characters specified by A and B. - -**/ -#define SIGNATURE_16(A, B) ((A) | (B << 8)) - -/** - Returns a 32-bit signature built from 4 ASCII characters. - - @param A The first ASCII character. - @param B The second ASCII character. - @param C The third ASCII character. - @param D The fourth ASCII character. - - @return A 32-bit value built from the two ASCII characters specified by A, B, - C and D. - -**/ -#define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16)) - -/** - Returns a 64-bit signature built from 8 ASCII characters. - - @param A The first ASCII character. - @param B The second ASCII character. - @param C The third ASCII character. - @param D The fourth ASCII character. - @param E The fifth ASCII character. - @param F The sixth ASCII character. - @param G The seventh ASCII character. - @param H The eighth ASCII character. - - @return A 64-bit value built from the two ASCII characters specified by A, B, - C, D, E, F, G and H. - -**/ -#define SIGNATURE_64(A, B, C, D, E, F, G, H) \ - (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32)) - -#endif - diff --git a/gpxe/src/include/gpxe/efi/Guid/PcAnsi.h b/gpxe/src/include/gpxe/efi/Guid/PcAnsi.h deleted file mode 100644 index 1dab3109..00000000 --- a/gpxe/src/include/gpxe/efi/Guid/PcAnsi.h +++ /dev/null @@ -1,58 +0,0 @@ -/** @file - Terminal Device Path Vendor Guid. - - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - GUIDs defined in UEFI 2.0 spec. - -**/ - -#ifndef __PC_ANSI_H__ -#define __PC_ANSI_H__ - -#define EFI_PC_ANSI_GUID \ - { \ - 0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ - } - -#define EFI_VT_100_GUID \ - { \ - 0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ - } - -#define EFI_VT_100_PLUS_GUID \ - { \ - 0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \ - } - -#define EFI_VT_UTF8_GUID \ - { \ - 0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \ - } - -#define EFI_UART_DEVICE_PATH_GUID \ - { \ - 0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \ - } - -#define EFI_SAS_DEVICE_PATH_GUID \ - { \ - 0xd487ddb4, 0x008b, 0x11d9, {0xaf, 0xdc, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \ - } - -extern EFI_GUID gEfiPcAnsiGuid; -extern EFI_GUID gEfiVT100Guid; -extern EFI_GUID gEfiVT100PlusGuid; -extern EFI_GUID gEfiVTUTF8Guid; -extern EFI_GUID gEfiUartDevicePathGuid; -extern EFI_GUID gEfiSasDevicePathGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Guid/SmBios.h b/gpxe/src/include/gpxe/efi/Guid/SmBios.h deleted file mode 100644 index c6c7f776..00000000 --- a/gpxe/src/include/gpxe/efi/Guid/SmBios.h +++ /dev/null @@ -1,34 +0,0 @@ -/** @file - GUIDs used to locate the SMBIOS tables in the UEFI 2.0 system table. - - This GUID in the system table is the only legal way to search for and - locate the SMBIOS tables. Do not search the 0xF0000 segment to find SMBIOS - tables. - - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - GUIDs defined in UEFI 2.0 spec. - -**/ - -#ifndef __SMBIOS_GUID_H__ -#define __SMBIOS_GUID_H__ - -#define EFI_SMBIOS_TABLE_GUID \ - { \ - 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ - } - -#define SMBIOS_TABLE_GUID EFI_SMBIOS_TABLE_GUID - -extern EFI_GUID gEfiSmbiosTableGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Ia32/ProcessorBind.h b/gpxe/src/include/gpxe/efi/Ia32/ProcessorBind.h deleted file mode 100644 index 5a3a9182..00000000 --- a/gpxe/src/include/gpxe/efi/Ia32/ProcessorBind.h +++ /dev/null @@ -1,215 +0,0 @@ -/** @file - Processor or Compiler specific defines and types for Ia32 architecture. - - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __PROCESSOR_BIND_H__ -#define __PROCESSOR_BIND_H__ - -/// -/// Define the processor type so other code can make processor based choices -/// -#define MDE_CPU_IA32 - -// -// Make sure we are useing the correct packing rules per EFI specification -// -#ifndef __GNUC__ -#pragma pack() -#endif - -#if __INTEL_COMPILER -// -// Disable ICC's remark #869: "Parameter" was never referenced warning. -// This is legal ANSI C code so we disable the remark that is turned on with -Wall -// -#pragma warning ( disable : 869 ) - -// -// Disable ICC's remark #1418: external function definition with no prior declaration. -// This is legal ANSI C code so we disable the remark that is turned on with /W4 -// -#pragma warning ( disable : 1418 ) - -// -// Disable ICC's remark #1419: external declaration in primary source file -// This is legal ANSI C code so we disable the remark that is turned on with /W4 -// -#pragma warning ( disable : 1419 ) - -#endif - - -#if _MSC_EXTENSIONS - -// -// Disable warning that make it impossible to compile at /W4 -// This only works for Microsoft* tools -// - -// -// Disabling bitfield type checking warnings. -// -#pragma warning ( disable : 4214 ) - -// -// Disabling the unreferenced formal parameter warnings. -// -#pragma warning ( disable : 4100 ) - -// -// Disable slightly different base types warning as CHAR8 * can not be set -// to a constant string. -// -#pragma warning ( disable : 4057 ) - -// -// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning -// -#pragma warning ( disable : 4127 ) - -// -// This warning is caused by functions defined but not used. For precompiled header only. -// -#pragma warning ( disable : 4505 ) - -// -// This warning is caused by empty (after preprocessing) souce file. For precompiled header only. -// -#pragma warning ( disable : 4206 ) - -#endif - - -#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L) - // - // No ANSI C 2000 stdint.h integer width declarations, so define equivalents - // - - #if _MSC_EXTENSIONS - - // - // use Microsoft* C complier dependent interger width types - // - typedef unsigned __int64 UINT64; - typedef __int64 INT64; - typedef unsigned __int32 UINT32; - typedef __int32 INT32; - typedef unsigned short UINT16; - typedef unsigned short CHAR16; - typedef short INT16; - typedef unsigned char BOOLEAN; - typedef unsigned char UINT8; - typedef char CHAR8; - typedef char INT8; - #else - - // - // Assume standard IA-32 alignment. - // Need to check portability of long long - // - typedef unsigned long long UINT64; - typedef long long INT64; - typedef unsigned int UINT32; - typedef int INT32; - typedef unsigned short UINT16; - typedef unsigned short CHAR16; - typedef short INT16; - typedef unsigned char BOOLEAN; - typedef unsigned char UINT8; - typedef char CHAR8; - typedef char INT8; - #endif - - #define UINT8_MAX 0xff - -#else - // - // Use ANSI C 2000 stdint.h integer width declarations - // - #include "stdint.h" - typedef uint8_t BOOLEAN; - typedef int8_t INT8; - typedef uint8_t UINT8; - typedef int16_t INT16; - typedef uint16_t UINT16; - typedef int32_t INT32; - typedef uint32_t UINT32; - typedef int64_t INT64; - typedef uint64_t UINT64; - typedef char CHAR8; - typedef uint16_t CHAR16; - -#endif - -typedef UINT32 UINTN; -typedef INT32 INTN; - - -/// -/// Processor specific defines -/// -#define MAX_BIT 0x80000000 -#define MAX_2_BITS 0xC0000000 - -/// -/// Maximum legal IA-32 address -/// -#define MAX_ADDRESS 0xFFFFFFFF - -/// -/// The stack alignment required for IA-32 -/// -#define CPU_STACK_ALIGNMENT sizeof(UINTN) - -// -// Modifier to ensure that all protocol member functions and EFI intrinsics -// use the correct C calling convention. All protocol member functions and -// EFI intrinsics are required to modify thier member functions with EFIAPI. -// -#if _MSC_EXTENSIONS - /// - /// Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C. - /// - #define EFIAPI __cdecl -#else - #if __GNUC__ - #define EFIAPI __attribute__((cdecl,regparm(0))) - #endif -#endif - -// -// The Microsoft* C compiler can removed references to unreferenced data items -// if the /OPT:REF linker option is used. We defined a macro as this is a -// a non standard extension -// -#if _MSC_EXTENSIONS - #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany) -#else - #define GLOBAL_REMOVE_IF_UNREFERENCED -#endif - -// -// For symbol name in GNU assembly code, an extra "_" is necessary -// -#if __GNUC__ - #if defined(linux) - #define ASM_PFX(name) name - #else - #define ASM_PFX(name) _##name - #endif -#endif - -#define FUNCTION_ENTRY_POINT(p) (p) - -#endif - diff --git a/gpxe/src/include/gpxe/efi/IndustryStandard/Pci22.h b/gpxe/src/include/gpxe/efi/IndustryStandard/Pci22.h deleted file mode 100644 index 5b96a56d..00000000 --- a/gpxe/src/include/gpxe/efi/IndustryStandard/Pci22.h +++ /dev/null @@ -1,601 +0,0 @@ -/** @file - Support for PCI 2.2 standard. - - This file includes the definitions in the following specifications, - PCI Local Bus Specification, 2.0 - PCI-to-PCI Bridge Architecture Specification, - PC Card Standard, 8.0 - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef _PCI22_H_ -#define _PCI22_H_ - -#define PCI_MAX_SEGMENT 0 -#define PCI_MAX_BUS 255 -#define PCI_MAX_DEVICE 31 -#define PCI_MAX_FUNC 7 - - -#pragma pack(1) -typedef struct { - UINT16 VendorId; - UINT16 DeviceId; - UINT16 Command; - UINT16 Status; - UINT8 RevisionID; - UINT8 ClassCode[3]; - UINT8 CacheLineSize; - UINT8 LatencyTimer; - UINT8 HeaderType; - UINT8 BIST; -} PCI_DEVICE_INDEPENDENT_REGION; - -typedef struct { - UINT32 Bar[6]; - UINT32 CISPtr; - UINT16 SubsystemVendorID; - UINT16 SubsystemID; - UINT32 ExpansionRomBar; - UINT8 CapabilityPtr; - UINT8 Reserved1[3]; - UINT32 Reserved2; - UINT8 InterruptLine; - UINT8 InterruptPin; - UINT8 MinGnt; - UINT8 MaxLat; -} PCI_DEVICE_HEADER_TYPE_REGION; - -typedef struct { - PCI_DEVICE_INDEPENDENT_REGION Hdr; - PCI_DEVICE_HEADER_TYPE_REGION Device; -} PCI_TYPE00; - -/// -/// defined in PCI-to-PCI Bridge Architecture Specification -/// -typedef struct { - UINT32 Bar[2]; - UINT8 PrimaryBus; - UINT8 SecondaryBus; - UINT8 SubordinateBus; - UINT8 SecondaryLatencyTimer; - UINT8 IoBase; - UINT8 IoLimit; - UINT16 SecondaryStatus; - UINT16 MemoryBase; - UINT16 MemoryLimit; - UINT16 PrefetchableMemoryBase; - UINT16 PrefetchableMemoryLimit; - UINT32 PrefetchableBaseUpper32; - UINT32 PrefetchableLimitUpper32; - UINT16 IoBaseUpper16; - UINT16 IoLimitUpper16; - UINT8 CapabilityPtr; - UINT8 Reserved[3]; - UINT32 ExpansionRomBAR; - UINT8 InterruptLine; - UINT8 InterruptPin; - UINT16 BridgeControl; -} PCI_BRIDGE_CONTROL_REGISTER; - -typedef struct { - PCI_DEVICE_INDEPENDENT_REGION Hdr; - PCI_BRIDGE_CONTROL_REGISTER Bridge; -} PCI_TYPE01; - -typedef union { - PCI_TYPE00 Device; - PCI_TYPE01 Bridge; -} PCI_TYPE_GENERIC; - -/// -/// CardBus Conroller Configuration Space, defined in PC Card Standard. 8.0 -/// -typedef struct { - UINT32 CardBusSocketReg; ///< Cardus Socket/ExCA Base - UINT8 Cap_Ptr; - UINT8 Reserved; - UINT16 SecondaryStatus; ///< Secondary Status - UINT8 PciBusNumber; ///< PCI Bus Number - UINT8 CardBusBusNumber; ///< CardBus Bus Number - UINT8 SubordinateBusNumber; ///< Subordinate Bus Number - UINT8 CardBusLatencyTimer; ///< CardBus Latency Timer - UINT32 MemoryBase0; ///< Memory Base Register 0 - UINT32 MemoryLimit0; ///< Memory Limit Register 0 - UINT32 MemoryBase1; - UINT32 MemoryLimit1; - UINT32 IoBase0; - UINT32 IoLimit0; ///< I/O Base Register 0 - UINT32 IoBase1; ///< I/O Limit Register 0 - UINT32 IoLimit1; - UINT8 InterruptLine; ///< Interrupt Line - UINT8 InterruptPin; ///< Interrupt Pin - UINT16 BridgeControl; ///< Bridge Control -} PCI_CARDBUS_CONTROL_REGISTER; - -/// -/// Definitions of PCI class bytes and manipulation macros. -/// -#define PCI_CLASS_OLD 0x00 -#define PCI_CLASS_OLD_OTHER 0x00 -#define PCI_CLASS_OLD_VGA 0x01 - -#define PCI_CLASS_MASS_STORAGE 0x01 -#define PCI_CLASS_MASS_STORAGE_SCSI 0x00 -#define PCI_CLASS_MASS_STORAGE_IDE 0x01 -#define PCI_CLASS_MASS_STORAGE_FLOPPY 0x02 -#define PCI_CLASS_MASS_STORAGE_IPI 0x03 -#define PCI_CLASS_MASS_STORAGE_RAID 0x04 -#define PCI_CLASS_MASS_STORAGE_OTHER 0x80 - -#define PCI_CLASS_NETWORK 0x02 -#define PCI_CLASS_NETWORK_ETHERNET 0x00 -#define PCI_CLASS_NETWORK_TOKENRING 0x01 -#define PCI_CLASS_NETWORK_FDDI 0x02 -#define PCI_CLASS_NETWORK_ATM 0x03 -#define PCI_CLASS_NETWORK_ISDN 0x04 -#define PCI_CLASS_NETWORK_OTHER 0x80 - -#define PCI_CLASS_DISPLAY 0x03 -#define PCI_CLASS_DISPLAY_VGA 0x00 -#define PCI_IF_VGA_VGA 0x00 -#define PCI_IF_VGA_8514 0x01 -#define PCI_CLASS_DISPLAY_XGA 0x01 -#define PCI_CLASS_DISPLAY_3D 0x02 -#define PCI_CLASS_DISPLAY_OTHER 0x80 -#define PCI_CLASS_DISPLAY_GFX 0x80 - -#define PCI_CLASS_MEDIA 0x04 -#define PCI_CLASS_MEDIA_VIDEO 0x00 -#define PCI_CLASS_MEDIA_AUDIO 0x01 -#define PCI_CLASS_MEDIA_TELEPHONE 0x02 -#define PCI_CLASS_MEDIA_OTHER 0x80 - -#define PCI_CLASS_MEMORY_CONTROLLER 0x05 -#define PCI_CLASS_MEMORY_RAM 0x00 -#define PCI_CLASS_MEMORY_FLASH 0x01 -#define PCI_CLASS_MEMORY_OTHER 0x80 - -#define PCI_CLASS_BRIDGE 0x06 -#define PCI_CLASS_BRIDGE_HOST 0x00 -#define PCI_CLASS_BRIDGE_ISA 0x01 -#define PCI_CLASS_BRIDGE_EISA 0x02 -#define PCI_CLASS_BRIDGE_MCA 0x03 -#define PCI_CLASS_BRIDGE_P2P 0x04 -#define PCI_IF_BRIDGE_P2P 0x00 -#define PCI_IF_BRIDGE_P2P_SUBTRACTIVE 0x01 -#define PCI_CLASS_BRIDGE_PCMCIA 0x05 -#define PCI_CLASS_BRIDGE_NUBUS 0x06 -#define PCI_CLASS_BRIDGE_CARDBUS 0x07 -#define PCI_CLASS_BRIDGE_RACEWAY 0x08 -#define PCI_CLASS_BRIDGE_OTHER 0x80 -#define PCI_CLASS_BRIDGE_ISA_PDECODE 0x80 - -#define PCI_CLASS_SCC 0x07 ///< Simple communications controllers -#define PCI_SUBCLASS_SERIAL 0x00 -#define PCI_IF_GENERIC_XT 0x00 -#define PCI_IF_16450 0x01 -#define PCI_IF_16550 0x02 -#define PCI_IF_16650 0x03 -#define PCI_IF_16750 0x04 -#define PCI_IF_16850 0x05 -#define PCI_IF_16950 0x06 -#define PCI_SUBCLASS_PARALLEL 0x01 -#define PCI_IF_PARALLEL_PORT 0x00 -#define PCI_IF_BI_DIR_PARALLEL_PORT 0x01 -#define PCI_IF_ECP_PARALLEL_PORT 0x02 -#define PCI_IF_1284_CONTROLLER 0x03 -#define PCI_IF_1284_DEVICE 0xFE -#define PCI_SUBCLASS_MULTIPORT_SERIAL 0x02 -#define PCI_SUBCLASS_MODEM 0x03 -#define PCI_IF_GENERIC_MODEM 0x00 -#define PCI_IF_16450_MODEM 0x01 -#define PCI_IF_16550_MODEM 0x02 -#define PCI_IF_16650_MODEM 0x03 -#define PCI_IF_16750_MODEM 0x04 -#define PCI_SUBCLASS_SCC_OTHER 0x80 - -#define PCI_CLASS_SYSTEM_PERIPHERAL 0x08 -#define PCI_SUBCLASS_PIC 0x00 -#define PCI_IF_8259_PIC 0x00 -#define PCI_IF_ISA_PIC 0x01 -#define PCI_IF_EISA_PIC 0x02 -#define PCI_IF_APIC_CONTROLLER 0x10 ///< I/O APIC interrupt controller , 32 bye none-prefectable memory. -#define PCI_IF_APIC_CONTROLLER2 0x20 -#define PCI_SUBCLASS_DMA 0x01 -#define PCI_IF_8237_DMA 0x00 -#define PCI_IF_ISA_DMA 0x01 -#define PCI_IF_EISA_DMA 0x02 -#define PCI_SUBCLASS_TIMER 0x02 -#define PCI_IF_8254_TIMER 0x00 -#define PCI_IF_ISA_TIMER 0x01 -#define PCI_IF_EISA_TIMER 0x02 -#define PCI_SUBCLASS_RTC 0x03 -#define PCI_IF_GENERIC_RTC 0x00 -#define PCI_IF_ISA_RTC 0x00 -#define PCI_SUBCLASS_PNP_CONTROLLER 0x04 ///< HotPlug Controller -#define PCI_SUBCLASS_PERIPHERAL_OTHER 0x80 - -#define PCI_CLASS_INPUT_DEVICE 0x09 -#define PCI_SUBCLASS_KEYBOARD 0x00 -#define PCI_SUBCLASS_PEN 0x01 -#define PCI_SUBCLASS_MOUSE_CONTROLLER 0x02 -#define PCI_SUBCLASS_SCAN_CONTROLLER 0x03 -#define PCI_SUBCLASS_GAMEPORT 0x04 -#define PCI_IF_GAMEPORT 0x00 -#define PCI_IF_GAMEPORT1 0x01 -#define PCI_SUBCLASS_INPUT_OTHER 0x80 - -#define PCI_CLASS_DOCKING_STATION 0x0A - -#define PCI_CLASS_PROCESSOR 0x0B -#define PCI_SUBCLASS_PROC_386 0x00 -#define PCI_SUBCLASS_PROC_486 0x01 -#define PCI_SUBCLASS_PROC_PENTIUM 0x02 -#define PCI_SUBCLASS_PROC_ALPHA 0x10 -#define PCI_SUBCLASS_PROC_POWERPC 0x20 -#define PCI_SUBCLASS_PROC_MIPS 0x30 -#define PCI_SUBCLASS_PROC_CO_PORC 0x40 ///< Co-Processor - -#define PCI_CLASS_SERIAL 0x0C -#define PCI_CLASS_SERIAL_FIREWIRE 0x00 -#define PCI_IF_1394 0x00 -#define PCI_IF_1394_OPEN_HCI 0x10 -#define PCI_CLASS_SERIAL_ACCESS_BUS 0x01 -#define PCI_CLASS_SERIAL_SSA 0x02 -#define PCI_CLASS_SERIAL_USB 0x03 -#define PCI_IF_UHCI 0x00 -#define PCI_IF_OHCI 0x10 -#define PCI_IF_USB_OTHER 0x80 -#define PCI_IF_USB_DEVICE 0xFE -#define PCI_CLASS_SERIAL_FIBRECHANNEL 0x04 -#define PCI_CLASS_SERIAL_SMB 0x05 - -#define PCI_CLASS_WIRELESS 0x0D -#define PCI_SUBCLASS_IRDA 0x00 -#define PCI_SUBCLASS_IR 0x01 -#define PCI_SUBCLASS_RF 0x02 -#define PCI_SUBCLASS_WIRELESS_OTHER 0x80 - -#define PCI_CLASS_INTELLIGENT_IO 0x0E - -#define PCI_CLASS_SATELLITE 0x0F -#define PCI_SUBCLASS_TV 0x01 -#define PCI_SUBCLASS_AUDIO 0x02 -#define PCI_SUBCLASS_VOICE 0x03 -#define PCI_SUBCLASS_DATA 0x04 - -#define PCI_SECURITY_CONTROLLER 0x10 ///< Encryption and decryption controller -#define PCI_SUBCLASS_NET_COMPUT 0x00 -#define PCI_SUBCLASS_ENTERTAINMENT 0x10 -#define PCI_SUBCLASS_SECURITY_OTHER 0x80 - -#define PCI_CLASS_DPIO 0x11 -#define PCI_SUBCLASS_DPIO 0x00 -#define PCI_SUBCLASS_DPIO_OTHER 0x80 - -#define IS_CLASS1(_p, c) ((_p)->Hdr.ClassCode[2] == (c)) -#define IS_CLASS2(_p, c, s) (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s))) -#define IS_CLASS3(_p, c, s, p) (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p))) - -#define IS_PCI_DISPLAY(_p) IS_CLASS1 (_p, PCI_CLASS_DISPLAY) -#define IS_PCI_VGA(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 0) -#define IS_PCI_8514(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 1) -#define IS_PCI_GFX(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_GFX, 0) -#define IS_PCI_OLD(_p) IS_CLASS1 (_p, PCI_CLASS_OLD) -#define IS_PCI_OLD_VGA(_p) IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA) -#define IS_PCI_IDE(_p) IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE) -#define IS_PCI_SCSI(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI, 0) -#define IS_PCI_RAID(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID, 0) -#define IS_PCI_LPC(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, 0) -#define IS_PCI_P2P(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 0) -#define IS_PCI_P2P_SUB(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 1) -#define IS_PCI_16550_SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550) -#define IS_PCI_USB(_p) IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB) - -// -// the definition of Header Type -// -#define HEADER_TYPE_DEVICE 0x00 -#define HEADER_TYPE_PCI_TO_PCI_BRIDGE 0x01 -#define HEADER_TYPE_CARDBUS_BRIDGE 0x02 -#define HEADER_TYPE_MULTI_FUNCTION 0x80 -// -// Mask of Header type -// -#define HEADER_LAYOUT_CODE 0x7f - -#define IS_PCI_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE)) -#define IS_CARDBUS_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE)) -#define IS_PCI_MULTI_FUNC(_p) ((_p)->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION) - -/// -/// Rom Base Address in Bridge, defined in PCI-to-PCI Bridge Architecure Specification, -/// -#define PCI_BRIDGE_ROMBAR 0x38 - -#define PCI_MAX_BAR 0x0006 -#define PCI_MAX_CONFIG_OFFSET 0x0100 - -#define PCI_VENDOR_ID_OFFSET 0x00 -#define PCI_DEVICE_ID_OFFSET 0x02 -#define PCI_COMMAND_OFFSET 0x04 -#define PCI_PRIMARY_STATUS_OFFSET 0x06 -#define PCI_REVISION_ID_OFFSET 0x08 -#define PCI_CLASSCODE_OFFSET 0x09 -#define PCI_CACHELINE_SIZE_OFFSET 0x0C -#define PCI_LATENCY_TIMER_OFFSET 0x0D -#define PCI_HEADER_TYPE_OFFSET 0x0E -#define PCI_BIST_OFFSET 0x0F -#define PCI_BASE_ADDRESSREG_OFFSET 0x10 -#define PCI_CARDBUS_CIS_OFFSET 0x28 -#define PCI_SVID_OFFSET 0x2C ///< SubSystem Vendor id -#define PCI_SUBSYSTEM_VENDOR_ID_OFFSET 0x2C -#define PCI_SID_OFFSET 0x2E ///< SubSystem ID -#define PCI_SUBSYSTEM_ID_OFFSET 0x2E -#define PCI_EXPANSION_ROM_BASE 0x30 -#define PCI_CAPBILITY_POINTER_OFFSET 0x34 -#define PCI_INT_LINE_OFFSET 0x3C ///< Interrupt Line Register -#define PCI_INT_PIN_OFFSET 0x3D ///< Interrupt Pin Register -#define PCI_MAXGNT_OFFSET 0x3E ///< Max Grant Register -#define PCI_MAXLAT_OFFSET 0x3F ///< Max Latency Register - -/// -/// defined in PCI-to-PCI Bridge Architecture Specification -/// -#define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET 0x18 -#define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET 0x19 -#define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET 0x1a -#define PCI_BRIDGE_STATUS_REGISTER_OFFSET 0x1E -#define PCI_BRIDGE_CONTROL_REGISTER_OFFSET 0x3E - -/// -/// Interrupt Line "Unknown" or "No connection" value defined for x86 based system -/// -#define PCI_INT_LINE_UNKNOWN 0xFF - -typedef union { - struct { - UINT32 Reg : 8; - UINT32 Func : 3; - UINT32 Dev : 5; - UINT32 Bus : 8; - UINT32 Reserved : 7; - UINT32 Enable : 1; - } Bits; - UINT32 Uint32; -} PCI_CONFIG_ACCESS_CF8; - -#pragma pack() - -#define EFI_PCI_COMMAND_IO_SPACE BIT0 ///< 0x0001 -#define EFI_PCI_COMMAND_MEMORY_SPACE BIT1 ///< 0x0002 -#define EFI_PCI_COMMAND_BUS_MASTER BIT2 ///< 0x0004 -#define EFI_PCI_COMMAND_SPECIAL_CYCLE BIT3 ///< 0x0008 -#define EFI_PCI_COMMAND_MEMORY_WRITE_AND_INVALIDATE BIT4 ///< 0x0010 -#define EFI_PCI_COMMAND_VGA_PALETTE_SNOOP BIT5 ///< 0x0020 -#define EFI_PCI_COMMAND_PARITY_ERROR_RESPOND BIT6 ///< 0x0040 -#define EFI_PCI_COMMAND_STEPPING_CONTROL BIT7 ///< 0x0080 -#define EFI_PCI_COMMAND_SERR BIT8 ///< 0x0100 -#define EFI_PCI_COMMAND_FAST_BACK_TO_BACK BIT9 ///< 0x0200 - -/// -/// defined in PCI-to-PCI Bridge Architecture Specification -/// -#define EFI_PCI_BRIDGE_CONTROL_PARITY_ERROR_RESPONSE BIT0 ///< 0x0001 -#define EFI_PCI_BRIDGE_CONTROL_SERR BIT1 ///< 0x0002 -#define EFI_PCI_BRIDGE_CONTROL_ISA BIT2 ///< 0x0004 -#define EFI_PCI_BRIDGE_CONTROL_VGA BIT3 ///< 0x0008 -#define EFI_PCI_BRIDGE_CONTROL_VGA_16 BIT4 ///< 0x0010 -#define EFI_PCI_BRIDGE_CONTROL_MASTER_ABORT BIT5 ///< 0x0020 -#define EFI_PCI_BRIDGE_CONTROL_RESET_SECONDARY_BUS BIT6 ///< 0x0040 -#define EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK BIT7 ///< 0x0080 -#define EFI_PCI_BRIDGE_CONTROL_PRIMARY_DISCARD_TIMER BIT8 ///< 0x0100 -#define EFI_PCI_BRIDGE_CONTROL_SECONDARY_DISCARD_TIMER BIT9 ///< 0x0200 -#define EFI_PCI_BRIDGE_CONTROL_TIMER_STATUS BIT10 ///< 0x0400 -#define EFI_PCI_BRIDGE_CONTROL_DISCARD_TIMER_SERR BIT11 ///< 0x0800 - -/// -/// Following are the PCI-CARDBUS bridge control bit, defined in PC Card Standard -/// -#define EFI_PCI_BRIDGE_CONTROL_IREQINT_ENABLE BIT7 ///< 0x0080 -#define EFI_PCI_BRIDGE_CONTROL_RANGE0_MEMORY_TYPE BIT8 ///< 0x0100 -#define EFI_PCI_BRIDGE_CONTROL_RANGE1_MEMORY_TYPE BIT9 ///< 0x0200 -#define EFI_PCI_BRIDGE_CONTROL_WRITE_POSTING_ENABLE BIT10 ///< 0x0400 - -// -// Following are the PCI status control bit -// -#define EFI_PCI_STATUS_CAPABILITY BIT4 ///< 0x0010 -#define EFI_PCI_STATUS_66MZ_CAPABLE BIT5 ///< 0x0020 -#define EFI_PCI_FAST_BACK_TO_BACK_CAPABLE BIT7 ///< 0x0080 -#define EFI_PCI_MASTER_DATA_PARITY_ERROR BIT8 ///< 0x0100 - -/// -/// defined in PC Card Standard -/// -#define EFI_PCI_CARDBUS_BRIDGE_CAPABILITY_PTR 0x14 - -#pragma pack(1) -// -// PCI Capability List IDs and records -// -#define EFI_PCI_CAPABILITY_ID_PMI 0x01 -#define EFI_PCI_CAPABILITY_ID_AGP 0x02 -#define EFI_PCI_CAPABILITY_ID_VPD 0x03 -#define EFI_PCI_CAPABILITY_ID_SLOTID 0x04 -#define EFI_PCI_CAPABILITY_ID_MSI 0x05 -#define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06 -typedef struct { - UINT8 CapabilityID; - UINT8 NextItemPtr; -} EFI_PCI_CAPABILITY_HDR; - -/// -/// Capability EFI_PCI_CAPABILITY_ID_PMI, defined in PCI Power Management Interface Specifiction -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT16 PMC; - UINT16 PMCSR; - UINT8 BridgeExtention; - UINT8 Data; -} EFI_PCI_CAPABILITY_PMI; - -/// -/// Capability EFI_PCI_CAPABILITY_ID_AGP, defined in Accelerated Graphics Port Interface Specification -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT8 Rev; - UINT8 Reserved; - UINT32 Status; - UINT32 Command; -} EFI_PCI_CAPABILITY_AGP; - -/// -/// Capability EFI_PCI_CAPABILITY_ID_VPD, in PCI2.2 Spec. -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT16 AddrReg; - UINT32 DataReg; -} EFI_PCI_CAPABILITY_VPD; - -/// -/// Capability EFI_PCI_CAPABILITY_ID_SLOTID, defined in PCI-to-PCI Bridge Architeture Specification -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT8 ExpnsSlotReg; - UINT8 ChassisNo; -} EFI_PCI_CAPABILITY_SLOTID; - -/// -/// Capability EFI_PCI_CAPABILITY_ID_MSI, defined in PCI2.2 -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT16 MsgCtrlReg; - UINT32 MsgAddrReg; - UINT16 MsgDataReg; -} EFI_PCI_CAPABILITY_MSI32; - -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT16 MsgCtrlReg; - UINT32 MsgAddrRegLsdw; - UINT32 MsgAddrRegMsdw; - UINT16 MsgDataReg; -} EFI_PCI_CAPABILITY_MSI64; - -/// -/// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG, defined in CompactPCI Hot Swap Specification PICMG 2.1, R1.0 -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - /// - /// not finished - fields need to go here - /// -} EFI_PCI_CAPABILITY_HOTPLUG; - -#define DEVICE_ID_NOCARE 0xFFFF - -#define PCI_ACPI_UNUSED 0 -#define PCI_BAR_NOCHANGE 0 -#define PCI_BAR_OLD_ALIGN 0xFFFFFFFFFFFFFFFFULL -#define PCI_BAR_EVEN_ALIGN 0xFFFFFFFFFFFFFFFEULL -#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL -#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL - -#define PCI_BAR_IDX0 0x00 -#define PCI_BAR_IDX1 0x01 -#define PCI_BAR_IDX2 0x02 -#define PCI_BAR_IDX3 0x03 -#define PCI_BAR_IDX4 0x04 -#define PCI_BAR_IDX5 0x05 -#define PCI_BAR_ALL 0xFF - -/// -/// EFI PCI Option ROM definitions -/// -#define EFI_ROOT_BRIDGE_LIST 'eprb' -#define EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE 0x0EF1 ///< defined in UEFI Spec. - -typedef struct { - UINT8 Register; - UINT8 Function; - UINT8 Device; - UINT8 Bus; - UINT8 Reserved[4]; -} DEFIO_PCI_ADDR; - -#define PCI_EXPANSION_ROM_HEADER_SIGNATURE 0xaa55 -#define PCI_DATA_STRUCTURE_SIGNATURE SIGNATURE_32 ('P', 'C', 'I', 'R') -#define PCI_CODE_TYPE_PCAT_IMAGE 0x00 -#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED 0x0001 ///<defined in UEFI spec. - -typedef struct { - UINT16 Signature; ///< 0xaa55 - UINT8 Reserved[0x16]; - UINT16 PcirOffset; -} PCI_EXPANSION_ROM_HEADER; - -typedef struct { - UINT16 Signature; ///< 0xaa55 - UINT8 Size512; - UINT8 InitEntryPoint[3]; - UINT8 Reserved[0x12]; - UINT16 PcirOffset; -} EFI_LEGACY_EXPANSION_ROM_HEADER; - -typedef struct { - UINT32 Signature; ///< "PCIR" - UINT16 VendorId; - UINT16 DeviceId; - UINT16 Reserved0; - UINT16 Length; - UINT8 Revision; - UINT8 ClassCode[3]; - UINT16 ImageLength; - UINT16 CodeRevision; - UINT8 CodeType; - UINT8 Indicator; - UINT16 Reserved1; -} PCI_DATA_STRUCTURE; - -/// -/// defined in EFI/UEFI Spec -/// -typedef struct { - UINT16 Signature; ///< 0xaa55 - UINT16 InitializationSize; - UINT32 EfiSignature; ///< 0x0EF1 - UINT16 EfiSubsystem; - UINT16 EfiMachineType; - UINT16 CompressionType; - UINT8 Reserved[8]; - UINT16 EfiImageHeaderOffset; - UINT16 PcirOffset; -} EFI_PCI_EXPANSION_ROM_HEADER; - -typedef union { - UINT8 *Raw; - PCI_EXPANSION_ROM_HEADER *Generic; - EFI_PCI_EXPANSION_ROM_HEADER *Efi; - EFI_LEGACY_EXPANSION_ROM_HEADER *PcAt; -} EFI_PCI_ROM_HEADER; - -#pragma pack() - -#endif diff --git a/gpxe/src/include/gpxe/efi/IndustryStandard/PeImage.h b/gpxe/src/include/gpxe/efi/IndustryStandard/PeImage.h deleted file mode 100644 index 73b3a5ad..00000000 --- a/gpxe/src/include/gpxe/efi/IndustryStandard/PeImage.h +++ /dev/null @@ -1,752 +0,0 @@ -/** @file - EFI image format for PE32, PE32+ and TE. Please note some data structures are - different for PE32 and PE32+. EFI_IMAGE_NT_HEADERS32 is for PE32 and - EFI_IMAGE_NT_HEADERS64 is for PE32+. - - This file is coded to the Visual Studio, Microsoft Portable Executable and - Common Object File Format Specification, Revision 8.0 - May 16, 2006. - This file also includes some definitions in PI Specification, Revision 1.0. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __PE_IMAGE_H__ -#define __PE_IMAGE_H__ - -/// -/// PE32+ Subsystem type for EFI images -/// -#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10 -#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 -#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 -#define EFI_IMAGE_SUBSYSTEM_EFI_EFI_ROM 13 - -#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13 ///< defined PI Specification, 1.0 - - -/// -/// PE32+ Machine type for EFI images -/// -#define IMAGE_FILE_MACHINE_I386 0x014c -#define IMAGE_FILE_MACHINE_IA64 0x0200 -#define IMAGE_FILE_MACHINE_EBC 0x0EBC -#define IMAGE_FILE_MACHINE_X64 0x8664 -// -// Support old names for backward compatible -// -#define EFI_IMAGE_MACHINE_IA32 IMAGE_FILE_MACHINE_I386 -#define EFI_IMAGE_MACHINE_IA64 IMAGE_FILE_MACHINE_IA64 -#define EFI_IMAGE_MACHINE_IPF IMAGE_FILE_MACHINE_IA64 -#define EFI_IMAGE_MACHINE_EBC IMAGE_FILE_MACHINE_EBC -#define EFI_IMAGE_MACHINE_X64 IMAGE_FILE_MACHINE_X64 - -/// -/// EXE file formats -/// -#define EFI_IMAGE_DOS_SIGNATURE SIGNATURE_16('M', 'Z') -#define EFI_IMAGE_OS2_SIGNATURE SIGNATURE_16('N', 'E') -#define EFI_IMAGE_OS2_SIGNATURE_LE SIGNATURE_16('L', 'E') -#define EFI_IMAGE_NT_SIGNATURE SIGNATURE_32('P', 'E', '\0', '\0') - -/// -/// PE images can start with an optional DOS header, so if an image is run -/// under DOS it can print an error message. -/// -typedef struct { - UINT16 e_magic; ///< Magic number - UINT16 e_cblp; ///< Bytes on last page of file - UINT16 e_cp; ///< Pages in file - UINT16 e_crlc; ///< Relocations - UINT16 e_cparhdr; ///< Size of header in paragraphs - UINT16 e_minalloc; ///< Minimum extra paragraphs needed - UINT16 e_maxalloc; ///< Maximum extra paragraphs needed - UINT16 e_ss; ///< Initial (relative) SS value - UINT16 e_sp; ///< Initial SP value - UINT16 e_csum; ///< Checksum - UINT16 e_ip; ///< Initial IP value - UINT16 e_cs; ///< Initial (relative) CS value - UINT16 e_lfarlc; ///< File address of relocation table - UINT16 e_ovno; ///< Overlay number - UINT16 e_res[4]; ///< Reserved words - UINT16 e_oemid; ///< OEM identifier (for e_oeminfo) - UINT16 e_oeminfo; ///< OEM information; e_oemid specific - UINT16 e_res2[10]; ///< Reserved words - UINT32 e_lfanew; ///< File address of new exe header -} EFI_IMAGE_DOS_HEADER; - -/// -/// COFF File Header (Object and Image) -/// -typedef struct { - UINT16 Machine; - UINT16 NumberOfSections; - UINT32 TimeDateStamp; - UINT32 PointerToSymbolTable; - UINT32 NumberOfSymbols; - UINT16 SizeOfOptionalHeader; - UINT16 Characteristics; -} EFI_IMAGE_FILE_HEADER; - -/// -/// Size of EFI_IMAGE_FILE_HEADER -/// -#define EFI_IMAGE_SIZEOF_FILE_HEADER 20 - -/// -/// Characteristics -/// -#define EFI_IMAGE_FILE_RELOCS_STRIPPED BIT0 ///< 0x0001 Relocation info stripped from file. -#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE BIT1 ///< 0x0002 File is executable (i.e. no unresolved externel references). -#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED BIT2 ///< 0x0004 Line nunbers stripped from file. -#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED BIT3 ///< 0x0008 Local symbols stripped from file. -#define EFI_IMAGE_FILE_BYTES_REVERSED_LO BIT7 ///< 0x0080 Bytes of machine word are reversed. -#define EFI_IMAGE_FILE_32BIT_MACHINE BIT8 ///< 0x0100 32 bit word machine. -#define EFI_IMAGE_FILE_DEBUG_STRIPPED BIT9 ///< 0x0200 Debugging info stripped from file in .DBG file -#define EFI_IMAGE_FILE_SYSTEM BIT12 ///< 0x1000 System File. -#define EFI_IMAGE_FILE_DLL BIT13 ///< 0x2000 File is a DLL. -#define EFI_IMAGE_FILE_BYTES_REVERSED_HI BIT15 ///< 0x8000 Bytes of machine word are reversed. - -/// -/// Other Machine Types -/// -#define EFI_IMAGE_FILE_MACHINE_UNKNOWN 0 ///< Any machine type -#define EFI_IMAGE_FILE_MACHINE_I386 0x14c ///< Intel 386. -#define EFI_IMAGE_FILE_MACHINE_R3000 0x162 ///< MIPS* little-endian, 0540 big-endian -#define EFI_IMAGE_FILE_MACHINE_R4000 0x166 ///< MIPS* little-endian -#define EFI_IMAGE_FILE_MACHINE_POWERPC 0x1F0 ///< IBM* PowerPC Little-Endian -// -// * Other names and brands may be claimed as the property of others. -// - -/// -/// Header Data Directories -/// -typedef struct { - UINT32 VirtualAddress; - UINT32 Size; -} EFI_IMAGE_DATA_DIRECTORY; - -#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 - -/// -/// Directory Entries -/// -#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT 0 -#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT 1 -#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE 2 -#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 -#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY 4 -#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC 5 -#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG 6 -#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 -#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 -#define EFI_IMAGE_DIRECTORY_ENTRY_TLS 9 -#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 - -#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16 - -/// -/// @attention -/// EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC means PE32 and -/// EFI_IMAGE_OPTIONAL_HEADER32 must be used. The data structures only vary -/// after NT additional fields. -/// -#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b - -typedef struct { - /// - /// Standard fields. - /// - UINT16 Magic; - UINT8 MajorLinkerVersion; - UINT8 MinorLinkerVersion; - UINT32 SizeOfCode; - UINT32 SizeOfInitializedData; - UINT32 SizeOfUninitializedData; - UINT32 AddressOfEntryPoint; - UINT32 BaseOfCode; - UINT32 BaseOfData; ///< PE32 contains this additional field, which is absent in PE32+ - /// - /// NT additional fields. - /// - UINT32 ImageBase; - UINT32 SectionAlignment; - UINT32 FileAlignment; - UINT16 MajorOperatingSystemVersion; - UINT16 MinorOperatingSystemVersion; - UINT16 MajorImageVersion; - UINT16 MinorImageVersion; - UINT16 MajorSubsystemVersion; - UINT16 MinorSubsystemVersion; - UINT32 Win32VersionValue; - UINT32 SizeOfImage; - UINT32 SizeOfHeaders; - UINT32 CheckSum; - UINT16 Subsystem; - UINT16 DllCharacteristics; - UINT32 SizeOfStackReserve; - UINT32 SizeOfStackCommit; - UINT32 SizeOfHeapReserve; - UINT32 SizeOfHeapCommit; - UINT32 LoaderFlags; - UINT32 NumberOfRvaAndSizes; - EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES]; -} EFI_IMAGE_OPTIONAL_HEADER32; - -/// -/// @attention -/// EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC means PE32+ and -/// EFI_IMAGE_OPTIONAL_HEADER64 must be used. The data structures only vary -/// after NT additional fields. -/// -#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b - -typedef struct { - // - // Standard fields. - // - UINT16 Magic; - UINT8 MajorLinkerVersion; - UINT8 MinorLinkerVersion; - UINT32 SizeOfCode; - UINT32 SizeOfInitializedData; - UINT32 SizeOfUninitializedData; - UINT32 AddressOfEntryPoint; - UINT32 BaseOfCode; - // - // NT additional fields. - // - UINT64 ImageBase; - UINT32 SectionAlignment; - UINT32 FileAlignment; - UINT16 MajorOperatingSystemVersion; - UINT16 MinorOperatingSystemVersion; - UINT16 MajorImageVersion; - UINT16 MinorImageVersion; - UINT16 MajorSubsystemVersion; - UINT16 MinorSubsystemVersion; - UINT32 Win32VersionValue; - UINT32 SizeOfImage; - UINT32 SizeOfHeaders; - UINT32 CheckSum; - UINT16 Subsystem; - UINT16 DllCharacteristics; - UINT64 SizeOfStackReserve; - UINT64 SizeOfStackCommit; - UINT64 SizeOfHeapReserve; - UINT64 SizeOfHeapCommit; - UINT32 LoaderFlags; - UINT32 NumberOfRvaAndSizes; - EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES]; -} EFI_IMAGE_OPTIONAL_HEADER64; - - -/// -/// @attention -/// EFI_IMAGE_NT_HEADERS32 and EFI_IMAGE_HEADERS64 are for use ONLY -/// by tools. All proper EFI code MUST use EFI_IMAGE_NT_HEADERS ONLY!!! -/// -typedef struct { - UINT32 Signature; - EFI_IMAGE_FILE_HEADER FileHeader; - EFI_IMAGE_OPTIONAL_HEADER32 OptionalHeader; -} EFI_IMAGE_NT_HEADERS32; - -#define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32) - -typedef struct { - UINT32 Signature; - EFI_IMAGE_FILE_HEADER FileHeader; - EFI_IMAGE_OPTIONAL_HEADER64 OptionalHeader; -} EFI_IMAGE_NT_HEADERS64; - -#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64) - - -/// -/// Processor specific definition of EFI_IMAGE_OPTIONAL_HEADER so the -/// type name EFI_IMAGE_OPTIONAL_HEADER is appropriate to the build. Same for -/// EFI_IMAGE_NT_HEADERS. These definitions MUST be used by ALL EFI code. -/// -#if defined (MDE_CPU_IA32) - -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ - (((Machine) == EFI_IMAGE_MACHINE_IA32) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_X64) - -typedef EFI_IMAGE_NT_HEADERS32 EFI_IMAGE_NT_HEADERS; - -#elif defined (MDE_CPU_IPF) - -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ - (((Machine) == EFI_IMAGE_MACHINE_IPF) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) - -typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS; - -#elif defined (MDE_CPU_X64) - -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ - (((Machine) == EFI_IMAGE_MACHINE_X64) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32) - -typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS; - -#elif defined (MDE_CPU_EBC) - -/// -/// This is just to make sure you can cross compile with the EBC compiiler. -/// It does not make sense to have a PE loader coded in EBC. You need to -/// understand the basic -/// -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) - -typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS; - -#else -#error Unknown Processor Type -#endif - - -#define EFI_IMAGE_FIRST_SECTION(ntheader) \ - ( \ - (EFI_IMAGE_SECTION_HEADER *) \ - ( \ - (UINT32) ntheader + \ - FIELD_OFFSET (EFI_IMAGE_NT_HEADERS, OptionalHeader) + \ - ((EFI_IMAGE_NT_HEADERS *) (ntheader))->FileHeader.SizeOfOptionalHeader \ - ) \ - ) - -/// -/// Other Windows Subsystem Values -/// -#define EFI_IMAGE_SUBSYSTEM_UNKNOWN 0 -#define EFI_IMAGE_SUBSYSTEM_NATIVE 1 -#define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI 2 -#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3 -#define EFI_IMAGE_SUBSYSTEM_OS2_CUI 5 -#define EFI_IMAGE_SUBSYSTEM_POSIX_CUI 7 - -/// -/// Section header format. -/// -#define EFI_IMAGE_SIZEOF_SHORT_NAME 8 - -typedef struct { - UINT8 Name[EFI_IMAGE_SIZEOF_SHORT_NAME]; - union { - UINT32 PhysicalAddress; - UINT32 VirtualSize; - } Misc; - UINT32 VirtualAddress; - UINT32 SizeOfRawData; - UINT32 PointerToRawData; - UINT32 PointerToRelocations; - UINT32 PointerToLinenumbers; - UINT16 NumberOfRelocations; - UINT16 NumberOfLinenumbers; - UINT32 Characteristics; -} EFI_IMAGE_SECTION_HEADER; - -/// -/// Size of EFI_IMAGE_SECTION_HEADER -/// -#define EFI_IMAGE_SIZEOF_SECTION_HEADER 40 - -/// -/// Section Flags Values -/// -#define EFI_IMAGE_SCN_TYPE_NO_PAD BIT3 ///< 0x00000008 ///< Reserved. -#define EFI_IMAGE_SCN_CNT_CODE BIT5 ///< 0x00000020 -#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA BIT6 ///< 0x00000040 -#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA BIT7 ///< 0x00000080 - -#define EFI_IMAGE_SCN_LNK_OTHER BIT8 ///< 0x00000100 ///< Reserved. -#define EFI_IMAGE_SCN_LNK_INFO BIT9 ///< 0x00000200 ///< Section contains comments or some other type of information. -#define EFI_IMAGE_SCN_LNK_REMOVE BIT10 ///< 0x00000800 ///< Section contents will not become part of image. -#define EFI_IMAGE_SCN_LNK_COMDAT BIT12 ///< 0x00001000 - -#define EFI_IMAGE_SCN_ALIGN_1BYTES BIT20 ///< 0x00100000 -#define EFI_IMAGE_SCN_ALIGN_2BYTES BIT21 ///< 0x00200000 -#define EFI_IMAGE_SCN_ALIGN_4BYTES (BIT20|BIT21) ///< 0x00300000 -#define EFI_IMAGE_SCN_ALIGN_8BYTES BIT22 ///< 0x00400000 -#define EFI_IMAGE_SCN_ALIGN_16BYTES (BIT20|BIT22) ///< 0x00500000 -#define EFI_IMAGE_SCN_ALIGN_32BYTES (BIT21|BIT22) ///< 0x00600000 -#define EFI_IMAGE_SCN_ALIGN_64BYTES (BIT20|BIT21|BIT22) ///< 0x00700000 - -#define EFI_IMAGE_SCN_MEM_DISCARDABLE BIT25 ///< 0x02000000 -#define EFI_IMAGE_SCN_MEM_NOT_CACHED BIT26 ///< 0x04000000 -#define EFI_IMAGE_SCN_MEM_NOT_PAGED BIT27 ///< 0x08000000 -#define EFI_IMAGE_SCN_MEM_SHARED BIT28 ///< 0x10000000 -#define EFI_IMAGE_SCN_MEM_EXECUTE BIT29 ///< 0x20000000 -#define EFI_IMAGE_SCN_MEM_READ BIT30 ///< 0x40000000 -#define EFI_IMAGE_SCN_MEM_WRITE BIT31 ///< 0x80000000 - -/// -/// Size of a Symbol Table Record -/// -#define EFI_IMAGE_SIZEOF_SYMBOL 18 - -/// -/// Symbols have a section number of the section in which they are -/// defined. Otherwise, section numbers have the following meanings: -/// -#define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0 ///< Symbol is undefined or is common. -#define EFI_IMAGE_SYM_ABSOLUTE (UINT16) -1 ///< Symbol is an absolute value. -#define EFI_IMAGE_SYM_DEBUG (UINT16) -2 ///< Symbol is a special debug item. - -/// -/// Symbol Type (fundamental) values. -/// -#define EFI_IMAGE_SYM_TYPE_NULL 0 ///< no type. -#define EFI_IMAGE_SYM_TYPE_VOID 1 ///< no valid type. -#define EFI_IMAGE_SYM_TYPE_CHAR 2 ///< type character. -#define EFI_IMAGE_SYM_TYPE_SHORT 3 ///< type short integer. -#define EFI_IMAGE_SYM_TYPE_INT 4 -#define EFI_IMAGE_SYM_TYPE_LONG 5 -#define EFI_IMAGE_SYM_TYPE_FLOAT 6 -#define EFI_IMAGE_SYM_TYPE_DOUBLE 7 -#define EFI_IMAGE_SYM_TYPE_STRUCT 8 -#define EFI_IMAGE_SYM_TYPE_UNION 9 -#define EFI_IMAGE_SYM_TYPE_ENUM 10 ///< enumeration. -#define EFI_IMAGE_SYM_TYPE_MOE 11 ///< member of enumeration. -#define EFI_IMAGE_SYM_TYPE_BYTE 12 -#define EFI_IMAGE_SYM_TYPE_WORD 13 -#define EFI_IMAGE_SYM_TYPE_UINT 14 -#define EFI_IMAGE_SYM_TYPE_DWORD 15 - -/// -/// Symbol Type (derived) values. -/// -#define EFI_IMAGE_SYM_DTYPE_NULL 0 ///< no derived type. -#define EFI_IMAGE_SYM_DTYPE_POINTER 1 -#define EFI_IMAGE_SYM_DTYPE_FUNCTION 2 -#define EFI_IMAGE_SYM_DTYPE_ARRAY 3 - -/// -/// Storage classes. -/// -#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION ((UINT8) -1) -#define EFI_IMAGE_SYM_CLASS_NULL 0 -#define EFI_IMAGE_SYM_CLASS_AUTOMATIC 1 -#define EFI_IMAGE_SYM_CLASS_EXTERNAL 2 -#define EFI_IMAGE_SYM_CLASS_STATIC 3 -#define EFI_IMAGE_SYM_CLASS_REGISTER 4 -#define EFI_IMAGE_SYM_CLASS_EXTERNAL_DEF 5 -#define EFI_IMAGE_SYM_CLASS_LABEL 6 -#define EFI_IMAGE_SYM_CLASS_UNDEFINED_LABEL 7 -#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8 -#define EFI_IMAGE_SYM_CLASS_ARGUMENT 9 -#define EFI_IMAGE_SYM_CLASS_STRUCT_TAG 10 -#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_UNION 11 -#define EFI_IMAGE_SYM_CLASS_UNION_TAG 12 -#define EFI_IMAGE_SYM_CLASS_TYPE_DEFINITION 13 -#define EFI_IMAGE_SYM_CLASS_UNDEFINED_STATIC 14 -#define EFI_IMAGE_SYM_CLASS_ENUM_TAG 15 -#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16 -#define EFI_IMAGE_SYM_CLASS_REGISTER_PARAM 17 -#define EFI_IMAGE_SYM_CLASS_BIT_FIELD 18 -#define EFI_IMAGE_SYM_CLASS_BLOCK 100 -#define EFI_IMAGE_SYM_CLASS_FUNCTION 101 -#define EFI_IMAGE_SYM_CLASS_END_OF_STRUCT 102 -#define EFI_IMAGE_SYM_CLASS_FILE 103 -#define EFI_IMAGE_SYM_CLASS_SECTION 104 -#define EFI_IMAGE_SYM_CLASS_WEAK_EXTERNAL 105 - -// -// type packing constants -// -#define EFI_IMAGE_N_BTMASK 017 -#define EFI_IMAGE_N_TMASK 060 -#define EFI_IMAGE_N_TMASK1 0300 -#define EFI_IMAGE_N_TMASK2 0360 -#define EFI_IMAGE_N_BTSHFT 4 -#define EFI_IMAGE_N_TSHIFT 2 - -/// -/// Communal selection types. -/// -#define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES 1 -#define EFI_IMAGE_COMDAT_SELECT_ANY 2 -#define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE 3 -#define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH 4 -#define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE 5 - -/// -/// the following values only be referred in PeCoff, not defined in PECOFF. -/// -#define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 -#define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 -#define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 - -/// -/// Relocation format. -/// -typedef struct { - UINT32 VirtualAddress; - UINT32 SymbolTableIndex; - UINT16 Type; -} EFI_IMAGE_RELOCATION; - -/// -/// Size of EFI_IMAGE_RELOCATION -/// -#define EFI_IMAGE_SIZEOF_RELOCATION 10 - -/// -/// I386 relocation types. -/// -#define EFI_IMAGE_REL_I386_ABSOLUTE 0x0000 ///< Reference is absolute, no relocation is necessary -#define EFI_IMAGE_REL_I386_DIR16 0x0001 ///< Direct 16-bit reference to the symbols virtual address -#define EFI_IMAGE_REL_I386_REL16 0x0002 ///< PC-relative 16-bit reference to the symbols virtual address -#define EFI_IMAGE_REL_I386_DIR32 0x0006 ///< Direct 32-bit reference to the symbols virtual address -#define EFI_IMAGE_REL_I386_DIR32NB 0x0007 ///< Direct 32-bit reference to the symbols virtual address, base not included -#define EFI_IMAGE_REL_I386_SEG12 0x0009 ///< Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address -#define EFI_IMAGE_REL_I386_SECTION 0x000A -#define EFI_IMAGE_REL_I386_SECREL 0x000B -#define EFI_IMAGE_REL_I386_REL32 0x0014 ///< PC-relative 32-bit reference to the symbols virtual address - -/// -/// x64 processor relocation types. -/// -#define IMAGE_REL_AMD64_ABSOLUTE 0x0000 -#define IMAGE_REL_AMD64_ADDR64 0x0001 -#define IMAGE_REL_AMD64_ADDR32 0x0002 -#define IMAGE_REL_AMD64_ADDR32NB 0x0003 -#define IMAGE_REL_AMD64_REL32 0x0004 -#define IMAGE_REL_AMD64_REL32_1 0x0005 -#define IMAGE_REL_AMD64_REL32_2 0x0006 -#define IMAGE_REL_AMD64_REL32_3 0x0007 -#define IMAGE_REL_AMD64_REL32_4 0x0008 -#define IMAGE_REL_AMD64_REL32_5 0x0009 -#define IMAGE_REL_AMD64_SECTION 0x000A -#define IMAGE_REL_AMD64_SECREL 0x000B -#define IMAGE_REL_AMD64_SECREL7 0x000C -#define IMAGE_REL_AMD64_TOKEN 0x000D -#define IMAGE_REL_AMD64_SREL32 0x000E -#define IMAGE_REL_AMD64_PAIR 0x000F -#define IMAGE_REL_AMD64_SSPAN32 0x0010 - -/// -/// Based relocation format. -/// -typedef struct { - UINT32 VirtualAddress; - UINT32 SizeOfBlock; -} EFI_IMAGE_BASE_RELOCATION; - -/// -/// Size of EFI_IMAGE_BASE_RELOCATION -/// -#define EFI_IMAGE_SIZEOF_BASE_RELOCATION 8 - -/// -/// Based relocation types. -/// -#define EFI_IMAGE_REL_BASED_ABSOLUTE 0 -#define EFI_IMAGE_REL_BASED_HIGH 1 -#define EFI_IMAGE_REL_BASED_LOW 2 -#define EFI_IMAGE_REL_BASED_HIGHLOW 3 -#define EFI_IMAGE_REL_BASED_HIGHADJ 4 -#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR 5 -#define EFI_IMAGE_REL_BASED_IA64_IMM64 9 -#define IMAGE_REL_BASED_MIPS_JMPADDR16 9 -#define EFI_IMAGE_REL_BASED_DIR64 10 - -/// -/// Line number format. -/// -typedef struct { - union { - UINT32 SymbolTableIndex; // Symbol table index of function name if Linenumber is 0. - UINT32 VirtualAddress; // Virtual address of line number. - } Type; - UINT16 Linenumber; // Line number. -} EFI_IMAGE_LINENUMBER; - -/// -/// Size of EFI_IMAGE_LINENUMBER -/// -#define EFI_IMAGE_SIZEOF_LINENUMBER 6 - -/// -/// Archive format. -/// -#define EFI_IMAGE_ARCHIVE_START_SIZE 8 -#define EFI_IMAGE_ARCHIVE_START "!<arch>\n" -#define EFI_IMAGE_ARCHIVE_END "`\n" -#define EFI_IMAGE_ARCHIVE_PAD "\n" -#define EFI_IMAGE_ARCHIVE_LINKER_MEMBER "/ " -#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER "// " - -typedef struct { - UINT8 Name[16]; ///< File member name - `/' terminated. - UINT8 Date[12]; ///< File member date - decimal. - UINT8 UserID[6]; ///< File member user id - decimal. - UINT8 GroupID[6]; ///< File member group id - decimal. - UINT8 Mode[8]; ///< File member mode - octal. - UINT8 Size[10]; ///< File member size - decimal. - UINT8 EndHeader[2]; ///< String to end header. (0x60 0x0A) -} EFI_IMAGE_ARCHIVE_MEMBER_HEADER; - -/// -/// Size of EFI_IMAGE_ARCHIVE_MEMBER_HEADER -/// -#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60 - - -/// -/// DLL Support -/// - -/// -/// Export Directory Table -/// -typedef struct { - UINT32 Characteristics; - UINT32 TimeDateStamp; - UINT16 MajorVersion; - UINT16 MinorVersion; - UINT32 Name; - UINT32 Base; - UINT32 NumberOfFunctions; - UINT32 NumberOfNames; - UINT32 AddressOfFunctions; - UINT32 AddressOfNames; - UINT32 AddressOfNameOrdinals; -} EFI_IMAGE_EXPORT_DIRECTORY; - -/// -/// Hint/Name Table -/// -typedef struct { - UINT16 Hint; - UINT8 Name[1]; -} EFI_IMAGE_IMPORT_BY_NAME; - -typedef struct { - union { - UINT32 Function; - UINT32 Ordinal; - EFI_IMAGE_IMPORT_BY_NAME *AddressOfData; - } u1; -} EFI_IMAGE_THUNK_DATA; - -#define EFI_IMAGE_ORDINAL_FLAG BIT31 ///< Flag for PE32 -#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0) -#define EFI_IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff) - -/// -/// Import Directory Table -/// -typedef struct { - UINT32 Characteristics; - UINT32 TimeDateStamp; - UINT32 ForwarderChain; - UINT32 Name; - EFI_IMAGE_THUNK_DATA *FirstThunk; -} EFI_IMAGE_IMPORT_DESCRIPTOR; - - -/// -/// Debug Direcotry Format -/// -typedef struct { - UINT32 Characteristics; - UINT32 TimeDateStamp; - UINT16 MajorVersion; - UINT16 MinorVersion; - UINT32 Type; - UINT32 SizeOfData; - UINT32 RVA; ///< The address of the debug data when loaded, relative to the image base - UINT32 FileOffset; ///< The file pointer to the debug data -} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY; - -#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2 ///< The Visual C++ debug information - -/// -/// Debug Data Structure defined in Microsoft C++ -/// -#define CODEVIEW_SIGNATURE_NB10 SIGNATURE_32('N', 'B', '1', '0') -typedef struct { - UINT32 Signature; ///< "NB10" - UINT32 Unknown; - UINT32 Unknown2; - UINT32 Unknown3; - // - // Filename of .PDB goes here - // -} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY; - -/// -/// Debug Data Structure defined in Microsoft C++ -/// -#define CODEVIEW_SIGNATURE_RSDS SIGNATURE_32('R', 'S', 'D', 'S') -typedef struct { - UINT32 Signature; ///< "RSDS" - UINT32 Unknown; - UINT32 Unknown2; - UINT32 Unknown3; - UINT32 Unknown4; - UINT32 Unknown5; - // - // Filename of .PDB goes here - // -} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY; - -/// -/// Header format for TE images, defined in PI Specification, 1.0 -/// -typedef struct { - UINT16 Signature; ///< signature for TE format = "VZ" - UINT16 Machine; ///< from the original file header - UINT8 NumberOfSections; ///< from the original file header - UINT8 Subsystem; ///< from original optional header - UINT16 StrippedSize; ///< how many bytes we removed from the header - UINT32 AddressOfEntryPoint; ///< offset to entry point -- from original optional header - UINT32 BaseOfCode; ///< from original image -- required for ITP debug - UINT64 ImageBase; ///< from original file header - EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]; ///< only base relocation and debug directory -} EFI_TE_IMAGE_HEADER; - - -#define EFI_TE_IMAGE_HEADER_SIGNATURE SIGNATURE_16('V', 'Z') - -// -// Data directory indexes in our TE image header -// -#define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC 0 -#define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG 1 - - -/// -/// Union of PE32, PE32+, and TE headers -/// -typedef union { - EFI_IMAGE_NT_HEADERS32 Pe32; - EFI_IMAGE_NT_HEADERS64 Pe32Plus; - EFI_TE_IMAGE_HEADER Te; -} EFI_IMAGE_OPTIONAL_HEADER_UNION; - -typedef union { - EFI_IMAGE_NT_HEADERS32 *Pe32; - EFI_IMAGE_NT_HEADERS64 *Pe32Plus; - EFI_TE_IMAGE_HEADER *Te; - EFI_IMAGE_OPTIONAL_HEADER_UNION *Union; -} EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION; - -#endif diff --git a/gpxe/src/include/gpxe/efi/LICENCE b/gpxe/src/include/gpxe/efi/LICENCE deleted file mode 100644 index 6aa2b2ff..00000000 --- a/gpxe/src/include/gpxe/efi/LICENCE +++ /dev/null @@ -1,40 +0,0 @@ -The EFI headers contained herein are copied from the EFI Development -Kit, available from http://www.tianocore.org and published under the -following licence: - - BSD License from Intel - Copyright (c) 2004, Intel Corporation - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - - -This licence applies only to files that are part of the EFI -Development Kit. Other files may contain their own licence terms, or -may fall under the standard gPXE GPL licence. diff --git a/gpxe/src/include/gpxe/efi/Pi/PiBootMode.h b/gpxe/src/include/gpxe/efi/Pi/PiBootMode.h deleted file mode 100644 index bebca227..00000000 --- a/gpxe/src/include/gpxe/efi/Pi/PiBootMode.h +++ /dev/null @@ -1,43 +0,0 @@ -/** @file - Present the boot mode values in PI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - PI Version 1.0 - -**/ - -#ifndef __PI_BOOT_MODE_H__ -#define __PI_BOOT_MODE_H__ - -#include <gpxe/efi/ProcessorBind.h> - -/// -/// EFI boot mode -/// -typedef UINT32 EFI_BOOT_MODE; - -// -// 0x21 - 0xf..f are reserved. -// -#define BOOT_WITH_FULL_CONFIGURATION 0x00 -#define BOOT_WITH_MINIMAL_CONFIGURATION 0x01 -#define BOOT_ASSUMING_NO_CONFIGURATION_CHANGES 0x02 -#define BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS 0x03 -#define BOOT_WITH_DEFAULT_SETTINGS 0x04 -#define BOOT_ON_S4_RESUME 0x05 -#define BOOT_ON_S5_RESUME 0x06 -#define BOOT_ON_S2_RESUME 0x10 -#define BOOT_ON_S3_RESUME 0x11 -#define BOOT_ON_FLASH_UPDATE 0x12 -#define BOOT_IN_RECOVERY_MODE 0x20 - -#endif diff --git a/gpxe/src/include/gpxe/efi/Pi/PiDependency.h b/gpxe/src/include/gpxe/efi/Pi/PiDependency.h deleted file mode 100644 index 73f6027e..00000000 --- a/gpxe/src/include/gpxe/efi/Pi/PiDependency.h +++ /dev/null @@ -1,47 +0,0 @@ -/** @file - Present the dependency expression values in PI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - PI Version 1.0 - -**/ -#ifndef __PI_DEPENDENCY_H__ -#define __PI_DEPENDENCY_H__ - -/// -/// If present, this must be the first and only opcode, -/// EFI_DEP_BEFORE is only used by DXE driver. -/// -#define EFI_DEP_BEFORE 0x00 - -/// -/// If present, this must be the first and only opcode, -/// EFI_DEP_AFTER is only used by DXE driver. -/// -#define EFI_DEP_AFTER 0x01 - -#define EFI_DEP_PUSH 0x02 -#define EFI_DEP_AND 0x03 -#define EFI_DEP_OR 0x04 -#define EFI_DEP_NOT 0x05 -#define EFI_DEP_TRUE 0x06 -#define EFI_DEP_FALSE 0x07 -#define EFI_DEP_END 0x08 - - -/// -/// If present, this must be the first opcode, -/// EFI_DEP_SOR is only used by DXE driver. -/// -#define EFI_DEP_SOR 0x09 - -#endif diff --git a/gpxe/src/include/gpxe/efi/Pi/PiDxeCis.h b/gpxe/src/include/gpxe/efi/Pi/PiDxeCis.h deleted file mode 100644 index a9248883..00000000 --- a/gpxe/src/include/gpxe/efi/Pi/PiDxeCis.h +++ /dev/null @@ -1,642 +0,0 @@ -/** @file - Include file matches things in PI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - PI Version 1.0 - -**/ - -#ifndef __PI_DXECIS_H__ -#define __PI_DXECIS_H__ - -#include <gpxe/efi/Pi/PiMultiPhase.h> - -/// -/// Global Coherencey Domain types - Memory type -/// -typedef enum { - EfiGcdMemoryTypeNonExistent, - EfiGcdMemoryTypeReserved, - EfiGcdMemoryTypeSystemMemory, - EfiGcdMemoryTypeMemoryMappedIo, - EfiGcdMemoryTypeMaximum -} EFI_GCD_MEMORY_TYPE; - -/// -/// Global Coherencey Domain types - IO type -/// -typedef enum { - EfiGcdIoTypeNonExistent, - EfiGcdIoTypeReserved, - EfiGcdIoTypeIo, - EfiGcdIoTypeMaximum -} EFI_GCD_IO_TYPE; - -/// -/// The type of allocation to perform. -/// -typedef enum { - EfiGcdAllocateAnySearchBottomUp, - EfiGcdAllocateMaxAddressSearchBottomUp, - EfiGcdAllocateAddress, - EfiGcdAllocateAnySearchTopDown, - EfiGcdAllocateMaxAddressSearchTopDown, - EfiGcdMaxAllocateType -} EFI_GCD_ALLOCATE_TYPE; - -/// -/// EFI_GCD_MEMORY_SPACE_DESCRIPTOR -/// -typedef struct { - /// - /// The physical address of the first byte in the memory region. Type - /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function - /// description in the UEFI 2.0 specification - /// - EFI_PHYSICAL_ADDRESS BaseAddress; - - /// - /// The number of bytes in the memory region. - /// - UINT64 Length; - - /// - /// The bit mask of attributes that the memory region is capable of supporting. The bit - /// mask of available attributes is defined in the GetMemoryMap() function description - /// in the UEFI 2.0 specification. - /// - UINT64 Capabilities; - /// - /// The bit mask of attributes that the memory region is currently using. The bit mask of - /// available attributes is defined in GetMemoryMap(). - /// - UINT64 Attributes; - /// - /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the - /// AddMemorySpace() function description - /// - EFI_GCD_MEMORY_TYPE GcdMemoryType; - - /// - /// The image handle of the agent that allocated the memory resource described by - /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory - /// resource is not currently allocated. Type EFI_HANDLE is defined in - /// InstallProtocolInterface() in the UEFI 2.0 specification. - /// - EFI_HANDLE ImageHandle; - - /// - /// The device handle for which the memory resource has been allocated. If - /// ImageHandle is NULL, then the memory resource is not currently allocated. If this - /// field is NULL, then the memory resource is not associated with a device that is - /// described by a device handle. Type EFI_HANDLE is defined in - /// InstallProtocolInterface() in the UEFI 2.0 specification. - /// - EFI_HANDLE DeviceHandle; -} EFI_GCD_MEMORY_SPACE_DESCRIPTOR; - -/// -/// EFI_GCD_IO_SPACE_DESCRIPTOR -/// -typedef struct { - /// - /// Physical address of the first byte in the I/O region. Type - /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function - /// description in the UEFI 2.0 specification. - /// - EFI_PHYSICAL_ADDRESS BaseAddress; - - /// - /// Number of bytes in the I/O region. - /// - UINT64 Length; - - /// - /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the - /// AddIoSpace() function description. - /// - EFI_GCD_IO_TYPE GcdIoType; - - /// - /// The image handle of the agent that allocated the I/O resource described by - /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O - /// resource is not currently allocated. Type EFI_HANDLE is defined in - /// InstallProtocolInterface() in the UEFI 2.0 specification. - /// - EFI_HANDLE ImageHandle; - - /// - /// The device handle for which the I/O resource has been allocated. If ImageHandle - /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then - /// the I/O resource is not associated with a device that is described by a device handle. - /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI - /// 2.0 specification. - /// - EFI_HANDLE DeviceHandle; -} EFI_GCD_IO_SPACE_DESCRIPTOR; - - -/** - Adds reserved memory, system memory, or memory-mapped I/O resources to the - global coherency domain of the processor. - - @param GcdMemoryType The type of memory resource being added. - @param BaseAddress The physical address that is the start address - of the memory resource being added. - @param Length The size, in bytes, of the memory resource that - is being added. - @param Capabilities The bit mask of attributes that the memory - resource region supports. - - @retval EFI_SUCCESS The memory resource was added to the global - coherency domain of the processor. - @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add - the memory resource to the global coherency - domain of the processor. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes - of the memory resource range specified by - BaseAddress and Length. - @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range - specified by BaseAddress and Length conflicts - with a memory resource range that was previously - added to the global coherency domain of the processor. - @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range - specified by BaseAddress and Length was allocated - in a prior call to AllocateMemorySpace().. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ADD_MEMORY_SPACE)( - IN EFI_GCD_MEMORY_TYPE GcdMemoryType, - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN UINT64 Capabilities - ); - -/** - Allocates nonexistent memory, reserved memory, system memory, or memorymapped - I/O resources from the global coherency domain of the processor. - - @param GcdAllocateType The type of allocation to perform. - @param GcdMemoryType The type of memory resource being allocated. - @param Alignment The log base 2 of the boundary that BaseAddress must - be aligned on output. Align with 2^Alignment. - @param Length The size in bytes of the memory resource range that - is being allocated. - @param BaseAddress A pointer to a physical address to allocate. - @param Imagehandle The image handle of the agent that is allocating - the memory resource. - @param DeviceHandle The device handle for which the memory resource - is being allocated. - - @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid. - @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_INVALID_PARAMETER BaseAddress is NULL. - @retval EFI_INVALID_PARAMETER ImageHandle is NULL. - @retval EFI_NOT_FOUND The memory resource request could not be satisfied. - No descriptor contains the desired space. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the memory - resource from the global coherency domain of the processor. - @retval EFI_SUCCESS The memory resource was allocated from the global coherency - domain of the processor. - - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)( - IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, - IN EFI_GCD_MEMORY_TYPE GcdMemoryType, - IN UINTN Alignment, - IN UINT64 Length, - IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, - IN EFI_HANDLE ImageHandle, - IN EFI_HANDLE DeviceHandle OPTIONAL - ); - -/** - Frees nonexistent memory, reserved memory, system memory, or memory-mapped - I/O resources from the global coherency domain of the processor. - - @param BaseAddress The physical address that is the start address of the memory resource being freed. - @param Length The size in bytes of the memory resource range that is being freed. - - @retval EFI_SUCCESS The memory resource was freed from the global coherency domain of - the processor. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory - resource range specified by BaseAddress and Length. - @retval EFI_NOT_FOUND The memory resource range specified by BaseAddress and - Length was not allocated with previous calls to AllocateMemorySpace(). - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the memory resource - from the global coherency domain of the processor. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FREE_MEMORY_SPACE)( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Removes reserved memory, system memory, or memory-mapped I/O resources from - the global coherency domain of the processor. - - @param BaseAddress The physical address that is the start address of the memory resource being removed. - @param Length The size in bytes of the memory resource that is being removed. - - @retval EFI_SUCCESS The memory resource was removed from the global coherency - domain of the processor. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory - resource range specified by BaseAddress and Length. - @retval EFI_NOT_FOUND One or more bytes of the memory resource range specified by - BaseAddress and Length was not added with previous calls to - AddMemorySpace(). - @retval EFI_ACCESS_DEFINED One or more bytes of the memory resource range specified by - BaseAddress and Length has been allocated with AllocateMemorySpace(). - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the memory - resource from the global coherency domain of the processor. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_REMOVE_MEMORY_SPACE)( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Retrieves the descriptor for a memory region containing a specified address. - - @param BaseAddress The physical address that is the start address of a memory region. - @param Descriptor A pointer to a caller allocated descriptor. - - @retval EFI_SUCCESS The descriptor for the memory resource region containing - BaseAddress was returned in Descriptor. - @retval EFI_INVALID_PARAMETER Descriptor is NULL. - @retval EFI_NOT_FOUND A memory resource range containing BaseAddress was not found. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor - ); - -/** - Modifies the attributes for a memory region in the global coherency domain of the - processor. - - @param BaseAddress The physical address that is the start address of a memory region. - @param Length The size in bytes of the memory region. - @param Attributes The bit mask of attributes to set for the memory region. - - @retval EFI_SUCCESS The attributes were set for the memory region. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory - resource range specified by BaseAddress and Length. - @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource - range specified by BaseAddress and Length. - @retval EFI_ACCESS_DEFINED The attributes for the memory resource range specified by - BaseAddress and Length cannot be modified. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of - the memory resource range. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN UINT64 Attributes - ); - -/** - Returns a map of the memory resources in the global coherency domain of the - processor. - - @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer. - @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs. - - @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap - buffer, and the number of descriptors in MemorySpaceMap was - returned in NumberOfDescriptors. - @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL. - @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL. - @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_MEMORY_SPACE_MAP)( - OUT UINTN *NumberOfDescriptors, - OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap - ); - -/** - Adds reserved I/O or I/O resources to the global coherency domain of the processor. - - @param GcdIoType The type of I/O resource being added. - @param BaseAddress The physical address that is the start address of the I/O resource being added. - @param Length The size in bytes of the I/O resource that is being added. - - @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of - the processor. - @retval EFI_INVALID_PARAMETER GcdIoType is invalid. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to - the global coherency domain of the processor. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O - resource range specified by BaseAddress and Length. - @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by - BaseAddress and Length conflicts with an I/O resource - range that was previously added to the global coherency domain - of the processor. - @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by - BaseAddress and Length was allocated in a prior call to - AllocateIoSpace(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ADD_IO_SPACE)( - IN EFI_GCD_IO_TYPE GcdIoType, - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency - domain of the processor. - - @param GcdAllocateType The type of allocation to perform. - @param GcdIoType The type of I/O resource being allocated. - @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output. - @param Length The size in bytes of the I/O resource range that is being allocated. - @param BaseAddress A pointer to a physical address. - @param Imagehandle The image handle of the agent that is allocating the I/O resource. - @param DeviceHandle The device handle for which the I/O resource is being allocated. - - @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain - of the processor. - @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid. - @retval EFI_INVALID_PARAMETER GcdIoType is invalid. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_INVALID_PARAMETER BaseAddress is NULL. - @retval EFI_INVALID_PARAMETER ImageHandle is NULL. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O - resource from the global coherency domain of the processor. - @retval EFI_NOT_FOUND The I/O resource request could not be satisfied. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ALLOCATE_IO_SPACE)( - IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType, - IN EFI_GCD_IO_TYPE GcdIoType, - IN UINTN Alignment, - IN UINT64 Length, - IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress, - IN EFI_HANDLE ImageHandle, - IN EFI_HANDLE DeviceHandle OPTIONAL - ); - -/** - Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency - domain of the processor. - - @param BaseAddress The physical address that is the start address of the I/O resource being freed. - @param Length The size in bytes of the I/O resource range that is being freed. - - @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the - processor. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource - range specified by BaseAddress and Length. - @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length - was not allocated with previous calls to AllocateIoSpace(). - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from - the global coherency domain of the processor. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FREE_IO_SPACE)( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Removes reserved I/O or I/O resources from the global coherency domain of the - processor. - - @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being - removed. - @param Length The size in bytes of the I/O resource that is being removed. - - @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain - of the processor. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O - resource range specified by BaseAddress and Length. - @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by - BaseAddress and Length was not added with previous - calls to AddIoSpace(). - @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by - BaseAddress and Length has been allocated with - AllocateIoSpace(). - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O - resource from the global coherency domain of the processor. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_REMOVE_IO_SPACE)( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length - ); - -/** - Retrieves the descriptor for an I/O region containing a specified address. - - @param BaseAddress The physical address that is the start address of an I/O region. - @param Descriptor A pointer to a caller allocated descriptor. - - @retval EFI_SUCCESS The descriptor for the I/O resource region containing - BaseAddress was returned in Descriptor. - @retval EFI_INVALID_PARAMETER Descriptor is NULL. - @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)( - IN EFI_PHYSICAL_ADDRESS BaseAddress, - OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor - ); - -/** - Returns a map of the I/O resources in the global coherency domain of the processor. - - @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer. - @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs. - - @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and - the number of descriptors in IoSpaceMap was returned in - NumberOfDescriptors. - @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL. - @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL. - @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap. - - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_IO_SPACE_MAP)( - OUT UINTN *NumberOfDescriptors, - OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap - ); - - - -/** - Loads and executed DXE drivers from firmware volumes. - - The Dispatch() function searches for DXE drivers in firmware volumes that have been - installed since the last time the Dispatch() service was called. It then evaluates - the dependency expressions of all the DXE drivers and loads and executes those DXE - drivers whose dependency expression evaluate to TRUE. This service must interact with - the Security Architectural Protocol to authenticate DXE drivers before they are executed. - This process is continued until no more DXE drivers can be executed. - - @retval EFI_SUCCESS One or more DXE driver were dispatched. - @retval EFI_NOT_FOUND No DXE drivers were dispatched. - @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively. - Thus no action was taken. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DISPATCH)( - VOID - ); - -/** - Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume. - - @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName. - @param FileName A pointer to the name of the file in a firmware volume. - - @retval EFI_SUCCESS The DXE driver was found and its SOR bit was cleared. - @retval EFI_NOT_FOUND The DXE driver does not exist, or the DXE driver exists and its SOR - bit is not set. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SCHEDULE)( - IN EFI_HANDLE FirmwareVolumeHandle, - IN CONST EFI_GUID *FileName - ); - -/** - Promotes a file stored in a firmware volume from the untrusted to the trusted state. - - @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName. - @param DriverName A pointer to the name of the file in a firmware volume. - - @return Status of promoting FFS from untrusted to trusted - state. - @retval EFI_NOT_FOUND The file was not found in the untrusted state. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TRUST)( - IN EFI_HANDLE FirmwareVolumeHandle, - IN CONST EFI_GUID *FileName - ); - -/** - Creates a firmware volume handle for a firmware volume that is present in system memory. - - @param FirmwareVolumeHeader A pointer to the header of the firmware volume. - @param Size The size, in bytes, of the firmware volume. - @param FirmwareVolumeHandle On output, a pointer to the created handle. - - @retval EFI_SUCCESS The EFI_FIRMWARE_VOLUME_PROTOCOL and - EFI_DEVICE_PATH_PROTOCOL were installed onto - FirmwareVolumeHandle for the firmware volume described - by FirmwareVolumeHeader and Size. - @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader - and Size is corrupted. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the - EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL - for the firmware volume described by FirmwareVolumeHeader and Size. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)( - IN CONST VOID *FirmwareVolumeHeader, - IN UINTN Size, - OUT EFI_HANDLE *FirmwareVolumeHandle - ); - -// -// DXE Services Table -// -#define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL -#define DXE_SERVICES_REVISION ((1<<16) | (00)) - -typedef struct { - EFI_TABLE_HEADER Hdr; - - // - // Global Coherency Domain Services - // - EFI_ADD_MEMORY_SPACE AddMemorySpace; - EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace; - EFI_FREE_MEMORY_SPACE FreeMemorySpace; - EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace; - EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor; - EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes; - EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap; - EFI_ADD_IO_SPACE AddIoSpace; - EFI_ALLOCATE_IO_SPACE AllocateIoSpace; - EFI_FREE_IO_SPACE FreeIoSpace; - EFI_REMOVE_IO_SPACE RemoveIoSpace; - EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor; - EFI_GET_IO_SPACE_MAP GetIoSpaceMap; - - // - // Dispatcher Services - // - EFI_DISPATCH Dispatch; - EFI_SCHEDULE Schedule; - EFI_TRUST Trust; - // - // Service to process a single firmware volume found in a capsule - // - EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume; -} DXE_SERVICES; - -typedef DXE_SERVICES EFI_DXE_SERVICES; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Pi/PiFirmwareFile.h b/gpxe/src/include/gpxe/efi/Pi/PiFirmwareFile.h deleted file mode 100644 index be6f8bd2..00000000 --- a/gpxe/src/include/gpxe/efi/Pi/PiFirmwareFile.h +++ /dev/null @@ -1,242 +0,0 @@ -/** @file - The firmware file related definitions in PI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - PI Version 1.0 - -**/ - - -#ifndef __PI_FIRMWARE_FILE_H__ -#define __PI_FIRMWARE_FILE_H__ - -#include <gpxe/efi/ProcessorBind.h> - -#pragma pack(1) -/// -/// Used to verify the integrity of the file. -/// -typedef union { - struct { - UINT8 Header; - UINT8 File; - } Checksum; - UINT16 Checksum16; -} EFI_FFS_INTEGRITY_CHECK; - -typedef UINT8 EFI_FV_FILETYPE; -typedef UINT8 EFI_FFS_FILE_ATTRIBUTES; -typedef UINT8 EFI_FFS_FILE_STATE; - -/// -/// File Types Definitions -/// -#define EFI_FV_FILETYPE_ALL 0x00 -#define EFI_FV_FILETYPE_RAW 0x01 -#define EFI_FV_FILETYPE_FREEFORM 0x02 -#define EFI_FV_FILETYPE_SECURITY_CORE 0x03 -#define EFI_FV_FILETYPE_PEI_CORE 0x04 -#define EFI_FV_FILETYPE_DXE_CORE 0x05 -#define EFI_FV_FILETYPE_PEIM 0x06 -#define EFI_FV_FILETYPE_DRIVER 0x07 -#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08 -#define EFI_FV_FILETYPE_APPLICATION 0x09 -#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B -#define EFI_FV_FILETYPE_OEM_MIN 0xc0 -#define EFI_FV_FILETYPE_OEM_MAX 0xdf -#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0 -#define EFI_FV_FILETYPE_DEBUG_MAX 0xef -#define EFI_FV_FILETYPE_FFS_MIN 0xf0 -#define EFI_FV_FILETYPE_FFS_MAX 0xff -#define EFI_FV_FILETYPE_FFS_PAD 0xf0 -/// -/// FFS File Attributes. -/// -#define FFS_ATTRIB_FIXED 0x04 -#define FFS_ATTRIB_DATA_ALIGNMENT 0x38 -#define FFS_ATTRIB_CHECKSUM 0x40 - -/// -/// FFS File State Bits. -/// -#define EFI_FILE_HEADER_CONSTRUCTION 0x01 -#define EFI_FILE_HEADER_VALID 0x02 -#define EFI_FILE_DATA_VALID 0x04 -#define EFI_FILE_MARKED_FOR_UPDATE 0x08 -#define EFI_FILE_DELETED 0x10 -#define EFI_FILE_HEADER_INVALID 0x20 - - -/// -/// Each file begins with the header that describe the -/// contents and state of the files. -/// -typedef struct { - EFI_GUID Name; - EFI_FFS_INTEGRITY_CHECK IntegrityCheck; - EFI_FV_FILETYPE Type; - EFI_FFS_FILE_ATTRIBUTES Attributes; - UINT8 Size[3]; - EFI_FFS_FILE_STATE State; -} EFI_FFS_FILE_HEADER; - - -typedef UINT8 EFI_SECTION_TYPE; - -/// -/// Pseudo type. It is -/// used as a wild card when retrieving sections. The section -/// type EFI_SECTION_ALL matches all section types. -/// -#define EFI_SECTION_ALL 0x00 - -/// -/// Encapsulation section Type values -/// -#define EFI_SECTION_COMPRESSION 0x01 - -#define EFI_SECTION_GUID_DEFINED 0x02 - -/// -/// Leaf section Type values -/// -#define EFI_SECTION_PE32 0x10 -#define EFI_SECTION_PIC 0x11 -#define EFI_SECTION_TE 0x12 -#define EFI_SECTION_DXE_DEPEX 0x13 -#define EFI_SECTION_VERSION 0x14 -#define EFI_SECTION_USER_INTERFACE 0x15 -#define EFI_SECTION_COMPATIBILITY16 0x16 -#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17 -#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18 -#define EFI_SECTION_RAW 0x19 -#define EFI_SECTION_PEI_DEPEX 0x1B - -/// -/// Common section header -/// -typedef struct { - UINT8 Size[3]; - EFI_SECTION_TYPE Type; -} EFI_COMMON_SECTION_HEADER; - -/// -/// Leaf section type that contains an -/// IA-32 16-bit executable image. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION; - -/// -/// CompressionType of EFI_COMPRESSION_SECTION. -/// -#define EFI_NOT_COMPRESSED 0x00 -#define EFI_STANDARD_COMPRESSION 0x01 -/// -/// An encapsulation section type in which the -/// section data is compressed. -/// -typedef struct { - EFI_COMMON_SECTION_HEADER CommonHeader; - UINT32 UncompressedLength; - UINT8 CompressionType; -} EFI_COMPRESSION_SECTION; - -/// -/// Leaf section which could be used to determine the dispatch order of DXEs. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION; - -/// -/// Leaf section which contains a PI FV. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION; - -/// -/// Leaf section which contains a single GUID. -/// -typedef struct { - EFI_COMMON_SECTION_HEADER CommonHeader; - EFI_GUID SubTypeGuid; -} EFI_FREEFORM_SUBTYPE_GUID_SECTION; - -/// -/// Attributes of EFI_GUID_DEFINED_SECTION -/// -#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01 -#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02 -/// -/// Leaf section which is encapsulation defined by specific GUID -/// -typedef struct { - EFI_COMMON_SECTION_HEADER CommonHeader; - EFI_GUID SectionDefinitionGuid; - UINT16 DataOffset; - UINT16 Attributes; -} EFI_GUID_DEFINED_SECTION; - -/// -/// Leaf section which contains PE32+ image. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION; - - -/// -/// Leaf section which used to determine the dispatch order of PEIMs. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION; - -/// -/// Leaf section which constains the position-independent-code image. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION; - -/// -/// Leaf section which contains an array of zero or more bytes. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION; - -/// -/// Leaf section which contains a unicode string that -/// is human readable file name. -/// -typedef struct { - EFI_COMMON_SECTION_HEADER CommonHeader; - - /// - /// Array of unicode string. - /// - CHAR16 FileNameString[1]; -} EFI_USER_INTERFACE_SECTION; - - -/// -/// Leaf section which contains a numeric build number and -/// an optional unicode string that represents the file revision. -/// -typedef struct { - EFI_COMMON_SECTION_HEADER CommonHeader; - UINT16 BuildNumber; - - /// - /// Array of unicode string. - /// - CHAR16 VersionString[1]; -} EFI_VERSION_SECTION; - - -#define SECTION_SIZE(SectionHeaderPtr) \ - ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff)) - -#pragma pack() - -#endif - diff --git a/gpxe/src/include/gpxe/efi/Pi/PiFirmwareVolume.h b/gpxe/src/include/gpxe/efi/Pi/PiFirmwareVolume.h deleted file mode 100644 index 277b7045..00000000 --- a/gpxe/src/include/gpxe/efi/Pi/PiFirmwareVolume.h +++ /dev/null @@ -1,154 +0,0 @@ -/** @file - The firmware volume related definitions in PI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - PI Version 1.0 - -**/ - -#ifndef __PI_FIRMWAREVOLUME_H__ -#define __PI_FIRMWAREVOLUME_H__ - -#include <gpxe/efi/ProcessorBind.h> - -/// -/// EFI_FV_FILE_ATTRIBUTES -/// -typedef UINT32 EFI_FV_FILE_ATTRIBUTES; - -// -// Value of EFI_FV_FILE_ATTRIBUTES. -// -#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F -#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100 -#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200 - -/// -/// type of EFI FVB attribute -/// -typedef UINT32 EFI_FVB_ATTRIBUTES_2; - -// -// Attributes bit definitions -// -#define EFI_FVB2_READ_DISABLED_CAP 0x00000001 -#define EFI_FVB2_READ_ENABLED_CAP 0x00000002 -#define EFI_FVB2_READ_STATUS 0x00000004 -#define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008 -#define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010 -#define EFI_FVB2_WRITE_STATUS 0x00000020 -#define EFI_FVB2_LOCK_CAP 0x00000040 -#define EFI_FVB2_LOCK_STATUS 0x00000080 -#define EFI_FVB2_STICKY_WRITE 0x00000200 -#define EFI_FVB2_MEMORY_MAPPED 0x00000400 -#define EFI_FVB2_ERASE_POLARITY 0x00000800 -#define EFI_FVB2_READ_LOCK_CAP 0x00001000 -#define EFI_FVB2_READ_LOCK_STATUS 0x00002000 -#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000 -#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000 -#define EFI_FVB2_ALIGNMENT 0x001F0000 -#define EFI_FVB2_ALIGNMENT_1 0x00000000 -#define EFI_FVB2_ALIGNMENT_2 0x00010000 -#define EFI_FVB2_ALIGNMENT_4 0x00020000 -#define EFI_FVB2_ALIGNMENT_8 0x00030000 -#define EFI_FVB2_ALIGNMENT_16 0x00040000 -#define EFI_FVB2_ALIGNMENT_32 0x00050000 -#define EFI_FVB2_ALIGNMENT_64 0x00060000 -#define EFI_FVB2_ALIGNMENT_128 0x00070000 -#define EFI_FVB2_ALIGNMENT_256 0x00080000 -#define EFI_FVB2_ALIGNMENT_512 0x00090000 -#define EFI_FVB2_ALIGNMENT_1K 0x000A0000 -#define EFI_FVB2_ALIGNMENT_2K 0x000B0000 -#define EFI_FVB2_ALIGNMENT_4K 0x000C0000 -#define EFI_FVB2_ALIGNMENT_8K 0x000D0000 -#define EFI_FVB2_ALIGNMENT_16K 0x000E0000 -#define EFI_FVB2_ALIGNMENT_32K 0x000F0000 -#define EFI_FVB2_ALIGNMENT_64K 0x00100000 -#define EFI_FVB2_ALIGNMENT_128K 0x00110000 -#define EFI_FVB2_ALIGNMENT_256K 0x00120000 -#define EFI_FVB2_ALIGNMNET_512K 0x00130000 -#define EFI_FVB2_ALIGNMENT_1M 0x00140000 -#define EFI_FVB2_ALIGNMENT_2M 0x00150000 -#define EFI_FVB2_ALIGNMENT_4M 0x00160000 -#define EFI_FVB2_ALIGNMENT_8M 0x00170000 -#define EFI_FVB2_ALIGNMENT_16M 0x00180000 -#define EFI_FVB2_ALIGNMENT_32M 0x00190000 -#define EFI_FVB2_ALIGNMENT_64M 0x001A0000 -#define EFI_FVB2_ALIGNMENT_128M 0x001B0000 -#define EFI_FVB2_ALIGNMENT_256M 0x001C0000 -#define EFI_FVB2_ALIGNMENT_512M 0x001D0000 -#define EFI_FVB2_ALIGNMENT_1G 0x001E0000 -#define EFI_FVB2_ALIGNMENT_2G 0x001F0000 - - -typedef struct { - UINT32 NumBlocks; - UINT32 Length; -} EFI_FV_BLOCK_MAP_ENTRY; - -/// -/// Describes the features and layout of the firmware volume. -/// -typedef struct { - UINT8 ZeroVector[16]; - EFI_GUID FileSystemGuid; - UINT64 FvLength; - UINT32 Signature; - EFI_FVB_ATTRIBUTES_2 Attributes; - UINT16 HeaderLength; - UINT16 Checksum; - UINT16 ExtHeaderOffset; - UINT8 Reserved[1]; - UINT8 Revision; - EFI_FV_BLOCK_MAP_ENTRY BlockMap[1]; -} EFI_FIRMWARE_VOLUME_HEADER; - -#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H') - -/// -/// Firmware Volume Header Revision definition -/// -#define EFI_FVH_REVISION 0x02 - -/// -/// Extension header pointed by ExtHeaderOffset of volume header. -/// -typedef struct { - EFI_GUID FvName; - UINT32 ExtHeaderSize; -} EFI_FIRMWARE_VOLUME_EXT_HEADER; - -/// -/// Entry struture for describing FV extension header -/// -typedef struct { - UINT16 ExtEntrySize; - UINT16 ExtEntryType; -} EFI_FIRMWARE_VOLUME_EXT_ENTRY; - -#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01 -/// -/// This extension header provides a mapping between a GUID and an OEM file type. -/// -typedef struct { - EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr; - UINT32 TypeMask; - - // - // Array of GUIDs. - // Each GUID represents an OEM file type. - // - EFI_GUID Types[1]; -} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE; - - -#endif diff --git a/gpxe/src/include/gpxe/efi/Pi/PiHob.h b/gpxe/src/include/gpxe/efi/Pi/PiHob.h deleted file mode 100644 index 0c8df1f2..00000000 --- a/gpxe/src/include/gpxe/efi/Pi/PiHob.h +++ /dev/null @@ -1,295 +0,0 @@ -/** @file - HOB related definitions in PI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - PI Version 1.0 - -**/ - -#ifndef __PI_HOB_H__ -#define __PI_HOB_H__ - -#include <gpxe/efi/ProcessorBind.h> -#include <gpxe/efi/Pi/PiBootMode.h> -#include <gpxe/efi/Uefi/UefiBaseType.h> -#include <gpxe/efi/Uefi/UefiMultiPhase.h> - -// -// HobType of EFI_HOB_GENERIC_HEADER. -// -#define EFI_HOB_TYPE_HANDOFF 0x0001 -#define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002 -#define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003 -#define EFI_HOB_TYPE_GUID_EXTENSION 0x0004 -#define EFI_HOB_TYPE_FV 0x0005 -#define EFI_HOB_TYPE_CPU 0x0006 -#define EFI_HOB_TYPE_MEMORY_POOL 0x0007 -#define EFI_HOB_TYPE_FV2 0x0009 -#define EFI_HOB_TYPE_LOAD_PEIM 0x000A -#define EFI_HOB_TYPE_UNUSED 0xFFFE -#define EFI_HOB_TYPE_END_OF_HOB_LIST 0xFFFF - -/// -/// Describes the format and size of the data inside the HOB. -/// All HOBs must contain this generic HOB header. -/// -typedef struct { - UINT16 HobType; - UINT16 HobLength; - UINT32 Reserved; -} EFI_HOB_GENERIC_HEADER; - - -/// -/// Value of version ofinEFI_HOB_HANDOFF_INFO_TABLE. -/// -#define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009 - -/// -/// Contains general state information used by the HOB producer phase. -/// This HOB must be the first one in the HOB list. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - UINT32 Version; - EFI_BOOT_MODE BootMode; - EFI_PHYSICAL_ADDRESS EfiMemoryTop; - EFI_PHYSICAL_ADDRESS EfiMemoryBottom; - EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop; - EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom; - EFI_PHYSICAL_ADDRESS EfiEndOfHobList; -} EFI_HOB_HANDOFF_INFO_TABLE; - -/// -/// EFI_HOB_MEMORY_ALLOCATION_HEADER describes the -/// various attributes of the logical memory allocation. The type field will be used for -/// subsequent inclusion in the UEFI memory map. -/// -typedef struct { - /// - /// A GUID that defines the memory allocation region's type and purpose, as well as - /// other fields within the memory allocation HOB. This GUID is used to define the - /// additional data within the HOB that may be present for the memory allocation HOB. - /// Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 - /// specification. - /// - EFI_GUID Name; - - /// - /// The base address of memory allocated by this HOB. Type - /// EFI_PHYSICAL_ADDRESS is defined in AllocatePages() in the UEFI 2.0 - /// specification. - /// - EFI_PHYSICAL_ADDRESS MemoryBaseAddress; - - /// - /// The length in bytes of memory allocated by this HOB. - /// - UINT64 MemoryLength; - - /// - /// Defines the type of memory allocated by this HOB. The memory type definition - /// follows the EFI_MEMORY_TYPE definition. Type EFI_MEMORY_TYPE is defined - /// in AllocatePages() in the UEFI 2.0 specification. - /// - EFI_MEMORY_TYPE MemoryType; - - /// - /// Padding for Itanium processor family - /// - UINT8 Reserved[4]; -} EFI_HOB_MEMORY_ALLOCATION_HEADER; - -/// -/// Describes all memory ranges used during the HOB producer -/// phase that exist outside the HOB list. This HOB type -/// describes how memory is used, -/// not the physical attributes of memory. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor; - // - // Additional data pertaining to the "Name" Guid memory - // may go here. - // -} EFI_HOB_MEMORY_ALLOCATION; - - -/// -/// Describes the memory stack that is produced by the HOB producer -/// phase and upon which all postmemory-installed executable -/// content in the HOB producer phase is executing. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor; -} EFI_HOB_MEMORY_ALLOCATION_STACK; - -/// -/// Defines the location of the boot-strap -/// processor (BSP) BSPStore ("Backing Store Pointer Store"). -/// This HOB is valid for the Itanium processor family only -/// register overflow store. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor; -} EFI_HOB_MEMORY_ALLOCATION_BSP_STORE; - -/// -/// Defines the location and entry point of the HOB consumer phase. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader; - EFI_GUID ModuleName; - EFI_PHYSICAL_ADDRESS EntryPoint; -} EFI_HOB_MEMORY_ALLOCATION_MODULE; - -/// -/// Resource type -/// -typedef UINT32 EFI_RESOURCE_TYPE; - -// -// Value of ResourceType in EFI_HOB_RESOURCE_DESCRIPTOR. -// -#define EFI_RESOURCE_SYSTEM_MEMORY 0x00000000 -#define EFI_RESOURCE_MEMORY_MAPPED_IO 0x00000001 -#define EFI_RESOURCE_IO 0x00000002 -#define EFI_RESOURCE_FIRMWARE_DEVICE 0x00000003 -#define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 0x00000004 -#define EFI_RESOURCE_MEMORY_RESERVED 0x00000005 -#define EFI_RESOURCE_IO_RESERVED 0x00000006 -#define EFI_RESOURCE_MAX_MEMORY_TYPE 0x00000007 - -/// -/// type of recount attribute type -/// -typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE; - -// -// These types can be ORed together as needed. -// -// The first three enumerations describe settings -// -#define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001 -#define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002 -#define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004 -// -// The rest of the settings describe capabilities -// -#define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008 -#define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010 -#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020 -#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040 -#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080 -#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100 -#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200 -#define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400 -#define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800 -#define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000 -#define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000 -#define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000 -#define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000 -#define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000 -#define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000 - -/// -/// Describes the resource properties of all fixed, -/// nonrelocatable resource ranges found on the processor -/// host bus during the HOB producer phase. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_GUID Owner; - EFI_RESOURCE_TYPE ResourceType; - EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute; - EFI_PHYSICAL_ADDRESS PhysicalStart; - UINT64 ResourceLength; -} EFI_HOB_RESOURCE_DESCRIPTOR; - -/// -/// Allows writers of executable content in the HOB producer phase to -/// maintain and manage HOBs with specific GUID. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_GUID Name; - - /// - /// Guid specific data goes here - /// -} EFI_HOB_GUID_TYPE; - -/// -/// Details the location of firmware volumes that contain firmware files. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_PHYSICAL_ADDRESS BaseAddress; - UINT64 Length; -} EFI_HOB_FIRMWARE_VOLUME; - -/// -/// Details the location of a firmware volume which was extracted -/// from a file within another firmware volume. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - EFI_PHYSICAL_ADDRESS BaseAddress; - UINT64 Length; - EFI_GUID FvName; - EFI_GUID FileName; -} EFI_HOB_FIRMWARE_VOLUME2; - - -/// -/// Describes processor information, such as address space and I/O space capabilities. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; - UINT8 SizeOfMemorySpace; - UINT8 SizeOfIoSpace; - UINT8 Reserved[6]; -} EFI_HOB_CPU; - - -/// -/// Describes pool memory allocations. -/// -typedef struct { - EFI_HOB_GENERIC_HEADER Header; -} EFI_HOB_MEMORY_POOL; - -/// -/// Union of all the possible HOB Types -/// -typedef union { - EFI_HOB_GENERIC_HEADER *Header; - EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable; - EFI_HOB_MEMORY_ALLOCATION *MemoryAllocation; - EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *MemoryAllocationBspStore; - EFI_HOB_MEMORY_ALLOCATION_STACK *MemoryAllocationStack; - EFI_HOB_MEMORY_ALLOCATION_MODULE *MemoryAllocationModule; - EFI_HOB_RESOURCE_DESCRIPTOR *ResourceDescriptor; - EFI_HOB_GUID_TYPE *Guid; - EFI_HOB_FIRMWARE_VOLUME *FirmwareVolume; - EFI_HOB_FIRMWARE_VOLUME2 *FirmwareVolume2; - EFI_HOB_CPU *Cpu; - EFI_HOB_MEMORY_POOL *Pool; - UINT8 *Raw; -} EFI_PEI_HOB_POINTERS; - - -#endif diff --git a/gpxe/src/include/gpxe/efi/Pi/PiMultiPhase.h b/gpxe/src/include/gpxe/efi/Pi/PiMultiPhase.h deleted file mode 100644 index 3ab6421f..00000000 --- a/gpxe/src/include/gpxe/efi/Pi/PiMultiPhase.h +++ /dev/null @@ -1,104 +0,0 @@ -/** @file - Include file matches things in PI for multiple module types. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - PI Version 1.0 - -**/ - -#ifndef __PI_MULTIPHASE_H__ -#define __PI_MULTIPHASE_H__ - -#include <gpxe/efi/Uefi/UefiMultiPhase.h> - -#include <gpxe/efi/Pi/PiFirmwareVolume.h> -#include <gpxe/efi/Pi/PiFirmwareFile.h> -#include <gpxe/efi/Pi/PiBootMode.h> - -#include <gpxe/efi/Pi/PiHob.h> -#include <gpxe/efi/Pi/PiDependency.h> - - -#define EFI_NOT_AVAILABLE_YET EFIERR (32) - -/// -/// Status Code Type Definition -/// -typedef UINT32 EFI_STATUS_CODE_TYPE; - -// -// A Status Code Type is made up of the code type and severity -// All values masked by EFI_STATUS_CODE_RESERVED_MASK are -// reserved for use by this specification. -// -#define EFI_STATUS_CODE_TYPE_MASK 0x000000FF -#define EFI_STATUS_CODE_SEVERITY_MASK 0xFF000000 -#define EFI_STATUS_CODE_RESERVED_MASK 0x00FFFF00 - -// -// Definition of code types, all other values masked by -// EFI_STATUS_CODE_TYPE_MASK are reserved for use by -// this specification. -// -#define EFI_PROGRESS_CODE 0x00000001 -#define EFI_ERROR_CODE 0x00000002 -#define EFI_DEBUG_CODE 0x00000003 - -// -// Definitions of severities, all other values masked by -// EFI_STATUS_CODE_SEVERITY_MASK are reserved for use by -// this specification. -// Uncontained errors are major errors that could not contained -// to the specific component that is reporting the error -// For example, if a memory error was not detected early enough, -// the bad data could be consumed by other drivers. -// -#define EFI_ERROR_MINOR 0x40000000 -#define EFI_ERROR_MAJOR 0x80000000 -#define EFI_ERROR_UNRECOVERED 0x90000000 -#define EFI_ERROR_UNCONTAINED 0xa0000000 - -/// -/// Status Code Value Definition -/// -typedef UINT32 EFI_STATUS_CODE_VALUE; - -// -// A Status Code Value is made up of the class, subclass, and -// an operation. -// -#define EFI_STATUS_CODE_CLASS_MASK 0xFF000000 -#define EFI_STATUS_CODE_SUBCLASS_MASK 0x00FF0000 -#define EFI_STATUS_CODE_OPERATION_MASK 0x0000FFFF - -/// -/// Definition of Status Code extended data header. -/// The data will follow HeaderSize bytes from the beginning of -/// the structure and is Size bytes long. -/// -typedef struct { - UINT16 HeaderSize; - UINT16 Size; - EFI_GUID Type; -} EFI_STATUS_CODE_DATA; - - -// -// Bit values for Authentication Status -// -#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01 -#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02 -#define EFI_AUTH_STATUS_NOT_TESTED 0x04 -#define EFI_AUTH_STATUS_TEST_FAILED 0x08 -#define EFI_AUTH_STATUS_ALL 0x0f - -#endif diff --git a/gpxe/src/include/gpxe/efi/PiDxe.h b/gpxe/src/include/gpxe/efi/PiDxe.h deleted file mode 100644 index c3263029..00000000 --- a/gpxe/src/include/gpxe/efi/PiDxe.h +++ /dev/null @@ -1,25 +0,0 @@ -/** @file - - Root include file for Mde Package DXE_CORE, DXE, SMM, SAL type modules. - -Copyright (c) 2006 - 2007, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __PI_DXE_H__ -#define __PI_DXE_H__ - -#include <gpxe/efi/Uefi/UefiBaseType.h> -#include <gpxe/efi/Uefi/UefiSpec.h> - -#include <gpxe/efi/Pi/PiDxeCis.h> - -#endif - diff --git a/gpxe/src/include/gpxe/efi/ProcessorBind.h b/gpxe/src/include/gpxe/efi/ProcessorBind.h deleted file mode 100644 index 3dbaf1b8..00000000 --- a/gpxe/src/include/gpxe/efi/ProcessorBind.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * EFI header files rely on having the CPU architecture directory - * present in the search path in order to pick up ProcessorBind.h. We - * use this header file as a quick indirection layer. - * - mcb30 - */ - -#if __i386__ -#include <gpxe/efi/Ia32/ProcessorBind.h> -#endif - -#if __x86_64__ -#include <gpxe/efi/X64/ProcessorBind.h> -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/ComponentName2.h b/gpxe/src/include/gpxe/efi/Protocol/ComponentName2.h deleted file mode 100644 index 0f010142..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/ComponentName2.h +++ /dev/null @@ -1,174 +0,0 @@ -/** @file - UEFI Component Name 2 Protocol as defined in the UEFI 2.1 specification. - This protocol is used to retrieve user readable names of drivers - and controllers managed by UEFI Drivers. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __EFI_COMPONENT_NAME2_H__ -#define __EFI_COMPONENT_NAME2_H__ - -/// -/// Global ID for the Component Name Protocol -/// -#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ - {0x6a7a5cff, 0xe8d9, 0x4f70, { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } } - -typedef struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL; - - -/** - Retrieves a Unicode string that is the user readable name of - the EFI Driver. - - @param This A pointer to the - EFI_COMPONENT_NAME2_PROTOCOL instance. - - @param Language A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the caller - is requesting, and it must match one of the - languages specified in SupportedLanguages. - The number of languages supported by a - driver is up to the driver writer. Language - is specified in RFC 3066 language code - format. - - @param DriverName A pointer to the Unicode string to return. - This Unicode string is the name of the - driver specified by This in the language - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the - Driver specified by This and the - language specified by Language - was returned in DriverName. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER DriverName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This - does not support the language - specified by Language. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME)( - IN EFI_COMPONENT_NAME2_PROTOCOL *This, - IN CHAR8 *Language, - OUT CHAR16 **DriverName - ); - - -/** - Retrieves a Unicode string that is the user readable name of - the controller that is being managed by an EFI Driver. - - @param This A pointer to the - EFI_COMPONENT_NAME2_PROTOCOL instance. - - @param ControllerHandle The handle of a controller that the - driver specified by This is managing. - This handle specifies the controller - whose name is to be returned. - - @param ChildHandle The handle of the child controller to - retrieve the name of. 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 retrieve the - name of the bus controller. It will - not be NULL for a bus driver that - wishes to retrieve the name of a - child controller. - - @param Language A pointer to a Null-terminated ASCII - string array indicating the language. - This is the language of the driver - name that the caller is requesting, - and it must match one of the - languages specified in - SupportedLanguages. The number of - languages supported by a driver is up - to the driver writer. Language is - specified in RFC 3066 language code - format. - - @param ControllerName A pointer to the Unicode string to - return. This Unicode string is the - name of the controller specified by - ControllerHandle and ChildHandle in - the language specified by Language - from the point of view of the driver - specified by This. - - @retval EFI_SUCCESS The Unicode string for the user - readable name in the language - specified by Language for the - driver specified by This was - returned in DriverName. - - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid - EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it - is not a valid EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER ControllerName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This is - not currently managing the - controller specified by - ControllerHandle and - ChildHandle. - - @retval EFI_UNSUPPORTED The driver specified by This - does not support the language - specified by Language. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)( - IN EFI_COMPONENT_NAME2_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle OPTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ); - -/// -/// This protocol is used to retrieve user readable names of drivers -/// and controllers managed by UEFI Drivers. -/// -struct _EFI_COMPONENT_NAME2_PROTOCOL { - EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName; - EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName; - - /// - /// A Null-terminated ASCII string array that contains one or more - /// supported language codes. This is the list of language codes that - /// this protocol supports. The number of languages supported by a - /// driver is up to the driver writer. SupportedLanguages is - /// specified in RFC 3066 format. - /// - CHAR8 *SupportedLanguages; -}; - -extern EFI_GUID gEfiComponentName2ProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/Cpu.h b/gpxe/src/include/gpxe/efi/Protocol/Cpu.h deleted file mode 100644 index da3d0fda..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/Cpu.h +++ /dev/null @@ -1,291 +0,0 @@ -/** @file - CPU Architectural Protocol as defined in PI spec Volume 2 DXE - - This code abstracts the DXE core from processor implementation details. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __ARCH_PROTOCOL_CPU_H__ -#define __ARCH_PROTOCOL_CPU_H__ - -#include <gpxe/efi/Protocol/DebugSupport.h> - -#define EFI_CPU_ARCH_PROTOCOL_GUID \ - { 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } - -typedef struct _EFI_CPU_ARCH_PROTOCOL EFI_CPU_ARCH_PROTOCOL; - -typedef enum { - EfiCpuFlushTypeWriteBackInvalidate, - EfiCpuFlushTypeWriteBack, - EfiCpuFlushTypeInvalidate, - EfiCpuMaxFlushType -} EFI_CPU_FLUSH_TYPE; - -typedef enum { - EfiCpuInit, - EfiCpuMaxInitType -} EFI_CPU_INIT_TYPE; - -/** - EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs. - - @param InterruptType Defines the type of interrupt or exception that - occurred on the processor.This parameter is processor architecture specific. - @param SystemContext A pointer to the processor context when - the interrupt occurred on the processor. - - @return None - -**/ -typedef -VOID -(EFIAPI *EFI_CPU_INTERRUPT_HANDLER)( - IN CONST EFI_EXCEPTION_TYPE InterruptType, - IN CONST EFI_SYSTEM_CONTEXT SystemContext - ); - -/** - This function flushes the range of addresses from Start to Start+Length - from the processor's data cache. If Start is not aligned to a cache line - boundary, then the bytes before Start to the preceding cache line boundary - are also flushed. If Start+Length is not aligned to a cache line boundary, - then the bytes past Start+Length to the end of the next cache line boundary - are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be - supported. If the data cache is fully coherent with all DMA operations, then - this function can just return EFI_SUCCESS. If the processor does not support - flushing a range of the data cache, then the entire data cache can be flushed. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - @param Start The beginning physical address to flush from the processor's data - cache. - @param Length The number of bytes to flush from the processor's data cache. This - function may flush more bytes than Length specifies depending upon - the granularity of the flush operation that the processor supports. - @param FlushType Specifies the type of flush operation to perform. - - @retval EFI_SUCCESS The address range from Start to Start+Length was flushed from - the processor's data cache. - @retval EFI_UNSUPPORTEDT The processor does not support the cache flush type specified - by FlushType. - @retval EFI_DEVICE_ERROR The address range from Start to Start+Length could not be flushed - from the processor's data cache. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_FLUSH_DATA_CACHE)( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_PHYSICAL_ADDRESS Start, - IN UINT64 Length, - IN EFI_CPU_FLUSH_TYPE FlushType - ); - - -/** - This function enables interrupt processing by the processor. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - - @retval EFI_SUCCESS Interrupts are enabled on the processor. - @retval EFI_DEVICE_ERROR Interrupts could not be enabled on the processor. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_ENABLE_INTERRUPT)( - IN EFI_CPU_ARCH_PROTOCOL *This - ); - - -/** - This function disables interrupt processing by the processor. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - - @retval EFI_SUCCESS Interrupts are disabled on the processor. - @retval EFI_DEVICE_ERROR Interrupts could not be disabled on the processor. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_DISABLE_INTERRUPT)( - IN EFI_CPU_ARCH_PROTOCOL *This - ); - - -/** - This function retrieves the processor's current interrupt state a returns it in - State. If interrupts are currently enabled, then TRUE is returned. If interrupts - are currently disabled, then FALSE is returned. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - @param State A pointer to the processor's current interrupt state. Set to TRUE if - interrupts are enabled and FALSE if interrupts are disabled. - - @retval EFI_SUCCESS The processor's current interrupt state was returned in State. - @retval EFI_INVALID_PARAMETER State is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_GET_INTERRUPT_STATE)( - IN EFI_CPU_ARCH_PROTOCOL *This, - OUT BOOLEAN *State - ); - - -/** - This function generates an INIT on the processor. If this function succeeds, then the - processor will be reset, and control will not be returned to the caller. If InitType is - not supported by this processor, or the processor cannot programmatically generate an - INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error - occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - @param InitType The type of processor INIT to perform. - - @retval EFI_SUCCESS The processor INIT was performed. This return code should never be seen. - @retval EFI_UNSUPPORTED The processor INIT operation specified by InitType is not supported - by this processor. - @retval EFI_DEVICE_ERROR The processor INIT failed. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_INIT)( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_CPU_INIT_TYPE InitType - ); - - -/** - This function registers and enables the handler specified by InterruptHandler for a processor - interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the - handler for the processor interrupt or exception type specified by InterruptType is uninstalled. - The installed handler is called once for each processor interrupt or exception. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - @param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts - are enabled and FALSE if interrupts are disabled. - @param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called - when a processor interrupt occurs. If this parameter is NULL, then the handler - will be uninstalled. - - @retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled. - @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was - previously installed. - @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not - previously installed. - @retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER)( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_EXCEPTION_TYPE InterruptType, - IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler - ); - - -/** - This function reads the processor timer specified by TimerIndex and returns it in TimerValue. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - @param TimerIndex Specifies which processor timer is to be returned in TimerValue. This parameter - must be between 0 and NumberOfTimers-1. - @param TimerValue Pointer to the returned timer value. - @param TimerPeriod A pointer to the amount of time that passes in femtoseconds for each increment - of TimerValue. - - @retval EFI_SUCCESS The processor timer value specified by TimerIndex was returned in TimerValue. - @retval EFI_DEVICE_ERROR An error occurred attempting to read one of the processor's timers. - @retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid. - @retval EFI_UNSUPPORTED The processor does not have any readable timers. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_GET_TIMER_VALUE)( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN UINT32 TimerIndex, - OUT UINT64 *TimerValue, - OUT UINT64 *TimerPeriod OPTIONAL - ); - - -/** - This function modifies the attributes for the memory region specified by BaseAddress and - Length from their current attributes to the attributes specified by Attributes. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - @param BaseAddress The physical address that is the start address of a memory region. - @param Length The size in bytes of the memory region. - @param Attributes The bit mask of attributes to set for the memory region. - - @retval EFI_SUCCESS The attributes were set for the memory region. - @retval EFI_ACCESS_DENIED The attributes for the memory resource range specified by - BaseAddress and Length cannot be modified. - @retval EFI_INVALID_PARAMETER Length is zero. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of - the memory resource range. - @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory - resource range specified by BaseAddress and Length. - The bit mask of attributes is not support for the memory resource - range specified by BaseAddress and Length. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES)( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN UINT64 Attributes - ); - - -/// -/// The EFI_CPU_ARCH_PROTOCOL is used to abstract processor-specific functions from the DXE -/// Foundation. This includes flushing caches, enabling and disabling interrupts, hooking interrupt -/// vectors and exception vectors, reading internal processor timers, resetting the processor, and -/// determining the processor frequency. -/// -struct _EFI_CPU_ARCH_PROTOCOL { - EFI_CPU_FLUSH_DATA_CACHE FlushDataCache; - EFI_CPU_ENABLE_INTERRUPT EnableInterrupt; - EFI_CPU_DISABLE_INTERRUPT DisableInterrupt; - EFI_CPU_GET_INTERRUPT_STATE GetInterruptState; - EFI_CPU_INIT Init; - EFI_CPU_REGISTER_INTERRUPT_HANDLER RegisterInterruptHandler; - EFI_CPU_GET_TIMER_VALUE GetTimerValue; - EFI_CPU_SET_MEMORY_ATTRIBUTES SetMemoryAttributes; - /// - /// The number of timers that are available in a processor. The value in this - /// field is a constant that must not be modified after the CPU Architectural - /// Protocol is installed. All consumers must treat this as a read-only field. - /// - UINT32 NumberOfTimers; - /// - /// The size, in bytes, of the alignment required for DMA buffer allocations. - /// This is typically the size of the largest data cache line in the platform. - /// The value in this field is a constant that must not be modified after the - /// CPU Architectural Protocol is installed. All consumers must treat this as - /// a read-only field. - /// - UINT32 DmaBufferAlignment; -}; - -extern EFI_GUID gEfiCpuArchProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/CpuIo.h b/gpxe/src/include/gpxe/efi/Protocol/CpuIo.h deleted file mode 100644 index 8d35c6cd..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/CpuIo.h +++ /dev/null @@ -1,128 +0,0 @@ -/** @file - This code abstracts the CPU IO Protocol which installed by some platform or chipset-specific - PEIM that abstracts the processor-visible I/O operations. - - Copyright (c) 2007, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - Module Name: CpuIO.h - - @par Revision Reference: - CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec - Version 0.9 - -**/ - -#ifndef _CPUIO_H_ -#define _CPUIO_H_ - -#include <gpxe/efi/PiDxe.h> - -#define EFI_CPU_IO_PROTOCOL_GUID \ - { \ - 0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \ - } - -typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL; - -// -// ******************************************************* -// EFI_CPU_IO_PROTOCOL_WIDTH -// ******************************************************* -// -typedef enum { - EfiCpuIoWidthUint8, - EfiCpuIoWidthUint16, - EfiCpuIoWidthUint32, - EfiCpuIoWidthUint64, - EfiCpuIoWidthFifoUint8, - EfiCpuIoWidthFifoUint16, - EfiCpuIoWidthFifoUint32, - EfiCpuIoWidthFifoUint64, - EfiCpuIoWidthFillUint8, - EfiCpuIoWidthFillUint16, - EfiCpuIoWidthFillUint32, - EfiCpuIoWidthFillUint64, - EfiCpuIoWidthMaximum -} EFI_CPU_IO_PROTOCOL_WIDTH; - -// -// ******************************************************* -// EFI_CPU_IO_PROTOCOL_IO_MEM -// ******************************************************* -// -/** - Enables a driver to access memory-mapped registers in the EFI system memory space. - Or, Enables a driver to access registers in the EFI CPU I/O space. - - @param This A pointer to the EFI_CPU_IO_PROTOCOL instance. - @param Width Signifies the width of the I/O or Memory operation. - @param Address The base address of the I/O or Memoryoperation. - @param Count The number of I/O or Memory operations to perform. - The number of bytes moved is Width size * Count, starting at Address. - @param Buffer For read operations, the destination buffer to store the results. - For write operations, the source buffer from which to write data. - - @retval EFI_SUCCESS The data was read from or written to the EFI system. - @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL. - @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. - Or,The address range specified by Address, Width, and Count is not valid for this EFI system. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM)( - IN EFI_CPU_IO_PROTOCOL *This, - IN EFI_CPU_IO_PROTOCOL_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - IN OUT VOID *Buffer - ); - -// -// ******************************************************* -// EFI_CPU_IO_PROTOCOL_ACCESS -// ******************************************************* -// -typedef struct { - EFI_CPU_IO_PROTOCOL_IO_MEM Read; - EFI_CPU_IO_PROTOCOL_IO_MEM Write; -} EFI_CPU_IO_PROTOCOL_ACCESS; - -// -// ******************************************************* -// EFI_CPU_IO_PROTOCOL -// ******************************************************* -// -/** - @par Protocol Description: - Provides the basic memory and I/O interfaces that are used to abstract - accesses to devices in a system. - - @param Mem.Read - Allows reads from memory-mapped I/O space. - - @param Mem.Write - Allows writes to memory-mapped I/O space. - - @param Io.Read - Allows reads from I/O space. - - @param Io.Write - Allows writes to I/O space. - -**/ -struct _EFI_CPU_IO_PROTOCOL { - EFI_CPU_IO_PROTOCOL_ACCESS Mem; - EFI_CPU_IO_PROTOCOL_ACCESS Io; -}; - -extern EFI_GUID gEfiCpuIoProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/DebugSupport.h b/gpxe/src/include/gpxe/efi/Protocol/DebugSupport.h deleted file mode 100644 index c8db2498..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/DebugSupport.h +++ /dev/null @@ -1,634 +0,0 @@ -/** @file - DebugSupport protocol and supporting definitions as defined in the UEFI2.0 - specification. - - The DebugSupport protocol is used by source level debuggers to abstract the - processor and handle context save and restore operations. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __DEBUG_SUPPORT_H__ -#define __DEBUG_SUPPORT_H__ - -#include <gpxe/efi/ProcessorBind.h> -#include <gpxe/efi/IndustryStandard/PeImage.h> - -typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL; - -/// -/// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25} -/// -#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \ - { \ - 0x2755590C, 0x6F3C, 0x42FA, {0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \ - } - -/// -/// Debug Support definitions -/// -typedef INTN EFI_EXCEPTION_TYPE; - -// -// IA-32 processor exception types -// -#define EXCEPT_IA32_DIVIDE_ERROR 0 -#define EXCEPT_IA32_DEBUG 1 -#define EXCEPT_IA32_NMI 2 -#define EXCEPT_IA32_BREAKPOINT 3 -#define EXCEPT_IA32_OVERFLOW 4 -#define EXCEPT_IA32_BOUND 5 -#define EXCEPT_IA32_INVALID_OPCODE 6 -#define EXCEPT_IA32_DOUBLE_FAULT 8 -#define EXCEPT_IA32_INVALID_TSS 10 -#define EXCEPT_IA32_SEG_NOT_PRESENT 11 -#define EXCEPT_IA32_STACK_FAULT 12 -#define EXCEPT_IA32_GP_FAULT 13 -#define EXCEPT_IA32_PAGE_FAULT 14 -#define EXCEPT_IA32_FP_ERROR 16 -#define EXCEPT_IA32_ALIGNMENT_CHECK 17 -#define EXCEPT_IA32_MACHINE_CHECK 18 -#define EXCEPT_IA32_SIMD 19 - -/// -/// IA-32 processor context definition -/// -/// -/// FXSAVE_STATE -/// FP / MMX / XMM registers (see fxrstor instruction definition) -/// -typedef struct { - UINT16 Fcw; - UINT16 Fsw; - UINT16 Ftw; - UINT16 Opcode; - UINT32 Eip; - UINT16 Cs; - UINT16 Reserved1; - UINT32 DataOffset; - UINT16 Ds; - UINT8 Reserved2[10]; - UINT8 St0Mm0[10], Reserved3[6]; - UINT8 St1Mm1[10], Reserved4[6]; - UINT8 St2Mm2[10], Reserved5[6]; - UINT8 St3Mm3[10], Reserved6[6]; - UINT8 St4Mm4[10], Reserved7[6]; - UINT8 St5Mm5[10], Reserved8[6]; - UINT8 St6Mm6[10], Reserved9[6]; - UINT8 St7Mm7[10], Reserved10[6]; - UINT8 Xmm0[16]; - UINT8 Xmm1[16]; - UINT8 Xmm2[16]; - UINT8 Xmm3[16]; - UINT8 Xmm4[16]; - UINT8 Xmm5[16]; - UINT8 Xmm6[16]; - UINT8 Xmm7[16]; - UINT8 Reserved11[14 * 16]; -} EFI_FX_SAVE_STATE_IA32; - -typedef struct { - UINT32 ExceptionData; - EFI_FX_SAVE_STATE_IA32 FxSaveState; - UINT32 Dr0; - UINT32 Dr1; - UINT32 Dr2; - UINT32 Dr3; - UINT32 Dr6; - UINT32 Dr7; - UINT32 Cr0; - UINT32 Cr1; /* Reserved */ - UINT32 Cr2; - UINT32 Cr3; - UINT32 Cr4; - UINT32 Eflags; - UINT32 Ldtr; - UINT32 Tr; - UINT32 Gdtr[2]; - UINT32 Idtr[2]; - UINT32 Eip; - UINT32 Gs; - UINT32 Fs; - UINT32 Es; - UINT32 Ds; - UINT32 Cs; - UINT32 Ss; - UINT32 Edi; - UINT32 Esi; - UINT32 Ebp; - UINT32 Esp; - UINT32 Ebx; - UINT32 Edx; - UINT32 Ecx; - UINT32 Eax; -} EFI_SYSTEM_CONTEXT_IA32; - -// -// X64 processor exception types -// -#define EXCEPT_X64_DIVIDE_ERROR 0 -#define EXCEPT_X64_DEBUG 1 -#define EXCEPT_X64_NMI 2 -#define EXCEPT_X64_BREAKPOINT 3 -#define EXCEPT_X64_OVERFLOW 4 -#define EXCEPT_X64_BOUND 5 -#define EXCEPT_X64_INVALID_OPCODE 6 -#define EXCEPT_X64_DOUBLE_FAULT 8 -#define EXCEPT_X64_INVALID_TSS 10 -#define EXCEPT_X64_SEG_NOT_PRESENT 11 -#define EXCEPT_X64_STACK_FAULT 12 -#define EXCEPT_X64_GP_FAULT 13 -#define EXCEPT_X64_PAGE_FAULT 14 -#define EXCEPT_X64_FP_ERROR 16 -#define EXCEPT_X64_ALIGNMENT_CHECK 17 -#define EXCEPT_X64_MACHINE_CHECK 18 -#define EXCEPT_X64_SIMD 19 - -/// -/// X64 processor context definition -/// -/// FXSAVE_STATE -/// FP / MMX / XMM registers (see fxrstor instruction definition) -/// -typedef struct { - UINT16 Fcw; - UINT16 Fsw; - UINT16 Ftw; - UINT16 Opcode; - UINT64 Rip; - UINT64 DataOffset; - UINT8 Reserved1[8]; - UINT8 St0Mm0[10], Reserved2[6]; - UINT8 St1Mm1[10], Reserved3[6]; - UINT8 St2Mm2[10], Reserved4[6]; - UINT8 St3Mm3[10], Reserved5[6]; - UINT8 St4Mm4[10], Reserved6[6]; - UINT8 St5Mm5[10], Reserved7[6]; - UINT8 St6Mm6[10], Reserved8[6]; - UINT8 St7Mm7[10], Reserved9[6]; - UINT8 Xmm0[16]; - UINT8 Xmm1[16]; - UINT8 Xmm2[16]; - UINT8 Xmm3[16]; - UINT8 Xmm4[16]; - UINT8 Xmm5[16]; - UINT8 Xmm6[16]; - UINT8 Xmm7[16]; - // - // NOTE: UEFI 2.0 spec definition as follows. - // - UINT8 Reserved11[14 * 16]; -} EFI_FX_SAVE_STATE_X64; - -typedef struct { - UINT64 ExceptionData; - EFI_FX_SAVE_STATE_X64 FxSaveState; - UINT64 Dr0; - UINT64 Dr1; - UINT64 Dr2; - UINT64 Dr3; - UINT64 Dr6; - UINT64 Dr7; - UINT64 Cr0; - UINT64 Cr1; /* Reserved */ - UINT64 Cr2; - UINT64 Cr3; - UINT64 Cr4; - UINT64 Cr8; - UINT64 Rflags; - UINT64 Ldtr; - UINT64 Tr; - UINT64 Gdtr[2]; - UINT64 Idtr[2]; - UINT64 Rip; - UINT64 Gs; - UINT64 Fs; - UINT64 Es; - UINT64 Ds; - UINT64 Cs; - UINT64 Ss; - UINT64 Rdi; - UINT64 Rsi; - UINT64 Rbp; - UINT64 Rsp; - UINT64 Rbx; - UINT64 Rdx; - UINT64 Rcx; - UINT64 Rax; - UINT64 R8; - UINT64 R9; - UINT64 R10; - UINT64 R11; - UINT64 R12; - UINT64 R13; - UINT64 R14; - UINT64 R15; -} EFI_SYSTEM_CONTEXT_X64; - -// -// IPF processor exception types -// -#define EXCEPT_IPF_VHTP_TRANSLATION 0 -#define EXCEPT_IPF_INSTRUCTION_TLB 1 -#define EXCEPT_IPF_DATA_TLB 2 -#define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3 -#define EXCEPT_IPF_ALT_DATA_TLB 4 -#define EXCEPT_IPF_DATA_NESTED_TLB 5 -#define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6 -#define EXCEPT_IPF_DATA_KEY_MISSED 7 -#define EXCEPT_IPF_DIRTY_BIT 8 -#define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9 -#define EXCEPT_IPF_DATA_ACCESS_BIT 10 -#define EXCEPT_IPF_BREAKPOINT 11 -#define EXCEPT_IPF_EXTERNAL_INTERRUPT 12 -// -// 13 - 19 reserved -// -#define EXCEPT_IPF_PAGE_NOT_PRESENT 20 -#define EXCEPT_IPF_KEY_PERMISSION 21 -#define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22 -#define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23 -#define EXCEPT_IPF_GENERAL_EXCEPTION 24 -#define EXCEPT_IPF_DISABLED_FP_REGISTER 25 -#define EXCEPT_IPF_NAT_CONSUMPTION 26 -#define EXCEPT_IPF_SPECULATION 27 -// -// 28 reserved -// -#define EXCEPT_IPF_DEBUG 29 -#define EXCEPT_IPF_UNALIGNED_REFERENCE 30 -#define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31 -#define EXCEPT_IPF_FP_FAULT 32 -#define EXCEPT_IPF_FP_TRAP 33 -#define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34 -#define EXCEPT_IPF_TAKEN_BRANCH 35 -#define EXCEPT_IPF_SINGLE_STEP 36 -// -// 37 - 44 reserved -// -#define EXCEPT_IPF_IA32_EXCEPTION 45 -#define EXCEPT_IPF_IA32_INTERCEPT 46 -#define EXCEPT_IPF_IA32_INTERRUPT 47 - -/// -/// IPF processor context definition -/// -typedef struct { - // - // The first reserved field is necessary to preserve alignment for the correct - // bits in UNAT and to insure F2 is 16 byte aligned.. - // - UINT64 Reserved; - UINT64 R1; - UINT64 R2; - UINT64 R3; - UINT64 R4; - UINT64 R5; - UINT64 R6; - UINT64 R7; - UINT64 R8; - UINT64 R9; - UINT64 R10; - UINT64 R11; - UINT64 R12; - UINT64 R13; - UINT64 R14; - UINT64 R15; - UINT64 R16; - UINT64 R17; - UINT64 R18; - UINT64 R19; - UINT64 R20; - UINT64 R21; - UINT64 R22; - UINT64 R23; - UINT64 R24; - UINT64 R25; - UINT64 R26; - UINT64 R27; - UINT64 R28; - UINT64 R29; - UINT64 R30; - UINT64 R31; - - UINT64 F2[2]; - UINT64 F3[2]; - UINT64 F4[2]; - UINT64 F5[2]; - UINT64 F6[2]; - UINT64 F7[2]; - UINT64 F8[2]; - UINT64 F9[2]; - UINT64 F10[2]; - UINT64 F11[2]; - UINT64 F12[2]; - UINT64 F13[2]; - UINT64 F14[2]; - UINT64 F15[2]; - UINT64 F16[2]; - UINT64 F17[2]; - UINT64 F18[2]; - UINT64 F19[2]; - UINT64 F20[2]; - UINT64 F21[2]; - UINT64 F22[2]; - UINT64 F23[2]; - UINT64 F24[2]; - UINT64 F25[2]; - UINT64 F26[2]; - UINT64 F27[2]; - UINT64 F28[2]; - UINT64 F29[2]; - UINT64 F30[2]; - UINT64 F31[2]; - - UINT64 Pr; - - UINT64 B0; - UINT64 B1; - UINT64 B2; - UINT64 B3; - UINT64 B4; - UINT64 B5; - UINT64 B6; - UINT64 B7; - - // - // application registers - // - UINT64 ArRsc; - UINT64 ArBsp; - UINT64 ArBspstore; - UINT64 ArRnat; - - UINT64 ArFcr; - - UINT64 ArEflag; - UINT64 ArCsd; - UINT64 ArSsd; - UINT64 ArCflg; - UINT64 ArFsr; - UINT64 ArFir; - UINT64 ArFdr; - - UINT64 ArCcv; - - UINT64 ArUnat; - - UINT64 ArFpsr; - - UINT64 ArPfs; - UINT64 ArLc; - UINT64 ArEc; - - // - // control registers - // - UINT64 CrDcr; - UINT64 CrItm; - UINT64 CrIva; - UINT64 CrPta; - UINT64 CrIpsr; - UINT64 CrIsr; - UINT64 CrIip; - UINT64 CrIfa; - UINT64 CrItir; - UINT64 CrIipa; - UINT64 CrIfs; - UINT64 CrIim; - UINT64 CrIha; - - // - // debug registers - // - UINT64 Dbr0; - UINT64 Dbr1; - UINT64 Dbr2; - UINT64 Dbr3; - UINT64 Dbr4; - UINT64 Dbr5; - UINT64 Dbr6; - UINT64 Dbr7; - - UINT64 Ibr0; - UINT64 Ibr1; - UINT64 Ibr2; - UINT64 Ibr3; - UINT64 Ibr4; - UINT64 Ibr5; - UINT64 Ibr6; - UINT64 Ibr7; - - // - // virtual registers - nat bits for R1-R31 - // - UINT64 IntNat; - -} EFI_SYSTEM_CONTEXT_IPF; - -// -// EBC processor exception types -// -#define EXCEPT_EBC_UNDEFINED 0 -#define EXCEPT_EBC_DIVIDE_ERROR 1 -#define EXCEPT_EBC_DEBUG 2 -#define EXCEPT_EBC_BREAKPOINT 3 -#define EXCEPT_EBC_OVERFLOW 4 -#define EXCEPT_EBC_INVALID_OPCODE 5 // opcode out of range -#define EXCEPT_EBC_STACK_FAULT 6 -#define EXCEPT_EBC_ALIGNMENT_CHECK 7 -#define EXCEPT_EBC_INSTRUCTION_ENCODING 8 // malformed instruction -#define EXCEPT_EBC_BAD_BREAK 9 // BREAK 0 or undefined BREAK -#define EXCEPT_EBC_STEP 10 // to support debug stepping -/// -/// For coding convenience, define the maximum valid EBC exception. -/// -#define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP - -/// -/// EBC processor context definition -/// -typedef struct { - UINT64 R0; - UINT64 R1; - UINT64 R2; - UINT64 R3; - UINT64 R4; - UINT64 R5; - UINT64 R6; - UINT64 R7; - UINT64 Flags; - UINT64 ControlFlags; - UINT64 Ip; -} EFI_SYSTEM_CONTEXT_EBC; - -/// -/// Universal EFI_SYSTEM_CONTEXT definition -/// -typedef union { - EFI_SYSTEM_CONTEXT_EBC *SystemContextEbc; - EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32; - EFI_SYSTEM_CONTEXT_X64 *SystemContextX64; - EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf; -} EFI_SYSTEM_CONTEXT; - -// -// DebugSupport callback function prototypes -// - -/** - Registers and enables an exception callback function for the specified exception. - - @param ExceptionType Exception types in EBC, IA-32, X64, or IPF - @param SystemContext Exception content. - -**/ -typedef -VOID -(*EFI_EXCEPTION_CALLBACK)( - IN EFI_EXCEPTION_TYPE ExceptionType, - IN OUT EFI_SYSTEM_CONTEXT SystemContext - ); - -/** - Registers and enables the on-target debug agent's periodic entry point. - - @param SystemContext Exception content. - -**/ -typedef -VOID -(*EFI_PERIODIC_CALLBACK)( - IN OUT EFI_SYSTEM_CONTEXT SystemContext - ); - -/// -/// Machine type definition -/// -typedef enum { - IsaIa32 = IMAGE_FILE_MACHINE_I386, ///< 0x014C - IsaX64 = IMAGE_FILE_MACHINE_X64, ///< 0x8664 - IsaIpf = IMAGE_FILE_MACHINE_IA64, ///< 0x0200 - IsaEbc = IMAGE_FILE_MACHINE_EBC ///< 0x0EBC -} EFI_INSTRUCTION_SET_ARCHITECTURE; - - -// -// DebugSupport member function definitions -// - -/** - Returns the maximum value that may be used for the ProcessorIndex parameter in - RegisterPeriodicCallback() and RegisterExceptionCallback(). - - @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. - @param MaxProcessorIndex Pointer to a caller-allocated UINTN in which the maximum supported - processor index is returned. - - @retval EFI_SUCCESS The function completed successfully. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX)( - IN EFI_DEBUG_SUPPORT_PROTOCOL *This, - OUT UINTN *MaxProcessorIndex - ); - -/** - Registers a function to be called back periodically in interrupt context. - - @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. - @param ProcessorIndex Specifies which processor the callback function applies to. - @param PeriodicCallback A pointer to a function of type PERIODIC_CALLBACK that is the main - periodic entry point of the debug agent. - - @retval EFI_SUCCESS The function completed successfully. - @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback - function was previously registered. - @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback - function. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK)( - IN EFI_DEBUG_SUPPORT_PROTOCOL *This, - IN UINTN ProcessorIndex, - IN EFI_PERIODIC_CALLBACK PeriodicCallback - ); - -/** - Registers a function to be called when a given processor exception occurs. - - @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. - @param ProcessorIndex Specifies which processor the callback function applies to. - @param PeriodicCallback A pointer to a function of type EXCEPTION_CALLBACK that is called - when the processor exception specified by ExceptionType occurs. - @param ExceptionType Specifies which processor exception to hook. - - @retval EFI_SUCCESS The function completed successfully. - @retval EFI_ALREADY_STARTED Non-NULL PeriodicCallback parameter when a callback - function was previously registered. - @retval EFI_OUT_OF_RESOURCES System has insufficient memory resources to register new callback - function. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK)( - IN EFI_DEBUG_SUPPORT_PROTOCOL *This, - IN UINTN ProcessorIndex, - IN EFI_EXCEPTION_CALLBACK ExceptionCallback, - IN EFI_EXCEPTION_TYPE ExceptionType - ); - -/** - Invalidates processor instruction cache for a memory range. Subsequent execution in this range - causes a fresh memory fetch to retrieve code to be executed. - - @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. - @param ProcessorIndex Specifies which processor's instruction cache is to be invalidated. - @param Start Specifies the physical base of the memory range to be invalidated. - @param Length Specifies the minimum number of bytes in the processor's instruction - cache to invalidate. - - @retval EFI_SUCCESS The function completed successfully. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE)( - IN EFI_DEBUG_SUPPORT_PROTOCOL *This, - IN UINTN ProcessorIndex, - IN VOID *Start, - IN UINT64 Length - ); - -/// -/// This protocol provides the services to allow the debug agent to register -/// callback functions that are called either periodically or when specific -/// processor exceptions occur. -/// -struct _EFI_DEBUG_SUPPORT_PROTOCOL { - /// - /// Declares the processor architecture for this instance of the EFI Debug Support protocol. - /// - EFI_INSTRUCTION_SET_ARCHITECTURE Isa; - EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex; - EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback; - EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback; - EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache; -}; - -extern EFI_GUID gEfiDebugSupportProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/DevicePath.h b/gpxe/src/include/gpxe/efi/Protocol/DevicePath.h deleted file mode 100644 index e847668f..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/DevicePath.h +++ /dev/null @@ -1,535 +0,0 @@ -/** @file - The device path protocol as defined in UEFI 2.0. - - The device path represents a programatic path to a device. It's the view - from a software point of view. It also must persist from boot to boot, so - it can not contain things like PCI bus numbers that change from boot to boot. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__ -#define __EFI_DEVICE_PATH_PROTOCOL_H__ - -#include <gpxe/efi/Guid/PcAnsi.h> - -/// -/// Device Path protocol -/// -#define EFI_DEVICE_PATH_PROTOCOL_GUID \ - { \ - 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -// -// Protocol GUID defined in EFI1.1. -// - -/// -/// Device Path information -/// -#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID - -#pragma pack(1) - -/** - This protocol can be used on any device handle to obtain generic path/location - information concerning the physical device or logical device. If the handle does - not logically map to a physical device, the handle may not necessarily support - the device path protocol. The device path describes the location of the device - the handle is for. The size of the Device Path can be determined from the structures - that make up the Device Path. -**/ -typedef struct { - UINT8 Type; ///< 0x01 Hardware Device Path - ///< 0x02 ACPI Device Path - ///< 0x03 Messaging Device Path - ///< 0x04 Media Device Path - ///< 0x05 BIOS Boot Specification Device Path - ///< 0x7F End of Hardware Device Path - - UINT8 SubType; ///< Varies by Type - ///< 0xFF End Entire Device Path, or - ///< 0x01 End This Instance of a Device Path and start a new - ///< Device Path - - UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define - ///< type of data. Size of data is included in Length. - -} EFI_DEVICE_PATH_PROTOCOL; - -/// -/// For backward-compatible with EFI1.1. -/// -typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH; - -/// -/// Hardware Device Paths -/// -#define HARDWARE_DEVICE_PATH 0x01 - -#define HW_PCI_DP 0x01 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT8 Function; - UINT8 Device; -} PCI_DEVICE_PATH; - -#define HW_PCCARD_DP 0x02 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT8 FunctionNumber; -} PCCARD_DEVICE_PATH; - -#define HW_MEMMAP_DP 0x03 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 MemoryType; - EFI_PHYSICAL_ADDRESS StartingAddress; - EFI_PHYSICAL_ADDRESS EndingAddress; -} MEMMAP_DEVICE_PATH; - -#define HW_VENDOR_DP 0x04 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_GUID Guid; -} VENDOR_DEVICE_PATH; - -#define HW_CONTROLLER_DP 0x05 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 ControllerNumber; -} CONTROLLER_DEVICE_PATH; - -/// -/// ACPI Device Paths -/// -#define ACPI_DEVICE_PATH 0x02 - -#define ACPI_DP 0x01 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 HID; - UINT32 UID; -} ACPI_HID_DEVICE_PATH; - -#define ACPI_EXTENDED_DP 0x02 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 HID; - UINT32 UID; - UINT32 CID; - /// - /// Optional variable length _HIDSTR - /// Optional variable length _UIDSTR - /// Optional variable length _CIDSTR - /// -} ACPI_EXTENDED_HID_DEVICE_PATH; - -// -// EISA ID Macro -// EISA ID Definition 32-bits -// bits[15:0] - three character compressed ASCII EISA ID. -// bits[31:16] - binary number -// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z' -// -#define PNP_EISA_ID_CONST 0x41d0 -#define EISA_ID(_Name, _Num) ((UINT32)((_Name) | (_Num) << 16)) -#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) -#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId))) - -#define PNP_EISA_ID_MASK 0xffff -#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16) - - -#define ACPI_ADR_DP 0x03 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 ADR; -} ACPI_ADR_DEVICE_PATH; - -#define ACPI_ADR_DISPLAY_TYPE_OTHER 0 -#define ACPI_ADR_DISPLAY_TYPE_VGA 1 -#define ACPI_ADR_DISPLAY_TYPE_TV 2 -#define ACPI_ADR_DISPLAY_TYPE_EXTERNAL_DIGITAL 3 -#define ACPI_ADR_DISPLAY_TYPE_INTERNAL_DIGITAL 4 - -#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput, _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \ - ((UINT32)( (((_DeviceIdScheme) & 0x1) << 31) | \ - (((_HeadId) & 0x7) << 18) | \ - (((_NonVgaOutput) & 0x1) << 17) | \ - (((_BiosCanDetect) & 0x1) << 16) | \ - (((_VendorInfo) & 0xf) << 12) | \ - (((_Type) & 0xf) << 8) | \ - (((_Port) & 0xf) << 4) | \ - ((_Index) & 0xf) )) - -/// -/// Messaging Device Paths -/// -#define MESSAGING_DEVICE_PATH 0x03 - -#define MSG_ATAPI_DP 0x01 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT8 PrimarySecondary; - UINT8 SlaveMaster; - UINT16 Lun; -} ATAPI_DEVICE_PATH; - -#define MSG_SCSI_DP 0x02 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT16 Pun; - UINT16 Lun; -} SCSI_DEVICE_PATH; - -#define MSG_FIBRECHANNEL_DP 0x03 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 Reserved; - UINT64 WWN; - UINT64 Lun; -} FIBRECHANNEL_DEVICE_PATH; - -#define MSG_1394_DP 0x04 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 Reserved; - UINT64 Guid; -} F1394_DEVICE_PATH; - -#define MSG_USB_DP 0x05 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT8 ParentPortNumber; - UINT8 InterfaceNumber; -} USB_DEVICE_PATH; - -#define MSG_USB_CLASS_DP 0x0f -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT16 VendorId; - UINT16 ProductId; - UINT8 DeviceClass; - UINT8 DeviceSubClass; - UINT8 DeviceProtocol; -} USB_CLASS_DEVICE_PATH; - -#define MSG_USB_WWID_DP 0x10 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT16 InterfaceNumber; - UINT16 VendorId; - UINT16 ProductId; - // CHAR16 SerialNumber[...]; -} USB_WWID_DEVICE_PATH; - - -#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT8 Lun; -} DEVICE_LOGICAL_UNIT_DEVICE_PATH; - -#define MSG_SATA_DP 0x12 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT16 HBAPortNumber; - UINT16 PortMultiplierPortNumber; - UINT16 Lun; -} SATA_DEVICE_PATH; - -#define MSG_I2O_DP 0x06 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 Tid; -} I2O_DEVICE_PATH; - -#define MSG_MAC_ADDR_DP 0x0b -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_MAC_ADDRESS MacAddress; - UINT8 IfType; -} MAC_ADDR_DEVICE_PATH; - -#define MSG_IPv4_DP 0x0c -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_IPv4_ADDRESS LocalIpAddress; - EFI_IPv4_ADDRESS RemoteIpAddress; - UINT16 LocalPort; - UINT16 RemotePort; - UINT16 Protocol; - BOOLEAN StaticIpAddress; -} IPv4_DEVICE_PATH; - -#define MSG_IPv6_DP 0x0d -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_IPv6_ADDRESS LocalIpAddress; - EFI_IPv6_ADDRESS RemoteIpAddress; - UINT16 LocalPort; - UINT16 RemotePort; - UINT16 Protocol; - BOOLEAN StaticIpAddress; -} IPv6_DEVICE_PATH; - -#define MSG_INFINIBAND_DP 0x09 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 ResourceFlags; - UINT8 PortGid[16]; - UINT64 ServiceId; - UINT64 TargetPortId; - UINT64 DeviceId; -} INFINIBAND_DEVICE_PATH; - -#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01 -#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02 -#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04 -#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08 -#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10 - -#define MSG_UART_DP 0x0e -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 Reserved; - UINT64 BaudRate; - UINT8 DataBits; - UINT8 Parity; - UINT8 StopBits; -} UART_DEVICE_PATH; - -// -// Use VENDOR_DEVICE_PATH struct -// -#define MSG_VENDOR_DP 0x0a -typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH; - -#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID -#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID -#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID -#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID - -#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL EFI_UART_DEVICE_PATH_GUID - -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_GUID Guid; - UINT32 FlowControlMap; -} UART_FLOW_CONTROL_DEVICE_PATH; - -#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID - -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_GUID Guid; - UINT32 Reserved; - UINT64 SasAddress; - UINT64 Lun; - UINT16 DeviceTopology; - UINT16 RelativeTargetPort; -} SAS_DEVICE_PATH; - -#define MSG_ISCSI_DP 0x13 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT16 NetworkProtocol; - UINT16 LoginOption; - UINT64 Lun; - UINT16 TargetPortalGroupTag; - // CHAR8 iSCSI Target Name -} ISCSI_DEVICE_PATH; - -#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000 -#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002 -#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000 -#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008 -#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000 -#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000 -#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000 -#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000 - -// -// Media Device Path -// -#define MEDIA_DEVICE_PATH 0x04 - -#define MEDIA_HARDDRIVE_DP 0x01 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 PartitionNumber; - UINT64 PartitionStart; - UINT64 PartitionSize; - UINT8 Signature[16]; - UINT8 MBRType; - UINT8 SignatureType; -} HARDDRIVE_DEVICE_PATH; - -#define MBR_TYPE_PCAT 0x01 -#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02 - -#define SIGNATURE_TYPE_MBR 0x01 -#define SIGNATURE_TYPE_GUID 0x02 - -#define MEDIA_CDROM_DP 0x02 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 BootEntry; - UINT64 PartitionStart; - UINT64 PartitionSize; -} CDROM_DEVICE_PATH; - -// -// Use VENDOR_DEVICE_PATH struct -// -#define MEDIA_VENDOR_DP 0x03 - -#define MEDIA_FILEPATH_DP 0x04 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - CHAR16 PathName[1]; -} FILEPATH_DEVICE_PATH; - -#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName) - -#define MEDIA_PROTOCOL_DP 0x05 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_GUID Protocol; -} MEDIA_PROTOCOL_DEVICE_PATH; - - -#define MEDIA_PIWG_FW_VOL_DP 0x7 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_GUID FvName; -} MEDIA_FW_VOL_DEVICE_PATH; - - -#define MEDIA_PIWG_FW_FILE_DP 0x6 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - EFI_GUID FvFileName; -} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH; - -// -// BBS Device Path -// -#define BBS_DEVICE_PATH 0x05 -#define BBS_BBS_DP 0x01 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT16 DeviceType; - UINT16 StatusFlag; - CHAR8 String[1]; -} BBS_BBS_DEVICE_PATH; - -// -// DeviceType definitions - from BBS specification -// -#define BBS_TYPE_FLOPPY 0x01 -#define BBS_TYPE_HARDDRIVE 0x02 -#define BBS_TYPE_CDROM 0x03 -#define BBS_TYPE_PCMCIA 0x04 -#define BBS_TYPE_USB 0x05 -#define BBS_TYPE_EMBEDDED_NETWORK 0x06 -#define BBS_TYPE_BEV 0x80 -#define BBS_TYPE_UNKNOWN 0xFF - - -/// -/// Union of all possible Device Paths and pointers to Device Paths -/// - -typedef union { - EFI_DEVICE_PATH_PROTOCOL DevPath; - PCI_DEVICE_PATH Pci; - PCCARD_DEVICE_PATH PcCard; - MEMMAP_DEVICE_PATH MemMap; - VENDOR_DEVICE_PATH Vendor; - - CONTROLLER_DEVICE_PATH Controller; - ACPI_HID_DEVICE_PATH Acpi; - - ATAPI_DEVICE_PATH Atapi; - SCSI_DEVICE_PATH Scsi; - ISCSI_DEVICE_PATH Iscsi; - FIBRECHANNEL_DEVICE_PATH FibreChannel; - - F1394_DEVICE_PATH F1394; - USB_DEVICE_PATH Usb; - SATA_DEVICE_PATH Sata; - USB_CLASS_DEVICE_PATH UsbClass; - I2O_DEVICE_PATH I2O; - MAC_ADDR_DEVICE_PATH MacAddr; - IPv4_DEVICE_PATH Ipv4; - IPv6_DEVICE_PATH Ipv6; - INFINIBAND_DEVICE_PATH InfiniBand; - UART_DEVICE_PATH Uart; - - HARDDRIVE_DEVICE_PATH HardDrive; - CDROM_DEVICE_PATH CD; - - FILEPATH_DEVICE_PATH FilePath; - MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol; - - BBS_BBS_DEVICE_PATH Bbs; -} EFI_DEV_PATH; - - - -typedef union { - EFI_DEVICE_PATH_PROTOCOL *DevPath; - PCI_DEVICE_PATH *Pci; - PCCARD_DEVICE_PATH *PcCard; - MEMMAP_DEVICE_PATH *MemMap; - VENDOR_DEVICE_PATH *Vendor; - - CONTROLLER_DEVICE_PATH *Controller; - ACPI_HID_DEVICE_PATH *Acpi; - ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi; - - ATAPI_DEVICE_PATH *Atapi; - SCSI_DEVICE_PATH *Scsi; - FIBRECHANNEL_DEVICE_PATH *FibreChannel; - - F1394_DEVICE_PATH *F1394; - USB_DEVICE_PATH *Usb; - SATA_DEVICE_PATH *Sata; - USB_CLASS_DEVICE_PATH *UsbClass; - I2O_DEVICE_PATH *I2O; - MAC_ADDR_DEVICE_PATH *MacAddr; - IPv4_DEVICE_PATH *Ipv4; - IPv6_DEVICE_PATH *Ipv6; - INFINIBAND_DEVICE_PATH *InfiniBand; - UART_DEVICE_PATH *Uart; - - HARDDRIVE_DEVICE_PATH *HardDrive; - CDROM_DEVICE_PATH *CD; - - FILEPATH_DEVICE_PATH *FilePath; - MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol; - - BBS_BBS_DEVICE_PATH *Bbs; - UINT8 *Raw; -} EFI_DEV_PATH_PTR; - -#pragma pack() - -#define END_DEVICE_PATH_TYPE 0x7f -#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF -#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01 - -extern EFI_GUID gEfiDevicePathProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/DriverBinding.h b/gpxe/src/include/gpxe/efi/Protocol/DriverBinding.h deleted file mode 100644 index 510cb7ce..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/DriverBinding.h +++ /dev/null @@ -1,153 +0,0 @@ -/** @file - UEFI DriverBinding Protocol is defined in UEFI specification. - - This protocol is produced by every driver that follows the UEFI Driver Model, - and it is the central component that allows drivers and controllers to be managed. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __EFI_DRIVER_BINDING_H__ -#define __EFI_DRIVER_BINDING_H__ - -#include <gpxe/efi/Protocol/DevicePath.h> -/// -/// Global ID for the ControllerHandle Driver Protocol -/// -#define EFI_DRIVER_BINDING_PROTOCOL_GUID \ - { \ - 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \ - } - -typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL; - -/** - Test to see if this driver supports ControllerHandle. This service - is called by the EFI boot service ConnectController(). In - order to make drivers as small as possible, there are a few calling - restrictions for this service. ConnectController() must - follow these calling restrictions. If any other agent wishes to call - Supported() it must also follow these calling restrictions. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to test - @param RemainingDevicePath Optional parameter use to pick a specific child - device to start. - - @retval EFI_SUCCESS This driver supports this device - @retval EFI_ALREADY_STARTED This driver is already running on this device - @retval other This driver does not support this device - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED)( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL - ); - -/** - Start this driver on ControllerHandle. This service is called by the - EFI boot service ConnectController(). In order to make - drivers as small as possible, there are a few calling restrictions for - this service. ConnectController() must follow these - calling restrictions. If any other agent wishes to call Start() it - must also follow these calling restrictions. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to bind driver to - @param RemainingDevicePath Optional parameter use to pick a specific child - device to start. - - @retval EFI_SUCCESS This driver is added to ControllerHandle - @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle - @retval other This driver does not support this device - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DRIVER_BINDING_START)( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL - ); - -/** - Stop this driver on ControllerHandle. This service is called by the - EFI boot service DisconnectController(). In order to - make drivers as small as possible, there are a few calling - restrictions for this service. DisconnectController() - must follow these calling restrictions. If any other agent wishes - to call Stop() it must also follow these calling restrictions. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to stop driver on - @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of - children is zero stop the entire bus driver. - @param ChildHandleBuffer List of Child Handles to Stop. - - @retval EFI_SUCCESS This driver is removed ControllerHandle - @retval other This driver was not removed from this device - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DRIVER_BINDING_STOP)( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer OPTIONAL - ); - -/// -/// This protocol provides the services required to determine if a driver supports a given controller. -/// If a controller is supported, then it also provides routines to start and stop the controller. -/// -struct _EFI_DRIVER_BINDING_PROTOCOL { - EFI_DRIVER_BINDING_SUPPORTED Supported; - EFI_DRIVER_BINDING_START Start; - EFI_DRIVER_BINDING_STOP Stop; - - /// - /// The version number of the UEFI driver that produced the - /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by - /// the EFI boot service ConnectController() to determine - /// the order that driver's Supported() service will be used when - /// a controller needs to be started. EFI Driver Binding Protocol - /// instances with higher Version values will be used before ones - /// with lower Version values. The Version values of 0x0- - /// 0x0f and 0xfffffff0-0xffffffff are reserved for - /// platform/OEM specific drivers. The Version values of 0x10- - /// 0xffffffef are reserved for IHV-developed drivers. - /// - UINT32 Version; - - /// - /// The image handle of the UEFI driver that produced this instance - /// of the EFI_DRIVER_BINDING_PROTOCOL. - /// - EFI_HANDLE ImageHandle; - - /// - /// The handle on which this instance of the - /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most - /// cases, this is the same handle as ImageHandle. However, for - /// UEFI drivers that produce more than one instance of the - /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be - /// the same as ImageHandle. - /// - EFI_HANDLE DriverBindingHandle; -}; - -extern EFI_GUID gEfiDriverBindingProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/NetworkInterfaceIdentifier.h b/gpxe/src/include/gpxe/efi/Protocol/NetworkInterfaceIdentifier.h deleted file mode 100644 index e99ec38e..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/NetworkInterfaceIdentifier.h +++ /dev/null @@ -1,74 +0,0 @@ -/** @file - EFI Network Interface Identifier Protocol - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - -**/ - -#ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__ -#define __EFI_NETWORK_INTERFACE_IDENTIFER_H__ - - -#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID \ - { \ - 0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 } \ - } - -#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION 0x00010000 - -/// -/// Revision defined in EFI1.1. -/// -#define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION - -/// -/// Forward reference for pure ANSI compatability -/// -typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL; - -/// -/// Protocol defined in EFI1.1. -/// -typedef EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE; - -typedef enum { - EfiNetworkInterfaceUndi = 1 -} EFI_NETWORK_PROTOCOL_TYPE; - -/// -/// An optional protocol that is used to describe details about the software -/// layer that is used to produce the Simple Network Protocol. -/// -struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL { - UINT64 Revision; ///< The revision of the EFI_NETWORK_INTERFACE_IDENTIFIER protocol. - UINT64 ID; ///< Address of the first byte of the identifying structure for this network - ///< interface. This is only valid when the network interface is started - ///< (see Start()). When the network interface is not started, this field is set to zero. - UINT64 ImageAddr; ///< Address of the first byte of the identifying structure for this - ///< network interface. This is set to zero if there is no structure. - UINT32 ImageSize; ///< Size of unrelocated network interface image. - CHAR8 StringId[4];///< A four-character ASCII string that is sent in the class identifier field of - ///< option 60 in DHCP. For a Type of EfiNetworkInterfaceUndi, this field is UNDI. - UINT8 Type; ///< Network interface type. This will be set to one of the values - ///< in EFI_NETWORK_INTERFACE_TYPE. - UINT8 MajorVer; ///< Major version number. - UINT8 MinorVer; ///< Minor version number. - BOOLEAN Ipv6Supported; ///< TRUE if the network interface supports IPv6; otherwise FALSE. - UINT8 IfNum; ///< The network interface number that is being identified by this Network - ///< Interface Identifier Protocol. This field must be less than or equal - ///< to the IFcnt field in the !PXE structure. - -}; - -extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid; -extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31; - -#endif // _EFI_NII_H diff --git a/gpxe/src/include/gpxe/efi/Protocol/PciIo.h b/gpxe/src/include/gpxe/efi/Protocol/PciIo.h deleted file mode 100644 index 5aea5b4a..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/PciIo.h +++ /dev/null @@ -1,519 +0,0 @@ -/** @file - EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration, - and DMA interfaces that a driver uses to access its PCI controller. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __PCI_IO_H__ -#define __PCI_IO_H__ - -/// -/// Global ID for the PCI I/O Protocol -/// -#define EFI_PCI_IO_PROTOCOL_GUID \ - { \ - 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } \ - } - -typedef struct _EFI_PCI_IO_PROTOCOL EFI_PCI_IO_PROTOCOL; - -/// -/// Prototypes for the PCI I/O Protocol -/// -typedef enum { - EfiPciIoWidthUint8 = 0, - EfiPciIoWidthUint16, - EfiPciIoWidthUint32, - EfiPciIoWidthUint64, - EfiPciIoWidthFifoUint8, - EfiPciIoWidthFifoUint16, - EfiPciIoWidthFifoUint32, - EfiPciIoWidthFifoUint64, - EfiPciIoWidthFillUint8, - EfiPciIoWidthFillUint16, - EfiPciIoWidthFillUint32, - EfiPciIoWidthFillUint64, - EfiPciIoWidthMaximum -} EFI_PCI_IO_PROTOCOL_WIDTH; - -// -// Complete PCI address generater -// -#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff ///< Special BAR that passes a memory or I/O cycle through unchanged -#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f ///< All the following I/O and Memory cycles -#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 ///< I/O cycles 0x0000-0x00FF (10 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 ///< I/O cycles 0x0100-0x03FF or greater (10 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 ///< MEM cycles 0xA0000-0xBFFFF (24 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 ///< I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 ///< I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 ///< Map a memory range so write are combined -#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 ///< Enable the I/O decode bit in the PCI Config Header -#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 ///< Enable the Memory decode bit in the PCI Config Header -#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 ///< Enable the DMA bit in the PCI Config Header -#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 ///< Map a memory range so all r/w accesses are cached -#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ///< Disable a memory range -#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 ///< Clear for an add-in PCI Device -#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 ///< Clear for a physical PCI Option ROM accessed through ROM BAR -#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 ///< Clear for PCI controllers that can not genrate a DAC -#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 ///< I/O cycles 0x0100-0x03FF or greater (16 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode) -#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x30000 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode) - -#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER) -#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO) - -/// -/// ******************************************************* -/// EFI_PCI_IO_PROTOCOL_OPERATION -/// ******************************************************* -/// -typedef enum { - EfiPciIoOperationBusMasterRead, - EfiPciIoOperationBusMasterWrite, - EfiPciIoOperationBusMasterCommonBuffer, - EfiPciIoOperationMaximum -} EFI_PCI_IO_PROTOCOL_OPERATION; - -/// -/// ******************************************************* -/// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION -/// ******************************************************* -/// -typedef enum { - EfiPciIoAttributeOperationGet, - EfiPciIoAttributeOperationSet, - EfiPciIoAttributeOperationEnable, - EfiPciIoAttributeOperationDisable, - EfiPciIoAttributeOperationSupported, - EfiPciIoAttributeOperationMaximum -} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; - -/** - Reads from the memory space of a PCI controller. Returns when either the polling exit criteria is - satisfied or after a defined duration. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Width Signifies the width of the memory or I/O operations. - @param BarIndex The BAR index of the standard PCI Configuration header to use as the - base address for the memory operation to perform. - @param Offset The offset within the selected BAR to start the memory operation. - @param Mask Mask used for the polling criteria. - @param Value The comparison value used for the polling exit criteria. - @param Delay The number of 100 ns units to poll. - @param Result Pointer to the last value read from the memory location. - - @retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria. - @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. - @retval EFI_UNSUPPORTED Offset is not valid for the BarIndex of this PCI controller. - @retval EFI_TIMEOUT Delay expired before a match occurred. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM)( - IN EFI_PCI_IO_PROTOCOL *This, - IN EFI_PCI_IO_PROTOCOL_WIDTH Width, - IN UINT8 BarIndex, - IN UINT64 Offset, - IN UINT64 Mask, - IN UINT64 Value, - IN UINT64 Delay, - OUT UINT64 *Result - ); - -/** - Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Width Signifies the width of the memory or I/O operations. - @param BarIndex The BAR index of the standard PCI Configuration header to use as the - base address for the memory or I/O operation to perform. - @param Offset The offset within the selected BAR to start the memory or I/O operation. - @param Count The number of memory or I/O operations to perform. - @param Buffer For read operations, the destination buffer to store the results. For write - operations, the source buffer to write data from. - - @retval EFI_SUCCESS The data was read from or written to the PCI controller. - @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. - @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not - valid for the PCI BAR specified by BarIndex. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM)( - IN EFI_PCI_IO_PROTOCOL *This, - IN EFI_PCI_IO_PROTOCOL_WIDTH Width, - IN UINT8 BarIndex, - IN UINT64 Offset, - IN UINTN Count, - IN OUT VOID *Buffer - ); - -typedef struct { - EFI_PCI_IO_PROTOCOL_IO_MEM Read; - EFI_PCI_IO_PROTOCOL_IO_MEM Write; -} EFI_PCI_IO_PROTOCOL_ACCESS; - -/** - Enable a PCI driver to access PCI controller registers in PCI configuration space. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Width Signifies the width of the memory operations. - @param Offset The offset within the PCI configuration space for the PCI controller. - @param Count The number of PCI configuration operations to perform. - @param Buffer For read operations, the destination buffer to store the results. For write - operations, the source buffer to write data from. - - - @retval EFI_SUCCESS The data was read from or written to the PCI controller. - @retval EFI_UNSUPPORTED The address range specified by Offset, Width, and Count is not - valid for the PCI configuration header of the PCI controller. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_INVALID_PARAMETER Buffer is NULL or Width is invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG)( - IN EFI_PCI_IO_PROTOCOL *This, - IN EFI_PCI_IO_PROTOCOL_WIDTH Width, - IN UINT32 Offset, - IN UINTN Count, - IN OUT VOID *Buffer - ); - -typedef struct { - EFI_PCI_IO_PROTOCOL_CONFIG Read; - EFI_PCI_IO_PROTOCOL_CONFIG Write; -} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS; - -/** - Enables a PCI driver to copy one region of PCI memory space to another region of PCI - memory space. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Width Signifies the width of the memory operations. - @param DestBarIndex The BAR index in the standard PCI Configuration header to use as the - base address for the memory operation to perform. - @param DestOffset The destination offset within the BAR specified by DestBarIndex to - start the memory writes for the copy operation. - @param SrcBarIndex The BAR index in the standard PCI Configuration header to use as the - base address for the memory operation to perform. - @param SrcOffset The source offset within the BAR specified by SrcBarIndex to start - the memory reads for the copy operation. - @param Count The number of memory operations to perform. Bytes moved is Width - size * Count, starting at DestOffset and SrcOffset. - - @retval EFI_SUCCESS The data was copied from one memory region to another memory region. - @retval EFI_UNSUPPORTED DestBarIndex not valid for this PCI controller. - @retval EFI_UNSUPPORTED SrcBarIndex not valid for this PCI controller. - @retval EFI_UNSUPPORTED The address range specified by DestOffset, Width, and Count - is not valid for the PCI BAR specified by DestBarIndex. - @retval EFI_UNSUPPORTED The address range specified by SrcOffset, Width, and Count is - not valid for the PCI BAR specified by SrcBarIndex. - @retval EFI_INVALID_PARAMETER Width is invalid. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM)( - IN EFI_PCI_IO_PROTOCOL *This, - IN EFI_PCI_IO_PROTOCOL_WIDTH Width, - IN UINT8 DestBarIndex, - IN UINT64 DestOffset, - IN UINT8 SrcBarIndex, - IN UINT64 SrcOffset, - IN UINTN Count - ); - -/** - Provides the PCI controller-Cspecific addresses needed to access system memory. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Operation Indicates if the bus master is going to read or write to system memory. - @param HostAddress The system memory address to map to the PCI controller. - @param NumberOfBytes On input the number of bytes to map. On output the number of bytes - that were mapped. - @param DeviceAddress The resulting map address for the bus master PCI controller to use to - access the hosts HostAddress. - @param Mapping A resulting value to pass to Unmap(). - - @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. - @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_DEVICE_ERROR The system hardware could not map the requested address. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP)( - IN EFI_PCI_IO_PROTOCOL *This, - IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, - IN VOID *HostAddress, - IN OUT UINTN *NumberOfBytes, - OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, - OUT VOID **Mapping - ); - -/** - Completes the Map() operation and releases any corresponding resources. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Mapping The mapping value returned from Map(). - - @retval EFI_SUCCESS The range was unmapped. - @retval EFI_DEVICE_ERROR The data was not committed to the target system memory. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP)( - IN EFI_PCI_IO_PROTOCOL *This, - IN VOID *Mapping - ); - -/** - Allocates pages that are suitable for an EfiPciIoOperationBusMasterCommonBuffer - mapping. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Type This parameter is not used and must be ignored. - @param MemoryType The type of memory to allocate, EfiBootServicesData or - EfiRuntimeServicesData. - @param Pages The number of pages to allocate. - @param HostAddress A pointer to store the base system memory address of the - allocated range. - @param Attributes The requested bit mask of attributes for the allocated range. - - @retval EFI_SUCCESS The requested memory pages were allocated. - @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are - MEMORY_WRITE_COMBINE and MEMORY_CACHED. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER)( - IN EFI_PCI_IO_PROTOCOL *This, - IN EFI_ALLOCATE_TYPE Type, - IN EFI_MEMORY_TYPE MemoryType, - IN UINTN Pages, - OUT VOID **HostAddress, - IN UINT64 Attributes - ); - -/** - Frees memory that was allocated with AllocateBuffer(). - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Pages The number of pages to free. - @param HostAddress The base system memory address of the allocated range. - - @retval EFI_SUCCESS The requested memory pages were freed. - @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages - was not allocated with AllocateBuffer(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER)( - IN EFI_PCI_IO_PROTOCOL *This, - IN UINTN Pages, - IN VOID *HostAddress - ); - -/** - Flushes all PCI posted write transactions from a PCI host bridge to system memory. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - - @retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host - bridge to system memory. - @retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI - host bridge due to a hardware error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH)( - IN EFI_PCI_IO_PROTOCOL *This - ); - -/** - Retrieves this PCI controller's current PCI bus number, device number, and function number. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param SegmentNumber The PCI controller's current PCI segment number. - @param BusNumber The PCI controller's current PCI bus number. - @param DeviceNumber The PCI controller's current PCI device number. - @param FunctionNumber The PCI controller's current PCI function number. - - @retval EFI_SUCCESS The PCI controller location was returned. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION)( - IN EFI_PCI_IO_PROTOCOL *This, - OUT UINTN *SegmentNumber, - OUT UINTN *BusNumber, - OUT UINTN *DeviceNumber, - OUT UINTN *FunctionNumber - ); - -/** - Performs an operation on the attributes that this PCI controller supports. The operations include - getting the set of supported attributes, retrieving the current attributes, setting the current - attributes, enabling attributes, and disabling attributes. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Operation The operation to perform on the attributes for this PCI controller. - @param Attributes The mask of attributes that are used for Set, Enable, and Disable - operations. - @param Result A pointer to the result mask of attributes that are returned for the Get - and Supported operations. - - @retval EFI_SUCCESS The operation on the PCI controller's attributes was completed. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_UNSUPPORTED one or more of the bits set in - Attributes are not supported by this PCI controller or one of - its parent bridges when Operation is Set, Enable or Disable. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES)( - IN EFI_PCI_IO_PROTOCOL *This, - IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, - IN UINT64 Attributes, - OUT UINT64 *Result OPTIONAL - ); - -/** - Gets the attributes that this PCI controller supports setting on a BAR using - SetBarAttributes(), and retrieves the list of resource descriptors for a BAR. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param BarIndex The BAR index of the standard PCI Configuration header to use as the - base address for resource range. The legal range for this field is 0..5. - @param Supports A pointer to the mask of attributes that this PCI controller supports - setting for this BAR with SetBarAttributes(). - @param Resources A pointer to the ACPI 2.0 resource descriptors that describe the current - configuration of this BAR of the PCI controller. - - @retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI - controller supports are returned in Supports. If Resources - is not NULL, then the ACPI 2.0 resource descriptors that the PCI - controller is currently using are returned in Resources. - @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL. - @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. - @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate - Resources. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES)( - IN EFI_PCI_IO_PROTOCOL *This, - IN UINT8 BarIndex, - OUT UINT64 *Supports, OPTIONAL - OUT VOID **Resources OPTIONAL - ); - -/** - Sets the attributes for a range of a BAR on a PCI controller. - - @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param Attributes The mask of attributes to set for the resource range specified by - BarIndex, Offset, and Length. - @param BarIndex The BAR index of the standard PCI Configuration header to use as the - base address for resource range. The legal range for this field is 0..5. - @param Offset A pointer to the BAR relative base address of the resource range to be - modified by the attributes specified by Attributes. - @param Length A pointer to the length of the resource range to be modified by the - attributes specified by Attributes. - - @retval EFI_SUCCESS The set of attributes specified by Attributes for the resource - range specified by BarIndex, Offset, and Length were - set on the PCI controller, and the actual resource range is returned - in Offset and Length. - @retval EFI_INVALID_PARAMETER Offset or Length is NULL. - @retval EFI_UNSUPPORTED BarIndex not valid for this PCI controller. - @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the - resource range specified by BarIndex, Offset, and - Length. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES)( - IN EFI_PCI_IO_PROTOCOL *This, - IN UINT64 Attributes, - IN UINT8 BarIndex, - IN OUT UINT64 *Offset, - IN OUT UINT64 *Length - ); - -/// -/// The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration, -/// and DMA interfaces that are used to abstract accesses to PCI controllers. -/// There is one EFI_PCI_IO_PROTOCOL instance for each PCI controller on a PCI bus. -/// A device driver that wishes to manage a PCI controller in a system will have to -/// retrieve the EFI_PCI_IO_PROTOCOL instance that is associated with the PCI controller. -/// -struct _EFI_PCI_IO_PROTOCOL { - EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem; - EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo; - EFI_PCI_IO_PROTOCOL_ACCESS Mem; - EFI_PCI_IO_PROTOCOL_ACCESS Io; - EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci; - EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem; - EFI_PCI_IO_PROTOCOL_MAP Map; - EFI_PCI_IO_PROTOCOL_UNMAP Unmap; - EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; - EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer; - EFI_PCI_IO_PROTOCOL_FLUSH Flush; - EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation; - EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes; - EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes; - EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes; - - /// - /// The size, in bytes, of the ROM image. - /// - UINT64 RomSize; - - /// - /// A pointer to the in memory copy of the ROM image. The PCI Bus Driver is responsible - /// for allocating memory for the ROM image, and copying the contents of the ROM to memory. - /// The contents of this buffer are either from the PCI option ROM that can be accessed - /// through the ROM BAR of the PCI controller, or it is from a platform-specific location. - /// The Attributes() function can be used to determine from which of these two sources - /// the RomImage buffer was initialized. - /// - VOID *RomImage; -}; - -extern EFI_GUID gEfiPciIoProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h b/gpxe/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h deleted file mode 100644 index a1150f08..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h +++ /dev/null @@ -1,393 +0,0 @@ -/** @file - PCI Root Bridge I/O protocol as defined in the UEFI 2.0 specification. - - PCI Root Bridge I/O protocol is used by PCI Bus Driver to perform PCI Memory, PCI I/O, - and PCI Configuration cycles on a PCI Root Bridge. It also provides services to perform - defferent types of bus mastering DMA - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __PCI_ROOT_BRIDGE_IO_H__ -#define __PCI_ROOT_BRIDGE_IO_H__ - -#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \ - { \ - 0x2f707ebb, 0x4a1a, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ - } - -typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL; - -typedef enum { - EfiPciWidthUint8, - EfiPciWidthUint16, - EfiPciWidthUint32, - EfiPciWidthUint64, - EfiPciWidthFifoUint8, - EfiPciWidthFifoUint16, - EfiPciWidthFifoUint32, - EfiPciWidthFifoUint64, - EfiPciWidthFillUint8, - EfiPciWidthFillUint16, - EfiPciWidthFillUint32, - EfiPciWidthFillUint64, - EfiPciWidthMaximum -} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH; - -typedef enum { - EfiPciOperationBusMasterRead, - EfiPciOperationBusMasterWrite, - EfiPciOperationBusMasterCommonBuffer, - EfiPciOperationBusMasterRead64, - EfiPciOperationBusMasterWrite64, - EfiPciOperationBusMasterCommonBuffer64, - EfiPciOperationMaximum -} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION; - -#define EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 -#define EFI_PCI_ATTRIBUTE_ISA_IO 0x0002 -#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO 0x0004 -#define EFI_PCI_ATTRIBUTE_VGA_MEMORY 0x0008 -#define EFI_PCI_ATTRIBUTE_VGA_IO 0x0010 -#define EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 -#define EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 -#define EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 -#define EFI_PCI_ATTRIBUTE_MEMORY_CACHED 0x0800 -#define EFI_PCI_ATTRIBUTE_MEMORY_DISABLE 0x1000 -#define EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 - -#define EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER (EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_PCI_ATTRIBUTE_MEMORY_CACHED | EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE) - -#define EFI_PCI_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER (~EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER) - -#define EFI_PCI_ADDRESS(bus, dev, func, reg) \ - ((UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg))) - -typedef struct { - UINT8 Register; - UINT8 Function; - UINT8 Device; - UINT8 Bus; - UINT32 ExtendedRegister; -} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS; - -/** - Reads from the I/O space of a PCI Root Bridge. Returns when either the polling exit criteria is - satisfied or after a defined duration. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Width Signifies the width of the memory or I/O operations. - @param Address The base address of the memory or I/O operations. - @param Mask Mask used for the polling criteria. - @param Value The comparison value used for the polling exit criteria. - @param Delay The number of 100 ns units to poll. - @param Result Pointer to the last value read from the memory location. - - @retval EFI_SUCCESS The last data returned from the access matched the poll exit criteria. - @retval EFI_TIMEOUT Delay expired before a match occurred. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, - IN UINT64 Address, - IN UINT64 Mask, - IN UINT64 Value, - IN UINT64 Delay, - OUT UINT64 *Result - ); - -/** - Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Width Signifies the width of the memory operations. - @param Address The base address of the memory operations. - @param Count The number of memory operations to perform. - @param Buffer For read operations, the destination buffer to store the results. For write - operations, the source buffer to write data from. - - @retval EFI_SUCCESS The data was read from or written to the PCI root bridge. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, - IN UINT64 Address, - IN UINTN Count, - IN OUT VOID *Buffer - ); - -typedef struct { - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write; -} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS; - -/** - Enables a PCI driver to copy one region of PCI root bridge memory space to another region of PCI - root bridge memory space. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance. - @param Width Signifies the width of the memory operations. - @param DestAddress The destination address of the memory operation. - @param SrcAddress The source address of the memory operation. - @param Count The number of memory operations to perform. - - @retval EFI_SUCCESS The data was copied from one memory region to another memory region. - @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, - IN UINT64 DestAddress, - IN UINT64 SrcAddress, - IN UINTN Count - ); - -/** - Provides the PCI controller-Cspecific addresses required to access system memory from a - DMA bus master. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Operation Indicates if the bus master is going to read or write to system memory. - @param HostAddress The system memory address to map to the PCI controller. - @param NumberOfBytes On input the number of bytes to map. On output the number of bytes - that were mapped. - @param DeviceAddress The resulting map address for the bus master PCI controller to use to - access the hosts HostAddress. - @param Mapping A resulting value to pass to Unmap(). - - @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes. - @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval EFI_DEVICE_ERROR The system hardware could not map the requested address. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation, - IN VOID *HostAddress, - IN OUT UINTN *NumberOfBytes, - OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, - OUT VOID **Mapping - ); - -/** - Completes the Map() operation and releases any corresponding resources. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Mapping The mapping value returned from Map(). - - @retval EFI_SUCCESS The range was unmapped. - @retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map(). - @retval EFI_DEVICE_ERROR The data was not committed to the target system memory. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN VOID *Mapping - ); - -/** - Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer or - EfiPciOperationBusMasterCommonBuffer64 mapping. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Type This parameter is not used and must be ignored. - @param MemoryType The type of memory to allocate, EfiBootServicesData or - EfiRuntimeServicesData. - @param Pages The number of pages to allocate. - @param HostAddress A pointer to store the base system memory address of the - allocated range. - @param Attributes The requested bit mask of attributes for the allocated range. - - @retval EFI_SUCCESS The requested memory pages were allocated. - @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal attribute bits are - MEMORY_WRITE_COMBINE and MEMORY_CACHED. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN EFI_ALLOCATE_TYPE Type, - IN EFI_MEMORY_TYPE MemoryType, - IN UINTN Pages, - IN OUT VOID **HostAddress, - IN UINT64 Attributes - ); - -/** - Frees memory that was allocated with AllocateBuffer(). - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Pages The number of pages to free. - @param HostAddress The base system memory address of the allocated range. - - @retval EFI_SUCCESS The requested memory pages were freed. - @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages - was not allocated with AllocateBuffer(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN UINTN Pages, - IN VOID *HostAddress - ); - -/** - Flushes all PCI posted write transactions from a PCI host bridge to system memory. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - - @retval EFI_SUCCESS The PCI posted write transactions were flushed from the PCI host - bridge to system memory. - @retval EFI_DEVICE_ERROR The PCI posted write transactions were not flushed from the PCI - host bridge due to a hardware error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This - ); - -/** - Gets the attributes that a PCI root bridge supports setting with SetAttributes(), and the - attributes that a PCI root bridge is currently using. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Supports A pointer to the mask of attributes that this PCI root bridge supports - setting with SetAttributes(). - @param Attributes A pointer to the mask of attributes that this PCI root bridge is currently - using. - - @retval EFI_SUCCESS If Supports is not NULL, then the attributes that the PCI root - bridge supports is returned in Supports. If Attributes is - not NULL, then the attributes that the PCI root bridge is currently - using is returned in Attributes. - @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL. - - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - OUT UINT64 *Supports, - OUT UINT64 *Attributes - ); - -/** - Sets attributes for a resource range on a PCI root bridge. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Attributes The mask of attributes to set. - @param ResourceBase A pointer to the base address of the resource range to be modified by the - attributes specified by Attributes. - @param ResourceLength A pointer to the length of the resource range to be modified by the - attributes specified by Attributes. - - @retval EFI_SUCCESS The set of attributes specified by Attributes for the resource - range specified by ResourceBase and ResourceLength - were set on the PCI root bridge, and the actual resource range is - returned in ResuourceBase and ResourceLength. - @retval EFI_UNSUPPORTED A bit is set in Attributes that is not supported by the PCI Root - Bridge. - @retval EFI_OUT_OF_RESOURCES There are not enough resources to set the attributes on the - resource range specified by BaseAddress and Length. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - IN UINT64 Attributes, - IN OUT UINT64 *ResourceBase, - IN OUT UINT64 *ResourceLength - ); - -/** - Retrieves the current resource settings of this PCI root bridge in the form of a set of ACPI 2.0 - resource descriptors. - - @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. - @param Resources A pointer to the ACPI 2.0 resource descriptors that describe the current - configuration of this PCI root bridge. - - @retval EFI_SUCCESS The current configuration of this PCI root bridge was returned in - Resources. - @retval EFI_UNSUPPORTED The current configuration of this PCI root bridge could not be - retrieved. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION)( - IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, - OUT VOID **Resources - ); - -/// -/// Provides the basic Memory, I/O, PCI configuration, and DMA interfaces that are -/// used to abstract accesses to PCI controllers behind a PCI Root Bridge Controller. -/// -struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL { - /// - /// The EFI_HANDLE of the PCI Host Bridge of which this PCI Root Bridge is a member. - /// - EFI_HANDLE ParentHandle; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollMem; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollIo; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Mem; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Io; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Pci; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM CopyMem; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP Map; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP Unmap; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER FreeBuffer; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH Flush; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES GetAttributes; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES SetAttributes; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION Configuration; - - /// - /// The segment number that this PCI root bridge resides. - /// - UINT32 SegmentNumber; -}; - -extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/SimpleNetwork.h b/gpxe/src/include/gpxe/efi/Protocol/SimpleNetwork.h deleted file mode 100644 index d3d2afc7..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/SimpleNetwork.h +++ /dev/null @@ -1,593 +0,0 @@ -/** @file - Simple Network protocol as defined in the UEFI 2.0 specification. - - Basic network device abstraction. - - Rx - Received - Tx - Transmit - MCast - MultiCast - ... - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __SIMPLE_NETWORK_H__ -#define __SIMPLE_NETWORK_H__ - -#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \ - { \ - 0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } \ - } - -typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK_PROTOCOL; - - -/// -/// Protocol defined in EFI1.1. -/// -typedef EFI_SIMPLE_NETWORK_PROTOCOL EFI_SIMPLE_NETWORK; - -/// -/// Simple Network Protocol data structures -/// -typedef struct { - /// - /// Total number of frames received. Includes frames with errors and - /// dropped frames. - /// - UINT64 RxTotalFrames; - - /// - /// Number of valid frames received and copied into receive buffers. - /// - UINT64 RxGoodFrames; - - /// - /// Number of frames below the minimum length for the media. - /// This would be <64 for ethernet. - /// - UINT64 RxUndersizeFrames; - - /// - /// Number of frames longer than the maxminum length for the - /// media. This would be >1500 for ethernet. - /// - UINT64 RxOversizeFrames; - - /// - /// Valid frames that were dropped because receive buffers were full. - /// - UINT64 RxDroppedFrames; - - /// - /// Number of valid unicast frames received and not dropped. - /// - UINT64 RxUnicastFrames; - - /// - /// Number of valid broadcast frames received and not dropped. - /// - UINT64 RxBroadcastFrames; - - /// - /// Number of valid mutlicast frames received and not dropped. - /// - UINT64 RxMulticastFrames; - - /// - /// Number of frames w/ CRC or alignment errors. - /// - UINT64 RxCrcErrorFrames; - - /// - /// Total number of bytes received. Includes frames with errors - /// and dropped frames. - // - UINT64 RxTotalBytes; - - /// - /// Transmit statistics. - /// - UINT64 TxTotalFrames; - UINT64 TxGoodFrames; - UINT64 TxUndersizeFrames; - UINT64 TxOversizeFrames; - UINT64 TxDroppedFrames; - UINT64 TxUnicastFrames; - UINT64 TxBroadcastFrames; - UINT64 TxMulticastFrames; - UINT64 TxCrcErrorFrames; - UINT64 TxTotalBytes; - - /// - /// Number of collisions detection on this subnet. - /// - UINT64 Collisions; - - /// - /// Number of frames destined for unsupported protocol. - /// - UINT64 UnsupportedProtocol; - -} EFI_NETWORK_STATISTICS; - -typedef enum { - EfiSimpleNetworkStopped, - EfiSimpleNetworkStarted, - EfiSimpleNetworkInitialized, - EfiSimpleNetworkMaxState -} EFI_SIMPLE_NETWORK_STATE; - -#define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01 -#define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02 -#define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04 -#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08 -#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10 - -#define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01 -#define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02 -#define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04 -#define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08 - -#define MAX_MCAST_FILTER_CNT 16 -typedef struct { - UINT32 State; - UINT32 HwAddressSize; - UINT32 MediaHeaderSize; - UINT32 MaxPacketSize; - UINT32 NvRamSize; - UINT32 NvRamAccessSize; - UINT32 ReceiveFilterMask; - UINT32 ReceiveFilterSetting; - UINT32 MaxMCastFilterCount; - UINT32 MCastFilterCount; - EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT]; - EFI_MAC_ADDRESS CurrentAddress; - EFI_MAC_ADDRESS BroadcastAddress; - EFI_MAC_ADDRESS PermanentAddress; - UINT8 IfType; - BOOLEAN MacAddressChangeable; - BOOLEAN MultipleTxSupported; - BOOLEAN MediaPresentSupported; - BOOLEAN MediaPresent; -} EFI_SIMPLE_NETWORK_MODE; - -// -// Protocol Member Functions -// -/** - Changes the state of a network interface from "stopped" to "started". - - @param This Protocol instance pointer. - - @retval EFI_SUCCESS The network interface was started. - @retval EFI_ALREADY_STARTED The network interface is already in the started state. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_START)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This - ); - -/** - Changes the state of a network interface from "started" to "stopped". - - @param This Protocol instance pointer. - - @retval EFI_SUCCESS The network interface was stopped. - @retval EFI_ALREADY_STARTED The network interface is already in the stopped state. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_STOP)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This - ); - -/** - Resets a network adapter and allocates the transmit and receive buffers - required by the network interface; optionally, also requests allocation - of additional transmit and receive buffers. - - @param This Protocol instance pointer. - @param ExtraRxBufferSize The size, in bytes, of the extra receive buffer space - that the driver should allocate for the network interface. - Some network interfaces will not be able to use the extra - buffer, and the caller will not know if it is actually - being used. - @param ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space - that the driver should allocate for the network interface. - Some network interfaces will not be able to use the extra - buffer, and the caller will not know if it is actually - being used. - - @retval EFI_SUCCESS The network interface was initialized. - @retval EFI_NOT_STARTED The network interface has not been started - @retval EFI_OUT_OF_RESOURCES There was not enough memory for the transmit and - receive buffers. . - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN UINTN ExtraRxBufferSize OPTIONAL, - IN UINTN ExtraTxBufferSize OPTIONAL - ); - -/** - Resets a network adapter and re-initializes it with the parameters that were - provided in the previous call to Initialize(). - - @param This Protocol instance pointer. - @param ExtendedVerification Indicates that the driver may perform a more - exhaustive verification operation of the device - during reset. - - @retval EFI_SUCCESS The network interface was reset. - @retval EFI_NOT_STARTED The network interface has not been started - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_RESET)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ); - -/** - Resets a network adapter and leaves it in a state that is safe for - another driver to initialize. - - @param This Protocol instance pointer. - - @retval EFI_SUCCESS The network interface was shutdown. - @retval EFI_NOT_STARTED The network interface has not been started - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This - ); - -/** - Manages the multicast receive filters of a network interface. - - @param This Protocol instance pointer. - @param Enable A bit mask of receive filters to enable on the network interface. - @param Disable A bit mask of receive filters to disable on the network interface. - @param ResetMCastFilter Set to TRUE to reset the contents of the multicast receive - filters on the network interface to their default values. - @param McastFilterCnt Number of multicast HW MAC addresses in the new - MCastFilter list. This value must be less than or equal to - the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This - field is optional if ResetMCastFilter is TRUE. - @param MCastFilter A pointer to a list of new multicast receive filter HW MAC - addresses. This list will replace any existing multicast - HW MAC address list. This field is optional if - ResetMCastFilter is TRUE. - - @retval EFI_SUCCESS The multicast receive filter list was updated. - @retval EFI_NOT_STARTED The network interface has not been started - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN UINT32 Enable, - IN UINT32 Disable, - IN BOOLEAN ResetMCastFilter, - IN UINTN MCastFilterCnt OPTIONAL, - IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL - ); - -/** - Modifies or resets the current station address, if supported. - - @param This Protocol instance pointer. - @param Reset Flag used to reset the station address to the network interfaces - permanent address. - @param New New station address to be used for the network interface. - - @retval EFI_SUCCESS The network interfaces station address was updated. - @retval EFI_NOT_STARTED The network interface has not been started - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN BOOLEAN Reset, - IN EFI_MAC_ADDRESS *New OPTIONAL - ); - -/** - Resets or collects the statistics on a network interface. - - @param This Protocol instance pointer. - @param Reset Set to TRUE to reset the statistics for the network interface. - @param StatisticsSize On input the size, in bytes, of StatisticsTable. On - output the size, in bytes, of the resulting table of - statistics. - @param StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that - contains the statistics. - - @retval EFI_SUCCESS The statistics were collected from the network interface. - @retval EFI_NOT_STARTED The network interface has not been started. - @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer - size needed to hold the statistics is returned in - StatisticsSize. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN BOOLEAN Reset, - IN OUT UINTN *StatisticsSize OPTIONAL, - OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL - ); - -/** - Converts a multicast IP address to a multicast HW MAC address. - - @param This Protocol instance pointer. - @param IPv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set - to FALSE if the multicast IP address is IPv4 [RFC 791]. - @param IP The multicast IP address that is to be converted to a multicast - HW MAC address. - @param MAC The multicast HW MAC address that is to be generated from IP. - - @retval EFI_SUCCESS The multicast IP address was mapped to the multicast - HW MAC address. - @retval EFI_NOT_STARTED The network interface has not been started. - @retval EFI_BUFFER_TOO_SMALL The Statistics buffer was too small. The current buffer - size needed to hold the statistics is returned in - StatisticsSize. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN BOOLEAN IPv6, - IN EFI_IP_ADDRESS *IP, - OUT EFI_MAC_ADDRESS *MAC - ); - -/** - Performs read and write operations on the NVRAM device attached to a - network interface. - - @param This Protocol instance pointer. - @param ReadWrite TRUE for read operations, FALSE for write operations. - @param Offset Byte offset in the NVRAM device at which to start the read or - write operation. This must be a multiple of NvRamAccessSize and - less than NvRamSize. - @param BufferSize The number of bytes to read or write from the NVRAM device. - This must also be a multiple of NvramAccessSize. - @param Buffer A pointer to the data buffer. - - @retval EFI_SUCCESS The NVRAM access was performed. - @retval EFI_NOT_STARTED The network interface has not been started. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN BOOLEAN ReadWrite, - IN UINTN Offset, - IN UINTN BufferSize, - IN OUT VOID *Buffer - ); - -/** - Reads the current interrupt status and recycled transmit buffer status from - a network interface. - - @param This Protocol instance pointer. - @param InterruptStatus A pointer to the bit mask of the currently active interrupts - If this is NULL, the interrupt status will not be read from - the device. If this is not NULL, the interrupt status will - be read from the device. When the interrupt status is read, - it will also be cleared. Clearing the transmit interrupt - does not empty the recycled transmit buffer array. - @param TxBuf Recycled transmit buffer address. The network interface will - not transmit if its internal recycled transmit buffer array - is full. Reading the transmit buffer does not clear the - transmit interrupt. If this is NULL, then the transmit buffer - status will not be read. If there are no transmit buffers to - recycle and TxBuf is not NULL, * TxBuf will be set to NULL. - - @retval EFI_SUCCESS The status of the network interface was retrieved. - @retval EFI_NOT_STARTED The network interface has not been started. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - OUT UINT32 *InterruptStatus OPTIONAL, - OUT VOID **TxBuf OPTIONAL - ); - -/** - Places a packet in the transmit queue of a network interface. - - @param This Protocol instance pointer. - @param HeaderSize The size, in bytes, of the media header to be filled in by - the Transmit() function. If HeaderSize is non-zero, then it - must be equal to This->Mode->MediaHeaderSize and the DestAddr - and Protocol parameters must not be NULL. - @param BufferSize The size, in bytes, of the entire packet (media header and - data) to be transmitted through the network interface. - @param Buffer A pointer to the packet (media header followed by data) to be - transmitted. This parameter cannot be NULL. If HeaderSize is zero, - then the media header in Buffer must already be filled in by the - caller. If HeaderSize is non-zero, then the media header will be - filled in by the Transmit() function. - @param SrcAddr The source HW MAC address. If HeaderSize is zero, then this parameter - is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then - This->Mode->CurrentAddress is used for the source HW MAC address. - @param DsetAddr The destination HW MAC address. If HeaderSize is zero, then this - parameter is ignored. - @param Protocol The type of header to build. If HeaderSize is zero, then this - parameter is ignored. See RFC 1700, section "Ether Types", for - examples. - - @retval EFI_SUCCESS The packet was placed on the transmit queue. - @retval EFI_NOT_STARTED The network interface has not been started. - @retval EFI_NOT_READY The network interface is too busy to accept this transmit request. - @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - IN UINTN HeaderSize, - IN UINTN BufferSize, - IN VOID *Buffer, - IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL, - IN EFI_MAC_ADDRESS *DestAddr OPTIONAL, - IN UINT16 *Protocol OPTIONAL - ); - -/** - Receives a packet from a network interface. - - @param This Protocol instance pointer. - @param HeaderSize The size, in bytes, of the media header received on the network - interface. If this parameter is NULL, then the media header size - will not be returned. - @param BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in - bytes, of the packet that was received on the network interface. - @param Buffer A pointer to the data buffer to receive both the media header and - the data. - @param SrcAddr The source HW MAC address. If this parameter is NULL, the - HW MAC source address will not be extracted from the media - header. - @param DsetAddr The destination HW MAC address. If this parameter is NULL, - the HW MAC destination address will not be extracted from the - media header. - @param Protocol The media header type. If this parameter is NULL, then the - protocol will not be extracted from the media header. See - RFC 1700 section "Ether Types" for examples. - - @retval EFI_SUCCESS The received data was stored in Buffer, and BufferSize has - been updated to the number of bytes received. - @retval EFI_NOT_STARTED The network interface has not been started. - @retval EFI_NOT_READY The network interface is too busy to accept this transmit - request. - @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small. - @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value. - @retval EFI_DEVICE_ERROR The command could not be sent to the network interface. - @retval EFI_UNSUPPORTED This function is not supported by the network interface. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE)( - IN EFI_SIMPLE_NETWORK_PROTOCOL *This, - OUT UINTN *HeaderSize OPTIONAL, - IN OUT UINTN *BufferSize, - OUT VOID *Buffer, - OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL, - OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, - OUT UINT16 *Protocol OPTIONAL - ); - -#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000 - -// -// Revision defined in EFI1.1 -// -#define EFI_SIMPLE_NETWORK_INTERFACE_REVISION EFI_SIMPLE_NETWORK_PROTOCOL_REVISION - -/// -/// The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access -/// to a network adapter. Once the network adapter initializes, -/// the EFI_SIMPLE_NETWORK_PROTOCOL protocol provides services that -/// allow packets to be transmitted and received. -/// -struct _EFI_SIMPLE_NETWORK_PROTOCOL { - /// - /// Revision of the EFI_SIMPLE_NETWORK_PROTOCOL. All future revisions must - /// be backwards compatible. If a future version is not backwards compatible - /// it is not the same GUID. - /// - UINT64 Revision; - EFI_SIMPLE_NETWORK_START Start; - EFI_SIMPLE_NETWORK_STOP Stop; - EFI_SIMPLE_NETWORK_INITIALIZE Initialize; - EFI_SIMPLE_NETWORK_RESET Reset; - EFI_SIMPLE_NETWORK_SHUTDOWN Shutdown; - EFI_SIMPLE_NETWORK_RECEIVE_FILTERS ReceiveFilters; - EFI_SIMPLE_NETWORK_STATION_ADDRESS StationAddress; - EFI_SIMPLE_NETWORK_STATISTICS Statistics; - EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC MCastIpToMac; - EFI_SIMPLE_NETWORK_NVDATA NvData; - EFI_SIMPLE_NETWORK_GET_STATUS GetStatus; - EFI_SIMPLE_NETWORK_TRANSMIT Transmit; - EFI_SIMPLE_NETWORK_RECEIVE Receive; - /// - /// Event used with WaitForEvent() to wait for a packet to be received. - /// - EFI_EVENT WaitForPacket; - /// - /// Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device. - /// - EFI_SIMPLE_NETWORK_MODE *Mode; -}; - -extern EFI_GUID gEfiSimpleNetworkProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/SimpleTextIn.h b/gpxe/src/include/gpxe/efi/Protocol/SimpleTextIn.h deleted file mode 100644 index f14f62d5..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/SimpleTextIn.h +++ /dev/null @@ -1,136 +0,0 @@ -/** @file - Simple Text In protocol from the UEFI 2.0 specification. - - Abstraction of a very simple input device like a keyboard or serial - terminal. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__ -#define __SIMPLE_TEXT_IN_PROTOCOL_H__ - -#include <gpxe/efi/ProcessorBind.h> - -#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ - { \ - 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -/// -/// Protocol GUID defined in EFI1.1. -/// -#define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID - -typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL; - -/// -/// Backward-compatible with EFI1.1. -/// -typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE; -// -// Data structures -// -typedef struct { - UINT16 ScanCode; - CHAR16 UnicodeChar; -} EFI_INPUT_KEY; - -// -// Required unicode control chars -// -#define CHAR_NULL 0x0000 -#define CHAR_BACKSPACE 0x0008 -#define CHAR_TAB 0x0009 -#define CHAR_LINEFEED 0x000A -#define CHAR_CARRIAGE_RETURN 0x000D - -// -// EFI Scan codes -// -#define SCAN_NULL 0x0000 -#define SCAN_UP 0x0001 -#define SCAN_DOWN 0x0002 -#define SCAN_RIGHT 0x0003 -#define SCAN_LEFT 0x0004 -#define SCAN_HOME 0x0005 -#define SCAN_END 0x0006 -#define SCAN_INSERT 0x0007 -#define SCAN_DELETE 0x0008 -#define SCAN_PAGE_UP 0x0009 -#define SCAN_PAGE_DOWN 0x000A -#define SCAN_F1 0x000B -#define SCAN_F2 0x000C -#define SCAN_F3 0x000D -#define SCAN_F4 0x000E -#define SCAN_F5 0x000F -#define SCAN_F6 0x0010 -#define SCAN_F7 0x0011 -#define SCAN_F8 0x0012 -#define SCAN_F9 0x0013 -#define SCAN_F10 0x0014 -#define SCAN_F11 0x0015 -#define SCAN_F12 0x0016 -#define SCAN_ESC 0x0017 - -/** - Reset the input device and optionaly run diagnostics - - @param This Protocol instance pointer. - @param ExtendedVerification Driver may perform diagnostics on reset. - - @retval EFI_SUCCESS The device was reset. - @retval EFI_DEVICE_ERROR The device is not functioning properly and could not be reset. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INPUT_RESET)( - IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ); - -/** - Reads the next keystroke from the input device. The WaitForKey Event can - be used to test for existance of a keystroke via WaitForEvent () call. - - @param This Protocol instance pointer. - @param Key Driver may perform diagnostics on reset. - - @retval EFI_SUCCESS The keystroke information was returned. - @retval EFI_NOT_READY There was no keystroke data availiable. - @retval EFI_DEVICE_ERROR The keydtroke information was not returned due to - hardware errors. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INPUT_READ_KEY)( - IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This, - OUT EFI_INPUT_KEY *Key - ); - -/// -/// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device. -/// It is the minimum required protocol for ConsoleIn. -/// -struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL { - EFI_INPUT_RESET Reset; - EFI_INPUT_READ_KEY ReadKeyStroke; - /// - /// Event to use with WaitForEvent() to wait for a key to be available - /// - EFI_EVENT WaitForKey; -}; - -extern EFI_GUID gEfiSimpleTextInProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Protocol/SimpleTextOut.h b/gpxe/src/include/gpxe/efi/Protocol/SimpleTextOut.h deleted file mode 100644 index 426ce819..00000000 --- a/gpxe/src/include/gpxe/efi/Protocol/SimpleTextOut.h +++ /dev/null @@ -1,404 +0,0 @@ -/** @file - Simple Text Out protocol from the UEFI 2.0 specification. - - Abstraction of a very simple text based output device like VGA text mode or - a serial terminal. The Simple Text Out protocol instance can represent - a single hardware device or a virtual device that is an agregation - of multiple physical devices. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __SIMPLE_TEXT_OUT_H__ -#define __SIMPLE_TEXT_OUT_H__ - -#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \ - { \ - 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -/// -/// Protocol GUID defined in EFI1.1. -/// -#define SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID - -typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL; - -/// -/// Backward-compatible with EFI1.1. -/// -typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE; - -// -// Define's for required EFI Unicode Box Draw characters -// -#define BOXDRAW_HORIZONTAL 0x2500 -#define BOXDRAW_VERTICAL 0x2502 -#define BOXDRAW_DOWN_RIGHT 0x250c -#define BOXDRAW_DOWN_LEFT 0x2510 -#define BOXDRAW_UP_RIGHT 0x2514 -#define BOXDRAW_UP_LEFT 0x2518 -#define BOXDRAW_VERTICAL_RIGHT 0x251c -#define BOXDRAW_VERTICAL_LEFT 0x2524 -#define BOXDRAW_DOWN_HORIZONTAL 0x252c -#define BOXDRAW_UP_HORIZONTAL 0x2534 -#define BOXDRAW_VERTICAL_HORIZONTAL 0x253c -#define BOXDRAW_DOUBLE_HORIZONTAL 0x2550 -#define BOXDRAW_DOUBLE_VERTICAL 0x2551 -#define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552 -#define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553 -#define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554 -#define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555 -#define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556 -#define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557 -#define BOXDRAW_UP_RIGHT_DOUBLE 0x2558 -#define BOXDRAW_UP_DOUBLE_RIGHT 0x2559 -#define BOXDRAW_DOUBLE_UP_RIGHT 0x255a -#define BOXDRAW_UP_LEFT_DOUBLE 0x255b -#define BOXDRAW_UP_DOUBLE_LEFT 0x255c -#define BOXDRAW_DOUBLE_UP_LEFT 0x255d -#define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e -#define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f -#define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560 -#define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561 -#define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562 -#define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563 -#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564 -#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565 -#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566 -#define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567 -#define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568 -#define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569 -#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a -#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b -#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c - -// -// EFI Required Block Elements Code Chart -// -#define BLOCKELEMENT_FULL_BLOCK 0x2588 -#define BLOCKELEMENT_LIGHT_SHADE 0x2591 - -// -// EFI Required Geometric Shapes Code Chart -// -#define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2 -#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba -#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc -#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4 - -// -// EFI Required Arrow shapes -// -#define ARROW_LEFT 0x2190 -#define ARROW_UP 0x2191 -#define ARROW_RIGHT 0x2192 -#define ARROW_DOWN 0x2193 - -// -// EFI Console Colours -// -#define EFI_BLACK 0x00 -#define EFI_BLUE 0x01 -#define EFI_GREEN 0x02 -#define EFI_CYAN (EFI_BLUE | EFI_GREEN) -#define EFI_RED 0x04 -#define EFI_MAGENTA (EFI_BLUE | EFI_RED) -#define EFI_BROWN (EFI_GREEN | EFI_RED) -#define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED) -#define EFI_BRIGHT 0x08 -#define EFI_DARKGRAY (EFI_BRIGHT) -#define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT) -#define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT) -#define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT) -#define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT) -#define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT) -#define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT) -#define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT) - -#define EFI_TEXT_ATTR(f, b) ((f) | ((b) << 4)) - -#define EFI_BACKGROUND_BLACK 0x00 -#define EFI_BACKGROUND_BLUE 0x10 -#define EFI_BACKGROUND_GREEN 0x20 -#define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN) -#define EFI_BACKGROUND_RED 0x40 -#define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED) -#define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED) -#define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED) - -// -// We currently define attributes from 0 - 7F for color manipulations -// To internally handle the local display characteristics for a particular character, we are defining -// Bit 7 to signify the local glyph representation for a character. If turned on, glyphs will be -// pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19) -// If bit 7 is off, the narrow glyph database will be used. This does NOT affect information that is sent to -// non-local displays (e.g. serial or LAN consoles). -// -#define EFI_WIDE_ATTRIBUTE 0x80 - -/** - Reset the text output device hardware and optionaly run diagnostics - - @param This Protocol instance pointer. - @param ExtendedVerification Driver may perform more exhaustive verfication - operation of the device during reset. - - @retval EFI_SUCCESS The text output device was reset. - @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and - could not be reset. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_RESET)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ); - -/** - Write a Unicode string to the output device. - - @param This Protocol instance pointer. - @param String The NULL-terminated Unicode string to be displayed on the output - device(s). All output devices must also support the Unicode - drawing defined in this file. - - @retval EFI_SUCCESS The string was output to the device. - @retval EFI_DEVICE_ERROR The device reported an error while attempting to output - the text. - @retval EFI_UNSUPPORTED The output device's mode is not currently in a - defined text mode. - @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the - characters in the Unicode string could not be - rendered and were skipped. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_STRING)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN CHAR16 *String - ); - -/** - Verifies that all characters in a Unicode string can be output to the - target device. - - @param This Protocol instance pointer. - @param String The NULL-terminated Unicode string to be examined for the output - device(s). - - @retval EFI_SUCCESS The device(s) are capable of rendering the output string. - @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be - rendered by one or more of the output devices mapped - by the EFI handle. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_TEST_STRING)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN CHAR16 *String - ); - -/** - Returns information for an available text mode that the output device(s) - supports. - - @param This Protocol instance pointer. - @param ModeNumber The mode number to return information on. - @param Columns Returns the geometry of the text output device for the - requested ModeNumber. - @param Rows Returns the geometry of the text output device for the - requested ModeNumber. - - @retval EFI_SUCCESS The requested mode information was returned. - @retval EFI_DEVICE_ERROR The device had an error and could not complete the request. - @retval EFI_UNSUPPORTED The mode number was not valid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_QUERY_MODE)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN ModeNumber, - OUT UINTN *Columns, - OUT UINTN *Rows - ); - -/** - Sets the output device(s) to a specified mode. - - @param This Protocol instance pointer. - @param ModeNumber The mode number to set. - - @retval EFI_SUCCESS The requested text mode was set. - @retval EFI_DEVICE_ERROR The device had an error and could not complete the request. - @retval EFI_UNSUPPORTED The mode number was not valid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_SET_MODE)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN ModeNumber - ); - -/** - Sets the background and foreground colors for the OutputString () and - ClearScreen () functions. - - @param This Protocol instance pointer. - @param Attribute The attribute to set. Bits 0..3 are the foreground color, and - bits 4..6 are the background color. All other bits are undefined - and must be zero. The valid Attributes are defined in this file. - - @retval EFI_SUCCESS The attribute was set. - @retval EFI_DEVICE_ ERROR The device had an error and could not complete the request. - @retval EFI_UNSUPPORTED The attribute requested is not defined. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_SET_ATTRIBUTE)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN Attribute - ); - -/** - Clears the output device(s) display to the currently selected background - color. - - @param This Protocol instance pointer. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_DEVICE_ERROR The device had an error and could not complete the request. - @retval EFI_UNSUPPORTED The output device is not in a valid text mode. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_CLEAR_SCREEN)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This - ); - -/** - Sets the current coordinates of the cursor position - - @param This Protocol instance pointer. - @param Column The position to set the cursor to. Must be greater than or - equal to zero and less than the number of columns and rows - by QueryMode (). - @param Row The position to set the cursor to. Must be greater than or - equal to zero and less than the number of columns and rows - by QueryMode (). - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_DEVICE_ERROR The device had an error and could not complete the request. - @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the - cursor position is invalid for the current mode. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN UINTN Column, - IN UINTN Row - ); - -/** - Makes the cursor visible or invisible - - @param This Protocol instance pointer. - @param Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is - set to be invisible. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_DEVICE_ERROR The device had an error and could not complete the - request, or the device does not support changing - the cursor mode. - @retval EFI_UNSUPPORTED The output device is not in a valid text mode. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TEXT_ENABLE_CURSOR)( - IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This, - IN BOOLEAN Visible - ); - -/** - @par Data Structure Description: - Mode Structure pointed to by Simple Text Out protocol. - - @param MaxMode - The number of modes supported by QueryMode () and SetMode (). - - @param Mode - The text mode of the output device(s). - - @param Attribute - The current character output attribute - - @param CursorColumn - The cursor's column. - - @param CursorRow - The cursor's row. - - @param CursorVisible - The cursor is currently visbile or not. - -**/ -typedef struct { - INT32 MaxMode; - - // - // current settings - // - INT32 Mode; - INT32 Attribute; - INT32 CursorColumn; - INT32 CursorRow; - BOOLEAN CursorVisible; -} EFI_SIMPLE_TEXT_OUTPUT_MODE; - -/// -/// The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices. -/// It is the minimum required protocol for any handle supplied as the ConsoleOut -/// or StandardError device. In addition, the minimum supported text mode of such -/// devices is at least 80 x 25 characters. -/// -struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL { - EFI_TEXT_RESET Reset; - - EFI_TEXT_STRING OutputString; - EFI_TEXT_TEST_STRING TestString; - - EFI_TEXT_QUERY_MODE QueryMode; - EFI_TEXT_SET_MODE SetMode; - EFI_TEXT_SET_ATTRIBUTE SetAttribute; - - EFI_TEXT_CLEAR_SCREEN ClearScreen; - EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition; - EFI_TEXT_ENABLE_CURSOR EnableCursor; - - /// - /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data. - /// - EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode; -}; - -extern EFI_GUID gEfiSimpleTextOutProtocolGuid; - -#endif diff --git a/gpxe/src/include/gpxe/efi/Uefi.h b/gpxe/src/include/gpxe/efi/Uefi.h deleted file mode 100644 index 58ddb11f..00000000 --- a/gpxe/src/include/gpxe/efi/Uefi.h +++ /dev/null @@ -1,27 +0,0 @@ -/** @file - - Root include file for Mde Package UEFI, UEFI_APPLICATION type modules. - - This is the include file for any module of type UEFI and UEFI_APPLICATION. Uefi modules only use - types defined via this include file and can be ported easily to any - environment. - -Copyright (c) 2006 - 2007, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __PI_UEFI_H__ -#define __PI_UEFI_H__ - -#include <gpxe/efi/Uefi/UefiBaseType.h> -#include <gpxe/efi/Uefi/UefiSpec.h> - -#endif - diff --git a/gpxe/src/include/gpxe/efi/Uefi/UefiBaseType.h b/gpxe/src/include/gpxe/efi/Uefi/UefiBaseType.h deleted file mode 100644 index 475ac01e..00000000 --- a/gpxe/src/include/gpxe/efi/Uefi/UefiBaseType.h +++ /dev/null @@ -1,200 +0,0 @@ -/** @file - Defines data types and constants introduced in UEFI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __UEFI_BASETYPE_H__ -#define __UEFI_BASETYPE_H__ - -#include <gpxe/efi/Base.h> - -// -// Basical data type definitions introduced in UEFI. -// - -/// -/// 128-bit buffer containing a unique identifier value. -/// -typedef GUID EFI_GUID; -/// -/// Function return status for EFI API -/// -typedef RETURN_STATUS EFI_STATUS; -/// -/// A collection of related interfaces. -/// -typedef VOID *EFI_HANDLE; -/// -/// Handle to an event structure. -/// -typedef VOID *EFI_EVENT; -/// -/// Task priority level. -/// -typedef UINTN EFI_TPL; -/// -/// Logical block address. -/// -typedef UINT64 EFI_LBA; -typedef UINT64 EFI_PHYSICAL_ADDRESS; -typedef UINT64 EFI_VIRTUAL_ADDRESS; - -/// -/// EFI Time Abstraction: -/// Year: 1998 - 20XX -/// Month: 1 - 12 -/// Day: 1 - 31 -/// Hour: 0 - 23 -/// Minute: 0 - 59 -/// Second: 0 - 59 -/// Nanosecond: 0 - 999,999,999 -/// TimeZone: -1440 to 1440 or 2047 -/// -typedef struct { - UINT16 Year; - UINT8 Month; - UINT8 Day; - UINT8 Hour; - UINT8 Minute; - UINT8 Second; - UINT8 Pad1; - UINT32 Nanosecond; - INT16 TimeZone; - UINT8 Daylight; - UINT8 Pad2; -} EFI_TIME; - - -/// -/// 4-byte buffer. An IPv4 internet protocol address. -/// -typedef struct { - UINT8 Addr[4]; -} EFI_IPv4_ADDRESS; - -/// -/// 16-byte buffer. An IPv6 internet protocol address -/// -typedef struct { - UINT8 Addr[16]; -} EFI_IPv6_ADDRESS; - -/// -/// 32-byte buffer containing a network Media Access Control address. -/// -typedef struct { - UINT8 Addr[32]; -} EFI_MAC_ADDRESS; - -/// -/// 16-byte buffer aligned on a 4-byte boundary. -/// An IPv4 or IPv6 internet protocol address. -/// -typedef union { - UINT32 Addr[4]; - EFI_IPv4_ADDRESS v4; - EFI_IPv6_ADDRESS v6; -} EFI_IP_ADDRESS; - - -// -// Enumeration of EFI_STATUS. -// -#define EFI_SUCCESS RETURN_SUCCESS -#define EFI_LOAD_ERROR RETURN_LOAD_ERROR -#define EFI_INVALID_PARAMETER RETURN_INVALID_PARAMETER -#define EFI_UNSUPPORTED RETURN_UNSUPPORTED -#define EFI_BAD_BUFFER_SIZE RETURN_BAD_BUFFER_SIZE -#define EFI_BUFFER_TOO_SMALL RETURN_BUFFER_TOO_SMALL -#define EFI_NOT_READY RETURN_NOT_READY -#define EFI_DEVICE_ERROR RETURN_DEVICE_ERROR -#define EFI_WRITE_PROTECTED RETURN_WRITE_PROTECTED -#define EFI_OUT_OF_RESOURCES RETURN_OUT_OF_RESOURCES -#define EFI_VOLUME_CORRUPTED RETURN_VOLUME_CORRUPTED -#define EFI_VOLUME_FULL RETURN_VOLUME_FULL -#define EFI_NO_MEDIA RETURN_NO_MEDIA -#define EFI_MEDIA_CHANGED RETURN_MEDIA_CHANGED -#define EFI_NOT_FOUND RETURN_NOT_FOUND -#define EFI_ACCESS_DENIED RETURN_ACCESS_DENIED -#define EFI_NO_RESPONSE RETURN_NO_RESPONSE -#define EFI_NO_MAPPING RETURN_NO_MAPPING -#define EFI_TIMEOUT RETURN_TIMEOUT -#define EFI_NOT_STARTED RETURN_NOT_STARTED -#define EFI_ALREADY_STARTED RETURN_ALREADY_STARTED -#define EFI_ABORTED RETURN_ABORTED -#define EFI_ICMP_ERROR RETURN_ICMP_ERROR -#define EFI_TFTP_ERROR RETURN_TFTP_ERROR -#define EFI_PROTOCOL_ERROR RETURN_PROTOCOL_ERROR -#define EFI_INCOMPATIBLE_VERSION RETURN_INCOMPATIBLE_VERSION -#define EFI_SECURITY_VIOLATION RETURN_SECURITY_VIOLATION -#define EFI_CRC_ERROR RETURN_CRC_ERROR -#define EFI_END_OF_MEDIA RETURN_END_OF_MEDIA -#define EFI_END_OF_FILE RETURN_END_OF_FILE -#define EFI_INVALID_LANGUAGE RETURN_INVALID_LANGUAGE - -#define EFI_WARN_UNKNOWN_GLYPH RETURN_WARN_UNKNOWN_GLYPH -#define EFI_WARN_DELETE_FAILURE RETURN_WARN_DELETE_FAILURE -#define EFI_WARN_WRITE_FAILURE RETURN_WARN_WRITE_FAILURE -#define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL - - -// -// Define macro to encode the status code. -// -#define EFIERR(_a) ENCODE_ERROR(_a) - -#define EFI_ERROR(A) RETURN_ERROR(A) - -// -// Define macros to build data structure signatures from characters. -// -#define EFI_SIGNATURE_16(A, B) SIGNATURE_16 (A, B) -#define EFI_SIGNATURE_32(A, B, C, D) SIGNATURE_32 (A, B, C, D) -#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) SIGNATURE_64 (A, B, C, D, E, F, G, H) - - -/// -/// Returns the byte offset to a field within a structure -/// -#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field))) - -// -// The EFI memory allocation functions work in units of EFI_PAGEs that are -// 4K. This should in no way be confused with the page size of the processor. -// An EFI_PAGE is just the quanta of memory in EFI. -// -#define EFI_PAGE_SIZE 0x1000 -#define EFI_PAGE_MASK 0xFFF -#define EFI_PAGE_SHIFT 12 - -#define EFI_SIZE_TO_PAGES(a) (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0)) - -#define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT) - - -#define EFI_MAX_BIT MAX_BIT -#define EFI_MAX_ADDRESS MAX_ADDRESS - - -/// -/// Limited buffer size for a language code recommended by RFC3066 -/// (42 characters plus a NULL terminator) -/// -#define RFC_3066_ENTRY_SIZE (42 + 1) - -/// -/// The size of a 3 character ISO639 language code. -/// -#define ISO_639_2_ENTRY_SIZE 3 - - -#endif diff --git a/gpxe/src/include/gpxe/efi/Uefi/UefiGpt.h b/gpxe/src/include/gpxe/efi/Uefi/UefiGpt.h deleted file mode 100644 index 92c3035e..00000000 --- a/gpxe/src/include/gpxe/efi/Uefi/UefiGpt.h +++ /dev/null @@ -1,62 +0,0 @@ -/** @file - EFI Guid Partition Table Format Definition. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __UEFI_GPT_H__ -#define __UEFI_GPT_H__ - -/// -/// The primary GUID Partition Table Header must be -/// located in LBA 1 (i.e., the second logical block). -/// -#define PRIMARY_PART_HEADER_LBA 1 - -/// -/// EFI Partition Table Signature: "EFI PART" -/// -#define EFI_PTAB_HEADER_ID 0x5452415020494645ULL - -#pragma pack(1) - -/// -/// GPT Partition Table Header -/// -typedef struct { - EFI_TABLE_HEADER Header; - EFI_LBA MyLBA; - EFI_LBA AlternateLBA; - EFI_LBA FirstUsableLBA; - EFI_LBA LastUsableLBA; - EFI_GUID DiskGUID; - EFI_LBA PartitionEntryLBA; - UINT32 NumberOfPartitionEntries; - UINT32 SizeOfPartitionEntry; - UINT32 PartitionEntryArrayCRC32; -} EFI_PARTITION_TABLE_HEADER; - -/// -/// GPT Partition Entry -/// -typedef struct { - EFI_GUID PartitionTypeGUID; - EFI_GUID UniquePartitionGUID; - EFI_LBA StartingLBA; - EFI_LBA EndingLBA; - UINT64 Attributes; - CHAR16 PartitionName[36]; -} EFI_PARTITION_ENTRY; - -#pragma pack() -#endif - - diff --git a/gpxe/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h b/gpxe/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h deleted file mode 100644 index c6755173..00000000 --- a/gpxe/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h +++ /dev/null @@ -1,1590 +0,0 @@ -/** @file - This file defines the encoding for the VFR (Visual Form Representation) language. - IFR is primarily consumed by the EFI presentation engine, and produced by EFI - internal application and drivers as well as all add-in card option-ROM drivers - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - These definitions are from UEFI2.1. - -**/ - -#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__ -#define __UEFI_INTERNAL_FORMREPRESENTATION_H__ - -/// -/// The following types are currently defined: -/// -typedef VOID* EFI_HII_HANDLE; -typedef CHAR16* EFI_STRING; -typedef UINT16 EFI_IMAGE_ID; -typedef UINT16 EFI_QUESTION_ID; -typedef UINT16 EFI_STRING_ID; -typedef UINT16 EFI_FORM_ID; -typedef UINT16 EFI_VARSTORE_ID; - -typedef UINT16 EFI_DEFAULT_ID; - -typedef UINT32 EFI_HII_FONT_STYLE; - - - -#pragma pack(1) - -// -// Definitions for Package Lists and Package Headers -// Section 27.3.1 -// - -/// -/// The header found at the start of each package list. -/// -typedef struct { - EFI_GUID PackageListGuid; - UINT32 PackageLength; -} EFI_HII_PACKAGE_LIST_HEADER; - -/// -/// The header found at the start of each package. -/// -typedef struct { - UINT32 Length:24; - UINT32 Type:8; - // UINT8 Data[...]; -} EFI_HII_PACKAGE_HEADER; - -// -// Value of HII package type -// -#define EFI_HII_PACKAGE_TYPE_ALL 0x00 -#define EFI_HII_PACKAGE_TYPE_GUID 0x01 -#define EFI_HII_PACKAGE_FORMS 0x02 -#define EFI_HII_PACKAGE_STRINGS 0x04 -#define EFI_HII_PACKAGE_FONTS 0x05 -#define EFI_HII_PACKAGE_IMAGES 0x06 -#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07 -#define EFI_HII_PACKAGE_DEVICE_PATH 0x08 -#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x09 -#define EFI_HII_PACKAGE_END 0xDF -#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0 -#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF - -// -// Definitions for Simplified Font Package -// Section 27.3.2 -// - -// -// Contents of EFI_NARROW_GLYPH.Attributes -// -#define EFI_GLYPH_NON_SPACING 0x01 -#define EFI_GLYPH_WIDE 0x02 -#define EFI_GLYPH_HEIGHT 19 -#define EFI_GLYPH_WIDTH 8 - -typedef struct { - CHAR16 UnicodeWeight; - UINT8 Attributes; - UINT8 GlyphCol1[EFI_GLYPH_HEIGHT]; -} EFI_NARROW_GLYPH; - -typedef struct { - CHAR16 UnicodeWeight; - UINT8 Attributes; - UINT8 GlyphCol1[EFI_GLYPH_HEIGHT]; - UINT8 GlyphCol2[EFI_GLYPH_HEIGHT]; - UINT8 Pad[3]; -} EFI_WIDE_GLYPH; - -/// -/// A simplified font package consists of a font header -/// followed by a series of glyph structures. -/// -typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT16 NumberOfNarrowGlyphs; - UINT16 NumberOfWideGlyphs; - // EFI_NARROW_GLYPH NarrowGlyphs[]; - // EFI_WIDE_GLYPH WideGlyphs[]; -} EFI_HII_SIMPLE_FONT_PACKAGE_HDR; - -// -// Definitions for Font Package -// Section 27.3.3 -// - -// -// Value for font style -// -#define EFI_HII_FONT_STYLE_NORMAL 0x00000000 -#define EFI_HII_FONT_STYLE_BOLD 0x00000001 -#define EFI_HII_FONT_STYLE_ITALIC 0x00000002 -#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000 -#define EFI_HII_FONT_STYLE_OUTLINE 0x00020000 -#define EFI_HII_FONT_STYLE_SHADOW 0x00040000 -#define EFI_HII_FONT_STYLE_UNDERLINE 0x00080000 -#define EFI_HII_FONT_STYLE_DBL_UNDER 0x00100000 - -typedef struct _EFI_HII_GLYPH_INFO { - UINT16 Width; - UINT16 Height; - INT16 OffsetX; - INT16 OffsetY; - INT16 AdvanceX; -} EFI_HII_GLYPH_INFO; - -/// -/// The fixed header consists of a standard record header and -/// then the character values in this section, the flags -/// (including the encoding method) and the offsets of the glyph -/// information, the glyph bitmaps and the character map. -/// -typedef struct _EFI_HII_FONT_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT32 HdrSize; - UINT32 GlyphBlockOffset; - EFI_HII_GLYPH_INFO Cell; - EFI_HII_FONT_STYLE FontStyle; - CHAR16 FontFamily[1]; -} EFI_HII_FONT_PACKAGE_HDR; - -// -// Value of different glyph info block types -// -#define EFI_HII_GIBT_END 0x00 -#define EFI_HII_GIBT_GLYPH 0x10 -#define EFI_HII_GIBT_GLYPHS 0x11 -#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12 -#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13 -#define EFI_HII_GIBT_DUPLICATE 0x20 -#define EFI_HII_GIBT_SKIP2 0x21 -#define EFI_HII_GIBT_SKIP1 0x22 -#define EFI_HII_GIBT_DEFAULTS 0x23 -#define EFI_HII_GIBT_EXT1 0x30 -#define EFI_HII_GIBT_EXT2 0x31 -#define EFI_HII_GIBT_EXT4 0x32 - -typedef struct _EFI_HII_GLYPH_BLOCK { - UINT8 BlockType; -} EFI_HII_GLYPH_BLOCK; - -// -// Definition of different glyph info block types -// - -typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - EFI_HII_GLYPH_INFO Cell; -} EFI_HII_GIBT_DEFAULTS_BLOCK; - -typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - CHAR16 CharValue; -} EFI_HII_GIBT_DUPLICATE_BLOCK; - -typedef struct _EFI_GLYPH_GIBT_END_BLOCK { - EFI_HII_GLYPH_BLOCK Header; -} EFI_GLYPH_GIBT_END_BLOCK; - -typedef struct _EFI_HII_GIBT_EXT1_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BlockType2; - UINT8 Length; -} EFI_HII_GIBT_EXT1_BLOCK; - -typedef struct _EFI_HII_GIBT_EXT2_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BlockType2; - UINT16 Length; -} EFI_HII_GIBT_EXT2_BLOCK; - -typedef struct _EFI_HII_GIBT_EXT4_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BlockType2; - UINT32 Length; -} EFI_HII_GIBT_EXT4_BLOCK; - -typedef struct _EFI_HII_GIBT_GLYPH_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - EFI_HII_GLYPH_INFO Cell; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPH_BLOCK; - -typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - EFI_HII_GLYPH_INFO Cell; - UINT16 Count; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPHS_BLOCK; - -typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK; - -typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT16 Count; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK; - -typedef struct _EFI_HII_GIBT_SKIP1_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 SkipCount; -} EFI_HII_GIBT_SKIP1_BLOCK; - -typedef struct _EFI_HII_GIBT_SKIP2_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT16 SkipCount; -} EFI_HII_GIBT_SKIP2_BLOCK; - -// -// Definitions for Device Path Package -// Section 27.3.4 -// - -/// -/// The device path package is used to carry a device path -/// associated with the package list. -/// -typedef struct _EFI_HII_DEVICE_PATH_PACKAGE { - EFI_HII_PACKAGE_HEADER Header; - // EFI_DEVICE_PATH_PROTOCOL DevicePath[]; -} EFI_HII_DEVICE_PATH_PACKAGE; - -// -// Definitions for GUID Package -// Section 27.3.5 -// - -/// -/// The GUID package is used to carry data where the format is defined by a GUID. -/// -typedef struct _EFI_HII_GUID_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - EFI_GUID Guid; - // Data per GUID definition may follow -} EFI_HII_GUID_PACKAGE_HDR; - -// -// Definitions for String Package -// Section 27.3.6 -// - -#define UEFI_CONFIG_LANG L"x-UEFI" -#define UEFI_CONFIG_LANG2 L"x-i-UEFI" - -/// -/// The fixed header consists of a standard record header and then the string identifiers -/// contained in this section and the offsets of the string and language information. -/// -typedef struct _EFI_HII_STRING_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT32 HdrSize; - UINT32 StringInfoOffset; - CHAR16 LanguageWindow[16]; - EFI_STRING_ID LanguageName; - CHAR8 Language[1]; -} EFI_HII_STRING_PACKAGE_HDR; - -typedef struct { - UINT8 BlockType; -} EFI_HII_STRING_BLOCK; - -// -// Value of different string information block types -// -#define EFI_HII_SIBT_END 0x00 -#define EFI_HII_SIBT_STRING_SCSU 0x10 -#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11 -#define EFI_HII_SIBT_STRINGS_SCSU 0x12 -#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13 -#define EFI_HII_SIBT_STRING_UCS2 0x14 -#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15 -#define EFI_HII_SIBT_STRINGS_UCS2 0x16 -#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17 -#define EFI_HII_SIBT_DUPLICATE 0x20 -#define EFI_HII_SIBT_SKIP2 0x21 -#define EFI_HII_SIBT_SKIP1 0x22 -#define EFI_HII_SIBT_EXT1 0x30 -#define EFI_HII_SIBT_EXT2 0x31 -#define EFI_HII_SIBT_EXT4 0x32 -#define EFI_HII_SIBT_FONT 0x40 - -// -// Definition of different string information block types -// - -typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK { - EFI_HII_STRING_BLOCK Header; - EFI_STRING_ID StringId; -} EFI_HII_SIBT_DUPLICATE_BLOCK; - -typedef struct _EFI_HII_SIBT_END_BLOCK { - EFI_HII_STRING_BLOCK Header; -} EFI_HII_SIBT_END_BLOCK; - -typedef struct _EFI_HII_SIBT_EXT1_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 BlockType2; - UINT8 Length; -} EFI_HII_SIBT_EXT1_BLOCK; - -typedef struct _EFI_HII_SIBT_EXT2_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 BlockType2; - UINT16 Length; -} EFI_HII_SIBT_EXT2_BLOCK; - -typedef struct _EFI_HII_SIBT_EXT4_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 BlockType2; - UINT32 Length; -} EFI_HII_SIBT_EXT4_BLOCK; - -typedef struct _EFI_HII_SIBT_FONT_BLOCK { - EFI_HII_SIBT_EXT2_BLOCK Header; - UINT8 FontId; - UINT16 FontSize; - EFI_HII_FONT_STYLE FontStyle; - CHAR16 FontName[1]; -} EFI_HII_SIBT_FONT_BLOCK; - -typedef struct _EFI_HII_SIBT_SKIP1_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 SkipCount; -} EFI_HII_SIBT_SKIP1_BLOCK; - -typedef struct _EFI_HII_SIBT_SKIP2_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT16 SkipCount; -} EFI_HII_SIBT_SKIP2_BLOCK; - -typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRING_SCSU_BLOCK; - -typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 FontIdentifier; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK; - -typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT16 StringCount; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRINGS_SCSU_BLOCK; - -typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 FontIdentifier; - UINT16 StringCount; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK; - -typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK { - EFI_HII_STRING_BLOCK Header; - CHAR16 StringText[1]; -} EFI_HII_SIBT_STRING_UCS2_BLOCK; - -typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 FontIdentifier; - CHAR16 StringText[1]; -} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK; - -typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT16 StringCount; - CHAR16 StringText[1]; -} EFI_HII_SIBT_STRINGS_UCS2_BLOCK; - -typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 FontIdentifier; - UINT16 StringCount; - CHAR16 StringText[1]; -} EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK; - -// -// Definitions for Image Package -// Section 27.3.7 -// - -typedef struct _EFI_HII_IMAGE_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT32 ImageInfoOffset; - UINT32 PaletteInfoOffset; -} EFI_HII_IMAGE_PACKAGE_HDR; - -typedef struct _EFI_HII_IMAGE_BLOCK { - UINT8 BlockType; -} EFI_HII_IMAGE_BLOCK; - -// -// Value of different image information block types -// -#define EFI_HII_IIBT_END 0x00 -#define EFI_HII_IIBT_IMAGE_1BIT 0x10 -#define EFI_HII_IIBT_IMAGE_1BIT_TRANS 0x11 -#define EFI_HII_IIBT_IMAGE_4BIT 0x12 -#define EFI_HII_IIBT_IMAGE_4BIT_TRANS 0x13 -#define EFI_HII_IIBT_IMAGE_8BIT 0x14 -#define EFI_HII_IIBT_IMAGE_8BIT_TRANS 0x15 -#define EFI_HII_IIBT_IMAGE_24BIT 0x16 -#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17 -#define EFI_HII_IIBT_IMAGE_JPEG 0x18 -#define EFI_HII_IIBT_DUPLICATE 0x20 -#define EFI_HII_IIBT_SKIP2 0x21 -#define EFI_HII_IIBT_SKIP1 0x22 -#define EFI_HII_IIBT_EXT1 0x30 -#define EFI_HII_IIBT_EXT2 0x31 -#define EFI_HII_IIBT_EXT4 0x32 - -// -// Definition of different image information block types -// - -typedef struct _EFI_HII_IIBT_END_BLOCK { - EFI_HII_IMAGE_BLOCK Header; -} EFI_HII_IIBT_END_BLOCK; - -typedef struct _EFI_HII_IIBT_EXT1_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 BlockType2; - UINT8 Length; -} EFI_HII_IIBT_EXT1_BLOCK; - -typedef struct _EFI_HII_IIBT_EXT2_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 BlockType2; - UINT16 Length; -} EFI_HII_IIBT_EXT2_BLOCK; - -typedef struct _EFI_HII_IIBT_EXT4_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 BlockType2; - UINT32 Length; -} EFI_HII_IIBT_EXT4_BLOCK; - -typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE { - UINT16 Width; - UINT16 Height; - UINT8 Data[1]; -} EFI_HII_IIBT_IMAGE_1BIT_BASE; - -typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_1BIT_BLOCK; - -typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK; - -typedef struct _EFI_HII_RGB_PIXEL { - UINT8 b; - UINT8 g; - UINT8 r; -} EFI_HII_RGB_PIXEL; - -typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE { - UINT16 Width; - UINT16 Height; - EFI_HII_RGB_PIXEL Bitmap[1]; -} EFI_HII_IIBT_IMAGE_24BIT_BASE; - -typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_24BIT_BLOCK; - -typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK; - -typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE { - UINT16 Width; - UINT16 Height; - UINT8 Data[1]; -} EFI_HII_IIBT_IMAGE_4BIT_BASE; - -typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_4BIT_BLOCK; - -typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK; - -typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE { - UINT16 Width; - UINT16 Height; - UINT8 Data[1]; -} EFI_HII_IIBT_IMAGE_8BIT_BASE; - -typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_8BIT_BLOCK; - -typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK; - -typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - EFI_IMAGE_ID ImageId; -} EFI_HII_IIBT_DUPLICATE_BLOCK; - -typedef struct _EFI_HII_IIBT_JPEG_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT32 Size; - UINT8 Data[1]; -} EFI_HII_IIBT_JPEG_BLOCK; - -typedef struct _EFI_HII_IIBT_SKIP1_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 SkipCount; -} EFI_HII_IIBT_SKIP1_BLOCK; - -typedef struct _EFI_HII_IIBT_SKIP2_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT16 SkipCount; -} EFI_HII_IIBT_SKIP2_BLOCK; - -// -// Definitions for Palette Information -// - -typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER { - UINT16 PaletteCount; -} EFI_HII_IMAGE_PALETTE_INFO_HEADER; - -typedef struct _EFI_HII_IMAGE_PALETTE_INFO { - UINT16 PaletteSize; - EFI_HII_RGB_PIXEL PaletteValue[1]; -} EFI_HII_IMAGE_PALETTE_INFO; - -// -// Definitions for Forms Package -// Section 27.3.8 -// - -/// -/// The Forms package is used to carry forms-based encoding data. -/// -typedef struct _EFI_HII_FORM_PACKAGE { - EFI_HII_PACKAGE_HEADER Header; - // EFI_IFR_OP_HEADER OpCodeHeader; - // More op-codes follow -} EFI_HII_FORM_PACKAGE; - -typedef struct { - UINT8 Hour; - UINT8 Minute; - UINT8 Second; -} EFI_HII_TIME; - -typedef struct { - UINT16 Year; - UINT8 Month; - UINT8 Day; -} EFI_HII_DATE; - -typedef union { - UINT8 u8; - UINT16 u16; - UINT32 u32; - UINT64 u64; - BOOLEAN b; - EFI_HII_TIME time; - EFI_HII_DATE date; - EFI_STRING_ID string; -} EFI_IFR_TYPE_VALUE; - -// -// IFR Opcodes -// -#define EFI_IFR_FORM_OP 0x01 -#define EFI_IFR_SUBTITLE_OP 0x02 -#define EFI_IFR_TEXT_OP 0x03 -#define EFI_IFR_IMAGE_OP 0x04 -#define EFI_IFR_ONE_OF_OP 0x05 -#define EFI_IFR_CHECKBOX_OP 0x06 -#define EFI_IFR_NUMERIC_OP 0x07 -#define EFI_IFR_PASSWORD_OP 0x08 -#define EFI_IFR_ONE_OF_OPTION_OP 0x09 -#define EFI_IFR_SUPPRESS_IF_OP 0x0A -#define EFI_IFR_LOCKED_OP 0x0B -#define EFI_IFR_ACTION_OP 0x0C -#define EFI_IFR_RESET_BUTTON_OP 0x0D -#define EFI_IFR_FORM_SET_OP 0x0E -#define EFI_IFR_REF_OP 0x0F -#define EFI_IFR_NO_SUBMIT_IF_OP 0x10 -#define EFI_IFR_INCONSISTENT_IF_OP 0x11 -#define EFI_IFR_EQ_ID_VAL_OP 0x12 -#define EFI_IFR_EQ_ID_ID_OP 0x13 -#define EFI_IFR_EQ_ID_LIST_OP 0x14 -#define EFI_IFR_AND_OP 0x15 -#define EFI_IFR_OR_OP 0x16 -#define EFI_IFR_NOT_OP 0x17 -#define EFI_IFR_RULE_OP 0x18 -#define EFI_IFR_GRAY_OUT_IF_OP 0x19 -#define EFI_IFR_DATE_OP 0x1A -#define EFI_IFR_TIME_OP 0x1B -#define EFI_IFR_STRING_OP 0x1C -#define EFI_IFR_REFRESH_OP 0x1D -#define EFI_IFR_DISABLE_IF_OP 0x1E -#define EFI_IFR_TO_LOWER_OP 0x20 -#define EFI_IFR_TO_UPPER_OP 0x21 -#define EFI_IFR_ORDERED_LIST_OP 0x23 -#define EFI_IFR_VARSTORE_OP 0x24 -#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25 -#define EFI_IFR_VARSTORE_EFI_OP 0x26 -#define EFI_IFR_VARSTORE_DEVICE_OP 0x27 -#define EFI_IFR_VERSION_OP 0x28 -#define EFI_IFR_END_OP 0x29 -#define EFI_IFR_MATCH_OP 0x2A -#define EFI_IFR_EQUAL_OP 0x2F -#define EFI_IFR_NOT_EQUAL_OP 0x30 -#define EFI_IFR_GREATER_THAN_OP 0x31 -#define EFI_IFR_GREATER_EQUAL_OP 0x32 -#define EFI_IFR_LESS_THAN_OP 0x33 -#define EFI_IFR_LESS_EQUAL_OP 0x34 -#define EFI_IFR_BITWISE_AND_OP 0x35 -#define EFI_IFR_BITWISE_OR_OP 0x36 -#define EFI_IFR_BITWISE_NOT_OP 0x37 -#define EFI_IFR_SHIFT_LEFT_OP 0x38 -#define EFI_IFR_SHIFT_RIGHT_OP 0x39 -#define EFI_IFR_ADD_OP 0x3A -#define EFI_IFR_SUBTRACT_OP 0x3B -#define EFI_IFR_MULTIPLY_OP 0x3C -#define EFI_IFR_DIVIDE_OP 0x3D -#define EFI_IFR_MODULO_OP 0x3E -#define EFI_IFR_RULE_REF_OP 0x3F -#define EFI_IFR_QUESTION_REF1_OP 0x40 -#define EFI_IFR_QUESTION_REF2_OP 0x41 -#define EFI_IFR_UINT8_OP 0x42 -#define EFI_IFR_UINT16_OP 0x43 -#define EFI_IFR_UINT32_OP 0x44 -#define EFI_IFR_UINT64_OP 0x45 -#define EFI_IFR_TRUE_OP 0x46 -#define EFI_IFR_FALSE_OP 0x47 -#define EFI_IFR_TO_UINT_OP 0x48 -#define EFI_IFR_TO_STRING_OP 0x49 -#define EFI_IFR_TO_BOOLEAN_OP 0x4A -#define EFI_IFR_MID_OP 0x4B -#define EFI_IFR_FIND_OP 0x4C -#define EFI_IFR_TOKEN_OP 0x4D -#define EFI_IFR_STRING_REF1_OP 0x4E -#define EFI_IFR_STRING_REF2_OP 0x4F -#define EFI_IFR_CONDITIONAL_OP 0x50 -#define EFI_IFR_QUESTION_REF3_OP 0x51 -#define EFI_IFR_ZERO_OP 0x52 -#define EFI_IFR_ONE_OP 0x53 -#define EFI_IFR_ONES_OP 0x54 -#define EFI_IFR_UNDEFINED_OP 0x55 -#define EFI_IFR_LENGTH_OP 0x56 -#define EFI_IFR_DUP_OP 0x57 -#define EFI_IFR_THIS_OP 0x58 -#define EFI_IFR_SPAN_OP 0x59 -#define EFI_IFR_VALUE_OP 0x5A -#define EFI_IFR_DEFAULT_OP 0x5B -#define EFI_IFR_DEFAULTSTORE_OP 0x5C -#define EFI_IFR_CATENATE_OP 0x5E -#define EFI_IFR_GUID_OP 0x5F - -// -// Definitions of IFR Standard Headers -// Section 27.3.8.2 -// - -typedef struct _EFI_IFR_OP_HEADER { - UINT8 OpCode; - UINT8 Length:7; - UINT8 Scope:1; -} EFI_IFR_OP_HEADER; - -typedef struct _EFI_IFR_STATEMENT_HEADER { - EFI_STRING_ID Prompt; - EFI_STRING_ID Help; -} EFI_IFR_STATEMENT_HEADER; - -typedef struct _EFI_IFR_QUESTION_HEADER { - EFI_IFR_STATEMENT_HEADER Header; - EFI_QUESTION_ID QuestionId; - EFI_VARSTORE_ID VarStoreId; - union { - EFI_STRING_ID VarName; - UINT16 VarOffset; - } VarStoreInfo; - UINT8 Flags; -} EFI_IFR_QUESTION_HEADER; - -// -// Flag values of EFI_IFR_QUESTION_HEADER -// -#define EFI_IFR_FLAG_READ_ONLY 0x01 -#define EFI_IFR_FLAG_CALLBACK 0x04 -#define EFI_IFR_FLAG_RESET_REQUIRED 0x10 -#define EFI_IFR_FLAG_OPTIONS_ONLY 0x80 - -// -// Definition for Opcode Reference -// Section 27.3.8.3 -// -typedef struct _EFI_IFR_DEFAULTSTORE { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID DefaultName; - UINT16 DefaultId; -} EFI_IFR_DEFAULTSTORE; - -// -// Default Identifier of default store -// -#define EFI_HII_DEFAULT_CLASS_STANDARD 0x0000 -#define EFI_HII_DEFAULT_CLASS_MANUFACTURING 0x0001 -#define EFI_HII_DEFAULT_CLASS_SAFE 0x0002 -#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000 -#define EFI_HII_DEFAULT_CLASS_PLATFORM_END 0x7fff -#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000 -#define EFI_HII_DEFAULT_CLASS_HARDWARE_END 0xbfff -#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000 -#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END 0xffff - -typedef struct _EFI_IFR_VARSTORE { - EFI_IFR_OP_HEADER Header; - EFI_GUID Guid; - EFI_VARSTORE_ID VarStoreId; - UINT16 Size; - UINT8 Name[1]; -} EFI_IFR_VARSTORE; - -typedef struct _EFI_IFR_VARSTORE_EFI { - EFI_IFR_OP_HEADER Header; - EFI_VARSTORE_ID VarStoreId; - EFI_GUID Guid; - UINT32 Attributes; -} EFI_IFR_VARSTORE_EFI; - -typedef struct _EFI_IFR_VARSTORE_NAME_VALUE { - EFI_IFR_OP_HEADER Header; - EFI_VARSTORE_ID VarStoreId; - EFI_GUID Guid; -} EFI_IFR_VARSTORE_NAME_VALUE; - -typedef struct _EFI_IFR_FORM_SET { - EFI_IFR_OP_HEADER Header; - EFI_GUID Guid; - EFI_STRING_ID FormSetTitle; - EFI_STRING_ID Help; -} EFI_IFR_FORM_SET; - -typedef struct _EFI_IFR_END { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_END; - -typedef struct _EFI_IFR_FORM { - EFI_IFR_OP_HEADER Header; - UINT16 FormId; - EFI_STRING_ID FormTitle; -} EFI_IFR_FORM; - -typedef struct _EFI_IFR_IMAGE { - EFI_IFR_OP_HEADER Header; - EFI_IMAGE_ID Id; -} EFI_IFR_IMAGE; - -typedef struct _EFI_IFR_LOCKED { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_LOCKED; - -typedef struct _EFI_IFR_RULE { - EFI_IFR_OP_HEADER Header; - UINT8 RuleId; -} EFI_IFR_RULE; - -typedef struct _EFI_IFR_DEFAULT { - EFI_IFR_OP_HEADER Header; - UINT16 DefaultId; - UINT8 Type; - EFI_IFR_TYPE_VALUE Value; -} EFI_IFR_DEFAULT; - -typedef struct _EFI_IFR_VALUE { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_VALUE; - -typedef struct _EFI_IFR_SUBTITLE { - EFI_IFR_OP_HEADER Header; - EFI_IFR_STATEMENT_HEADER Statement; - UINT8 Flags; -} EFI_IFR_SUBTITLE; - -#define EFI_IFR_FLAGS_HORIZONTAL 0x01 - -typedef struct _EFI_IFR_CHECKBOX { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT8 Flags; -} EFI_IFR_CHECKBOX; - -#define EFI_IFR_CHECKBOX_DEFAULT 0x01 -#define EFI_IFR_CHECKBOX_DEFAULT_MFG 0x02 - -typedef struct _EFI_IFR_TEXT { - EFI_IFR_OP_HEADER Header; - EFI_IFR_STATEMENT_HEADER Statement; - EFI_STRING_ID TextTwo; -} EFI_IFR_TEXT; - -typedef struct _EFI_IFR_REF { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - EFI_FORM_ID FormId; -} EFI_IFR_REF; - -typedef struct _EFI_IFR_REF2 { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - EFI_FORM_ID FormId; - EFI_QUESTION_ID QuestionId; -} EFI_IFR_REF2; - -typedef struct _EFI_IFR_REF3 { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - EFI_FORM_ID FormId; - EFI_QUESTION_ID QuestionId; - EFI_GUID FormSetId; -} EFI_IFR_REF3; - -typedef struct _EFI_IFR_REF4 { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - EFI_FORM_ID FormId; - EFI_QUESTION_ID QuestionId; - EFI_GUID FormSetId; - EFI_STRING_ID DevicePath; -} EFI_IFR_REF4; - -typedef struct _EFI_IFR_RESET_BUTTON { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - EFI_DEFAULT_ID DefaultId; -} EFI_IFR_RESET_BUTTON; - -typedef struct _EFI_IFR_ACTION { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - EFI_STRING_ID QuestionConfig; -} EFI_IFR_ACTION; - -typedef struct _EFI_IFR_ACTION_1 { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; -} EFI_IFR_ACTION_1; - -typedef struct _EFI_IFR_DATE { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT8 Flags; -} EFI_IFR_DATE; - -// -// Flags that describe the behavior of the question. -// -#define EFI_QF_DATE_YEAR_SUPPRESS 0x01 -#define EFI_QF_DATE_MONTH_SUPPRESS 0x02 -#define EFI_QF_DATE_DAY_SUPPRESS 0x04 - -#define EFI_QF_DATE_STORAGE 0x30 -#define QF_DATE_STORAGE_NORMAL 0x00 -#define QF_DATE_STORAGE_TIME 0x10 -#define QF_DATE_STORAGE_WAKEUP 0x20 - -typedef union { - struct { - UINT8 MinValue; - UINT8 MaxValue; - UINT8 Step; - } u8; - struct { - UINT16 MinValue; - UINT16 MaxValue; - UINT16 Step; - } u16; - struct { - UINT32 MinValue; - UINT32 MaxValue; - UINT32 Step; - } u32; - struct { - UINT64 MinValue; - UINT64 MaxValue; - UINT64 Step; - } u64; -} MINMAXSTEP_DATA; - -typedef struct _EFI_IFR_NUMERIC { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT8 Flags; - MINMAXSTEP_DATA data; -} EFI_IFR_NUMERIC; - -// -// Flags related to the numeric question -// -#define EFI_IFR_NUMERIC_SIZE 0x03 -#define EFI_IFR_NUMERIC_SIZE_1 0x00 -#define EFI_IFR_NUMERIC_SIZE_2 0x01 -#define EFI_IFR_NUMERIC_SIZE_4 0x02 -#define EFI_IFR_NUMERIC_SIZE_8 0x03 - -#define EFI_IFR_DISPLAY 0x30 -#define EFI_IFR_DISPLAY_INT_DEC 0x00 -#define EFI_IFR_DISPLAY_UINT_DEC 0x10 -#define EFI_IFR_DISPLAY_UINT_HEX 0x20 - -typedef struct _EFI_IFR_ONE_OF { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT8 Flags; - MINMAXSTEP_DATA data; -} EFI_IFR_ONE_OF; - -typedef struct _EFI_IFR_STRING { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT8 MinSize; - UINT8 MaxSize; - UINT8 Flags; -} EFI_IFR_STRING; - -#define EFI_IFR_STRING_MULTI_LINE 0x01 - -typedef struct _EFI_IFR_PASSWORD { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT16 MinSize; - UINT16 MaxSize; -} EFI_IFR_PASSWORD; - -typedef struct _EFI_IFR_ORDERED_LIST { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT8 MaxContainers; - UINT8 Flags; -} EFI_IFR_ORDERED_LIST; - -#define EFI_IFR_UNIQUE_SET 0x01 -#define EFI_IFR_NO_EMPTY_SET 0x02 - -typedef struct _EFI_IFR_TIME { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; - UINT8 Flags; -} EFI_IFR_TIME; - -// -// A bit-mask that determines which unique settings are active for this opcode. -// -#define QF_TIME_HOUR_SUPPRESS 0x01 -#define QF_TIME_MINUTE_SUPPRESS 0x02 -#define QF_TIME_SECOND_SUPPRESS 0x04 - -#define QF_TIME_STORAGE 0x30 -#define QF_TIME_STORAGE_NORMAL 0x00 -#define QF_TIME_STORAGE_TIME 0x10 -#define QF_TIME_STORAGE_WAKEUP 0x20 - -typedef struct _EFI_IFR_DISABLE_IF { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_DISABLE_IF; - -typedef struct _EFI_IFR_SUPPRESS_IF { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_SUPPRESS_IF; - -typedef struct _EFI_IFR_GRAY_OUT_IF { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_GRAY_OUT_IF; - -typedef struct _EFI_IFR_INCONSISTENT_IF { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID Error; -} EFI_IFR_INCONSISTENT_IF; - -typedef struct _EFI_IFR_NO_SUBMIT_IF { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID Error; -} EFI_IFR_NO_SUBMIT_IF; - -typedef struct _EFI_IFR_REFRESH { - EFI_IFR_OP_HEADER Header; - UINT8 RefreshInterval; -} EFI_IFR_REFRESH; - -typedef struct _EFI_IFR_VARSTORE_DEVICE { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID DevicePath; -} EFI_IFR_VARSTORE_DEVICE; - -typedef struct _EFI_IFR_ONE_OF_OPTION { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID Option; - UINT8 Flags; - UINT8 Type; - EFI_IFR_TYPE_VALUE Value; -} EFI_IFR_ONE_OF_OPTION; - -// -// Types of the option's value. -// -#define EFI_IFR_TYPE_NUM_SIZE_8 0x00 -#define EFI_IFR_TYPE_NUM_SIZE_16 0x01 -#define EFI_IFR_TYPE_NUM_SIZE_32 0x02 -#define EFI_IFR_TYPE_NUM_SIZE_64 0x03 -#define EFI_IFR_TYPE_BOOLEAN 0x04 -#define EFI_IFR_TYPE_TIME 0x05 -#define EFI_IFR_TYPE_DATE 0x06 -#define EFI_IFR_TYPE_STRING 0x07 -#define EFI_IFR_TYPE_OTHER 0x08 - -#define EFI_IFR_OPTION_DEFAULT 0x10 -#define EFI_IFR_OPTION_DEFAULT_MFG 0x20 - -typedef struct _EFI_IFR_GUID { - EFI_IFR_OP_HEADER Header; - EFI_GUID Guid; - //Optional Data Follows -} EFI_IFR_GUID; - -typedef struct _EFI_IFR_DUP { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_DUP; - -typedef struct _EFI_IFR_EQ_ID_ID { - EFI_IFR_OP_HEADER Header; - EFI_QUESTION_ID QuestionId1; - EFI_QUESTION_ID QuestionId2; -} EFI_IFR_EQ_ID_ID; - -typedef struct _EFI_IFR_EQ_ID_VAL { - EFI_IFR_OP_HEADER Header; - EFI_QUESTION_ID QuestionId; - UINT16 Value; -} EFI_IFR_EQ_ID_VAL; - -typedef struct _EFI_IFR_EQ_ID_LIST { - EFI_IFR_OP_HEADER Header; - EFI_QUESTION_ID QuestionId; - UINT16 ListLength; - UINT16 ValueList[1]; -} EFI_IFR_EQ_ID_LIST; - -typedef struct _EFI_IFR_UINT8 { - EFI_IFR_OP_HEADER Header; - UINT8 Value; -} EFI_IFR_UINT8; - -typedef struct _EFI_IFR_UINT16 { - EFI_IFR_OP_HEADER Header; - UINT16 Value; -} EFI_IFR_UINT16; - -typedef struct _EFI_IFR_UINT32 { - EFI_IFR_OP_HEADER Header; - UINT32 Value; -} EFI_IFR_UINT32; - -typedef struct _EFI_IFR_UINT64 { - EFI_IFR_OP_HEADER Header; - UINT64 Value; -} EFI_IFR_UINT64; - -typedef struct _EFI_IFR_QUESTION_REF1 { - EFI_IFR_OP_HEADER Header; - EFI_QUESTION_ID QuestionId; -} EFI_IFR_QUESTION_REF1; - -typedef struct _EFI_IFR_QUESTION_REF2 { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_QUESTION_REF2; - -typedef struct _EFI_IFR_QUESTION_REF3 { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_QUESTION_REF3; - -typedef struct _EFI_IFR_QUESTION_REF3_2 { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID DevicePath; -} EFI_IFR_QUESTION_REF3_2; - -typedef struct _EFI_IFR_QUESTION_REF3_3 { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID DevicePath; - EFI_GUID Guid; -} EFI_IFR_QUESTION_REF3_3; - -typedef struct _EFI_IFR_RULE_REF { - EFI_IFR_OP_HEADER Header; - UINT8 RuleId; -} EFI_IFR_RULE_REF; - -typedef struct _EFI_IFR_STRING_REF1 { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID StringId; -} EFI_IFR_STRING_REF1; - -typedef struct _EFI_IFR_STRING_REF2 { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_STRING_REF2; - -typedef struct _EFI_IFR_THIS { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_THIS; - -typedef struct _EFI_IFR_TRUE { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_TRUE; - -typedef struct _EFI_IFR_FALSE { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_FALSE; - -typedef struct _EFI_IFR_ONE { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_ONE; - -typedef struct _EFI_IFR_ONES { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_ONES; - -typedef struct _EFI_IFR_ZERO { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_ZERO; - -typedef struct _EFI_IFR_UNDEFINED { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_UNDEFINED; - -typedef struct _EFI_IFR_VERSION { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_VERSION; - -typedef struct _EFI_IFR_LENGTH { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_LENGTH; - -typedef struct _EFI_IFR_NOT { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_NOT; - -typedef struct _EFI_IFR_BITWISE_NOT { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_BITWISE_NOT; - -typedef struct _EFI_IFR_TO_BOOLEAN { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_TO_BOOLEAN; - -// -// For EFI_IFR_TO_STRING, when converting from -// unsigned integers, these flags control the format: -// 0 = unsigned decimal -// 1 = signed decimal -// 2 = hexadecimal (lower-case alpha) -// 3 = hexadecimal (upper-case alpha) -// -#define EFI_IFR_STRING_UNSIGNED_DEC 0 -#define EFI_IFR_STRING_SIGNED_DEC 1 -#define EFI_IFR_STRING_LOWERCASE_HEX 2 -#define EFI_IFR_STRING_UPPERCASE_HEX 3 -// -// When converting from a buffer, these flags control the format: -// 0 = ASCII -// 8 = Unicode -// -#define EFI_IFR_STRING_ASCII 0 -#define EFI_IFR_STRING_UNICODE 8 - -typedef struct _EFI_IFR_TO_STRING { - EFI_IFR_OP_HEADER Header; - UINT8 Format; -} EFI_IFR_TO_STRING; - -typedef struct _EFI_IFR_TO_UINT { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_TO_UINT; - -typedef struct _EFI_IFR_TO_UPPER { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_TO_UPPER; - -typedef struct _EFI_IFR_TO_LOWER { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_TO_LOWER; - -typedef struct _EFI_IFR_ADD { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_ADD; - -typedef struct _EFI_IFR_AND { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_AND; - -typedef struct _EFI_IFR_BITWISE_AND { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_BITWISE_AND; - -typedef struct _EFI_IFR_BITWISE_OR { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_BITWISE_OR; - -typedef struct _EFI_IFR_CATENATE { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_CATENATE; - -typedef struct _EFI_IFR_DIVIDE { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_DIVIDE; - -typedef struct _EFI_IFR_EQUAL { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_EQUAL; - -typedef struct _EFI_IFR_GREATER_EQUAL { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_GREATER_EQUAL; - -typedef struct _EFI_IFR_GREATER_THAN { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_GREATER_THAN; - -typedef struct _EFI_IFR_LESS_EQUAL { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_LESS_EQUAL; - -typedef struct _EFI_IFR_LESS_THAN { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_LESS_THAN; - -typedef struct _EFI_IFR_MATCH { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_MATCH; - -typedef struct _EFI_IFR_MULTIPLY { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_MULTIPLY; - -typedef struct _EFI_IFR_MODULO { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_MODULO; - -typedef struct _EFI_IFR_NOT_EQUAL { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_NOT_EQUAL; - -typedef struct _EFI_IFR_OR { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_OR; - -typedef struct _EFI_IFR_SHIFT_LEFT { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_SHIFT_LEFT; - -typedef struct _EFI_IFR_SHIFT_RIGHT { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_SHIFT_RIGHT; - -typedef struct _EFI_IFR_SUBTRACT { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_SUBTRACT; - -typedef struct _EFI_IFR_CONDITIONAL { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_CONDITIONAL; - -// -// Flags governing the matching criteria of EFI_IFR_FIND -// -#define EFI_IFR_FF_CASE_SENSITIVE 0x00 -#define EFI_IFR_FF_CASE_INSENSITIVE 0x01 - -typedef struct _EFI_IFR_FIND { - EFI_IFR_OP_HEADER Header; - UINT8 Format; -} EFI_IFR_FIND; - -typedef struct _EFI_IFR_MID { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_MID; - -typedef struct _EFI_IFR_TOKEN { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_TOKEN; - -// -// Flags specifying whether to find the first matching string -// or the first non-matching string. -// -#define EFI_IFR_FLAGS_FIRST_MATCHING 0x00 -#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01 - -typedef struct _EFI_IFR_SPAN { - EFI_IFR_OP_HEADER Header; - UINT8 Flags; -} EFI_IFR_SPAN; - -// -// Definitions for Keyboard Package -// Section 27.3.9 -// Releated definitions are in Section of EFI_HII_DATABASE_PROTOCOL -// - -typedef enum { - EfiKeyLCtrl, - EfiKeyA0, - EfiKeyLAlt, - EfiKeySpaceBar, - EfiKeyA2, - EfiKeyA3, - EfiKeyA4, - EfiKeyRCtrl, - EfiKeyLeftArrow, - EfiKeyDownArrow, - EfiKeyRightArrow, - EfiKeyZero, - EfiKeyPeriod, - EfiKeyEnter, - EfiKeyLShift, - EfiKeyB0, - EfiKeyB1, - EfiKeyB2, - EfiKeyB3, - EfiKeyB4, - EfiKeyB5, - EfiKeyB6, - EfiKeyB7, - EfiKeyB8, - EfiKeyB9, - EfiKeyB10, - EfiKeyRShift, - EfiKeyUpArrow, - EfiKeyOne, - EfiKeyTwo, - EfiKeyThree, - EfiKeyCapsLock, - EfiKeyC1, - EfiKeyC2, - EfiKeyC3, - EfiKeyC4, - EfiKeyC5, - EfiKeyC6, - EfiKeyC7, - EfiKeyC8, - EfiKeyC9, - EfiKeyC10, - EfiKeyC11, - EfiKeyC12, - EfiKeyFour, - EfiKeyFive, - EfiKeySix, - EfiKeyPlus, - EfiKeyTab, - EfiKeyD1, - EfiKeyD2, - EfiKeyD3, - EfiKeyD4, - EfiKeyD5, - EfiKeyD6, - EfiKeyD7, - EfiKeyD8, - EfiKeyD9, - EfiKeyD10, - EfiKeyD11, - EfiKeyD12, - EfiKeyD13, - EfiKeyDel, - EfiKeyEnd, - EfiKeyPgDn, - EfiKeySeven, - EfiKeyEight, - EfiKeyNine, - EfiKeyE0, - EfiKeyE1, - EfiKeyE2, - EfiKeyE3, - EfiKeyE4, - EfiKeyE5, - EfiKeyE6, - EfiKeyE7, - EfiKeyE8, - EfiKeyE9, - EfiKeyE10, - EfiKeyE11, - EfiKeyE12, - EfiKeyBackSpace, - EfiKeyIns, - EfiKeyHome, - EfiKeyPgUp, - EfiKeyNLck, - EfiKeySlash, - EfiKeyAsterisk, - EfiKeyMinus, - EfiKeyEsc, - EfiKeyF1, - EfiKeyF2, - EfiKeyF3, - EfiKeyF4, - EfiKeyF5, - EfiKeyF6, - EfiKeyF7, - EfiKeyF8, - EfiKeyF9, - EfiKeyF10, - EfiKeyF11, - EfiKeyF12, - EfiKeyPrint, - EfiKeySLck, - EfiKeyPause -} EFI_KEY; - -typedef struct { - EFI_KEY Key; - CHAR16 Unicode; - CHAR16 ShiftedUnicode; - CHAR16 AltGrUnicode; - CHAR16 ShiftedAltGrUnicode; - UINT16 Modifier; - UINT16 AffectedAttribute; -} EFI_KEY_DESCRIPTOR; - -/// -/// A key which is affected by all the standard shift modifiers. -/// Most keys would be expected to have this bit active. -/// -#define EFI_AFFECTED_BY_STANDARD_SHIFT 0x0001 - -/// -/// This key is affected by the caps lock so that if a keyboard driver -/// would need to disambiguate between a key which had a "1" defined -/// versus a "a" character. Having this bit turned on would tell -/// the keyboard driver to use the appropriate shifted state or not. -/// -#define EFI_AFFECTED_BY_CAPS_LOCK 0x0002 - -/// -/// Similar to the case of CAPS lock, if this bit is active, the key -/// is affected by the num lock being turned on. -/// -#define EFI_AFFECTED_BY_NUM_LOCK 0x0004 - -typedef struct { - UINT16 LayoutLength; - EFI_GUID Guid; - UINT32 LayoutDescriptorStringOffset; - UINT8 DescriptorCount; - // EFI_KEY_DESCRIPTOR Descriptors[]; -} EFI_HII_KEYBOARD_LAYOUT; - -typedef struct { - EFI_HII_PACKAGE_HEADER Header; - UINT16 LayoutCount; - // EFI_HII_KEYBOARD_LAYOUT Layout[]; -} EFI_HII_KEYBOARD_PACKAGE_HDR; - -// -// Modifier values -// -#define EFI_NULL_MODIFIER 0x0000 -#define EFI_LEFT_CONTROL_MODIFIER 0x0001 -#define EFI_RIGHT_CONTROL_MODIFIER 0x0002 -#define EFI_LEFT_ALT_MODIFIER 0x0003 -#define EFI_RIGHT_ALT_MODIFIER 0x0004 -#define EFI_ALT_GR_MODIFIER 0x0005 -#define EFI_INSERT_MODIFIER 0x0006 -#define EFI_DELETE_MODIFIER 0x0007 -#define EFI_PAGE_DOWN_MODIFIER 0x0008 -#define EFI_PAGE_UP_MODIFIER 0x0009 -#define EFI_HOME_MODIFIER 0x000A -#define EFI_END_MODIFIER 0x000B -#define EFI_LEFT_SHIFT_MODIFIER 0x000C -#define EFI_RIGHT_SHIFT_MODIFIER 0x000D -#define EFI_CAPS_LOCK_MODIFIER 0x000E -#define EFI_NUM_LOCK_MODIFIER 0x000F -#define EFI_LEFT_ARROW_MODIFIER 0x0010 -#define EFI_RIGHT_ARROW_MODIFIER 0x0011 -#define EFI_DOWN_ARROW_MODIFIER 0x0012 -#define EFI_UP_ARROW_MODIFIER 0x0013 -#define EFI_NS_KEY_MODIFIER 0x0014 -#define EFI_NS_KEY_DEPENDENCY_MODIFIER 0x0015 -#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016 -#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017 -#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018 -#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019 -#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A -#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B -#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C -#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D -#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E -#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F -#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020 -#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021 - -// -// Keys that have multiple control functions based on modifier -// settings are handled in the keyboard driver implementation. -// For instance PRINT_KEY might have a modifier held down and -// is still a nonprinting character, but might have an alternate -// control function like SYSREQUEST -// -#define EFI_PRINT_MODIFIER 0x0022 -#define EFI_SYS_REQUEST_MODIFIER 0x0023 -#define EFI_SCROLL_LOCK_MODIFIER 0x0024 -#define EFI_PAUSE_MODIFIER 0x0025 -#define EFI_BREAK_MODIFIER 0x0026 - -#define EFI_LEFT_LOGO_MODIFIER 0x0027 -#define EFI_RIGHT_LOGO_MODIFIER 0x0028 -#define EFI_MENU_MODIFIER 0x0029 - -#pragma pack() - - - -/// -/// References to string tokens must use this macro to enable scanning for -/// token usages. -/// -/// -/// STRING_TOKEN is not defined in UEFI specification. But it is placed -/// here for the easy access by C files and VFR source files. -/// -#define STRING_TOKEN(t) t - -#endif diff --git a/gpxe/src/include/gpxe/efi/Uefi/UefiMultiPhase.h b/gpxe/src/include/gpxe/efi/Uefi/UefiMultiPhase.h deleted file mode 100644 index 2d1af5ed..00000000 --- a/gpxe/src/include/gpxe/efi/Uefi/UefiMultiPhase.h +++ /dev/null @@ -1,210 +0,0 @@ -/** @file - This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __UEFI_MULTIPHASE_H__ -#define __UEFI_MULTIPHASE_H__ - -#include <gpxe/efi/ProcessorBind.h> - -/// -/// Enumeration of memory types introduced in UEFI. -/// -typedef enum { - EfiReservedMemoryType, - EfiLoaderCode, - EfiLoaderData, - EfiBootServicesCode, - EfiBootServicesData, - EfiRuntimeServicesCode, - EfiRuntimeServicesData, - EfiConventionalMemory, - EfiUnusableMemory, - EfiACPIReclaimMemory, - EfiACPIMemoryNVS, - EfiMemoryMappedIO, - EfiMemoryMappedIOPortSpace, - EfiPalCode, - EfiMaxMemoryType -} EFI_MEMORY_TYPE; - - -/// -/// Data structure that precedes all of the standard EFI table types. -/// -typedef struct { - UINT64 Signature; - UINT32 Revision; - UINT32 HeaderSize; - UINT32 CRC32; - UINT32 Reserved; -} EFI_TABLE_HEADER; - -/// -/// Attributes of variable. -/// -#define EFI_VARIABLE_NON_VOLATILE 0x00000001 -#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 -#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 -#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008 - -/// -/// This attribute is identified by the mnemonic 'HR' -/// elsewhere in this specification. -/// -#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010 - -// -// _WIN_CERTIFICATE.wCertificateType -// -#define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0 -#define WIN_CERT_TYPE_EFI_GUID 0x0EF1 - -/// -/// The WIN_CERTIFICATE structure is part of the PE/COFF specification. -/// -typedef struct _WIN_CERTIFICATE { - /// - /// The length of the entire certificate, - /// including the length of the header, in bytes. - /// - UINT32 dwLength; - /// - /// The revision level of the WIN_CERTIFICATE - /// structure. The current revision level is 0x0200. - /// - UINT16 wRevision; - /// - /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI - /// certificate types. The UEFI specification reserves the range of - /// certificate type values from 0x0EF0 to 0x0EFF. - /// - UINT16 wCertificateType; - /// - /// The following is the actual certificate. The format of - /// the certificate depends on wCertificateType. - /// - /// UINT8 bCertificate[ANYSIZE_ARRAY]; - /// -} WIN_CERTIFICATE; - -/// -/// WIN_CERTIFICATE_UEFI_GUID.CertType -/// -#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \ - {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } } - -// -// WIN_CERTIFICATE_UEFI_GUID.CertData -// -typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 { - UINT32 HashType; - UINT8 PublicKey[256]; - UINT8 Signature[256]; -} EFI_CERT_BLOCK_RSA_2048_SHA256; - - -/// -/// Certificate which encapsulates a GUID-specific digital signature -/// -typedef struct _WIN_CERTIFICATE_UEFI_GUID { - /// - /// This is the standard WIN_CERTIFICATE header, where - /// wCertificateType is set to WIN_CERT_TYPE_UEFI_GUID. - /// - WIN_CERTIFICATE Hdr; - /// - /// This is the unique id which determines the - /// format of the CertData. In this case, the - /// value is EFI_CERT_TYPE_RSA2048_SHA256_GUID. - /// - EFI_GUID CertType; - /// - /// The following is the certificate data. The format of - /// the data is determined by the CertType. In this case the value is - /// EFI_CERT_BLOCK_RSA_2048_SHA256. - /// - /// UINT8 CertData[ANYSIZE_ARRAY]; - /// -} WIN_CERTIFICATE_UEFI_GUID; - - -/// -/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature. -/// -/// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from -/// WIN_CERTIFICATE and encapsulate the information needed to -/// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as -/// specified in RFC2437. -/// -typedef struct _WIN_CERTIFICATE_EFI_PKCS1_15 { - /// - /// This is the standard WIN_CERTIFICATE header, where - /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15. - /// - WIN_CERTIFICATE Hdr; - /// - /// This is the hashing algorithm which was performed on the - /// UEFI executable when creating the digital signature. - /// - EFI_GUID HashAlgorithm; - /// - /// The following is the actual digital signature. The - /// size of the signature is the same size as the key - /// (1024-bit key is 128 bytes) and can be determined by - /// subtracting the length of the other parts of this header - /// from the total length of the certificate as found in - /// Hdr.dwLength. - /// - /// UINT8 Signature[ANYSIZE_ARRAY]; - /// -} WIN_CERTIFICATE_EFI_PKCS1_15; - - - -/// -/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType -/// WIN_CERTIFICATE_UEFI_GUID and the CertType -/// EFI_CERT_TYPE_RSA2048_SHA256. If the attribute specifies -/// authenticated access, then the Data buffer should begin with an -/// authentication descriptor prior to the data payload and DataSize -/// should reflect the the data.and descriptor size. The caller -/// shall digest the Monotonic Count value and the associated data -/// for the variable update using the SHA-256 1-way hash algorithm. -/// The ensuing the 32-byte digest will be signed using the private -/// key associated w/ the public/private 2048-bit RSA key-pair. The -/// WIN_CERTIFICATE shall be used to describe the signature of the -/// Variable data *Data. In addition, the signature will also -/// include the MonotonicCount value to guard against replay attacks -/// -typedef struct { - /// - /// Included in the signature of - /// AuthInfo.Used to ensure freshness/no - /// replay. Incremented during each - /// "Write" access. - /// - UINT64 MonotonicCount; - /// - /// Provides the authorization for the variable - /// access. It is a signature across the - /// variable data and the Monotonic Count - /// value. Caller uses Private key that is - /// associated with a public key that has been - /// provisioned via the key exchange. - /// - WIN_CERTIFICATE_UEFI_GUID AuthInfo; -} EFI_VARIABLE_AUTHENTICATION; - -#endif - diff --git a/gpxe/src/include/gpxe/efi/Uefi/UefiPxe.h b/gpxe/src/include/gpxe/efi/Uefi/UefiPxe.h deleted file mode 100644 index bb8ab410..00000000 --- a/gpxe/src/include/gpxe/efi/Uefi/UefiPxe.h +++ /dev/null @@ -1,1756 +0,0 @@ -/** @file - This header file contains all of the PXE type definitions, - structure prototypes, global variables and constants that - are needed for porting PXE to EFI. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - - @par Revision Reference: - 32/64-bit PXE specification: - alpha-4, 99-Dec-17 - -**/ - -#ifndef __EFI_PXE_H__ -#define __EFI_PXE_H__ - -#pragma pack(1) - -#define PXE_BUSTYPE(a, b, c, d) \ - ( \ - (((PXE_UINT32) (d) & 0xFF) << 24) | (((PXE_UINT32) (c) & 0xFF) << 16) | (((PXE_UINT32) (b) & 0xFF) << 8) | \ - ((PXE_UINT32) (a) & 0xFF) \ - ) - -/// -/// UNDI ROM ID and devive ID signature -/// -#define PXE_BUSTYPE_PXE PXE_BUSTYPE ('!', 'P', 'X', 'E') - -/// -/// BUS ROM ID signatures -/// -#define PXE_BUSTYPE_PCI PXE_BUSTYPE ('P', 'C', 'I', 'R') -#define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE ('P', 'C', 'C', 'R') -#define PXE_BUSTYPE_USB PXE_BUSTYPE ('U', 'S', 'B', 'R') -#define PXE_BUSTYPE_1394 PXE_BUSTYPE ('1', '3', '9', '4') - -#define PXE_SWAP_UINT16(n) ((((PXE_UINT16) (n) & 0x00FF) << 8) | (((PXE_UINT16) (n) & 0xFF00) >> 8)) - -#define PXE_SWAP_UINT32(n) \ - ((((PXE_UINT32)(n) & 0x000000FF) << 24) | \ - (((PXE_UINT32)(n) & 0x0000FF00) << 8) | \ - (((PXE_UINT32)(n) & 0x00FF0000) >> 8) | \ - (((PXE_UINT32)(n) & 0xFF000000) >> 24)) - -#define PXE_SWAP_UINT64(n) \ - ((((PXE_UINT64)(n) & 0x00000000000000FFULL) << 56) | \ - (((PXE_UINT64)(n) & 0x000000000000FF00ULL) << 40) | \ - (((PXE_UINT64)(n) & 0x0000000000FF0000ULL) << 24) | \ - (((PXE_UINT64)(n) & 0x00000000FF000000ULL) << 8) | \ - (((PXE_UINT64)(n) & 0x000000FF00000000ULL) >> 8) | \ - (((PXE_UINT64)(n) & 0x0000FF0000000000ULL) >> 24) | \ - (((PXE_UINT64)(n) & 0x00FF000000000000ULL) >> 40) | \ - (((PXE_UINT64)(n) & 0xFF00000000000000ULL) >> 56)) - - -#define PXE_CPBSIZE_NOT_USED 0 ///< zero -#define PXE_DBSIZE_NOT_USED 0 ///< zero -#define PXE_CPBADDR_NOT_USED (PXE_UINT64) 0 ///< zero -#define PXE_DBADDR_NOT_USED (PXE_UINT64) 0 ///< zero -#define PXE_CONST CONST - -#define PXE_VOLATILE volatile - -typedef VOID PXE_VOID; -typedef UINT8 PXE_UINT8; -typedef UINT16 PXE_UINT16; -typedef UINT32 PXE_UINT32; -typedef UINTN PXE_UINTN; - -/// -/// typedef unsigned long PXE_UINT64; -/// -typedef UINT64 PXE_UINT64; - -typedef PXE_UINT8 PXE_BOOL; -#define PXE_FALSE 0 ///< zero -#define PXE_TRUE (!PXE_FALSE) - -typedef PXE_UINT16 PXE_OPCODE; - -/// -/// Return UNDI operational state. -/// -#define PXE_OPCODE_GET_STATE 0x0000 - -/// -/// Change UNDI operational state from Stopped to Started. -/// -#define PXE_OPCODE_START 0x0001 - -/// -/// Change UNDI operational state from Started to Stopped. -/// -#define PXE_OPCODE_STOP 0x0002 - -/// -/// Get UNDI initialization information. -/// -#define PXE_OPCODE_GET_INIT_INFO 0x0003 - -/// -/// Get NIC configuration information. -/// -#define PXE_OPCODE_GET_CONFIG_INFO 0x0004 - -/// -/// Changed UNDI operational state from Started to Initialized. -/// -#define PXE_OPCODE_INITIALIZE 0x0005 - -/// -/// Re-initialize the NIC H/W. -/// -#define PXE_OPCODE_RESET 0x0006 - -/// -/// Change the UNDI operational state from Initialized to Started. -/// -#define PXE_OPCODE_SHUTDOWN 0x0007 - -/// -/// Read & change state of external interrupt enables. -/// -#define PXE_OPCODE_INTERRUPT_ENABLES 0x0008 - -/// -/// Read & change state of packet receive filters. -/// -#define PXE_OPCODE_RECEIVE_FILTERS 0x0009 - -/// -/// Read & change station MAC address. -/// -#define PXE_OPCODE_STATION_ADDRESS 0x000A - -/// -/// Read traffic statistics. -/// -#define PXE_OPCODE_STATISTICS 0x000B - -/// -/// Convert multicast IP address to multicast MAC address. -/// -#define PXE_OPCODE_MCAST_IP_TO_MAC 0x000C - -/// -/// Read or change non-volatile storage on the NIC. -/// -#define PXE_OPCODE_NVDATA 0x000D - -/// -/// Get & clear interrupt status. -/// -#define PXE_OPCODE_GET_STATUS 0x000E - -/// -/// Fill media header in packet for transmit. -/// -#define PXE_OPCODE_FILL_HEADER 0x000F - -/// -/// Transmit packet(s). -/// -#define PXE_OPCODE_TRANSMIT 0x0010 - -/// -/// Receive packet. -/// -#define PXE_OPCODE_RECEIVE 0x0011 - -/// -/// Last valid PXE UNDI OpCode number. -/// -#define PXE_OPCODE_LAST_VALID 0x0011 - -typedef PXE_UINT16 PXE_OPFLAGS; - -#define PXE_OPFLAGS_NOT_USED 0x0000 - -// -// ////////////////////////////////////// -// UNDI Get State -// -// No OpFlags - -//////////////////////////////////////// -// UNDI Start -// -// No OpFlags - -//////////////////////////////////////// -// UNDI Stop -// -// No OpFlags - -//////////////////////////////////////// -// UNDI Get Init Info -// -// No Opflags - -//////////////////////////////////////// -// UNDI Get Config Info -// -// No Opflags - -/// -/// UNDI Initialize -/// -#define PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK 0x0001 -#define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE 0x0000 -#define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE 0x0001 - -/// -/// -/// UNDI Reset -/// -#define PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS 0x0001 -#define PXE_OPFLAGS_RESET_DISABLE_FILTERS 0x0002 - -/// -/// UNDI Shutdown -/// -/// No OpFlags - -/// -/// UNDI Interrupt Enables -/// -/// -/// Select whether to enable or disable external interrupt signals. -/// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS. -/// -#define PXE_OPFLAGS_INTERRUPT_OPMASK 0xC000 -#define PXE_OPFLAGS_INTERRUPT_ENABLE 0x8000 -#define PXE_OPFLAGS_INTERRUPT_DISABLE 0x4000 -#define PXE_OPFLAGS_INTERRUPT_READ 0x0000 - -/// -/// Enable receive interrupts. An external interrupt will be generated -/// after a complete non-error packet has been received. -/// -#define PXE_OPFLAGS_INTERRUPT_RECEIVE 0x0001 - -/// -/// Enable transmit interrupts. An external interrupt will be generated -/// after a complete non-error packet has been transmitted. -/// -#define PXE_OPFLAGS_INTERRUPT_TRANSMIT 0x0002 - -/// -/// Enable command interrupts. An external interrupt will be generated -/// when command execution stops. -/// -#define PXE_OPFLAGS_INTERRUPT_COMMAND 0x0004 - -/// -/// Generate software interrupt. Setting this bit generates an external -/// interrupt, if it is supported by the hardware. -/// -#define PXE_OPFLAGS_INTERRUPT_SOFTWARE 0x0008 - -/// -/// UNDI Receive Filters -/// -/// -/// Select whether to enable or disable receive filters. -/// Setting both enable and disable will return PXE_STATCODE_INVALID_OPCODE. -/// -#define PXE_OPFLAGS_RECEIVE_FILTER_OPMASK 0xC000 -#define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE 0x8000 -#define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE 0x4000 -#define PXE_OPFLAGS_RECEIVE_FILTER_READ 0x0000 - -/// -/// To reset the contents of the multicast MAC address filter list, -/// set this OpFlag: -/// -#define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST 0x2000 - -/// -/// Enable unicast packet receiving. Packets sent to the current station -/// MAC address will be received. -/// -#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST 0x0001 - -/// -/// Enable broadcast packet receiving. Packets sent to the broadcast -/// MAC address will be received. -/// -#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST 0x0002 - -/// -/// Enable filtered multicast packet receiving. Packets sent to any -/// of the multicast MAC addresses in the multicast MAC address filter -/// list will be received. If the filter list is empty, no multicast -/// -#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004 - -/// -/// Enable promiscuous packet receiving. All packets will be received. -/// -#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008 - -/// -/// Enable promiscuous multicast packet receiving. All multicast -/// packets will be received. -/// -#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010 - -/// -/// UNDI Station Address -/// -#define PXE_OPFLAGS_STATION_ADDRESS_READ 0x0000 -#define PXE_OPFLAGS_STATION_ADDRESS_WRITE 0x0000 -#define PXE_OPFLAGS_STATION_ADDRESS_RESET 0x0001 - -/// -/// UNDI Statistics -/// -#define PXE_OPFLAGS_STATISTICS_READ 0x0000 -#define PXE_OPFLAGS_STATISTICS_RESET 0x0001 - -/// -/// UNDI MCast IP to MAC -/// -/// -/// Identify the type of IP address in the CPB. -/// -#define PXE_OPFLAGS_MCAST_IP_TO_MAC_OPMASK 0x0003 -#define PXE_OPFLAGS_MCAST_IPV4_TO_MAC 0x0000 -#define PXE_OPFLAGS_MCAST_IPV6_TO_MAC 0x0001 - -/// -/// UNDI NvData -/// -/// -/// Select the type of non-volatile data operation. -/// -#define PXE_OPFLAGS_NVDATA_OPMASK 0x0001 -#define PXE_OPFLAGS_NVDATA_READ 0x0000 -#define PXE_OPFLAGS_NVDATA_WRITE 0x0001 - -/// -/// UNDI Get Status -/// -/// -/// Return current interrupt status. This will also clear any interrupts -/// that are currently set. This can be used in a polling routine. The -/// interrupt flags are still set and cleared even when the interrupts -/// are disabled. -/// -#define PXE_OPFLAGS_GET_INTERRUPT_STATUS 0x0001 - -/// -/// Return list of transmitted buffers for recycling. Transmit buffers -/// must not be changed or unallocated until they have recycled. After -/// issuing a transmit command, wait for a transmit complete interrupt. -/// When a transmit complete interrupt is received, read the transmitted -/// buffers. Do not plan on getting one buffer per interrupt. Some -/// NICs and UNDIs may transmit multiple buffers per interrupt. -/// -#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002 - -/// -/// UNDI Fill Header -/// -#define PXE_OPFLAGS_FILL_HEADER_OPMASK 0x0001 -#define PXE_OPFLAGS_FILL_HEADER_FRAGMENTED 0x0001 -#define PXE_OPFLAGS_FILL_HEADER_WHOLE 0x0000 - -/// -/// UNDI Transmit -/// -/// -/// S/W UNDI only. Return after the packet has been transmitted. A -/// transmit complete interrupt will still be generated and the transmit -/// buffer will have to be recycled. -/// -#define PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK 0x0001 -#define PXE_OPFLAGS_TRANSMIT_BLOCK 0x0001 -#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK 0x0000 - -#define PXE_OPFLAGS_TRANSMIT_OPMASK 0x0002 -#define PXE_OPFLAGS_TRANSMIT_FRAGMENTED 0x0002 -#define PXE_OPFLAGS_TRANSMIT_WHOLE 0x0000 - -/// -/// UNDI Receive -/// -/// No OpFlags -/// - -/// -/// PXE STATFLAGS -/// -typedef PXE_UINT16 PXE_STATFLAGS; - -#define PXE_STATFLAGS_INITIALIZE 0x0000 - -/// -/// Common StatFlags that can be returned by all commands. -/// -/// -/// The COMMAND_COMPLETE and COMMAND_FAILED status flags must be -/// implemented by all UNDIs. COMMAND_QUEUED is only needed by UNDIs -/// that support command queuing. -/// -#define PXE_STATFLAGS_STATUS_MASK 0xC000 -#define PXE_STATFLAGS_COMMAND_COMPLETE 0xC000 -#define PXE_STATFLAGS_COMMAND_FAILED 0x8000 -#define PXE_STATFLAGS_COMMAND_QUEUED 0x4000 - -/// -/// UNDI Get State -/// -#define PXE_STATFLAGS_GET_STATE_MASK 0x0003 -#define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002 -#define PXE_STATFLAGS_GET_STATE_STARTED 0x0001 -#define PXE_STATFLAGS_GET_STATE_STOPPED 0x0000 - -/// -/// UNDI Start -/// -/// No additional StatFlags -/// - -/// -/// UNDI Get Init Info -/// -#define PXE_STATFLAGS_CABLE_DETECT_MASK 0x0001 -#define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED 0x0000 -#define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED 0x0001 - -/// -/// UNDI Initialize -/// -#define PXE_STATFLAGS_INITIALIZED_NO_MEDIA 0x0001 - -/// -/// UNDI Reset -/// -#define PXE_STATFLAGS_RESET_NO_MEDIA 0x0001 - -/// -/// UNDI Shutdown -/// -/// No additional StatFlags - -/// -/// UNDI Interrupt Enables -/// -/// -/// If set, receive interrupts are enabled. -/// -#define PXE_STATFLAGS_INTERRUPT_RECEIVE 0x0001 - -/// -/// If set, transmit interrupts are enabled. -/// -#define PXE_STATFLAGS_INTERRUPT_TRANSMIT 0x0002 - -/// -/// If set, command interrupts are enabled. -/// -#define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004 - -/// -/// UNDI Receive Filters -/// - -/// -/// If set, unicast packets will be received. -/// -#define PXE_STATFLAGS_RECEIVE_FILTER_UNICAST 0x0001 - -/// -/// If set, broadcast packets will be received. -/// -#define PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST 0x0002 - -/// -/// If set, multicast packets that match up with the multicast address -/// filter list will be received. -/// -#define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004 - -/// -/// If set, all packets will be received. -/// -#define PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008 - -/// -/// If set, all multicast packets will be received. -/// -#define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010 - -/// -/// UNDI Station Address -/// -/// No additional StatFlags -/// - -/// -/// UNDI Statistics -/// -/// No additional StatFlags -/// - -/// -//// UNDI MCast IP to MAC -//// -//// No additional StatFlags - -/// -/// UNDI NvData -/// -/// No additional StatFlags -/// - -/// -/// UNDI Get Status -/// - -/// -/// Use to determine if an interrupt has occurred. -/// -#define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK 0x000F -#define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS 0x0000 - -/// -/// If set, at least one receive interrupt occurred. -/// -#define PXE_STATFLAGS_GET_STATUS_RECEIVE 0x0001 - -/// -/// If set, at least one transmit interrupt occurred. -/// -#define PXE_STATFLAGS_GET_STATUS_TRANSMIT 0x0002 - -/// -/// If set, at least one command interrupt occurred. -/// -#define PXE_STATFLAGS_GET_STATUS_COMMAND 0x0004 - -/// -/// If set, at least one software interrupt occurred. -/// -#define PXE_STATFLAGS_GET_STATUS_SOFTWARE 0x0008 - -/// -/// This flag is set if the transmitted buffer queue is empty. This flag -/// will be set if all transmitted buffer addresses get written into the DB. -/// -#define PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY 0x0010 - -/// -/// This flag is set if no transmitted buffer addresses were written -/// into the DB. (This could be because DBsize was too small.) -/// -#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN 0x0020 - -/// -/// UNDI Fill Header -/// -/// No additional StatFlags -/// - -/// -/// UNDI Transmit -/// -/// No additional StatFlags. - -/// -/// UNDI Receive -/// - -/// -/// No additional StatFlags. -/// -typedef PXE_UINT16 PXE_STATCODE; - -#define PXE_STATCODE_INITIALIZE 0x0000 - -/// -/// Common StatCodes returned by all UNDI commands, UNDI protocol functions -/// and BC protocol functions. -/// -#define PXE_STATCODE_SUCCESS 0x0000 - -#define PXE_STATCODE_INVALID_CDB 0x0001 -#define PXE_STATCODE_INVALID_CPB 0x0002 -#define PXE_STATCODE_BUSY 0x0003 -#define PXE_STATCODE_QUEUE_FULL 0x0004 -#define PXE_STATCODE_ALREADY_STARTED 0x0005 -#define PXE_STATCODE_NOT_STARTED 0x0006 -#define PXE_STATCODE_NOT_SHUTDOWN 0x0007 -#define PXE_STATCODE_ALREADY_INITIALIZED 0x0008 -#define PXE_STATCODE_NOT_INITIALIZED 0x0009 -#define PXE_STATCODE_DEVICE_FAILURE 0x000A -#define PXE_STATCODE_NVDATA_FAILURE 0x000B -#define PXE_STATCODE_UNSUPPORTED 0x000C -#define PXE_STATCODE_BUFFER_FULL 0x000D -#define PXE_STATCODE_INVALID_PARAMETER 0x000E -#define PXE_STATCODE_INVALID_UNDI 0x000F -#define PXE_STATCODE_IPV4_NOT_SUPPORTED 0x0010 -#define PXE_STATCODE_IPV6_NOT_SUPPORTED 0x0011 -#define PXE_STATCODE_NOT_ENOUGH_MEMORY 0x0012 -#define PXE_STATCODE_NO_DATA 0x0013 - -typedef PXE_UINT16 PXE_IFNUM; - -/// -/// This interface number must be passed to the S/W UNDI Start command. -/// -#define PXE_IFNUM_START 0x0000 - -/// -/// This interface number is returned by the S/W UNDI Get State and -/// Start commands if information in the CDB, CPB or DB is invalid. -/// -#define PXE_IFNUM_INVALID 0x0000 - -typedef PXE_UINT16 PXE_CONTROL; - -/// -/// Setting this flag directs the UNDI to queue this command for later -/// execution if the UNDI is busy and it supports command queuing. -/// If queuing is not supported, a PXE_STATCODE_INVALID_CONTROL error -/// is returned. If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL -/// error is returned. -/// -#define PXE_CONTROL_QUEUE_IF_BUSY 0x0002 - -/// -/// These two bit values are used to determine if there are more UNDI -/// CDB structures following this one. If the link bit is set, there -/// must be a CDB structure following this one. Execution will start -/// on the next CDB structure as soon as this one completes successfully. -/// If an error is generated by this command, execution will stop. -/// -#define PXE_CONTROL_LINK 0x0001 -#define PXE_CONTROL_LAST_CDB_IN_LIST 0x0000 - -typedef PXE_UINT8 PXE_FRAME_TYPE; - -#define PXE_FRAME_TYPE_NONE 0x00 -#define PXE_FRAME_TYPE_UNICAST 0x01 -#define PXE_FRAME_TYPE_BROADCAST 0x02 -#define PXE_FRAME_TYPE_FILTERED_MULTICAST 0x03 -#define PXE_FRAME_TYPE_PROMISCUOUS 0x04 -#define PXE_FRAME_TYPE_PROMISCUOUS_MULTICAST 0x05 - -#define PXE_FRAME_TYPE_MULTICAST PXE_FRAME_TYPE_FILTERED_MULTICAST - -typedef PXE_UINT32 PXE_IPV4; - -typedef PXE_UINT32 PXE_IPV6[4]; -#define PXE_MAC_LENGTH 32 - -typedef PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH]; - -typedef PXE_UINT8 PXE_IFTYPE; -typedef UINT16 PXE_MEDIA_PROTOCOL; - -/// -/// This information is from the ARP section of RFC 1700. -/// -/// 1 Ethernet (10Mb) [JBP] -/// 2 Experimental Ethernet (3Mb) [JBP] -/// 3 Amateur Radio AX.25 [PXK] -/// 4 Proteon ProNET Token Ring [JBP] -/// 5 Chaos [GXP] -/// 6 IEEE 802 Networks [JBP] -/// 7 ARCNET [JBP] -/// 8 Hyperchannel [JBP] -/// 9 Lanstar [TU] -/// 10 Autonet Short Address [MXB1] -/// 11 LocalTalk [JKR1] -/// 12 LocalNet (IBM* PCNet or SYTEK* LocalNET) [JXM] -/// 13 Ultra link [RXD2] -/// 14 SMDS [GXC1] -/// 15 Frame Relay [AGM] -/// 16 Asynchronous Transmission Mode (ATM) [JXB2] -/// 17 HDLC [JBP] -/// 18 Fibre Channel [Yakov Rekhter] -/// 19 Asynchronous Transmission Mode (ATM) [Mark Laubach] -/// 20 Serial Line [JBP] -/// 21 Asynchronous Transmission Mode (ATM) [MXB1] -/// -/// * Other names and brands may be claimed as the property of others. -/// -#define PXE_IFTYPE_ETHERNET 0x01 -#define PXE_IFTYPE_TOKENRING 0x04 -#define PXE_IFTYPE_FIBRE_CHANNEL 0x12 - -typedef struct s_pxe_hw_undi { - PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE - PXE_UINT8 Len; ///< sizeof(PXE_HW_UNDI) - PXE_UINT8 Fudge; ///< makes 8-bit cksum equal zero - PXE_UINT8 Rev; ///< PXE_ROMID_REV - PXE_UINT8 IFcnt; ///< physical connector count - PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER - PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER - PXE_UINT16 reserved; ///< zero, not used - PXE_UINT32 Implementation; ///< implementation flags - ///< reserved ///< vendor use - ///< UINT32 Status; ///< status port - ///< UINT32 Command; ///< command port - ///< UINT64 CDBaddr; ///< CDB address port - ///< -} PXE_HW_UNDI; - -/// -/// Status port bit definitions -/// - -/// -/// UNDI operation state -/// -#define PXE_HWSTAT_STATE_MASK 0xC0000000 -#define PXE_HWSTAT_BUSY 0xC0000000 -#define PXE_HWSTAT_INITIALIZED 0x80000000 -#define PXE_HWSTAT_STARTED 0x40000000 -#define PXE_HWSTAT_STOPPED 0x00000000 - -/// -/// If set, last command failed -/// -#define PXE_HWSTAT_COMMAND_FAILED 0x20000000 - -/// -/// If set, identifies enabled receive filters -/// -#define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000 -#define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED 0x00000800 -#define PXE_HWSTAT_BROADCAST_RX_ENABLED 0x00000400 -#define PXE_HWSTAT_MULTICAST_RX_ENABLED 0x00000200 -#define PXE_HWSTAT_UNICAST_RX_ENABLED 0x00000100 - -/// -/// If set, identifies enabled external interrupts -/// -#define PXE_HWSTAT_SOFTWARE_INT_ENABLED 0x00000080 -#define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED 0x00000040 -#define PXE_HWSTAT_PACKET_RX_INT_ENABLED 0x00000020 -#define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010 - -/// -/// If set, identifies pending interrupts -/// -#define PXE_HWSTAT_SOFTWARE_INT_PENDING 0x00000008 -#define PXE_HWSTAT_TX_COMPLETE_INT_PENDING 0x00000004 -#define PXE_HWSTAT_PACKET_RX_INT_PENDING 0x00000002 -#define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001 - -/// -/// Command port definitions -/// - -/// -/// If set, CDB identified in CDBaddr port is given to UNDI. -/// If not set, other bits in this word will be processed. -/// -#define PXE_HWCMD_ISSUE_COMMAND 0x80000000 -#define PXE_HWCMD_INTS_AND_FILTS 0x00000000 - -/// -/// Use these to enable/disable receive filters. -/// -#define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000 -#define PXE_HWCMD_PROMISCUOUS_RX_ENABLE 0x00000800 -#define PXE_HWCMD_BROADCAST_RX_ENABLE 0x00000400 -#define PXE_HWCMD_MULTICAST_RX_ENABLE 0x00000200 -#define PXE_HWCMD_UNICAST_RX_ENABLE 0x00000100 - -/// -/// Use these to enable/disable external interrupts -/// -#define PXE_HWCMD_SOFTWARE_INT_ENABLE 0x00000080 -#define PXE_HWCMD_TX_COMPLETE_INT_ENABLE 0x00000040 -#define PXE_HWCMD_PACKET_RX_INT_ENABLE 0x00000020 -#define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010 - -/// -/// Use these to clear pending external interrupts -/// -#define PXE_HWCMD_CLEAR_SOFTWARE_INT 0x00000008 -#define PXE_HWCMD_CLEAR_TX_COMPLETE_INT 0x00000004 -#define PXE_HWCMD_CLEAR_PACKET_RX_INT 0x00000002 -#define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT 0x00000001 - -typedef struct s_pxe_sw_undi { - PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE - PXE_UINT8 Len; ///< sizeof(PXE_SW_UNDI) - PXE_UINT8 Fudge; ///< makes 8-bit cksum zero - PXE_UINT8 Rev; ///< PXE_ROMID_REV - PXE_UINT8 IFcnt; ///< physical connector count - PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER - PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER - PXE_UINT16 reserved1; ///< zero, not used - PXE_UINT32 Implementation; ///< Implementation flags - PXE_UINT64 EntryPoint; ///< API entry point - PXE_UINT8 reserved2[3]; ///< zero, not used - PXE_UINT8 BusCnt; ///< number of bustypes supported - PXE_UINT32 BusType[1]; ///< list of supported bustypes -} PXE_SW_UNDI; - -typedef union u_pxe_undi { - PXE_HW_UNDI hw; - PXE_SW_UNDI sw; -} PXE_UNDI; - -/// -/// Signature of !PXE structure -/// -#define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E') - -/// -/// !PXE structure format revision -/// -#define PXE_ROMID_REV 0x02 - -/// -/// UNDI command interface revision. These are the values that get sent -/// in option 94 (Client Network Interface Identifier) in the DHCP Discover -/// and PXE Boot Server Request packets. -/// -#define PXE_ROMID_MAJORVER 0x03 -#define PXE_ROMID_MINORVER 0x01 - -/// -/// Implementation flags -/// -#define PXE_ROMID_IMP_HW_UNDI 0x80000000 -#define PXE_ROMID_IMP_SW_VIRT_ADDR 0x40000000 -#define PXE_ROMID_IMP_64BIT_DEVICE 0x00010000 -#define PXE_ROMID_IMP_FRAG_SUPPORTED 0x00008000 -#define PXE_ROMID_IMP_CMD_LINK_SUPPORTED 0x00004000 -#define PXE_ROMID_IMP_CMD_QUEUE_SUPPORTED 0x00002000 -#define PXE_ROMID_IMP_MULTI_FRAME_SUPPORTED 0x00001000 -#define PXE_ROMID_IMP_NVDATA_SUPPORT_MASK 0x00000C00 -#define PXE_ROMID_IMP_NVDATA_BULK_WRITABLE 0x00000C00 -#define PXE_ROMID_IMP_NVDATA_SPARSE_WRITABLE 0x00000800 -#define PXE_ROMID_IMP_NVDATA_READ_ONLY 0x00000400 -#define PXE_ROMID_IMP_NVDATA_NOT_AVAILABLE 0x00000000 -#define PXE_ROMID_IMP_STATISTICS_SUPPORTED 0x00000200 -#define PXE_ROMID_IMP_STATION_ADDR_SETTABLE 0x00000100 -#define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED 0x00000080 -#define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED 0x00000040 -#define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED 0x00000020 -#define PXE_ROMID_IMP_FILTERED_MULTICAST_RX_SUPPORTED 0x00000010 -#define PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED 0x00000008 -#define PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED 0x00000004 -#define PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED 0x00000002 -#define PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED 0x00000001 - -typedef struct s_pxe_cdb { - PXE_OPCODE OpCode; - PXE_OPFLAGS OpFlags; - PXE_UINT16 CPBsize; - PXE_UINT16 DBsize; - PXE_UINT64 CPBaddr; - PXE_UINT64 DBaddr; - PXE_STATCODE StatCode; - PXE_STATFLAGS StatFlags; - PXE_UINT16 IFnum; - PXE_CONTROL Control; -} PXE_CDB; - -typedef union u_pxe_ip_addr { - PXE_IPV6 IPv6; - PXE_IPV4 IPv4; -} PXE_IP_ADDR; - -typedef union pxe_device { - /// - /// PCI and PC Card NICs are both identified using bus, device - /// and function numbers. For PC Card, this may require PC - /// Card services to be loaded in the BIOS or preboot - /// environment. - /// - struct { - /// - /// See S/W UNDI ROMID structure definition for PCI and - /// PCC BusType definitions. - /// - PXE_UINT32 BusType; - - /// - /// Bus, device & function numbers that locate this device. - /// - PXE_UINT16 Bus; - PXE_UINT8 Device; - PXE_UINT8 Function; - } - PCI, PCC; - -} PXE_DEVICE; - -/// -/// cpb and db definitions -/// -#define MAX_PCI_CONFIG_LEN 64 ///< # of dwords -#define MAX_EEPROM_LEN 128 ///< # of dwords -#define MAX_XMIT_BUFFERS 32 ///< recycling Q length for xmit_done -#define MAX_MCAST_ADDRESS_CNT 8 - -typedef struct s_pxe_cpb_start_30 { - /// - /// PXE_VOID Delay(UINTN microseconds); - /// - /// UNDI will never request a delay smaller than 10 microseconds - /// and will always request delays in increments of 10 microseconds. - /// The Delay() CallBack routine must delay between n and n + 10 - /// microseconds before returning control to the UNDI. - /// - /// This field cannot be set to zero. - /// - UINT64 Delay; - - /// - /// PXE_VOID Block(UINT32 enable); - /// - /// UNDI may need to block multi-threaded/multi-processor access to - /// critical code sections when programming or accessing the network - /// device. To this end, a blocking service is needed by the UNDI. - /// When UNDI needs a block, it will call Block() passing a non-zero - /// value. When UNDI no longer needs a block, it will call Block() - /// with a zero value. When called, if the Block() is already enabled, - /// do not return control to the UNDI until the previous Block() is - /// disabled. - /// - /// This field cannot be set to zero. - /// - UINT64 Block; - - /// - /// PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr); - /// - /// UNDI will pass the virtual address of a buffer and the virtual - /// address of a 64-bit physical buffer. Convert the virtual address - /// to a physical address and write the result to the physical address - /// buffer. If virtual and physical addresses are the same, just - /// copy the virtual address to the physical address buffer. - /// - /// This field can be set to zero if virtual and physical addresses - /// are equal. - /// - UINT64 Virt2Phys; - /// - /// PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port, - /// UINT64 buf_addr); - /// - /// UNDI will read or write the device io space using this call back - /// function. It passes the number of bytes as the len parameter and it - /// will be either 1,2,4 or 8. - /// - /// This field can not be set to zero. - /// - UINT64 Mem_IO; -} PXE_CPB_START_30; - -typedef struct s_pxe_cpb_start_31 { - /// - /// PXE_VOID Delay(UINT64 UnqId, UINTN microseconds); - /// - /// UNDI will never request a delay smaller than 10 microseconds - /// and will always request delays in increments of 10 microseconds. - /// The Delay() CallBack routine must delay between n and n + 10 - /// microseconds before returning control to the UNDI. - /// - /// This field cannot be set to zero. - /// - UINT64 Delay; - - /// - /// PXE_VOID Block(UINT64 unq_id, UINT32 enable); - /// - /// UNDI may need to block multi-threaded/multi-processor access to - /// critical code sections when programming or accessing the network - /// device. To this end, a blocking service is needed by the UNDI. - /// When UNDI needs a block, it will call Block() passing a non-zero - /// value. When UNDI no longer needs a block, it will call Block() - /// with a zero value. When called, if the Block() is already enabled, - /// do not return control to the UNDI until the previous Block() is - /// disabled. - /// - /// This field cannot be set to zero. - /// - UINT64 Block; - - /// - /// PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr); - /// - /// UNDI will pass the virtual address of a buffer and the virtual - /// address of a 64-bit physical buffer. Convert the virtual address - /// to a physical address and write the result to the physical address - /// buffer. If virtual and physical addresses are the same, just - /// copy the virtual address to the physical address buffer. - /// - /// This field can be set to zero if virtual and physical addresses - /// are equal. - /// - UINT64 Virt2Phys; - /// - /// PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port, - /// UINT64 buf_addr); - /// - /// UNDI will read or write the device io space using this call back - /// function. It passes the number of bytes as the len parameter and it - /// will be either 1,2,4 or 8. - /// - /// This field can not be set to zero. - /// - UINT64 Mem_IO; - /// - /// PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size, - /// UINT32 Direction, UINT64 mapped_addr); - /// - /// UNDI will pass the virtual address of a buffer, direction of the data - /// flow from/to the mapped buffer (the constants are defined below) - /// and a place holder (pointer) for the mapped address. - /// This call will Map the given address to a physical DMA address and write - /// the result to the mapped_addr pointer. If there is no need to - /// map the given address to a lower address (i.e. the given address is - /// associated with a physical address that is already compatible to be - /// used with the DMA, it converts the given virtual address to it's - /// physical address and write that in the mapped address pointer. - /// - /// This field can be set to zero if there is no mapping service available - /// - UINT64 Map_Mem; - - /// - /// PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size, - /// UINT32 Direction, UINT64 mapped_addr); - /// - /// UNDI will pass the virtual and mapped addresses of a buffer - /// This call will un map the given address - /// - /// This field can be set to zero if there is no unmapping service available - /// - UINT64 UnMap_Mem; - - /// - /// PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual, - /// UINT32 size, UINT32 Direction, UINT64 mapped_addr); - /// - /// UNDI will pass the virtual and mapped addresses of a buffer - /// This call will synchronize the contents of both the virtual and mapped - /// buffers for the given Direction. - /// - /// This field can be set to zero if there is no service available - /// - UINT64 Sync_Mem; - - /// - /// protocol driver can provide anything for this Unique_ID, UNDI remembers - /// that as just a 64bit value assocaited to the interface specified by - /// the ifnum and gives it back as a parameter to all the call-back routines - /// when calling for that interface! - /// - UINT64 Unique_ID; -} PXE_CPB_START_31; - -#define TO_AND_FROM_DEVICE 0 -#define FROM_DEVICE 1 -#define TO_DEVICE 2 - -#define PXE_DELAY_MILLISECOND 1000 -#define PXE_DELAY_SECOND 1000000 -#define PXE_IO_READ 0 -#define PXE_IO_WRITE 1 -#define PXE_MEM_READ 2 -#define PXE_MEM_WRITE 4 - -typedef struct s_pxe_db_get_init_info { - /// - /// Minimum length of locked memory buffer that must be given to - /// the Initialize command. Giving UNDI more memory will generally - /// give better performance. - /// - /// If MemoryRequired is zero, the UNDI does not need and will not - /// use system memory to receive and transmit packets. - /// - PXE_UINT32 MemoryRequired; - - /// - /// Maximum frame data length for Tx/Rx excluding the media header. - /// - PXE_UINT32 FrameDataLen; - - /// - /// Supported link speeds are in units of mega bits. Common ethernet - /// values are 10, 100 and 1000. Unused LinkSpeeds[] entries are zero - /// filled. - /// - PXE_UINT32 LinkSpeeds[4]; - - /// - /// Number of non-volatile storage items. - /// - PXE_UINT32 NvCount; - - /// - /// Width of non-volatile storage item in bytes. 0, 1, 2 or 4 - /// - PXE_UINT16 NvWidth; - - /// - /// Media header length. This is the typical media header length for - /// this UNDI. This information is needed when allocating receive - /// and transmit buffers. - /// - PXE_UINT16 MediaHeaderLen; - - /// - /// Number of bytes in the NIC hardware (MAC) address. - /// - PXE_UINT16 HWaddrLen; - - /// - /// Maximum number of multicast MAC addresses in the multicast - /// MAC address filter list. - /// - PXE_UINT16 MCastFilterCnt; - - /// - /// Default number and size of transmit and receive buffers that will - /// be allocated by the UNDI. If MemoryRequired is non-zero, this - /// allocation will come out of the memory buffer given to the Initialize - /// command. If MemoryRequired is zero, this allocation will come out of - /// memory on the NIC. - /// - PXE_UINT16 TxBufCnt; - PXE_UINT16 TxBufSize; - PXE_UINT16 RxBufCnt; - PXE_UINT16 RxBufSize; - - /// - /// Hardware interface types defined in the Assigned Numbers RFC - /// and used in DHCP and ARP packets. - /// See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros. - /// - PXE_UINT8 IFtype; - - /// - /// Supported duplex. See PXE_DUPLEX_xxxxx #defines below. - /// - PXE_UINT8 SupportedDuplexModes; - - /// - /// Supported loopback options. See PXE_LOOPBACK_xxxxx #defines below. - /// - PXE_UINT8 SupportedLoopBackModes; -} PXE_DB_GET_INIT_INFO; - -#define PXE_MAX_TXRX_UNIT_ETHER 1500 - -#define PXE_HWADDR_LEN_ETHER 0x0006 -#define PXE_MAC_HEADER_LEN_ETHER 0x000E - -#define PXE_DUPLEX_ENABLE_FULL_SUPPORTED 1 -#define PXE_DUPLEX_FORCE_FULL_SUPPORTED 2 - -#define PXE_LOOPBACK_INTERNAL_SUPPORTED 1 -#define PXE_LOOPBACK_EXTERNAL_SUPPORTED 2 - -typedef struct s_pxe_pci_config_info { - /// - /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union. - /// For PCI bus devices, this field is set to PXE_BUSTYPE_PCI. - /// - UINT32 BusType; - - /// - /// This identifies the PCI network device that this UNDI interface - /// is bound to. - /// - UINT16 Bus; - UINT8 Device; - UINT8 Function; - - /// - /// This is a copy of the PCI configuration space for this - /// network device. - /// - union { - UINT8 Byte[256]; - UINT16 Word[128]; - UINT32 Dword[64]; - } Config; -} PXE_PCI_CONFIG_INFO; - -typedef struct s_pxe_pcc_config_info { - /// - /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union. - /// For PCC bus devices, this field is set to PXE_BUSTYPE_PCC. - /// - PXE_UINT32 BusType; - - /// - /// This identifies the PCC network device that this UNDI interface - /// is bound to. - /// - PXE_UINT16 Bus; - PXE_UINT8 Device; - PXE_UINT8 Function; - - /// - /// This is a copy of the PCC configuration space for this - /// network device. - /// - union { - PXE_UINT8 Byte[256]; - PXE_UINT16 Word[128]; - PXE_UINT32 Dword[64]; - } Config; -} PXE_PCC_CONFIG_INFO; - -typedef union u_pxe_db_get_config_info { - PXE_PCI_CONFIG_INFO pci; - PXE_PCC_CONFIG_INFO pcc; -} PXE_DB_GET_CONFIG_INFO; - -typedef struct s_pxe_cpb_initialize { - /// - /// Address of first (lowest) byte of the memory buffer. This buffer must - /// be in contiguous physical memory and cannot be swapped out. The UNDI - /// will be using this for transmit and receive buffering. - /// - PXE_UINT64 MemoryAddr; - - /// - /// MemoryLength must be greater than or equal to MemoryRequired - /// returned by the Get Init Info command. - /// - PXE_UINT32 MemoryLength; - - /// - /// Desired link speed in Mbit/sec. Common ethernet values are 10, 100 - /// and 1000. Setting a value of zero will auto-detect and/or use the - /// default link speed (operation depends on UNDI/NIC functionality). - /// - PXE_UINT32 LinkSpeed; - - /// - /// Suggested number and size of receive and transmit buffers to - /// allocate. If MemoryAddr and MemoryLength are non-zero, this - /// allocation comes out of the supplied memory buffer. If MemoryAddr - /// and MemoryLength are zero, this allocation comes out of memory - /// on the NIC. - /// - /// If these fields are set to zero, the UNDI will allocate buffer - /// counts and sizes as it sees fit. - /// - PXE_UINT16 TxBufCnt; - PXE_UINT16 TxBufSize; - PXE_UINT16 RxBufCnt; - PXE_UINT16 RxBufSize; - - /// - /// The following configuration parameters are optional and must be zero - /// to use the default values. - /// - PXE_UINT8 DuplexMode; - - PXE_UINT8 LoopBackMode; -} PXE_CPB_INITIALIZE; - -#define PXE_DUPLEX_DEFAULT 0x00 -#define PXE_FORCE_FULL_DUPLEX 0x01 -#define PXE_ENABLE_FULL_DUPLEX 0x02 -#define PXE_FORCE_HALF_DUPLEX 0x04 -#define PXE_DISABLE_FULL_DUPLEX 0x08 - -#define LOOPBACK_NORMAL 0 -#define LOOPBACK_INTERNAL 1 -#define LOOPBACK_EXTERNAL 2 - -typedef struct s_pxe_db_initialize { - /// - /// Actual amount of memory used from the supplied memory buffer. This - /// may be less that the amount of memory suppllied and may be zero if - /// the UNDI and network device do not use external memory buffers. - /// - /// Memory used by the UNDI and network device is allocated from the - /// lowest memory buffer address. - /// - PXE_UINT32 MemoryUsed; - - /// - /// Actual number and size of receive and transmit buffers that were - /// allocated. - /// - PXE_UINT16 TxBufCnt; - PXE_UINT16 TxBufSize; - PXE_UINT16 RxBufCnt; - PXE_UINT16 RxBufSize; -} PXE_DB_INITIALIZE; - -typedef struct s_pxe_cpb_receive_filters { - /// - /// List of multicast MAC addresses. This list, if present, will - /// replace the existing multicast MAC address filter list. - /// - PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT]; -} PXE_CPB_RECEIVE_FILTERS; - -typedef struct s_pxe_db_receive_filters { - /// - /// Filtered multicast MAC address list. - /// - PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT]; -} PXE_DB_RECEIVE_FILTERS; - -typedef struct s_pxe_cpb_station_address { - /// - /// If supplied and supported, the current station MAC address - /// will be changed. - /// - PXE_MAC_ADDR StationAddr; -} PXE_CPB_STATION_ADDRESS; - -typedef struct s_pxe_dpb_station_address { - /// - /// Current station MAC address. - /// - PXE_MAC_ADDR StationAddr; - - /// - /// Station broadcast MAC address. - /// - PXE_MAC_ADDR BroadcastAddr; - - /// - /// Permanent station MAC address. - /// - PXE_MAC_ADDR PermanentAddr; -} PXE_DB_STATION_ADDRESS; - -typedef struct s_pxe_db_statistics { - /// - /// Bit field identifying what statistic data is collected by the - /// UNDI/NIC. - /// If bit 0x00 is set, Data[0x00] is collected. - /// If bit 0x01 is set, Data[0x01] is collected. - /// If bit 0x20 is set, Data[0x20] is collected. - /// If bit 0x21 is set, Data[0x21] is collected. - /// Etc. - /// - PXE_UINT64 Supported; - - /// - /// Statistic data. - /// - PXE_UINT64 Data[64]; -} PXE_DB_STATISTICS; - -/// -/// Total number of frames received. Includes frames with errors and -/// dropped frames. -/// -#define PXE_STATISTICS_RX_TOTAL_FRAMES 0x00 - -/// -/// Number of valid frames received and copied into receive buffers. -/// -#define PXE_STATISTICS_RX_GOOD_FRAMES 0x01 - -/// -/// Number of frames below the minimum length for the media. -/// This would be <64 for ethernet. -/// -#define PXE_STATISTICS_RX_UNDERSIZE_FRAMES 0x02 - -/// -/// Number of frames longer than the maxminum length for the -/// media. This would be >1500 for ethernet. -/// -#define PXE_STATISTICS_RX_OVERSIZE_FRAMES 0x03 - -/// -/// Valid frames that were dropped because receive buffers were full. -/// -#define PXE_STATISTICS_RX_DROPPED_FRAMES 0x04 - -/// -/// Number of valid unicast frames received and not dropped. -/// -#define PXE_STATISTICS_RX_UNICAST_FRAMES 0x05 - -/// -/// Number of valid broadcast frames received and not dropped. -/// -#define PXE_STATISTICS_RX_BROADCAST_FRAMES 0x06 - -/// -/// Number of valid mutlicast frames received and not dropped. -/// -#define PXE_STATISTICS_RX_MULTICAST_FRAMES 0x07 - -/// -/// Number of frames w/ CRC or alignment errors. -/// -#define PXE_STATISTICS_RX_CRC_ERROR_FRAMES 0x08 - -/// -/// Total number of bytes received. Includes frames with errors -/// and dropped frames. -/// -#define PXE_STATISTICS_RX_TOTAL_BYTES 0x09 - -/// -/// Transmit statistics. -/// -#define PXE_STATISTICS_TX_TOTAL_FRAMES 0x0A -#define PXE_STATISTICS_TX_GOOD_FRAMES 0x0B -#define PXE_STATISTICS_TX_UNDERSIZE_FRAMES 0x0C -#define PXE_STATISTICS_TX_OVERSIZE_FRAMES 0x0D -#define PXE_STATISTICS_TX_DROPPED_FRAMES 0x0E -#define PXE_STATISTICS_TX_UNICAST_FRAMES 0x0F -#define PXE_STATISTICS_TX_BROADCAST_FRAMES 0x10 -#define PXE_STATISTICS_TX_MULTICAST_FRAMES 0x11 -#define PXE_STATISTICS_TX_CRC_ERROR_FRAMES 0x12 -#define PXE_STATISTICS_TX_TOTAL_BYTES 0x13 - -/// -/// Number of collisions detection on this subnet. -/// -#define PXE_STATISTICS_COLLISIONS 0x14 - -/// -/// Number of frames destined for unsupported protocol. -/// -#define PXE_STATISTICS_UNSUPPORTED_PROTOCOL 0x15 - -typedef struct s_pxe_cpb_mcast_ip_to_mac { - /// - /// Multicast IP address to be converted to multicast MAC address. - /// - PXE_IP_ADDR IP; -} PXE_CPB_MCAST_IP_TO_MAC; - -typedef struct s_pxe_db_mcast_ip_to_mac { - /// - /// Multicast MAC address. - /// - PXE_MAC_ADDR MAC; -} PXE_DB_MCAST_IP_TO_MAC; - -typedef struct s_pxe_cpb_nvdata_sparse { - /// - /// NvData item list. Only items in this list will be updated. - /// - struct { - /// - /// Non-volatile storage address to be changed. - /// - PXE_UINT32 Addr; - - /// - /// Data item to write into above storage address. - /// - union { - PXE_UINT8 Byte; - PXE_UINT16 Word; - PXE_UINT32 Dword; - } Data; - } Item[MAX_EEPROM_LEN]; -} PXE_CPB_NVDATA_SPARSE; - -/// -/// When using bulk update, the size of the CPB structure must be -/// the same size as the non-volatile NIC storage. -/// -typedef union u_pxe_cpb_nvdata_bulk { - /// - /// Array of byte-wide data items. - /// - PXE_UINT8 Byte[MAX_EEPROM_LEN << 2]; - - /// - /// Array of word-wide data items. - /// - PXE_UINT16 Word[MAX_EEPROM_LEN << 1]; - - /// - /// Array of dword-wide data items. - /// - PXE_UINT32 Dword[MAX_EEPROM_LEN]; -} PXE_CPB_NVDATA_BULK; - -typedef struct s_pxe_db_nvdata { - /// - /// Arrays of data items from non-volatile storage. - /// - union { - /// - /// Array of byte-wide data items. - /// - PXE_UINT8 Byte[MAX_EEPROM_LEN << 2]; - - /// - /// Array of word-wide data items. - /// - PXE_UINT16 Word[MAX_EEPROM_LEN << 1]; - - /// - /// Array of dword-wide data items. - /// - PXE_UINT32 Dword[MAX_EEPROM_LEN]; - } Data; -} PXE_DB_NVDATA; - -typedef struct s_pxe_db_get_status { - /// - /// Length of next receive frame (header + data). If this is zero, - /// there is no next receive frame available. - /// - PXE_UINT32 RxFrameLen; - - /// - /// Reserved, set to zero. - /// - PXE_UINT32 reserved; - - /// - /// Addresses of transmitted buffers that need to be recycled. - /// - PXE_UINT64 TxBuffer[MAX_XMIT_BUFFERS]; -} PXE_DB_GET_STATUS; - -typedef struct s_pxe_cpb_fill_header { - /// - /// Source and destination MAC addresses. These will be copied into - /// the media header without doing byte swapping. - /// - PXE_MAC_ADDR SrcAddr; - PXE_MAC_ADDR DestAddr; - - /// - /// Address of first byte of media header. The first byte of packet data - /// follows the last byte of the media header. - /// - PXE_UINT64 MediaHeader; - - /// - /// Length of packet data in bytes (not including the media header). - /// - PXE_UINT32 PacketLen; - - /// - /// Protocol type. This will be copied into the media header without - /// doing byte swapping. Protocol type numbers can be obtained from - /// the Assigned Numbers RFC 1700. - /// - PXE_UINT16 Protocol; - - /// - /// Length of the media header in bytes. - /// - PXE_UINT16 MediaHeaderLen; -} PXE_CPB_FILL_HEADER; - -#define PXE_PROTOCOL_ETHERNET_IP 0x0800 -#define PXE_PROTOCOL_ETHERNET_ARP 0x0806 -#define MAX_XMIT_FRAGMENTS 16 - -typedef struct s_pxe_cpb_fill_header_fragmented { - /// - /// Source and destination MAC addresses. These will be copied into - /// the media header without doing byte swapping. - /// - PXE_MAC_ADDR SrcAddr; - PXE_MAC_ADDR DestAddr; - - /// - /// Length of packet data in bytes (not including the media header). - /// - PXE_UINT32 PacketLen; - - /// - /// Protocol type. This will be copied into the media header without - /// doing byte swapping. Protocol type numbers can be obtained from - /// the Assigned Numbers RFC 1700. - /// - PXE_MEDIA_PROTOCOL Protocol; - - /// - /// Length of the media header in bytes. - /// - PXE_UINT16 MediaHeaderLen; - - /// - /// Number of packet fragment descriptors. - /// - PXE_UINT16 FragCnt; - - /// - /// Reserved, must be set to zero. - /// - PXE_UINT16 reserved; - - /// - /// Array of packet fragment descriptors. The first byte of the media - /// header is the first byte of the first fragment. - /// - struct { - /// - /// Address of this packet fragment. - /// - PXE_UINT64 FragAddr; - - /// - /// Length of this packet fragment. - /// - PXE_UINT32 FragLen; - - /// - /// Reserved, must be set to zero. - /// - PXE_UINT32 reserved; - } FragDesc[MAX_XMIT_FRAGMENTS]; -} -PXE_CPB_FILL_HEADER_FRAGMENTED; - -typedef struct s_pxe_cpb_transmit { - /// - /// Address of first byte of frame buffer. This is also the first byte - /// of the media header. - /// - PXE_UINT64 FrameAddr; - - /// - /// Length of the data portion of the frame buffer in bytes. Do not - /// include the length of the media header. - /// - PXE_UINT32 DataLen; - - /// - /// Length of the media header in bytes. - /// - PXE_UINT16 MediaheaderLen; - - /// - /// Reserved, must be zero. - /// - PXE_UINT16 reserved; -} PXE_CPB_TRANSMIT; - -typedef struct s_pxe_cpb_transmit_fragments { - /// - /// Length of packet data in bytes (not including the media header). - /// - PXE_UINT32 FrameLen; - - /// - /// Length of the media header in bytes. - /// - PXE_UINT16 MediaheaderLen; - - /// - /// Number of packet fragment descriptors. - /// - PXE_UINT16 FragCnt; - - /// - /// Array of frame fragment descriptors. The first byte of the first - /// fragment is also the first byte of the media header. - /// - struct { - /// - /// Address of this frame fragment. - /// - PXE_UINT64 FragAddr; - - /// - /// Length of this frame fragment. - /// - PXE_UINT32 FragLen; - - /// - /// Reserved, must be set to zero. - /// - PXE_UINT32 reserved; - } FragDesc[MAX_XMIT_FRAGMENTS]; -} -PXE_CPB_TRANSMIT_FRAGMENTS; - -typedef struct s_pxe_cpb_receive { - /// - /// Address of first byte of receive buffer. This is also the first byte - /// of the frame header. - /// - PXE_UINT64 BufferAddr; - - /// - /// Length of receive buffer. This must be large enough to hold the - /// received frame (media header + data). If the length of smaller than - /// the received frame, data will be lost. - /// - PXE_UINT32 BufferLen; - - /// - /// Reserved, must be set to zero. - /// - PXE_UINT32 reserved; -} PXE_CPB_RECEIVE; - -typedef struct s_pxe_db_receive { - /// - /// Source and destination MAC addresses from media header. - /// - PXE_MAC_ADDR SrcAddr; - PXE_MAC_ADDR DestAddr; - - /// - /// Length of received frame. May be larger than receive buffer size. - /// The receive buffer will not be overwritten. This is how to tell - /// if data was lost because the receive buffer was too small. - /// - PXE_UINT32 FrameLen; - - /// - /// Protocol type from media header. - /// - PXE_MEDIA_PROTOCOL Protocol; - - /// - /// Length of media header in received frame. - /// - PXE_UINT16 MediaHeaderLen; - - /// - /// Type of receive frame. - /// - PXE_FRAME_TYPE Type; - - /// - /// Reserved, must be zero. - /// - PXE_UINT8 reserved[7]; - -} PXE_DB_RECEIVE; - -#pragma pack() - -#endif diff --git a/gpxe/src/include/gpxe/efi/Uefi/UefiSpec.h b/gpxe/src/include/gpxe/efi/Uefi/UefiSpec.h deleted file mode 100644 index 03e7b6cc..00000000 --- a/gpxe/src/include/gpxe/efi/Uefi/UefiSpec.h +++ /dev/null @@ -1,1916 +0,0 @@ -/** @file - Include file that supports UEFI. - - This include file must only contain things defined in the UEFI 2.1 specification. - If a code construct is defined in the UEFI 2.1 specification it must be included - by this include file. - - Copyright (c) 2006 - 2008, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __UEFI_SPEC_H__ -#define __UEFI_SPEC_H__ - -#include <gpxe/efi/Uefi/UefiMultiPhase.h> - -#include <gpxe/efi/Protocol/DevicePath.h> -#include <gpxe/efi/Protocol/SimpleTextIn.h> -#include <gpxe/efi/Protocol/SimpleTextOut.h> - -/// -/// Enumeration of memory allocation. -/// -typedef enum { - AllocateAnyPages, - AllocateMaxAddress, - AllocateAddress, - MaxAllocateType -} EFI_ALLOCATE_TYPE; - -// -// Bit definitions for EFI_TIME.Daylight -// -#define EFI_TIME_ADJUST_DAYLIGHT 0x01 -#define EFI_TIME_IN_DAYLIGHT 0x02 - -/// -/// Value definition for EFI_TIME.TimeZone -/// -#define EFI_UNSPECIFIED_TIMEZONE 0x07FF - -// -// Memory cacheability attributes -// -#define EFI_MEMORY_UC 0x0000000000000001ULL -#define EFI_MEMORY_WC 0x0000000000000002ULL -#define EFI_MEMORY_WT 0x0000000000000004ULL -#define EFI_MEMORY_WB 0x0000000000000008ULL -#define EFI_MEMORY_UCE 0x0000000000000010ULL -// -// Physical memory protection attributes -// -#define EFI_MEMORY_WP 0x0000000000001000ULL -#define EFI_MEMORY_RP 0x0000000000002000ULL -#define EFI_MEMORY_XP 0x0000000000004000ULL -// -// Runtime memory attribute -// -#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL - -/// -/// Memory descriptor version number -/// -#define EFI_MEMORY_DESCRIPTOR_VERSION 1 - -/// -/// Definition of memory descriptor -/// -typedef struct { - UINT32 Type; - EFI_PHYSICAL_ADDRESS PhysicalStart; - EFI_VIRTUAL_ADDRESS VirtualStart; - UINT64 NumberOfPages; - UINT64 Attribute; -} EFI_MEMORY_DESCRIPTOR; - -/// -/// Build macros to find next EFI_MEMORY_DESCRIPTOR. -/// -#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size))) - -/// -/// Declare forward referenced data structures -/// -typedef struct _EFI_SYSTEM_TABLE EFI_SYSTEM_TABLE; - -/** - Allocates memory pages from the system. - - @param Type The type of allocation to perform. - @param MemoryType The type of memory to allocate. - @param Pages The number of contiguous 4 KB pages to allocate. - @param Memory Pointer to a physical address. On input, the way in which the address is - used depends on the value of Type. - - @retval EFI_SUCCESS The requested pages were allocated. - @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or - AllocateMaxAddress or AllocateAddress. - 2) MemoryType is in the range - EfiMaxMemoryType..0x7FFFFFFF. - @retval EFI_OUT_OF_RESOURCES The pages could not be allocated. - @retval EFI_NOT_FOUND The requested pages could not be found. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ALLOCATE_PAGES)( - IN EFI_ALLOCATE_TYPE Type, - IN EFI_MEMORY_TYPE MemoryType, - IN UINTN Pages, - IN OUT EFI_PHYSICAL_ADDRESS *Memory - ); - -/** - Frees memory pages. - - @param Memory The base physical address of the pages to be freed. - @param Pages The number of contiguous 4 KB pages to free. - - @retval EFI_SUCCESS The requested pages were freed. - @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid. - @retval EFI_NOT_FOUND The requested memory pages were not allocated with - AllocatePages(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FREE_PAGES)( - IN EFI_PHYSICAL_ADDRESS Memory, - IN UINTN Pages - ); - -/** - Returns the current memory map. - - @param MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer. - On input, this is the size of the buffer allocated by the caller. - On output, it is the size of the buffer returned by the firmware if - the buffer was large enough, or the size of the buffer needed to contain - the map if the buffer was too small. - @param MemoryMap A pointer to the buffer in which firmware places the current memory - map. - @param MapKey A pointer to the location in which firmware returns the key for the - current memory map. - @param DescriptorSize A pointer to the location in which firmware returns the size, in bytes, of - an individual EFI_MEMORY_DESCRIPTOR. - @param DescriptorVersion A pointer to the location in which firmware returns the version number - associated with the EFI_MEMORY_DESCRIPTOR. - - @retval EFI_SUCCESS The memory map was returned in the MemoryMap buffer. - @retval EFI_BUFFER_TOO_SMALL The MemoryMap buffer was too small. The current buffer size - needed to hold the memory map is returned in MemoryMapSize. - @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL. - 2) The MemoryMap buffer is not too small and MemoryMap is - NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_MEMORY_MAP)( - IN OUT UINTN *MemoryMapSize, - IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, - OUT UINTN *MapKey, - OUT UINTN *DescriptorSize, - OUT UINT32 *DescriptorVersion - ); - -/** - Allocates pool memory. - - @param PoolType The type of pool to allocate. - @param Size The number of bytes to allocate from the pool. - @param Buffer A pointer to a pointer to the allocated buffer if the call succeeds; - undefined otherwise. - - @retval EFI_SUCCESS The requested number of bytes was allocated. - @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated. - @retval EFI_INVALID_PARAMETER PoolType was invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ALLOCATE_POOL)( - IN EFI_MEMORY_TYPE PoolType, - IN UINTN Size, - OUT VOID **Buffer - ); - -/** - Returns pool memory to the system. - - @param Buffer Pointer to the buffer to free. - - @retval EFI_SUCCESS The memory was returned to the system. - @retval EFI_INVALID_PARAMETER Buffer was invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FREE_POOL)( - IN VOID *Buffer - ); - -/** - Changes the runtime addressing mode of EFI firmware from physical to virtual. - - @param MemoryMapSize The size in bytes of VirtualMap. - @param DescriptorSize The size in bytes of an entry in the VirtualMap. - @param DescriptorVersion The version of the structure entries in VirtualMap. - @param VirtualMap An array of memory descriptors which contain new virtual - address mapping information for all runtime ranges. - - @retval EFI_SUCCESS The virtual address map has been applied. - @retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in - virtual address mapped mode. - @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid. - @retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory - map that requires a mapping. - @retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found - in the memory map. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP)( - IN UINTN MemoryMapSize, - IN UINTN DescriptorSize, - IN UINT32 DescriptorVersion, - IN EFI_MEMORY_DESCRIPTOR *VirtualMap - ); - -/** - Connects one or more drivers to a controller. - - @param ControllerHandle The handle of the controller to which driver(s) are to be connected. - @param DriverImageHandle A pointer to an ordered list handles that support the - EFI_DRIVER_BINDING_PROTOCOL. - @param RemainingDevicePath A pointer to the device path that specifies a child of the - controller specified by ControllerHandle. - @param Recursive If TRUE, then ConnectController() is called recursively - until the entire tree of controllers below the controller specified - by ControllerHandle have been created. If FALSE, then - the tree of controllers is only expanded one level. - - @retval EFI_SUCCESS 1) One or more drivers were connected to ControllerHandle. - 2) No drivers were connected to ControllerHandle, but - RemainingDevicePath is not NULL, and it is an End Device - Path Node. - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. - @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances - present in the system. - 2) No drivers were connected to ControllerHandle. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CONNECT_CONTROLLER)( - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE *DriverImageHandle, OPTIONAL - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath, OPTIONAL - IN BOOLEAN Recursive - ); - -/** - Disconnects one or more drivers from a controller. - - @param ControllerHandle The handle of the controller from which driver(s) are to be disconnected. - @param DriverImageHandle The driver to disconnect from ControllerHandle. - If DriverImageHandle is NULL, then all the drivers currently managing - ControllerHandle are disconnected from ControllerHandle. - @param ChildHandle The handle of the child to destroy. - If ChildHandle is NULL, then all the children of ControllerHandle are - destroyed before the drivers are disconnected from ControllerHandle. - - @retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller. - 2) On entry, no drivers are managing ControllerHandle. - 3) DriverImageHandle is not NULL, and on entry - DriverImageHandle is not managing ControllerHandle. - @retval EFI_INVALID_PARAMETER 1) ControllerHandle is not a valid EFI_HANDLE. - 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE. - 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE. - 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL. - @retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from - ControllerHandle. - @retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DISCONNECT_CONTROLLER)( - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE DriverImageHandle, OPTIONAL - IN EFI_HANDLE ChildHandle OPTIONAL - ); - - - -// -// ConvertPointer DebugDisposition type. -// -#define EFI_OPTIONAL_PTR 0x00000001 -#define EFI_OPTIONAL_POINTER EFI_OPTIONAL_PTR - -/** - Determines the new virtual address that is to be used on subsequent memory accesses. - - @param DebugDisposition Supplies type information for the pointer being converted. - @param Address A pointer to a pointer that is to be fixed to be the value needed - for the new virtual address mappings being applied. - - @retval EFI_SUCCESS The pointer pointed to by Address was modified. - @retval EFI_INVALID_PARAMETER 1) Address is NULL. - 2) *Address is NULL and DebugDisposition does - not have the EFI_OPTIONAL_PTR bit set. - @retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part - of the current memory map. This is normally fatal. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CONVERT_POINTER)( - IN UINTN DebugDisposition, - IN OUT VOID **Address - ); - - -// -// These types can be ORed together as needed - for example, -// EVT_TIMER might be Ored with EVT_NOTIFY_WAIT or -// EVT_NOTIFY_SIGNAL. -// -#define EVT_TIMER 0x80000000 -#define EVT_RUNTIME 0x40000000 -#define EVT_NOTIFY_WAIT 0x00000100 -#define EVT_NOTIFY_SIGNAL 0x00000200 - -#define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201 -#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202 - -// -// The event's NotifyContext pointer points to a runtime memory -// address. -// The event is deprecated in UEFI2.0 and later specifications. -// -#define EVT_RUNTIME_CONTEXT 0x20000000 - - -/** - Invoke a notification event - - @param Event Event whose notification function is being invoked. - @param Context Pointer to the notification function's context, - which is implementation-dependent. - -**/ -typedef -VOID -(EFIAPI *EFI_EVENT_NOTIFY)( - IN EFI_EVENT Event, - IN VOID *Context - ); - -/** - Creates an event. - - @param Type The type of event to create and its mode and attributes. - @param NotifyTpl The task priority level of event notifications, if needed. - @param NotifyFunction Pointer to the event's notification function, if any. - @param NotifyContext Pointer to the notification function's context; corresponds to parameter - Context in the notification function. - @param Event Pointer to the newly created event if the call succeeds; undefined - otherwise. - - @retval EFI_SUCCESS The event structure was created. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The event could not be allocated. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CREATE_EVENT)( - IN UINT32 Type, - IN EFI_TPL NotifyTpl, - IN EFI_EVENT_NOTIFY NotifyFunction, - IN VOID *NotifyContext, - OUT EFI_EVENT *Event - ); - -/** - Creates an event in a group. - - @param Type The type of event to create and its mode and attributes. - @param NotifyTpl The task priority level of event notifications,if needed. - @param NotifyFunction Pointer to the event's notification function, if any. - @param NotifyContext Pointer to the notification function's context; corresponds to parameter - Context in the notification function. - @param EventGroup Pointer to the unique identifier of the group to which this event belongs. - If this is NULL, then the function behaves as if the parameters were passed - to CreateEvent. - @param Event Pointer to the newly created event if the call succeeds; undefined - otherwise. - - @retval EFI_SUCCESS The event structure was created. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES The event could not be allocated. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CREATE_EVENT_EX)( - IN UINT32 Type, - IN EFI_TPL NotifyTpl, - IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, - IN CONST VOID *NotifyContext OPTIONAL, - IN CONST EFI_GUID *EventGroup OPTIONAL, - OUT EFI_EVENT *Event - ); - -/// -/// Timer delay types -/// -typedef enum { - TimerCancel, - TimerPeriodic, - TimerRelative -} EFI_TIMER_DELAY; - -/** - Sets the type of timer and the trigger time for a timer event. - - @param Event The timer event that is to be signaled at the specified time. - @param Type The type of time that is specified in TriggerTime. - @param TriggerTime The number of 100ns units until the timer expires. - A TriggerTime of 0 is legal. - If Type is TimerRelative and TriggerTime is 0, then the timer - event will be signaled on the next timer tick. - If Type is TimerPeriodic and TriggerTime is 0, then the timer - event will be signaled on every timer tick. - - @retval EFI_SUCCESS The event has been set to be signaled at the requested time. - @retval EFI_INVALID_PARAMETER Event or Type is not valid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_TIMER)( - IN EFI_EVENT Event, - IN EFI_TIMER_DELAY Type, - IN UINT64 TriggerTime - ); - -/** - Signals an event. - - @param Event The event to signal. - - @retval EFI_SUCCESS The event has been signaled. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIGNAL_EVENT)( - IN EFI_EVENT Event - ); - -/** - Stops execution until an event is signaled. - - @param NumberOfEvents The number of events in the Event array. - @param Event An array of EFI_EVENT. - @param Index Pointer to the index of the event which satisfied the wait condition. - - @retval EFI_SUCCESS The event indicated by Index was signaled. - @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0. - 2) The event indicated by Index is of type - EVT_NOTIFY_SIGNAL. - @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_WAIT_FOR_EVENT)( - IN UINTN NumberOfEvents, - IN EFI_EVENT *Event, - OUT UINTN *Index - ); - -/** - Closes an event. - - @param Event The event to close. - - @retval EFI_SUCCESS The event has been closed. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CLOSE_EVENT)( - IN EFI_EVENT Event - ); - -/** - Checks whether an event is in the signaled state. - - @param Event The event to check. - - @retval EFI_SUCCESS The event is in the signaled state. - @retval EFI_NOT_READY The event is not in the signaled state. - @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CHECK_EVENT)( - IN EFI_EVENT Event - ); - - -// -// Task priority level -// -#define TPL_APPLICATION 4 -#define TPL_CALLBACK 8 -#define TPL_NOTIFY 16 -#define TPL_HIGH_LEVEL 31 - - -/** - Raises a task's priority level and returns its previous level. - - @param NewTpl The new task priority level. - - @return Previous task priority level - -**/ -typedef -EFI_TPL -(EFIAPI *EFI_RAISE_TPL)( - IN EFI_TPL NewTpl - ); - -/** - Restores a task's priority level to its previous value. - - @param OldTpl The previous task priority level to restore. - -**/ -typedef -VOID -(EFIAPI *EFI_RESTORE_TPL)( - IN EFI_TPL OldTpl - ); - -/** - Returns the value of a variable. - - @param VariableName A Null-terminated Unicode string that is the name of the - vendor's variable. - @param VendorGuid A unique identifier for the vendor. - @param Attributes If not NULL, a pointer to the memory location to return the - attributes bitmask for the variable. - @param DataSize On input, the size in bytes of the return Data buffer. - On output the size of data returned in Data. - @param Data The buffer to return the contents of the variable. - - @retval EFI_SUCCESS The function completed successfully. - @retval EFI_NOT_FOUND The variable was not found. - @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. - @retval EFI_INVALID_PARAMETER VariableName is NULL. - @retval EFI_INVALID_PARAMETER VendorGuid is NULL. - @retval EFI_INVALID_PARAMETER DataSize is NULL. - @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL. - @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error. - @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_VARIABLE)( - IN CHAR16 *VariableName, - IN EFI_GUID *VendorGuid, - OUT UINT32 *Attributes, OPTIONAL - IN OUT UINTN *DataSize, - OUT VOID *Data - ); - -/** - Enumerates the current variable names. - - @param VariableNameSize The size of the VariableName buffer. - @param VariableName On input, supplies the last VariableName that was returned - by GetNextVariableName(). On output, returns the Nullterminated - Unicode string of the current variable. - @param VendorGuid On input, supplies the last VendorGuid that was returned by - GetNextVariableName(). On output, returns the - VendorGuid of the current variable. - - @retval EFI_SUCCESS The function completed successfully. - @retval EFI_NOT_FOUND The next variable was not found. - @retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result. - @retval EFI_INVALID_PARAMETER VariableNameSize is NULL. - @retval EFI_INVALID_PARAMETER VariableName is NULL. - @retval EFI_INVALID_PARAMETER VendorGuid is NULL. - @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_NEXT_VARIABLE_NAME)( - IN OUT UINTN *VariableNameSize, - IN OUT CHAR16 *VariableName, - IN OUT EFI_GUID *VendorGuid - ); - -/** - Sets the value of a variable. - - @param VariableName A Null-terminated Unicode string that is the name of the - vendor's variable. - @param VendorGuid A unique identifier for the vendor. - @param Attributes Attributes bitmask to set for the variable. - @param DataSize The size in bytes of the Data buffer. - @param Data The contents for the variable. - - @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as - defined by the Attributes. - @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the - DataSize exceeds the maximum allowed. - @retval EFI_INVALID_PARAMETER VariableName is an empty Unicode string. - @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data. - @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error. - @retval EFI_WRITE_PROTECTED The variable in question is read-only. - @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted. - @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure. - @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_VARIABLE)( - IN CHAR16 *VariableName, - IN EFI_GUID *VendorGuid, - IN UINT32 Attributes, - IN UINTN DataSize, - IN VOID *Data - ); - - -/// -/// This provides the capabilities of the -/// real time clock device as exposed through the EFI interfaces. -/// -typedef struct { - UINT32 Resolution; - UINT32 Accuracy; - BOOLEAN SetsToZero; -} EFI_TIME_CAPABILITIES; - -/** - Returns the current time and date information, and the time-keeping capabilities - of the hardware platform. - - @param Time A pointer to storage to receive a snapshot of the current time. - @param Capabilities An optional pointer to a buffer to receive the real time clock - device's capabilities. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER Time is NULL. - @retval EFI_DEVICE_ERROR The time could not be retrieved due to hardware error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_TIME)( - OUT EFI_TIME *Time, - OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL - ); - -/** - Sets the current local time and date information. - - @param Time A pointer to the current time. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER A time field is out of range. - @retval EFI_DEVICE_ERROR The time could not be set due due to hardware error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_TIME)( - IN EFI_TIME *Time - ); - -/** - Returns the current wakeup alarm clock setting. - - @param Enabled Indicates if the alarm is currently enabled or disabled. - @param Pending Indicates if the alarm signal is pending and requires acknowledgement. - @param Time The current alarm setting. - - @retval EFI_SUCCESS The alarm settings were returned. - @retval EFI_INVALID_PARAMETER Enabled is NULL. - @retval EFI_INVALID_PARAMETER Pending is NULL. - @retval EFI_INVALID_PARAMETER Time is NULL. - @retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error. - @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_WAKEUP_TIME)( - OUT BOOLEAN *Enabled, - OUT BOOLEAN *Pending, - OUT EFI_TIME *Time - ); - -/** - Sets the system wakeup alarm clock time. - - @param Enabled Enable or disable the wakeup alarm. - @param Time If Enable is TRUE, the time to set the wakeup alarm for. - If Enable is FALSE, then this parameter is optional, and may be NULL. - - @retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If - Enable is FALSE, then the wakeup alarm was disabled. - @retval EFI_INVALID_PARAMETER A time field is out of range. - @retval EFI_DEVICE_ERROR The wakeup time could not be set due to a hardware error. - @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_WAKEUP_TIME)( - IN BOOLEAN Enable, - IN EFI_TIME *Time OPTIONAL - ); - -/** - This is the declaration of an EFI image entry point. This entry point is - the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including - both device drivers and bus drivers. - - @param ImageHandle The firmware allocated handle for the UEFI image. - @param SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IMAGE_ENTRY_POINT)( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - -/** - Loads an EFI image into memory. - - @param BootPolicy If TRUE, indicates that the request originates from the boot - manager, and that the boot manager is attempting to load - FilePath as a boot selection. Ignored if SourceBuffer is - not NULL. - @param ParentImageHandle The caller's image handle. - @param DevicePath The DeviceHandle specific file path from which the image is - loaded. - @param SourceBuffer If not NULL, a pointer to the memory location containing a copy - of the image to be loaded. - @param SourceSize The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL. - @param ImageHandle Pointer to the returned image handle that is created when the - image is successfully loaded. - - @retval EFI_SUCCESS Image was loaded into memory correctly. - @retval EFI_NOT_FOUND Both SourceBuffer and DevicePath are NULL. - @retval EFI_INVALID_PARAMETER One or more parametes are invalid. - @retval EFI_UNSUPPORTED The image type is not supported. - @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources. - @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not - understood. - @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IMAGE_LOAD)( - IN BOOLEAN BootPolicy, - IN EFI_HANDLE ParentImageHandle, - IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN VOID *SourceBuffer OPTIONAL, - IN UINTN SourceSize, - OUT EFI_HANDLE *ImageHandle - ); - -/** - Transfers control to a loaded image's entry point. - - @param ImageHandle Handle of image to be started. - @param ExitDataSize Pointer to the size, in bytes, of ExitData. - @param ExitData Pointer to a pointer to a data buffer that includes a Null-terminated - Unicode string, optionally followed by additional binary data. - - @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image - has already been initialized with StartImage - @return Exit code from image - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IMAGE_START)( - IN EFI_HANDLE ImageHandle, - OUT UINTN *ExitDataSize, - OUT CHAR16 **ExitData OPTIONAL - ); - -/** - Terminates a loaded EFI image and returns control to boot services. - - @param ImageHandle Handle that identifies the image. - @param ExitStatus The image's exit code. - @param ExitDataSize The size, in bytes, of ExitData. - @param ExitData Pointer to a data buffer that includes a Null-terminated Unicode string, - optionally followed by additional binary data. - - @retval EFI_SUCCESS The image specified by ImageHandle was unloaded. - @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and - started with LoadImage() and StartImage(), but the - image is not the currently executing image. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_EXIT)( - IN EFI_HANDLE ImageHandle, - IN EFI_STATUS ExitStatus, - IN UINTN ExitDataSize, - IN CHAR16 *ExitData OPTIONAL - ); - -/** - Unloads an image. - - @param ImageHandle Handle that identifies the image to be unloaded. - - @retval EFI_SUCCESS The image has been unloaded. - @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle. - @retval EFI_UNSUPPORTED The image has been started, and does not support unload. - @return Exit code from the image's unload handler - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IMAGE_UNLOAD)( - IN EFI_HANDLE ImageHandle - ); - -/** - Terminates all boot services. - - @param ImageHandle Handle that identifies the exiting image. - @param MapKey Key to the latest memory map. - - @retval EFI_SUCCESS Boot services have been terminated. - @retval EFI_INVALID_PARAMETER MapKey is incorrect. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_EXIT_BOOT_SERVICES)( - IN EFI_HANDLE ImageHandle, - IN UINTN MapKey - ); - -/** - Induces a fine-grained stall. - - @param Microseconds The number of microseconds to stall execution. - - @retval EFI_SUCCESS Execution was stalled at least the requested number of - Microseconds. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_STALL)( - IN UINTN Microseconds - ); - -/** - Sets the system's watchdog timer. - - @param Timeout The number of seconds to set the watchdog timer to. - @param WatchdogCode The numeric code to log on a watchdog timer timeout event. - @param DataSize The size, in bytes, of WatchdogData. - @param WatchdogData A data buffer that includes a Null-terminated Unicode string, optionally - followed by additional binary data. - - @retval EFI_SUCCESS The timeout has been set. - @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid. - @retval EFI_UNSUPPORTED The system does not have a watchdog timer. - @retval EFI_DEVICE_ERROR The watch dog timer could not be programmed due to a hardware - error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_WATCHDOG_TIMER)( - IN UINTN Timeout, - IN UINT64 WatchdogCode, - IN UINTN DataSize, - IN CHAR16 *WatchdogData OPTIONAL - ); - -/// -/// Enumeration of reset types. -/// -typedef enum { - EfiResetCold, - EfiResetWarm, - EfiResetShutdown, - EfiResetUpdate -} EFI_RESET_TYPE; - -/** - Resets the entire platform. - - @param ResetType The type of reset to perform. - @param ResetStatus The status code for the reset. - @param DataSize The size, in bytes, of WatchdogData. - @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or - EfiResetShutdown the data buffer starts with a Null-terminated - Unicode string, optionally followed by additional binary data. - -**/ -typedef -VOID -(EFIAPI *EFI_RESET_SYSTEM)( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN CHAR16 *ResetData OPTIONAL - ); - -/** - Returns a monotonically increasing count for the platform. - - @param Count Pointer to returned value. - - @retval EFI_SUCCESS The next monotonic count was returned. - @retval EFI_INVALID_PARAMETER Count is NULL. - @retval EFI_DEVICE_ERROR The device is not functioning properly. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT)( - OUT UINT64 *Count - ); - -/** - Returns the next high 32 bits of the platform's monotonic counter. - - @param HighCount Pointer to returned value. - - @retval EFI_SUCCESS The next high monotonic count was returned. - @retval EFI_INVALID_PARAMETER HighCount is NULL. - @retval EFI_DEVICE_ERROR The device is not functioning properly. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT)( - OUT UINT32 *HighCount - ); - -/** - Computes and returns a 32-bit CRC for a data buffer. - - @param Data A pointer to the buffer on which the 32-bit CRC is to be computed. - @param DataSize The number of bytes in the buffer Data. - @param Crc32 The 32-bit CRC that was computed for the data buffer specified by Data - and DataSize. - - @retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in - Crc32. - @retval EFI_INVALID_PARAMETER Data is NULL. - @retval EFI_INVALID_PARAMETER Crc32 is NULL. - @retval EFI_INVALID_PARAMETER DataSize is 0. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CALCULATE_CRC32)( - IN VOID *Data, - IN UINTN DataSize, - OUT UINT32 *Crc32 - ); - -/** - Copies the contents of one buffer to another buffer. - - @param Destination Pointer to the destination buffer of the memory copy. - @param Source Pointer to the source buffer of the memory copy. - @param Length Number of bytes to copy from Source to Destination. - -**/ -typedef -VOID -(EFIAPI *EFI_COPY_MEM)( - IN VOID *Destination, - IN VOID *Source, - IN UINTN Length - ); - -/** - The SetMem() function fills a buffer with a specified value. - - @param Buffer Pointer to the buffer to fill. - @param Size Number of bytes in Buffer to fill. - @param Value Value to fill Buffer with. - -**/ -typedef -VOID -(EFIAPI *EFI_SET_MEM)( - IN VOID *Buffer, - IN UINTN Size, - IN UINT8 Value - ); - - -// -// Protocol handler functions -// -typedef enum { - EFI_NATIVE_INTERFACE -} EFI_INTERFACE_TYPE; - -/** - Installs a protocol interface on a device handle. If the handle does not exist, it is created and added - to the list of handles in the system. InstallMultipleProtocolInterfaces() performs - more error checking than InstallProtocolInterface(), so it is recommended that - InstallMultipleProtocolInterfaces() be used in place of - InstallProtocolInterface() - - @param Handle A pointer to the EFI_HANDLE on which the interface is to be installed. - @param Protocol The numeric ID of the protocol interface. - @param InterfaceType Indicates whether Interface is supplied in native form. - @param Interface A pointer to the protocol interface. - - @retval EFI_SUCCESS The protocol interface was installed. - @retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated. - @retval EFI_INVALID_PARAMETER Handle is NULL. - @retval EFI_INVALID_PARAMETER Protocol is NULL. - @retval EFI_INVALID_PARAMETER InterfaceType is not EFI_NATIVE_INTERFACE. - @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE)( - IN OUT EFI_HANDLE *Handle, - IN EFI_GUID *Protocol, - IN EFI_INTERFACE_TYPE InterfaceType, - IN VOID *Interface - ); - -/** - Installs one or more protocol interfaces into the boot services environment. - - @param Handle The handle to install the new protocol interfaces on, or NULL if a new - handle is to be allocated. - @param ... A variable argument list containing pairs of protocol GUIDs and protocol - interfaces. - - @retval EFI_SUCCESS All the protocol interface was installed. - @retval EFI_OUT_OF_RESOURCES There was not enough memory in pool to install all the protocols. - @retval EFI_ALREADY_STARTED A Device Path Protocol instance was passed in that is already present in - the handle database. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)( - IN OUT EFI_HANDLE *Handle, - ... - ); - -/** - Reinstalls a protocol interface on a device handle. - - @param Handle Handle on which the interface is to be reinstalled. - @param Protocol The numeric ID of the interface. - @param OldInterface A pointer to the old interface. NULL can be used if a structure is not - associated with Protocol. - @param NewInterface A pointer to the new interface. - - @retval EFI_SUCCESS The protocol interface was reinstalled. - @retval EFI_NOT_FOUND The OldInterface on the handle was not found. - @retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled, - because OldInterface is still being used by a - driver that will not release it. - @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER Protocol is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE)( - IN EFI_HANDLE Handle, - IN EFI_GUID *Protocol, - IN VOID *OldInterface, - IN VOID *NewInterface - ); - -/** - Removes a protocol interface from a device handle. It is recommended that - UninstallMultipleProtocolInterfaces() be used in place of - UninstallProtocolInterface(). - - @param Handle The handle on which the interface was installed. - @param Protocol The numeric ID of the interface. - @param Interface A pointer to the interface. - - @retval EFI_SUCCESS The interface was removed. - @retval EFI_NOT_FOUND The interface was not found. - @retval EFI_ACCESS_DENIED The interface was not removed because the interface - is still being used by a driver. - @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER Protocol is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE)( - IN EFI_HANDLE Handle, - IN EFI_GUID *Protocol, - IN VOID *Interface - ); - -/** - Removes one or more protocol interfaces into the boot services environment. - - @param Handle The handle to remove the protocol interfaces from. - @param ... A variable argument list containing pairs of protocol GUIDs and - protocol interfaces. - - @retval EFI_SUCCESS All the protocol interfaces were removed. - @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)( - IN EFI_HANDLE Handle, - ... - ); - -/** - Queries a handle to determine if it supports a specified protocol. - - @param Handle The handle being queried. - @param Protocol The published unique identifier of the protocol. - @param Interface Supplies the address where a pointer to the corresponding Protocol - Interface is returned. - - @retval EFI_SUCCESS The interface information for the specified protocol was returned. - @retval EFI_UNSUPPORTED The device does not support the specified protocol. - @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER Protocol is NULL. - @retval EFI_INVALID_PARAMETER Interface is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HANDLE_PROTOCOL)( - IN EFI_HANDLE Handle, - IN EFI_GUID *Protocol, - OUT VOID **Interface - ); - -#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 -#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 -#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004 -#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008 -#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 -#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 - -/** - Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the - handle, it opens the protocol on behalf of the calling agent. - - @param Handle The handle for the protocol interface that is being opened. - @param Protocol The published unique identifier of the protocol. - @param Interface Supplies the address where a pointer to the corresponding Protocol - Interface is returned. - @param AgentHandle The handle of the agent that is opening the protocol interface - specified by Protocol and Interface. - @param ControllerHandle If the agent that is opening a protocol is a driver that follows the - UEFI Driver Model, then this parameter is the controller handle - that requires the protocol interface. If the agent does not follow - the UEFI Driver Model, then this parameter is optional and may - be NULL. - @param Attributes The open mode of the protocol interface specified by Handle - and Protocol. - - @retval EFI_SUCCESS An item was added to the open list for the protocol interface, and the - protocol interface was returned in Interface. - @retval EFI_UNSUPPORTED Handle does not support Protocol. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_ACCESS_DENIED Required attributes can't be supported in current environment. - @retval EFI_ALREADY_STARTED Item on the open list already has requierd attributes whose agent - handle is the same as AgentHandle. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_OPEN_PROTOCOL)( - IN EFI_HANDLE Handle, - IN EFI_GUID *Protocol, - OUT VOID **Interface, OPTIONAL - IN EFI_HANDLE AgentHandle, - IN EFI_HANDLE ControllerHandle, - IN UINT32 Attributes - ); - - -/** - Closes a protocol on a handle that was opened using OpenProtocol(). - - @param Handle The handle for the protocol interface that was previously opened - with OpenProtocol(), and is now being closed. - @param Protocol The published unique identifier of the protocol. - @param AgentHandle The handle of the agent that is closing the protocol interface. - @param ControllerHandle If the agent that opened a protocol is a driver that follows the - UEFI Driver Model, then this parameter is the controller handle - that required the protocol interface. - - @retval EFI_SUCCESS The protocol instance was closed. - @retval EFI_INVALID_PARAMETER 1) Handle is not a valid EFI_HANDLE. - 2) AgentHandle is not a valid EFI_HANDLE. - 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE. - 4) Protocol is NULL. - @retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol. - 2) The protocol interface specified by Handle and Protocol is not - currently open by AgentHandle and ControllerHandle. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_CLOSE_PROTOCOL)( - IN EFI_HANDLE Handle, - IN EFI_GUID *Protocol, - IN EFI_HANDLE AgentHandle, - IN EFI_HANDLE ControllerHandle - ); - - -typedef struct { - EFI_HANDLE AgentHandle; - EFI_HANDLE ControllerHandle; - UINT32 Attributes; - UINT32 OpenCount; -} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY; - -/** - Retrieves the list of agents that currently have a protocol interface opened. - - @param Handle The handle for the protocol interface that is being queried. - @param Protocol The published unique identifier of the protocol. - @param EntryBuffer A pointer to a buffer of open protocol information in the form of - EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures. - @param EntryCount A pointer to the number of entries in EntryBuffer. - - @retval EFI_SUCCESS The open protocol information was returned in EntryBuffer, and the - number of entries was returned EntryCount. - @retval EFI_OUT_OF_RESOURCES There are not enough resources available to allocate EntryBuffer. - @retval EFI_NOT_FOUND Handle does not support the protocol specified by Protocol. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION)( - IN EFI_HANDLE Handle, - IN EFI_GUID *Protocol, - OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer, - OUT UINTN *EntryCount - ); - -/** - Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated - from pool. - - @param Handle The handle from which to retrieve the list of protocol interface - GUIDs. - @param ProtocolBuffer A pointer to the list of protocol interface GUID pointers that are - installed on Handle. - @param ProtocolBufferCount A pointer to the number of GUID pointers present in - ProtocolBuffer. - - @retval EFI_SUCCESS The list of protocol interface GUIDs installed on Handle was returned in - ProtocolBuffer. The number of protocol interface GUIDs was - returned in ProtocolBufferCount. - @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results. - @retval EFI_INVALID_PARAMETER Handle is NULL. - @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL. - @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PROTOCOLS_PER_HANDLE)( - IN EFI_HANDLE Handle, - OUT EFI_GUID ***ProtocolBuffer, - OUT UINTN *ProtocolBufferCount - ); - -/** - Creates an event that is to be signaled whenever an interface is installed for a specified protocol. - - @param Protocol The numeric ID of the protocol for which the event is to be registered. - @param Event Event that is to be signaled whenever a protocol interface is registered - for Protocol. - @param Registration A pointer to a memory location to receive the registration value. - - @retval EFI_SUCCESS The notification event has been registered. - @retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated. - @retval EFI_INVALID_PARAMETER Protocol is NULL. - @retval EFI_INVALID_PARAMETER Event is NULL. - @retval EFI_INVALID_PARAMETER Registration is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY)( - IN EFI_GUID *Protocol, - IN EFI_EVENT Event, - OUT VOID **Registration - ); - - -typedef enum { - AllHandles, - ByRegisterNotify, - ByProtocol -} EFI_LOCATE_SEARCH_TYPE; - -/** - Returns an array of handles that support a specified protocol. - - @param SearchType Specifies which handle(s) are to be returned. - @param Protocol Specifies the protocol to search by. - @param SearchKey Specifies the search key. - @param BufferSize On input, the size in bytes of Buffer. On output, the size in bytes of - the array returned in Buffer (if the buffer was large enough) or the - size, in bytes, of the buffer needed to obtain the array (if the buffer was - not large enough). - @param Buffer The buffer in which the array is returned. - - @retval EFI_SUCCESS The array of handles was returned. - @retval EFI_NOT_FOUND No handles match the search. - @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result. - @retval EFI_INVALID_PARAMETER SearchType is not a member of EFI_LOCATE_SEARCH_TYPE. - @retval EFI_INVALID_PARAMETER SearchType is ByRegisterNotify and SearchKey is NULL. - @retval EFI_INVALID_PARAMETER SearchType is ByProtocol and Protocol is NULL. - @retval EFI_INVALID_PARAMETER One or more matches are found and BufferSize is NULL. - @retval EFI_INVALID_PARAMETER BufferSize is large enough for the result and Buffer is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LOCATE_HANDLE)( - IN EFI_LOCATE_SEARCH_TYPE SearchType, - IN EFI_GUID *Protocol, OPTIONAL - IN VOID *SearchKey, OPTIONAL - IN OUT UINTN *BufferSize, - OUT EFI_HANDLE *Buffer - ); - -/** - Locates the handle to a device on the device path that supports the specified protocol. - - @param Protocol Specifies the protocol to search for. - @param DevicePath On input, a pointer to a pointer to the device path. On output, the device - path pointer is modified to point to the remaining part of the device - path. - @param Device A pointer to the returned device handle. - - @retval EFI_SUCCESS The resulting handle was returned. - @retval EFI_NOT_FOUND No handles match the search. - @retval EFI_INVALID_PARAMETER Protocol is NULL. - @retval EFI_INVALID_PARAMETER DevicePath is NULL. - @retval EFI_INVALID_PARAMETER A handle matched the search and Device is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LOCATE_DEVICE_PATH)( - IN EFI_GUID *Protocol, - IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, - OUT EFI_HANDLE *Device - ); - -/** - Adds, updates, or removes a configuration table entry from the EFI System Table. - - @param Guid A pointer to the GUID for the entry to add, update, or remove. - @param Table A pointer to the configuration table for the entry to add, update, or - remove. May be NULL. - - @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed. - @retval EFI_NOT_FOUND An attempt was made to delete a nonexistent entry. - @retval EFI_INVALID_PARAMETER Guid is not valid. - @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE)( - IN EFI_GUID *Guid, - IN VOID *Table - ); - - -/** - Returns an array of handles that support the requested protocol in a buffer allocated from pool. - - @param SearchType Specifies which handle(s) are to be returned. - @param Protocol Provides the protocol to search by. - This parameter is only valid for a SearchType of ByProtocol. - @param SearchKey Supplies the search key depending on the SearchType. - @param NoHandles The number of handles returned in Buffer. - @param Buffer A pointer to the buffer to return the requested array of handles that - support Protocol. - - @retval EFI_SUCCESS The array of handles was returned in Buffer, and the number of - handles in Buffer was returned in NoHandles. - @retval EFI_NOT_FOUND No handles match the search. - @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results. - @retval EFI_INVALID_PARAMETER NoHandles is NULL. - @retval EFI_INVALID_PARAMETER Buffer is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LOCATE_HANDLE_BUFFER)( - IN EFI_LOCATE_SEARCH_TYPE SearchType, - IN EFI_GUID *Protocol, OPTIONAL - IN VOID *SearchKey, OPTIONAL - IN OUT UINTN *NoHandles, - OUT EFI_HANDLE **Buffer - ); - -/** - Returns the first protocol instance that matches the given protocol. - - @param Protocol Provides the protocol to search for. - @param Registration Optional registration key returned from - RegisterProtocolNotify(). - @param Interface On return, a pointer to the first interface that matches Protocol and - Registration. - - @retval EFI_SUCCESS A protocol instance matching Protocol was found and returned in - Interface. - @retval EFI_NOT_FOUND No protocol instances were found that match Protocol and - Registration. - @retval EFI_INVALID_PARAMETER Interface is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LOCATE_PROTOCOL)( - IN EFI_GUID *Protocol, - IN VOID *Registration, OPTIONAL - OUT VOID **Interface - ); - -typedef struct { - UINT64 Length; - union { - EFI_PHYSICAL_ADDRESS DataBlock; - EFI_PHYSICAL_ADDRESS ContinuationPointer; - } Union; -} EFI_CAPSULE_BLOCK_DESCRIPTOR; - -typedef struct { - EFI_GUID CapsuleGuid; - UINT32 HeaderSize; - UINT32 Flags; - UINT32 CapsuleImageSize; -} EFI_CAPSULE_HEADER; - -// -// The EFI System Table entry must point to an array of capsules -// that contain the same CapsuleGuid value. The array must be -// prefixed by a UINT32 that represents the size of the array of capsules. -// -typedef struct { - UINT32 CapsuleArrayNumber; - VOID* CapsulePtr[1]; -} EFI_CAPSULE_TABLE; - -#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000 -#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000 - -/** - Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended - consumption, the firmware may process the capsule immediately. If the payload should persist - across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must - be passed into ResetSystem() and will cause the capsule to be processed by the firmware as - part of the reset process. - - @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules - being passed into update capsule. - @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in - CaspuleHeaderArray. - @param ScatterGatherList Physical pointer to a set of - EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the - location in physical memory of a set of capsules. - - @retval EFI_SUCCESS Valid capsule was passed. If - CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the - capsule has been successfully processed by the firmware. - @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error. - @retval EFI_INVALID_PARAMETER CapsuleSize is NULL. - @retval EFI_UNSUPPORTED The capsule type is not supported on this platform. - @retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the capsule. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UPDATE_CAPSULE)( - IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, - IN UINTN CapsuleCount, - IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL - ); - -/** - Returns if the capsule can be supported via UpdateCapsule(). - - @param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules - being passed into update capsule. - @param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in - CaspuleHeaderArray. - @param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can - support as an argument to UpdateCapsule() via - CapsuleHeaderArray and ScatterGatherList. - @param ResetType Returns the type of reset required for the capsule update. - - @retval EFI_SUCCESS Valid answer returned. - @retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and - MaximumCapsuleSize and ResetType are undefined. - @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL. - @retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the query request. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES)( - IN EFI_CAPSULE_HEADER **CapsuleHeaderArray, - IN UINTN CapsuleCount, - OUT UINT64 *MaximumCapsuleSize, - OUT EFI_RESET_TYPE *ResetType - ); - -/** - Returns information about the EFI variables. - - @param Attributes Attributes bitmask to specify the type of variables on - which to return information. - @param MaximumVariableStorageSize On output the maximum size of the storage space - available for the EFI variables associated with the - attributes specified. - @param RemainingVariableStorageSize Returns the remaining size of the storage space - available for the EFI variables associated with the - attributes specified. - @param MaximumVariableSize Returns the maximum size of the individual EFI - variables associated with the attributes specified. - - @retval EFI_SUCCESS Valid answer returned. - @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied - @retval EFI_UNSUPPORTED The attribute is not supported on this platform, and the - MaximumVariableStorageSize, - RemainingVariableStorageSize, MaximumVariableSize - are undefined. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_QUERY_VARIABLE_INFO)( - IN UINT32 Attributes, - OUT UINT64 *MaximumVariableStorageSize, - OUT UINT64 *RemainingVariableStorageSize, - OUT UINT64 *MaximumVariableSize - ); - - -// -// EFI Runtime Services Table -// -#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL -#define EFI_SYSTEM_TABLE_REVISION ((2<<16) | (10)) -#define EFI_2_10_SYSTEM_TABLE_REVISION ((2<<16) | (10)) -#define EFI_2_00_SYSTEM_TABLE_REVISION ((2<<16) | (00)) -#define EFI_1_10_SYSTEM_TABLE_REVISION ((1<<16) | (10)) -#define EFI_1_02_SYSTEM_TABLE_REVISION ((1<<16) | (02)) - -#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL -#define EFI_RUNTIME_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION - -/// -/// EFI Runtime Services Table -/// -typedef struct { - /// - /// The table header for the EFI Runtime Services Table. - /// - EFI_TABLE_HEADER Hdr; - - // - // Time Services - // - EFI_GET_TIME GetTime; - EFI_SET_TIME SetTime; - EFI_GET_WAKEUP_TIME GetWakeupTime; - EFI_SET_WAKEUP_TIME SetWakeupTime; - - // - // Virtual Memory Services - // - EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap; - EFI_CONVERT_POINTER ConvertPointer; - - // - // Variable Services - // - EFI_GET_VARIABLE GetVariable; - EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName; - EFI_SET_VARIABLE SetVariable; - - // - // Miscellaneous Services - // - EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount; - EFI_RESET_SYSTEM ResetSystem; - - // - // UEFI 2.0 Capsule Services - // - EFI_UPDATE_CAPSULE UpdateCapsule; - EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities; - - // - // Miscellaneous UEFI 2.0 Service - // - EFI_QUERY_VARIABLE_INFO QueryVariableInfo; -} EFI_RUNTIME_SERVICES; - - -#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42ULL -#define EFI_BOOT_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION - -/// -/// EFI Boot Services Table -/// -typedef struct { - /// - /// The table header for the EFI Boot Services Table. - /// - EFI_TABLE_HEADER Hdr; - - // - // Task Priority Services - // - EFI_RAISE_TPL RaiseTPL; - EFI_RESTORE_TPL RestoreTPL; - - // - // Memory Services - // - EFI_ALLOCATE_PAGES AllocatePages; - EFI_FREE_PAGES FreePages; - EFI_GET_MEMORY_MAP GetMemoryMap; - EFI_ALLOCATE_POOL AllocatePool; - EFI_FREE_POOL FreePool; - - // - // Event & Timer Services - // - EFI_CREATE_EVENT CreateEvent; - EFI_SET_TIMER SetTimer; - EFI_WAIT_FOR_EVENT WaitForEvent; - EFI_SIGNAL_EVENT SignalEvent; - EFI_CLOSE_EVENT CloseEvent; - EFI_CHECK_EVENT CheckEvent; - - // - // Protocol Handler Services - // - EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface; - EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface; - EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface; - EFI_HANDLE_PROTOCOL HandleProtocol; - VOID *Reserved; - EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify; - EFI_LOCATE_HANDLE LocateHandle; - EFI_LOCATE_DEVICE_PATH LocateDevicePath; - EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable; - - // - // Image Services - // - EFI_IMAGE_LOAD LoadImage; - EFI_IMAGE_START StartImage; - EFI_EXIT Exit; - EFI_IMAGE_UNLOAD UnloadImage; - EFI_EXIT_BOOT_SERVICES ExitBootServices; - - // - // Miscellaneous Services - // - EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount; - EFI_STALL Stall; - EFI_SET_WATCHDOG_TIMER SetWatchdogTimer; - - // - // DriverSupport Services - // - EFI_CONNECT_CONTROLLER ConnectController; - EFI_DISCONNECT_CONTROLLER DisconnectController; - - // - // Open and Close Protocol Services - // - EFI_OPEN_PROTOCOL OpenProtocol; - EFI_CLOSE_PROTOCOL CloseProtocol; - EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation; - - // - // Library Services - // - EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle; - EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer; - EFI_LOCATE_PROTOCOL LocateProtocol; - EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces; - EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces; - - // - // 32-bit CRC Services - // - EFI_CALCULATE_CRC32 CalculateCrc32; - - // - // Miscellaneous Services - // - EFI_COPY_MEM CopyMem; - EFI_SET_MEM SetMem; - EFI_CREATE_EVENT_EX CreateEventEx; -} EFI_BOOT_SERVICES; - -/// -/// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the -/// EFI System Table. -/// -typedef struct{ - /// - /// The 128-bit GUID value that uniquely identifies the system configuration table. - /// - EFI_GUID VendorGuid; - /// - /// A pointer to the table associated with VendorGuid. - /// - VOID *VendorTable; -} EFI_CONFIGURATION_TABLE; - -/// -/// EFI System Table -/// -struct _EFI_SYSTEM_TABLE { - /// - /// The table header for the EFI System Table. - /// - EFI_TABLE_HEADER Hdr; - /// - /// A pointer to a null terminated Unicode string that identifies - /// the vendor that produces the system firmware for the platform. - /// - CHAR16 *FirmwareVendor; - /// - /// A firmware vendor specific value that identifies the revision - /// of the system firmware for the platform. - /// - UINT32 FirmwareRevision; - /// - /// The handle for the active console input device. - /// - EFI_HANDLE ConsoleInHandle; - /// - /// A pointer to the SIMPLE_INPUT_PROTOCOL interface that is - /// associated with ConsoleInHandle. - /// - EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn; - /// - /// The handle for the active console output device. - /// - EFI_HANDLE ConsoleOutHandle; - /// - /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface - /// that is associated with ConsoleOutHandle. - /// - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut; - /// - /// The handle for the active standard error console device. - /// - EFI_HANDLE StandardErrorHandle; - /// - /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface - /// that is associated with StandardErrorHandle. - /// - EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr; - /// - /// A pointer to the EFI Runtime Services Table. - /// - EFI_RUNTIME_SERVICES *RuntimeServices; - /// - /// A pointer to the EFI Boot Services Table. - /// - EFI_BOOT_SERVICES *BootServices; - /// - /// The number of system configuration tables in the buffer ConfigurationTable. - /// - UINTN NumberOfTableEntries; - /// - /// A pointer to the system configuration tables. - /// The number of entries in the table is NumberOfTableEntries. - /// - EFI_CONFIGURATION_TABLE *ConfigurationTable; -}; - -// -// EFI Load Options Attributes -// -#define LOAD_OPTION_ACTIVE 0x00000001 -#define LOAD_OPTION_FORCE_RECONNECT 0x00000002 -#define LOAD_OPTION_HIDDEN 0x00000008 -#define LOAD_OPTION_CATEGORY 0x00001F00 - -#define LOAD_OPTION_CATEGORY_BOOT 0x00000000 -#define LOAD_OPTION_CATEGORY_APP 0x00000100 - -#define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001 -#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002 -#define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300 - -typedef union { - struct { - UINT32 Revision : 8; - UINT32 ShiftPressed : 1; - UINT32 ControlPressed : 1; - UINT32 AltPressed : 1; - UINT32 LogoPressed : 1; - UINT32 MenuPressed : 1; - UINT32 SysReqPessed : 1; - UINT32 Reserved : 16; - UINT32 InputKeyCount : 2; - } Options; - UINT32 PackedValue; -} HOT_KEY_EFI_KEY_DATA; - -typedef struct { - HOT_KEY_EFI_KEY_DATA KeyOptions; - UINT32 BootOptionCrc; - UINT16 BootOption; -//EFI_INPUT_KEY Keys[]; -} EFI_KEY_OPTION; - -#define EFI_KEY_OPTION_SHIFT 0x00000001 -#define EFI_KEY_OPTION_CONTROL 0x00000002 -#define EFI_KEY_OPTION_ALT 0x00000004 -#define EFI_KEY_OPTION_LOGO 0x00000008 -#define EFI_KEY_OPTION_MENU 0x00000010 -#define EFI_KEY_OPTION_SYSREQ 0x00000020 -#define EFI_KEY_CODE_COUNT 0x00000300 - - -// -// EFI File location to boot from on removable media devices -// -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI" - -#if defined (MDE_CPU_IA32) - #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 -#elif defined (MDE_CPU_IPF) - #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 -#elif defined (MDE_CPU_X64) - #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64 -#elif defined (MDE_CPU_EBC) -#else - #error Unknown Processor Type -#endif - -#include <gpxe/efi/Uefi/UefiPxe.h> -#include <gpxe/efi/Uefi/UefiGpt.h> -#include <gpxe/efi/Uefi/UefiInternalFormRepresentation.h> - -#endif diff --git a/gpxe/src/include/gpxe/efi/X64/ProcessorBind.h b/gpxe/src/include/gpxe/efi/X64/ProcessorBind.h deleted file mode 100644 index fe6c413b..00000000 --- a/gpxe/src/include/gpxe/efi/X64/ProcessorBind.h +++ /dev/null @@ -1,247 +0,0 @@ -/** @file - Processor or Compiler specific defines and types x64 (Intel(r) EM64T, AMD64). - - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef __PROCESSOR_BIND_H__ -#define __PROCESSOR_BIND_H__ - -/// -/// Define the processor type so other code can make processor based choices -/// -#define MDE_CPU_X64 - - -// -// Make sure we are useing the correct packing rules per EFI specification -// -#ifndef __GNUC__ -#pragma pack() -#endif - - -#if __INTEL_COMPILER -// -// Disable ICC's remark #869: "Parameter" was never referenced warning. -// This is legal ANSI C code so we disable the remark that is turned on with -Wall -// -#pragma warning ( disable : 869 ) - -// -// Disable ICC's remark #1418: external function definition with no prior declaration. -// This is legal ANSI C code so we disable the remark that is turned on with /W4 -// -#pragma warning ( disable : 1418 ) - -// -// Disable ICC's remark #1419: external declaration in primary source file -// This is legal ANSI C code so we disable the remark that is turned on with /W4 -// -#pragma warning ( disable : 1419 ) - -#endif - - -#if _MSC_EXTENSIONS - -// -// Disable warning that make it impossible to compile at /W4 -// This only works for Microsoft* tools -// - -// -// Disabling bitfield type checking warnings. -// -#pragma warning ( disable : 4214 ) - -// -// Disabling the unreferenced formal parameter warnings. -// -#pragma warning ( disable : 4100 ) - -// -// Disable slightly different base types warning as CHAR8 * can not be set -// to a constant string. -// -#pragma warning ( disable : 4057 ) - -// -// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning -// -#pragma warning ( disable : 4127 ) - -// -// This warning is caused by functions defined but not used. For precompiled header only. -// -#pragma warning ( disable : 4505 ) - -// -// This warning is caused by empty (after preprocessing) souce file. For precompiled header only. -// -#pragma warning ( disable : 4206 ) - -#endif - - -#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L) - // - // No ANSI C 2000 stdint.h integer width declarations, so define equivalents - // - - #if _MSC_EXTENSIONS - - - // - // use Microsoft C complier dependent interger width types - // - typedef unsigned __int64 UINT64; - typedef __int64 INT64; - typedef unsigned __int32 UINT32; - typedef __int32 INT32; - typedef unsigned short UINT16; - typedef unsigned short CHAR16; - typedef short INT16; - typedef unsigned char BOOLEAN; - typedef unsigned char UINT8; - typedef char CHAR8; - typedef char INT8; - #else - #ifdef _EFI_P64 - // - // P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints - // are 32-bits - // - typedef unsigned long long UINT64; - typedef long long INT64; - typedef unsigned int UINT32; - typedef int INT32; - typedef unsigned short CHAR16; - typedef unsigned short UINT16; - typedef short INT16; - typedef unsigned char BOOLEAN; - typedef unsigned char UINT8; - typedef char CHAR8; - typedef char INT8; - #else - // - // Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit. - // - typedef unsigned long UINT64; - typedef long INT64; - typedef unsigned int UINT32; - typedef int INT32; - typedef unsigned short UINT16; - typedef unsigned short CHAR16; - typedef short INT16; - typedef unsigned char BOOLEAN; - typedef unsigned char UINT8; - typedef char CHAR8; - typedef char INT8; - #endif - #endif - - #define UINT8_MAX 0xff - -#else - // - // Use ANSI C 2000 stdint.h integer width declarations - // - #include <stdint.h> - typedef uint8_t BOOLEAN; - typedef int8_t INT8; - typedef uint8_t UINT8; - typedef int16_t INT16; - typedef uint16_t UINT16; - typedef int32_t INT32; - typedef uint32_t UINT32; - typedef int64_t INT64; - typedef uint64_t UINT64; - typedef char CHAR8; - typedef uint16_t CHAR16; - -#endif - -typedef UINT64 UINTN; -typedef INT64 INTN; - - -// -// Processor specific defines -// -#define MAX_BIT 0x8000000000000000ULL -#define MAX_2_BITS 0xC000000000000000ULL - -// -// Maximum legal X64 address -// -#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL - -// -// The stack alignment required for X64 -// -#define CPU_STACK_ALIGNMENT 16 - -// -// Modifier to ensure that all protocol member functions and EFI intrinsics -// use the correct C calling convention. All protocol member functions and -// EFI intrinsics are required to modify thier member functions with EFIAPI. -// -#if _MSC_EXTENSIONS - /// - /// Define the standard calling convention reguardless of optimization level. - /// __cdecl is Microsoft* specific C extension. - /// - #define EFIAPI __cdecl -#elif __GNUC__ - /// - /// Define the standard calling convention reguardless of optimization level. - /// The GCC support assumes a GCC compiler that supports the EFI ABI. The EFI - /// ABI is much closer to the x64 Microsoft* ABI than standard x64 (x86-64) - /// GCC ABI. Thus a standard x64 (x86-64) GCC compiler can not be used for - /// x64. Warning the assembly code in the MDE x64 does not follow the correct - /// ABI for the standard x64 (x86-64) GCC. - /// - #define EFIAPI __attribute__((ms_abi)) -#else - /// - /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI - /// is the standard. - /// - #define EFIAPI -#endif - -// -// The Microsoft* C compiler can removed references to unreferenced data items -// if the /OPT:REF linker option is used. We defined a macro as this is a -// a non standard extension -// -#if _MSC_EXTENSIONS - #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany) -#else - #define GLOBAL_REMOVE_IF_UNREFERENCED -#endif - -// -// For symbol name in GNU assembly code, an extra "_" is necessary -// -#if __GNUC__ - #if defined(linux) - #define ASM_PFX(name) name - #else - #define ASM_PFX(name) _##name - #endif -#endif - -#define FUNCTION_ENTRY_POINT(p) (p) - -#endif - diff --git a/gpxe/src/include/gpxe/efi/efi.h b/gpxe/src/include/gpxe/efi/efi.h deleted file mode 100644 index f4459b74..00000000 --- a/gpxe/src/include/gpxe/efi/efi.h +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef _EFI_H -#define _EFI_H - -/** @file - * - * EFI API - * - * The intention is to include near-verbatim copies of the EFI headers - * required by gPXE. This is achieved using the import.pl script in - * this directory. Run the import script to update the local copies - * of the headers: - * - * ./import.pl /path/to/edk2/edk2 - * - * where /path/to/edk2/edk2 is the path to your local checkout of the - * EFI Development Kit. - * - * Note that import.pl will modify any #include lines in each imported - * header to reflect its new location within the gPXE tree. It will - * also tidy up the file by removing carriage return characters and - * trailing whitespace. - * - * - * At the time of writing, there are a few other modifications to - * these headers that are present in my personal edk2 tree, that are - * not yet committed back to the main edk2 repository. These - * modifications are fixes for compilation on case-dependent - * filesystems, compilation under -mrtd and -mregparm=3, etc. - */ - -/* EFI headers rudely redefine NULL */ -#undef NULL - -/* EFI headers expect ICC to define __GNUC__ */ -#if defined ( __ICC ) && ! defined ( __GNUC__ ) -#define __GNUC__ 1 -#endif - -/* Include the top-level EFI header files */ -#include <gpxe/efi/Uefi.h> -#include <gpxe/efi/PiDxe.h> - -/* Reset any trailing #pragma pack directives */ -#pragma pack(1) -#pragma pack() - -#include <gpxe/tables.h> -#include <gpxe/uuid.h> - -/** An EFI protocol used by gPXE */ -struct efi_protocol { - /** GUID */ - union { - /** EFI protocol GUID */ - EFI_GUID guid; - /** UUID structure understood by gPXE */ - union uuid uuid; - } u; - /** Variable containing pointer to protocol structure */ - void **protocol; -}; - -/** EFI protocol table */ -#define EFI_PROTOCOLS __table ( struct efi_protocol, "efi_protocols" ) - -/** Declare an EFI protocol used by gPXE */ -#define __efi_protocol __table_entry ( EFI_PROTOCOLS, 01 ) - -/** Declare an EFI protocol to be required by gPXE - * - * @v _protocol EFI protocol name - * @v _ptr Pointer to protocol instance - */ -#define EFI_REQUIRE_PROTOCOL( _protocol, _ptr ) \ - struct efi_protocol __ ## _protocol __efi_protocol = { \ - .u.guid = _protocol ## _GUID, \ - .protocol = ( ( void ** ) ( void * ) \ - ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \ - (_ptr) : (_ptr) ) ), \ - } - -/** An EFI configuration table used by gPXE */ -struct efi_config_table { - /** GUID */ - union { - /** EFI configuration table GUID */ - EFI_GUID guid; - /** UUID structure understood by gPXE */ - union uuid uuid; - } u; - /** Variable containing pointer to configuration table */ - void **table; - /** Table is required for operation */ - int required; -}; - -/** EFI configuration table table */ -#define EFI_CONFIG_TABLES \ - __table ( struct efi_config_table, "efi_config_tables" ) - -/** Declare an EFI configuration table used by gPXE */ -#define __efi_config_table __table_entry ( EFI_CONFIG_TABLES, 01 ) - -/** Declare an EFI configuration table to be used by gPXE - * - * @v _table EFI configuration table name - * @v _ptr Pointer to configuration table - * @v _required Table is required for operation - */ -#define EFI_USE_TABLE( _table, _ptr, _required ) \ - struct efi_config_table __ ## _table __efi_config_table = { \ - .u.guid = _table ## _GUID, \ - .table = ( ( void ** ) ( void * ) (_ptr) ), \ - .required = (_required), \ - } - -/** Convert a gPXE status code to an EFI status code - * - * FIXME: actually perform some kind of conversion. gPXE error codes - * will be detected as EFI error codes; both have the top bit set, and - * the success return code is zero for both. Anything that just - * reports a numerical error will be OK, anything attempting to - * interpret the value or to display a text equivalent will be - * screwed. - */ -#define RC_TO_EFIRC( rc ) (rc) - -/** Convert an EFI status code to a gPXE status code - * - * FIXME: as above - */ -#define EFIRC_TO_RC( efirc ) (efirc) - -extern EFI_HANDLE efi_image_handle; -extern EFI_SYSTEM_TABLE *efi_systab; - -extern const char * efi_strerror ( EFI_STATUS efirc ); -extern EFI_STATUS efi_init ( EFI_HANDLE image_handle, - EFI_SYSTEM_TABLE *systab ); -extern int efi_snp_install ( void ); - -#endif /* _EFI_H */ diff --git a/gpxe/src/include/gpxe/efi/efi_io.h b/gpxe/src/include/gpxe/efi/efi_io.h deleted file mode 100644 index 7ad5ffe7..00000000 --- a/gpxe/src/include/gpxe/efi/efi_io.h +++ /dev/null @@ -1,180 +0,0 @@ -#ifndef _GPXE_EFI_IO_H -#define _GPXE_EFI_IO_H - -/** @file - * - * gPXE I/O API for EFI - * - * EFI runs with flat physical addressing, so the various mappings - * between virtual addresses, I/O addresses and bus addresses are all - * no-ops. I/O is handled using the EFI_CPU_IO_PROTOCOL. - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -#ifdef IOAPI_EFI -#define IOAPI_PREFIX_efi -#else -#define IOAPI_PREFIX_efi __efi_ -#endif - -extern unsigned long long efi_ioread ( volatile void *io_addr, - size_t size ); -extern void efi_iowrite ( unsigned long long data, volatile void *io_addr, - size_t size ); -extern void efi_ioreads ( volatile void *io_addr, void *data, - size_t size, unsigned int count ); -extern void efi_iowrites ( volatile void *io_addr, const void *data, - size_t size, unsigned int count ); - -/* - * Physical<->Bus and Bus<->I/O address mappings - * - * EFI runs with flat physical addressing, so these are all no-ops. - * - */ - -static inline __always_inline unsigned long -IOAPI_INLINE ( efi, phys_to_bus ) ( unsigned long phys_addr ) { - return phys_addr; -} - -static inline __always_inline unsigned long -IOAPI_INLINE ( efi, bus_to_phys ) ( unsigned long bus_addr ) { - return bus_addr; -} - -static inline __always_inline void * -IOAPI_INLINE ( efi, ioremap ) ( unsigned long bus_addr, size_t len __unused ) { - return ( ( void * ) bus_addr ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, iounmap ) ( volatile const void *io_addr __unused ) { - /* Nothing to do */ -} - -static inline __always_inline unsigned long -IOAPI_INLINE ( efi, io_to_bus ) ( volatile const void *io_addr ) { - return ( ( unsigned long ) io_addr ); -} - -/* - * I/O functions - * - */ - -static inline __always_inline uint8_t -IOAPI_INLINE ( efi, readb ) ( volatile uint8_t *io_addr ) { - return efi_ioread ( io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline uint16_t -IOAPI_INLINE ( efi, readw ) ( volatile uint16_t *io_addr ) { - return efi_ioread ( io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline uint32_t -IOAPI_INLINE ( efi, readl ) ( volatile uint32_t *io_addr ) { - return efi_ioread ( io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline uint64_t -IOAPI_INLINE ( efi, readq ) ( volatile uint64_t *io_addr ) { - return efi_ioread ( io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, writeb ) ( uint8_t data, volatile uint8_t *io_addr ) { - efi_iowrite ( data, io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, writew ) ( uint16_t data, volatile uint16_t *io_addr ) { - efi_iowrite ( data, io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, writel ) ( uint32_t data, volatile uint32_t *io_addr ) { - efi_iowrite ( data, io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, writeq ) ( uint64_t data, volatile uint64_t *io_addr ) { - efi_iowrite ( data, io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline uint8_t -IOAPI_INLINE ( efi, inb ) ( volatile uint8_t *io_addr ) { - return efi_ioread ( io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline uint16_t -IOAPI_INLINE ( efi, inw ) ( volatile uint16_t *io_addr ) { - return efi_ioread ( io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline uint32_t -IOAPI_INLINE ( efi, inl ) ( volatile uint32_t *io_addr ) { - return efi_ioread ( io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, outb ) ( uint8_t data, volatile uint8_t *io_addr ) { - efi_iowrite ( data, io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, outw ) ( uint16_t data, volatile uint16_t *io_addr ) { - efi_iowrite ( data, io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, outl ) ( uint32_t data, volatile uint32_t *io_addr ) { - efi_iowrite ( data, io_addr, sizeof ( *io_addr ) ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, insb ) ( volatile uint8_t *io_addr, uint8_t *data, - unsigned int count ) { - efi_ioreads ( io_addr, data, sizeof ( *io_addr ), count ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, insw ) ( volatile uint16_t *io_addr, uint16_t *data, - unsigned int count ) { - efi_ioreads ( io_addr, data, sizeof ( *io_addr ), count ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, insl ) ( volatile uint32_t *io_addr, uint32_t *data, - unsigned int count ) { - efi_ioreads ( io_addr, data, sizeof ( *io_addr ), count ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, outsb ) ( volatile uint8_t *io_addr, const uint8_t *data, - unsigned int count ) { - efi_iowrites ( io_addr, data, sizeof ( *io_addr ), count ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, outsw ) ( volatile uint16_t *io_addr, const uint16_t *data, - unsigned int count ) { - efi_iowrites ( io_addr, data, sizeof ( *io_addr ), count ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, outsl ) ( volatile uint32_t *io_addr, const uint32_t *data, - unsigned int count ) { - efi_iowrites ( io_addr, data, sizeof ( *io_addr ), count ); -} - -static inline __always_inline void -IOAPI_INLINE ( efi, mb ) ( void ) { - /* Do nothing; EFI readl()/writel() calls already act as - * memory barriers. - */ -} - -#endif /* _GPXE_EFI_IO_H */ diff --git a/gpxe/src/include/gpxe/efi/efi_pci.h b/gpxe/src/include/gpxe/efi/efi_pci.h deleted file mode 100644 index 59c0eb1d..00000000 --- a/gpxe/src/include/gpxe/efi/efi_pci.h +++ /dev/null @@ -1,148 +0,0 @@ -#ifndef _GPXE_EFI_PCI_H -#define _GPXE_EFI_PCI_H - -/** @file - * - * gPXE PCI I/O API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -#ifdef PCIAPI_EFI -#define PCIAPI_PREFIX_efi -#else -#define PCIAPI_PREFIX_efi __efi_ -#endif - -/* EFI PCI width codes defined by EFI spec */ -#define EFIPCI_WIDTH_BYTE 0 -#define EFIPCI_WIDTH_WORD 1 -#define EFIPCI_WIDTH_DWORD 2 - -#define EFIPCI_LOCATION( _offset, _width ) \ - ( (_offset) | ( (_width) << 16 ) ) -#define EFIPCI_OFFSET( _location ) ( (_location) & 0xffff ) -#define EFIPCI_WIDTH( _location ) ( (_location) >> 16 ) - -struct pci_device; - -extern int efipci_read ( struct pci_device *pci, unsigned long location, - void *value ); -extern int efipci_write ( struct pci_device *pci, unsigned long location, - unsigned long value ); - -/** - * Determine maximum PCI bus number within system - * - * @ret max_bus Maximum bus number - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_max_bus ) ( void ) { - /* No way to work this out via EFI */ - return 0xff; -} - -/** - * Read byte from PCI configuration space via EFI - * - * @v pci PCI device - * @v where Location within PCI configuration space - * @v value Value read - * @ret rc Return status code - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_read_config_byte ) ( struct pci_device *pci, - unsigned int where, - uint8_t *value ) { - return efipci_read ( pci, - EFIPCI_LOCATION ( where, EFIPCI_WIDTH_BYTE ), - value ); -} - -/** - * Read word from PCI configuration space via EFI - * - * @v pci PCI device - * @v where Location within PCI configuration space - * @v value Value read - * @ret rc Return status code - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_read_config_word ) ( struct pci_device *pci, - unsigned int where, - uint16_t *value ) { - return efipci_read ( pci, - EFIPCI_LOCATION ( where, EFIPCI_WIDTH_WORD ), - value ); -} - -/** - * Read dword from PCI configuration space via EFI - * - * @v pci PCI device - * @v where Location within PCI configuration space - * @v value Value read - * @ret rc Return status code - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_read_config_dword ) ( struct pci_device *pci, - unsigned int where, - uint32_t *value ) { - return efipci_read ( pci, - EFIPCI_LOCATION ( where, EFIPCI_WIDTH_DWORD ), - value ); -} - -/** - * Write byte to PCI configuration space via EFI - * - * @v pci PCI device - * @v where Location within PCI configuration space - * @v value Value to be written - * @ret rc Return status code - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_write_config_byte ) ( struct pci_device *pci, - unsigned int where, - uint8_t value ) { - return efipci_write ( pci, - EFIPCI_LOCATION ( where, EFIPCI_WIDTH_BYTE ), - value ); -} - -/** - * Write word to PCI configuration space via EFI - * - * @v pci PCI device - * @v where Location within PCI configuration space - * @v value Value to be written - * @ret rc Return status code - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_write_config_word ) ( struct pci_device *pci, - unsigned int where, - uint16_t value ) { - return efipci_write ( pci, - EFIPCI_LOCATION ( where, EFIPCI_WIDTH_WORD ), - value ); -} - -/** - * Write dword to PCI configuration space via EFI - * - * @v pci PCI device - * @v where Location within PCI configuration space - * @v value Value to be written - * @ret rc Return status code - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_write_config_dword ) ( struct pci_device *pci, - unsigned int where, - uint32_t value ) { - return efipci_write ( pci, - EFIPCI_LOCATION ( where, EFIPCI_WIDTH_DWORD ), - value ); -} - -#endif /* _GPXE_EFI_PCI_H */ diff --git a/gpxe/src/include/gpxe/efi/efi_smbios.h b/gpxe/src/include/gpxe/efi/efi_smbios.h deleted file mode 100644 index 01631e52..00000000 --- a/gpxe/src/include/gpxe/efi/efi_smbios.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _GPXE_EFI_SMBIOS_H -#define _GPXE_EFI_SMBIOS_H - -/** @file - * - * gPXE SMBIOS API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -#ifdef SMBIOS_EFI -#define SMBIOS_PREFIX_efi -#else -#define SMBIOS_PREFIX_efi __efi_ -#endif - -#endif /* _GPXE_EFI_SMBIOS_H */ diff --git a/gpxe/src/include/gpxe/efi/efi_timer.h b/gpxe/src/include/gpxe/efi/efi_timer.h deleted file mode 100644 index e0531d5a..00000000 --- a/gpxe/src/include/gpxe/efi/efi_timer.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _GPXE_EFI_TIMER_H -#define _GPXE_EFI_TIMER_H - -/** @file - * - * gPXE timer API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -#ifdef TIMER_EFI -#define TIMER_PREFIX_efi -#else -#define TIMER_PREFIX_efi __efi_ -#endif - -#endif /* _GPXE_EFI_TIMER_H */ diff --git a/gpxe/src/include/gpxe/efi/efi_uaccess.h b/gpxe/src/include/gpxe/efi/efi_uaccess.h deleted file mode 100644 index a6b61c58..00000000 --- a/gpxe/src/include/gpxe/efi/efi_uaccess.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _GPXE_EFI_UACCESS_H -#define _GPXE_EFI_UACCESS_H - -/** @file - * - * gPXE user access API for EFI - * - * EFI runs with flat physical addressing, so the various mappings - * between virtual addresses, I/O addresses and bus addresses are all - * no-ops. - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -#ifdef UACCESS_EFI -#define UACCESS_PREFIX_efi -#else -#define UACCESS_PREFIX_efi __efi_ -#endif - -/** - * Convert physical address to user pointer - * - * @v phys_addr Physical address - * @ret userptr User pointer - */ -static inline __always_inline userptr_t -UACCESS_INLINE ( efi, phys_to_user ) ( unsigned long phys_addr ) { - return phys_addr; -} - -/** - * Convert user buffer to physical address - * - * @v userptr User pointer - * @v offset Offset from user pointer - * @ret phys_addr Physical address - */ -static inline __always_inline unsigned long -UACCESS_INLINE ( efi, user_to_phys ) ( userptr_t userptr, off_t offset ) { - return ( userptr + offset ); -} - -static inline __always_inline userptr_t -UACCESS_INLINE ( efi, virt_to_user ) ( volatile const void *addr ) { - return trivial_virt_to_user ( addr ); -} - -static inline __always_inline void * -UACCESS_INLINE ( efi, user_to_virt ) ( userptr_t userptr, off_t offset ) { - return trivial_user_to_virt ( userptr, offset ); -} - -static inline __always_inline userptr_t -UACCESS_INLINE ( efi, userptr_add ) ( userptr_t userptr, off_t offset ) { - return trivial_userptr_add ( userptr, offset ); -} - -static inline __always_inline void -UACCESS_INLINE ( efi, memcpy_user ) ( userptr_t dest, off_t dest_off, - userptr_t src, off_t src_off, - size_t len ) { - trivial_memcpy_user ( dest, dest_off, src, src_off, len ); -} - -static inline __always_inline void -UACCESS_INLINE ( efi, memmove_user ) ( userptr_t dest, off_t dest_off, - userptr_t src, off_t src_off, - size_t len ) { - trivial_memmove_user ( dest, dest_off, src, src_off, len ); -} - -static inline __always_inline void -UACCESS_INLINE ( efi, memset_user ) ( userptr_t buffer, off_t offset, - int c, size_t len ) { - trivial_memset_user ( buffer, offset, c, len ); -} - -static inline __always_inline size_t -UACCESS_INLINE ( efi, strlen_user ) ( userptr_t buffer, off_t offset ) { - return trivial_strlen_user ( buffer, offset ); -} - -static inline __always_inline off_t -UACCESS_INLINE ( efi, memchr_user ) ( userptr_t buffer, off_t offset, - int c, size_t len ) { - return trivial_memchr_user ( buffer, offset, c, len ); -} - -#endif /* _GPXE_EFI_UACCESS_H */ diff --git a/gpxe/src/include/gpxe/efi/efi_umalloc.h b/gpxe/src/include/gpxe/efi/efi_umalloc.h deleted file mode 100644 index 0388dd10..00000000 --- a/gpxe/src/include/gpxe/efi/efi_umalloc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _GPXE_EFI_UMALLOC_H -#define _GPXE_EFI_UMALLOC_H - -/** @file - * - * gPXE user memory allocation API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -#ifdef UMALLOC_EFI -#define UMALLOC_PREFIX_efi -#else -#define UMALLOC_PREFIX_efi __efi_ -#endif - -#endif /* _GPXE_EFI_UMALLOC_H */ diff --git a/gpxe/src/include/gpxe/efi/import.pl b/gpxe/src/include/gpxe/efi/import.pl deleted file mode 100755 index 16993944..00000000 --- a/gpxe/src/include/gpxe/efi/import.pl +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl -w - -use File::Spec::Functions qw ( :ALL ); -use File::Find; -use File::Path; -use FindBin; -use strict; -use warnings; - -sub try_import_file { - my $gpxedir = shift; - my $edkdirs = shift; - my $filename = shift; - - # Skip everything except headers - return unless $filename =~ /\.h$/; - print "$filename..."; - - my $outfile = catfile ( $gpxedir, $filename ); - foreach my $edkdir ( @$edkdirs ) { - my $infile = catfile ( $edkdir, $filename ); - if ( -e $infile ) { - # We have found a matching source file - import it - print "$infile\n"; - open my $infh, "<$infile" or die "Could not open $infile: $!\n"; - ( undef, my $outdir, undef ) = splitpath ( $outfile ); - mkpath ( $outdir ); - open my $outfh, ">$outfile" or die "Could not open $outfile: $!\n"; - my @dependencies = (); - while ( <$infh> ) { - # Strip CR and trailing whitespace - s/\r//g; - s/\s*$//g; - chomp; - # Update include lines, and record included files - if ( s/^\#include\s+[<\"](\S+)[>\"]/\#include <gpxe\/efi\/$1>/ ) { - push @dependencies, $1; - } - print $outfh "$_\n"; - } - close $outfh; - close $infh; - # Recurse to handle any included files that we don't already have - foreach my $dependency ( @dependencies ) { - if ( ! -e catfile ( $gpxedir, $dependency ) ) { - print "...following dependency on $dependency\n"; - try_import_file ( $gpxedir, $edkdirs, $dependency ); - } - } - return; - } - } - print "no equivalent found\n"; -} - -# Identify edk import directories -die "Syntax $0 /path/to/edk2/edk2\n" unless @ARGV == 1; -my $edktop = shift; -die "Directory \"$edktop\" does not appear to contain the EFI EDK2\n" - unless -e catfile ( $edktop, "MdePkg" ); -my $edkdirs = [ catfile ( $edktop, "MdePkg/Include" ), - catfile ( $edktop, "IntelFrameworkPkg/Include" ) ]; - -# Identify gPXE EFI includes directory -my $gpxedir = $FindBin::Bin; -die "Directory \"$gpxedir\" does not appear to contain the gPXE EFI includes\n" - unless -e catfile ( $gpxedir, "../../../include/gpxe/efi" ); - -print "Importing EFI headers into $gpxedir\nfrom "; -print join ( "\n and ", @$edkdirs )."\n"; - -# Import headers -find ( { wanted => sub { - try_import_file ( $gpxedir, $edkdirs, abs2rel ( $_, $gpxedir ) ); -}, no_chdir => 1 }, $gpxedir ); |