diff options
Diffstat (limited to 'qemu/roms/ipxe/src/include/ipxe/efi')
96 files changed, 0 insertions, 39439 deletions
diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Base.h b/qemu/roms/ipxe/src/include/ipxe/efi/Base.h deleted file mode 100644 index 844f428f1..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Base.h +++ /dev/null @@ -1,1022 +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 - 2013, Intel Corporation. All rights reserved.<BR> -Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> -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__ - -FILE_LICENCE ( BSD3 ); - -// -// Include processor specific binding -// -#include <ipxe/efi/ProcessorBind.h> - - -/** - Verifies the storage size of a given data type. - - This macro generates a divide by zero error or a zero size array declaration in - the preprocessor if the size is incorrect. These are declared as "extern" so - the space for these arrays will not be in the modules. - - @param TYPE The date type to determine the size of. - @param Size The expected size for the TYPE. - -**/ -#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))] - -// -// Verify that ProcessorBind.h produced UEFI Data Types that are compliant with -// Section 2.3.1 of the UEFI 2.3 Specification. -// -VERIFY_SIZE_OF (BOOLEAN, 1); -VERIFY_SIZE_OF (INT8, 1); -VERIFY_SIZE_OF (UINT8, 1); -VERIFY_SIZE_OF (INT16, 2); -VERIFY_SIZE_OF (UINT16, 2); -VERIFY_SIZE_OF (INT32, 4); -VERIFY_SIZE_OF (UINT32, 4); -VERIFY_SIZE_OF (INT64, 8); -VERIFY_SIZE_OF (UINT64, 8); -VERIFY_SIZE_OF (CHAR8, 1); -VERIFY_SIZE_OF (CHAR16, 2); - -// -// 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 defined(_MSC_EXTENSIONS) && !defined (MDE_CPU_EBC) - /// - /// Remove global variable from the linked image if there are no references to - /// it after all compiler and linker optimizations have been performed. - /// - /// - #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany) -#else - /// - /// Remove the global variable from the linked image if there are no references - /// to it after all compiler and linker optimizations have been performed. - /// - /// - #define GLOBAL_REMOVE_IF_UNREFERENCED -#endif - -// -// For symbol name in assembly code, an extra "_" is sometimes necessary -// - -/// -/// Private worker functions for ASM_PFX() -/// -#define _CONCATENATE(a, b) __CONCATENATE(a, b) -#define __CONCATENATE(a, b) a ## b - -/// -/// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix -/// on symbols in assembly language. -/// -#define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name) - -#if __APPLE__ - // - // Apple extension that is used by the linker to optimize code size - // with assembly functions. Put at the end of your .S files - // - #define ASM_FUNCTION_REMOVE_IF_UNREFERENCED .subsections_via_symbols -#else - #define ASM_FUNCTION_REMOVE_IF_UNREFERENCED -#endif - -#ifdef __CC_ARM - // - // Older RVCT ARM compilers don't fully support #pragma pack and require __packed - // as a prefix for the structure. - // - #define PACKED __packed -#else - #define PACKED -#endif - -/// -/// 128 bit buffer containing a unique identifier value. -/// Unless otherwise specified, aligned on a 64 bit boundary. -/// -typedef struct { - UINT32 Data1; - UINT16 Data2; - UINT16 Data3; - UINT8 Data4[8]; -} GUID; - -// -// 8-bytes unsigned value that represents a physical system address. -// -typedef UINT64 PHYSICAL_ADDRESS; - -/// -/// LIST_ENTRY structure definition. -/// -typedef struct _LIST_ENTRY LIST_ENTRY; - -/// -/// _LIST_ENTRY structure definition. -/// -struct _LIST_ENTRY { - LIST_ENTRY *ForwardLink; - LIST_ENTRY *BackLink; -}; - -// -// Modifiers to abstract standard types to aid in debug of problems -// - -/// -/// Datum is read-only. -/// -#define CONST const - -/// -/// Datum is scoped to the current file or function. -/// -#define STATIC static - -/// -/// Undeclared type. -/// -#define VOID void - -// -// Modifiers for Data Types used to self document code. -// This concept is borrowed for UEFI specification. -// - -/// -/// Datum is passed to the function. -/// -#define IN - -/// -/// Datum is returned from the function. -/// -#define OUT - -/// -/// Passing the datum to the function is optional, and a NULL -/// is passed if the value is not supplied. -/// -#define OPTIONAL - -// -// UEFI specification claims 1 and 0. We are concerned about the -// complier portability so we did it this way. -// - -/// -/// Boolean true value. UEFI Specification defines this value to be 1, -/// but this form is more portable. -/// -#define TRUE ((BOOLEAN)(1==1)) - -/// -/// Boolean false value. UEFI Specification defines this value to be 0, -/// but this form is more portable. -/// -#define FALSE ((BOOLEAN)(0==1)) - -/// -/// NULL pointer (VOID *) -/// -#define NULL ((VOID *) 0) - -/// -/// Maximum values for common UEFI Data Types -/// -#define MAX_INT8 ((INT8)0x7F) -#define MAX_UINT8 ((UINT8)0xFF) -#define MAX_INT16 ((INT16)0x7FFF) -#define MAX_UINT16 ((UINT16)0xFFFF) -#define MAX_INT32 ((INT32)0x7FFFFFFF) -#define MAX_UINT32 ((UINT32)0xFFFFFFFF) -#define MAX_INT64 ((INT64)0x7FFFFFFFFFFFFFFFULL) -#define MAX_UINT64 ((UINT64)0xFFFFFFFFFFFFFFFFULL) - -#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 0x0000000100000000ULL -#define BIT33 0x0000000200000000ULL -#define BIT34 0x0000000400000000ULL -#define BIT35 0x0000000800000000ULL -#define BIT36 0x0000001000000000ULL -#define BIT37 0x0000002000000000ULL -#define BIT38 0x0000004000000000ULL -#define BIT39 0x0000008000000000ULL -#define BIT40 0x0000010000000000ULL -#define BIT41 0x0000020000000000ULL -#define BIT42 0x0000040000000000ULL -#define BIT43 0x0000080000000000ULL -#define BIT44 0x0000100000000000ULL -#define BIT45 0x0000200000000000ULL -#define BIT46 0x0000400000000000ULL -#define BIT47 0x0000800000000000ULL -#define BIT48 0x0001000000000000ULL -#define BIT49 0x0002000000000000ULL -#define BIT50 0x0004000000000000ULL -#define BIT51 0x0008000000000000ULL -#define BIT52 0x0010000000000000ULL -#define BIT53 0x0020000000000000ULL -#define BIT54 0x0040000000000000ULL -#define BIT55 0x0080000000000000ULL -#define BIT56 0x0100000000000000ULL -#define BIT57 0x0200000000000000ULL -#define BIT58 0x0400000000000000ULL -#define BIT59 0x0800000000000000ULL -#define BIT60 0x1000000000000000ULL -#define BIT61 0x2000000000000000ULL -#define BIT62 0x4000000000000000ULL -#define BIT63 0x8000000000000000ULL - -#define SIZE_1KB 0x00000400 -#define SIZE_2KB 0x00000800 -#define SIZE_4KB 0x00001000 -#define SIZE_8KB 0x00002000 -#define SIZE_16KB 0x00004000 -#define SIZE_32KB 0x00008000 -#define SIZE_64KB 0x00010000 -#define SIZE_128KB 0x00020000 -#define SIZE_256KB 0x00040000 -#define SIZE_512KB 0x00080000 -#define SIZE_1MB 0x00100000 -#define SIZE_2MB 0x00200000 -#define SIZE_4MB 0x00400000 -#define SIZE_8MB 0x00800000 -#define SIZE_16MB 0x01000000 -#define SIZE_32MB 0x02000000 -#define SIZE_64MB 0x04000000 -#define SIZE_128MB 0x08000000 -#define SIZE_256MB 0x10000000 -#define SIZE_512MB 0x20000000 -#define SIZE_1GB 0x40000000 -#define SIZE_2GB 0x80000000 -#define SIZE_4GB 0x0000000100000000ULL -#define SIZE_8GB 0x0000000200000000ULL -#define SIZE_16GB 0x0000000400000000ULL -#define SIZE_32GB 0x0000000800000000ULL -#define SIZE_64GB 0x0000001000000000ULL -#define SIZE_128GB 0x0000002000000000ULL -#define SIZE_256GB 0x0000004000000000ULL -#define SIZE_512GB 0x0000008000000000ULL -#define SIZE_1TB 0x0000010000000000ULL -#define SIZE_2TB 0x0000020000000000ULL -#define SIZE_4TB 0x0000040000000000ULL -#define SIZE_8TB 0x0000080000000000ULL -#define SIZE_16TB 0x0000100000000000ULL -#define SIZE_32TB 0x0000200000000000ULL -#define SIZE_64TB 0x0000400000000000ULL -#define SIZE_128TB 0x0000800000000000ULL -#define SIZE_256TB 0x0001000000000000ULL -#define SIZE_512TB 0x0002000000000000ULL -#define SIZE_1PB 0x0004000000000000ULL -#define SIZE_2PB 0x0008000000000000ULL -#define SIZE_4PB 0x0010000000000000ULL -#define SIZE_8PB 0x0020000000000000ULL -#define SIZE_16PB 0x0040000000000000ULL -#define SIZE_32PB 0x0080000000000000ULL -#define SIZE_64PB 0x0100000000000000ULL -#define SIZE_128PB 0x0200000000000000ULL -#define SIZE_256PB 0x0400000000000000ULL -#define SIZE_512PB 0x0800000000000000ULL -#define SIZE_1EB 0x1000000000000000ULL -#define SIZE_2EB 0x2000000000000000ULL -#define SIZE_4EB 0x4000000000000000ULL -#define SIZE_8EB 0x8000000000000000ULL - -#define BASE_1KB 0x00000400 -#define BASE_2KB 0x00000800 -#define BASE_4KB 0x00001000 -#define BASE_8KB 0x00002000 -#define BASE_16KB 0x00004000 -#define BASE_32KB 0x00008000 -#define BASE_64KB 0x00010000 -#define BASE_128KB 0x00020000 -#define BASE_256KB 0x00040000 -#define BASE_512KB 0x00080000 -#define BASE_1MB 0x00100000 -#define BASE_2MB 0x00200000 -#define BASE_4MB 0x00400000 -#define BASE_8MB 0x00800000 -#define BASE_16MB 0x01000000 -#define BASE_32MB 0x02000000 -#define BASE_64MB 0x04000000 -#define BASE_128MB 0x08000000 -#define BASE_256MB 0x10000000 -#define BASE_512MB 0x20000000 -#define BASE_1GB 0x40000000 -#define BASE_2GB 0x80000000 -#define BASE_4GB 0x0000000100000000ULL -#define BASE_8GB 0x0000000200000000ULL -#define BASE_16GB 0x0000000400000000ULL -#define BASE_32GB 0x0000000800000000ULL -#define BASE_64GB 0x0000001000000000ULL -#define BASE_128GB 0x0000002000000000ULL -#define BASE_256GB 0x0000004000000000ULL -#define BASE_512GB 0x0000008000000000ULL -#define BASE_1TB 0x0000010000000000ULL -#define BASE_2TB 0x0000020000000000ULL -#define BASE_4TB 0x0000040000000000ULL -#define BASE_8TB 0x0000080000000000ULL -#define BASE_16TB 0x0000100000000000ULL -#define BASE_32TB 0x0000200000000000ULL -#define BASE_64TB 0x0000400000000000ULL -#define BASE_128TB 0x0000800000000000ULL -#define BASE_256TB 0x0001000000000000ULL -#define BASE_512TB 0x0002000000000000ULL -#define BASE_1PB 0x0004000000000000ULL -#define BASE_2PB 0x0008000000000000ULL -#define BASE_4PB 0x0010000000000000ULL -#define BASE_8PB 0x0020000000000000ULL -#define BASE_16PB 0x0040000000000000ULL -#define BASE_32PB 0x0080000000000000ULL -#define BASE_64PB 0x0100000000000000ULL -#define BASE_128PB 0x0200000000000000ULL -#define BASE_256PB 0x0400000000000000ULL -#define BASE_512PB 0x0800000000000000ULL -#define BASE_1EB 0x1000000000000000ULL -#define BASE_2EB 0x2000000000000000ULL -#define BASE_4EB 0x4000000000000000ULL -#define BASE_8EB 0x8000000000000000ULL - -// -// Support for variable length argument lists using the ANSI standard. -// -// Since we are using the ANSI standard we used the standard naming and -// did not follow 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 argument from -// the ... list. You must know the size and pass it in this macro. -// VA_COPY (VA_LIST Dest, VA_LIST Start) - Initialize Dest as a copy of Start. -// -// 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 -// } -// - -/** - Return the size of argument that has been aligned to sizeof (UINTN). - - @param n The parameter size to be aligned. - - @return The aligned size. -**/ -#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1)) - -#if defined(__CC_ARM) -// -// RVCT ARM variable argument list support. -// - -/// -/// Variable used to traverse the list of arguments. This type can vary by -/// implementation and could be an array or structure. -/// -#ifdef __APCS_ADSABI - typedef int *va_list[1]; - #define VA_LIST va_list -#else - typedef struct __va_list { void *__ap; } va_list; - #define VA_LIST va_list -#endif - -#define VA_START(Marker, Parameter) __va_start(Marker, Parameter) - -#define VA_ARG(Marker, TYPE) __va_arg(Marker, TYPE) - -#define VA_END(Marker) ((void)0) - -// For some ARM RVCT compilers, __va_copy is not defined -#ifndef __va_copy - #define __va_copy(dest, src) ((void)((dest) = (src))) -#endif - -#define VA_COPY(Dest, Start) __va_copy (Dest, Start) - -#elif defined(__GNUC__) && !defined(NO_BUILTIN_VA_FUNCS) -// -// Use GCC built-in macros for variable argument lists. -// - -/// -/// Variable used to traverse the list of arguments. This type can vary by -/// implementation and could be an array or structure. -/// -typedef __builtin_va_list VA_LIST; - -#define VA_START(Marker, Parameter) __builtin_va_start (Marker, Parameter) - -#define VA_ARG(Marker, TYPE) ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE))) - -#define VA_END(Marker) __builtin_va_end (Marker) - -#define VA_COPY(Dest, Start) __builtin_va_copy (Dest, Start) - -#else -/// -/// Variable used to traverse the list of arguments. This type can vary by -/// implementation and could be an array or structure. -/// -typedef CHAR8 *VA_LIST; - -/** - Retrieves a pointer to the beginning of a variable argument list, based on - the name of the parameter that immediately precedes the variable argument list. - - This function initializes Marker to point to the beginning of the variable - argument list that immediately follows Parameter. The method for computing the - pointer to the next argument in the argument list is CPU-specific following the - EFIAPI ABI. - - @param Marker The VA_LIST used to traverse the list of arguments. - @param Parameter The name of the parameter that immediately precedes - the variable argument list. - - @return A pointer to the beginning of a variable argument list. - -**/ -#define VA_START(Marker, Parameter) (Marker = (VA_LIST) ((UINTN) & (Parameter) + _INT_SIZE_OF (Parameter))) - -/** - Returns an argument of a specified type from a variable argument list and updates - the pointer to the variable argument list to point to the next argument. - - This function returns an argument of the type specified by TYPE from the beginning - of the variable argument list specified by Marker. Marker is then updated to point - to the next argument in the variable argument list. The method for computing the - pointer to the next argument in the argument list is CPU-specific following the EFIAPI ABI. - - @param Marker VA_LIST used to traverse the list of arguments. - @param TYPE The type of argument to retrieve from the beginning - of the variable argument list. - - @return An argument of the type specified by TYPE. - -**/ -#define VA_ARG(Marker, TYPE) (*(TYPE *) ((Marker += _INT_SIZE_OF (TYPE)) - _INT_SIZE_OF (TYPE))) - -/** - Terminates the use of a variable argument list. - - This function initializes Marker so it can no longer be used with VA_ARG(). - After this macro is used, the only way to access the variable argument list is - by using VA_START() again. - - @param Marker VA_LIST used to traverse the list of arguments. - -**/ -#define VA_END(Marker) (Marker = (VA_LIST) 0) - -/** - Initializes a VA_LIST as a copy of an existing VA_LIST. - - This macro initializes Dest as a copy of Start, as if the VA_START macro had been applied to Dest - followed by the same sequence of uses of the VA_ARG macro as had previously been used to reach - the present state of Start. - - @param Dest VA_LIST used to traverse the list of arguments. - @param Start VA_LIST used to traverse the list of arguments. - -**/ -#define VA_COPY(Dest, Start) ((void)((Dest) = (Start))) - -#endif - -/// -/// Pointer to the start of a variable argument list stored in a memory buffer. Same as UINT8 *. -/// -typedef UINTN *BASE_LIST; - -/** - Returns the size of a data type in sizeof(UINTN) units rounded up to the nearest UINTN boundary. - - @param TYPE The date type to determine the size of. - - @return The size of TYPE in sizeof (UINTN) units rounded up to the nearest UINTN boundary. -**/ -#define _BASE_INT_SIZE_OF(TYPE) ((sizeof (TYPE) + sizeof (UINTN) - 1) / sizeof (UINTN)) - -/** - Returns an argument of a specified type from a variable argument list and updates - the pointer to the variable argument list to point to the next argument. - - This function returns an argument of the type specified by TYPE from the beginning - of the variable argument list specified by Marker. Marker is then updated to point - to the next argument in the variable argument list. The method for computing the - pointer to the next argument in the argument list is CPU specific following the EFIAPI ABI. - - @param Marker The pointer to the beginning of a variable argument list. - @param TYPE The type of argument to retrieve from the beginning - of the variable argument list. - - @return An argument of the type specified by TYPE. - -**/ -#define BASE_ARG(Marker, TYPE) (*(TYPE *) ((Marker += _BASE_INT_SIZE_OF (TYPE)) - _BASE_INT_SIZE_OF (TYPE))) - -/** - The macro that returns the byte offset of a field in a data structure. - - This function returns the offset, in bytes, of field specified by Field from the - beginning of the data structure specified by TYPE. If TYPE does not contain Field, - the module will not compile. - - @param TYPE The name of the data structure that contains the field specified by Field. - @param Field The name of the field in the data structure. - - @return Offset, in bytes, of field. - -**/ -#ifdef __GNUC__ -#if __GNUC__ >= 4 -#define OFFSET_OF(TYPE, Field) ((UINTN) __builtin_offsetof(TYPE, Field)) -#endif -#endif - -#ifndef OFFSET_OF -#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field)) -#endif - -/** - Macro that returns a pointer to the data structure that contains a specified field of - that data structure. This is a lightweight method to hide information by placing a - public data structure inside a larger private data structure and using a pointer to - the public data structure to retrieve a pointer to the private data structure. - - This function computes the offset, in bytes, of field specified by Field from the beginning - of the data structure specified by TYPE. This offset is subtracted from Record, and is - used to return a pointer to a data structure of the type specified by TYPE. If the data type - specified by TYPE does not contain the field specified by Field, then the module will not compile. - - @param Record Pointer to the field specified by Field within a data structure of type TYPE. - @param TYPE The name of the data structure type to return. This data structure must - contain the field specified by Field. - @param Field The name of the field in the data structure specified by TYPE to which Record points. - - @return A pointer to the structure from one of it's elements. - -**/ -#define BASE_CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field))) - -/** - Rounds a value up to the next boundary using a specified alignment. - - This function rounds Value up to the next boundary using the specified Alignment. - This aligned value is returned. - - @param Value The value to round up. - @param Alignment The alignment boundary used to return the aligned value. - - @return A value up to the next boundary. - -**/ -#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) & ((Alignment) - 1))) - -/** - Adjust a pointer by adding the minimum offset required for it to be aligned on - a specified alignment boundary. - - This function rounds the pointer specified by Pointer to the next alignment boundary - specified by Alignment. The pointer to the aligned address is returned. - - @param Pointer The pointer to round up. - @param Alignment The alignment boundary to use to return an aligned pointer. - - @return Pointer to the aligned address. - -**/ -#define ALIGN_POINTER(Pointer, Alignment) ((VOID *) (ALIGN_VALUE ((UINTN)(Pointer), (Alignment)))) - -/** - Rounds a value up to the next natural boundary for the current CPU. - This is 4-bytes for 32-bit CPUs and 8-bytes for 64-bit CPUs. - - This function rounds the value specified by Value up to the next natural boundary for the - current CPU. This rounded value is returned. - - @param Value The value to round up. - - @return Rounded value specified by Value. - -**/ -#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. - - @param a The first operand with any numerical type. - @param b The second operand. Can be any numerical type as long as is - the same type as a. - - @return Maximum of two operands. - -**/ -#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. - - @param a The first operand with any numerical type. - @param b The second operand. It should be the same any numerical type with a. - - @return Minimum of two operands. - -**/ -#define MIN(a, b) \ - (((a) < (b)) ? (a) : (b)) - -/** - Return the absolute value of a signed operand. - - This macro returns the absolute value of the signed operand specified by a. - - @param a The signed operand. - - @return The absolute value of the signed operand. - -**/ -#define ABS(a) \ - (((a) < 0) ? (-(a)) : (a)) - -// -// Status codes common to all execution phases -// -typedef UINTN RETURN_STATUS; - -/** - Produces a RETURN_STATUS code with the highest bit set. - - @param StatusCode The status code value to convert into a warning code. - StatusCode must be in the range 0x00000000..0x7FFFFFFF. - - @return The value specified by StatusCode with the highest bit set. - -**/ -#define ENCODE_ERROR(StatusCode) ((RETURN_STATUS)(MAX_BIT | (StatusCode))) - -/** - Produces a RETURN_STATUS code with the highest bit clear. - - @param StatusCode The status code value to convert into a warning code. - StatusCode must be in the range 0x00000000..0x7FFFFFFF. - - @return The value specified by StatusCode with the highest bit clear. - -**/ -#define ENCODE_WARNING(StatusCode) ((RETURN_STATUS)(StatusCode)) - -/** - Returns TRUE if a specified RETURN_STATUS code is an error code. - - This function returns TRUE if StatusCode has the high bit set. Otherwise, FALSE is returned. - - @param StatusCode The status code value to evaluate. - - @retval TRUE The high bit of StatusCode is set. - @retval FALSE The high bit of StatusCode is clear. - -**/ -#define RETURN_ERROR(StatusCode) (((INTN)(RETURN_STATUS)(StatusCode)) < 0) - -/// -/// The operation completed successfully. -/// -#define RETURN_SUCCESS 0 - -/// -/// The image failed to load. -/// -#define RETURN_LOAD_ERROR ENCODE_ERROR (1) - -/// -/// The parameter was incorrect. -/// -#define RETURN_INVALID_PARAMETER ENCODE_ERROR (2) - -/// -/// The operation is not supported. -/// -#define RETURN_UNSUPPORTED ENCODE_ERROR (3) - -/// -/// The buffer was not the proper size for the request. -/// -#define RETURN_BAD_BUFFER_SIZE ENCODE_ERROR (4) - -/// -/// The buffer was not large enough to hold the requested data. -/// The required buffer size is returned in the appropriate -/// parameter when this error occurs. -/// -#define RETURN_BUFFER_TOO_SMALL ENCODE_ERROR (5) - -/// -/// There is no data pending upon return. -/// -#define RETURN_NOT_READY ENCODE_ERROR (6) - -/// -/// The physical device reported an error while attempting the -/// operation. -/// -#define RETURN_DEVICE_ERROR ENCODE_ERROR (7) - -/// -/// The device can not be written to. -/// -#define RETURN_WRITE_PROTECTED ENCODE_ERROR (8) - -/// -/// The resource has run out. -/// -#define RETURN_OUT_OF_RESOURCES ENCODE_ERROR (9) - -/// -/// An inconsistency was detected on the file system causing the -/// operation to fail. -/// -#define RETURN_VOLUME_CORRUPTED ENCODE_ERROR (10) - -/// -/// There is no more space on the file system. -/// -#define RETURN_VOLUME_FULL ENCODE_ERROR (11) - -/// -/// The device does not contain any medium to perform the -/// operation. -/// -#define RETURN_NO_MEDIA ENCODE_ERROR (12) - -/// -/// The medium in the device has changed since the last -/// access. -/// -#define RETURN_MEDIA_CHANGED ENCODE_ERROR (13) - -/// -/// The item was not found. -/// -#define RETURN_NOT_FOUND ENCODE_ERROR (14) - -/// -/// Access was denied. -/// -#define RETURN_ACCESS_DENIED ENCODE_ERROR (15) - -/// -/// The server was not found or did not respond to the request. -/// -#define RETURN_NO_RESPONSE ENCODE_ERROR (16) - -/// -/// A mapping to the device does not exist. -/// -#define RETURN_NO_MAPPING ENCODE_ERROR (17) - -/// -/// A timeout time expired. -/// -#define RETURN_TIMEOUT ENCODE_ERROR (18) - -/// -/// The protocol has not been started. -/// -#define RETURN_NOT_STARTED ENCODE_ERROR (19) - -/// -/// The protocol has already been started. -/// -#define RETURN_ALREADY_STARTED ENCODE_ERROR (20) - -/// -/// The operation was aborted. -/// -#define RETURN_ABORTED ENCODE_ERROR (21) - -/// -/// An ICMP error occurred during the network operation. -/// -#define RETURN_ICMP_ERROR ENCODE_ERROR (22) - -/// -/// A TFTP error occurred during the network operation. -/// -#define RETURN_TFTP_ERROR ENCODE_ERROR (23) - -/// -/// A protocol error occurred during the network operation. -/// -#define RETURN_PROTOCOL_ERROR ENCODE_ERROR (24) - -/// -/// A function encountered an internal version that was -/// incompatible with a version requested by the caller. -/// -#define RETURN_INCOMPATIBLE_VERSION ENCODE_ERROR (25) - -/// -/// The function was not performed due to a security violation. -/// -#define RETURN_SECURITY_VIOLATION ENCODE_ERROR (26) - -/// -/// A CRC error was detected. -/// -#define RETURN_CRC_ERROR ENCODE_ERROR (27) - -/// -/// The beginning or end of media was reached. -/// -#define RETURN_END_OF_MEDIA ENCODE_ERROR (28) - -/// -/// The end of the file was reached. -/// -#define RETURN_END_OF_FILE ENCODE_ERROR (31) - -/// -/// The language specified was invalid. -/// -#define RETURN_INVALID_LANGUAGE ENCODE_ERROR (32) - -/// -/// The security status of the data is unknown or compromised -/// and the data must be updated or replaced to restore a valid -/// security status. -/// -#define RETURN_COMPROMISED_DATA ENCODE_ERROR (33) - -/// -/// The string contained one or more characters that -/// the device could not render and were skipped. -/// -#define RETURN_WARN_UNKNOWN_GLYPH ENCODE_WARNING (1) - -/// -/// The handle was closed, but the file was not deleted. -/// -#define RETURN_WARN_DELETE_FAILURE ENCODE_WARNING (2) - -/// -/// The handle was closed, but the data to the file was not -/// flushed properly. -/// -#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3) - -/// -/// The resulting buffer was too small, and the data was -/// truncated to the buffer size. -/// -#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4) - -/// -/// The data has not been updated within the timeframe set by -/// local policy for this type of data. -/// -#define RETURN_WARN_STALE_DATA ENCODE_WARNING (5) - -/** - Returns a 16-bit signature built from 2 ASCII characters. - - This macro returns a 16-bit value built from the two ASCII characters specified - by A and B. - - @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. - - This macro returns a 32-bit value built from the four ASCII characters specified - by A, B, C, and D. - - @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. - - This macro returns a 64-bit value built from the eight ASCII characters specified - by A, B, C, D, E, F, G,and H. - - @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/qemu/roms/ipxe/src/include/ipxe/efi/Guid/FileInfo.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/FileInfo.h deleted file mode 100644 index 21fd38904..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/FileInfo.h +++ /dev/null @@ -1,73 +0,0 @@ -/** @file - Provides a GUID and a data structure that can be used with EFI_FILE_PROTOCOL.SetInfo() - and EFI_FILE_PROTOCOL.GetInfo() to set or get generic file information. - This GUID is defined in UEFI specification. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 __FILE_INFO_H__ -#define __FILE_INFO_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_FILE_INFO_ID \ - { \ - 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -typedef struct { - /// - /// The size of the EFI_FILE_INFO structure, including the Null-terminated FileName string. - /// - UINT64 Size; - /// - /// The size of the file in bytes. - /// - UINT64 FileSize; - /// - /// PhysicalSize The amount of physical space the file consumes on the file system volume. - /// - UINT64 PhysicalSize; - /// - /// The time the file was created. - /// - EFI_TIME CreateTime; - /// - /// The time when the file was last accessed. - /// - EFI_TIME LastAccessTime; - /// - /// The time when the file's contents were last modified. - /// - EFI_TIME ModificationTime; - /// - /// The attribute bits for the file. - /// - UINT64 Attribute; - /// - /// The Null-terminated name of the file. - /// - CHAR16 FileName[1]; -} EFI_FILE_INFO; - -/// -/// The FileName field of the EFI_FILE_INFO data structure is variable length. -/// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to -/// be the size of the data structure without the FileName field. The following macro -/// computes this size correctly no matter how big the FileName array is declared. -/// This is required to make the EFI_FILE_INFO data structure ANSI compilant. -/// -#define SIZE_OF_EFI_FILE_INFO OFFSET_OF (EFI_FILE_INFO, FileName) - -extern EFI_GUID gEfiFileInfoGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/FileSystemInfo.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/FileSystemInfo.h deleted file mode 100644 index 504b7938f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/FileSystemInfo.h +++ /dev/null @@ -1,65 +0,0 @@ -/** @file - Provides a GUID and a data structure that can be used with EFI_FILE_PROTOCOL.GetInfo() - or EFI_FILE_PROTOCOL.SetInfo() to get or set information about the system's volume. - This GUID is defined in UEFI specification. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 __FILE_SYSTEM_INFO_H__ -#define __FILE_SYSTEM_INFO_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_FILE_SYSTEM_INFO_ID \ - { \ - 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -typedef struct { - /// - /// The size of the EFI_FILE_SYSTEM_INFO structure, including the Null-terminated VolumeLabel string. - /// - UINT64 Size; - /// - /// TRUE if the volume only supports read access. - /// - BOOLEAN ReadOnly; - /// - /// The number of bytes managed by the file system. - /// - UINT64 VolumeSize; - /// - /// The number of available bytes for use by the file system. - /// - UINT64 FreeSpace; - /// - /// The nominal block size by which files are typically grown. - /// - UINT32 BlockSize; - /// - /// The Null-terminated string that is the volume's label. - /// - CHAR16 VolumeLabel[1]; -} EFI_FILE_SYSTEM_INFO; - -/// -/// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length. -/// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs -/// to be the size of the data structure without the VolumeLable field. The following macro -/// computes this size correctly no matter how big the VolumeLable array is declared. -/// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant. -/// -#define SIZE_OF_EFI_FILE_SYSTEM_INFO OFFSET_OF (EFI_FILE_SYSTEM_INFO, VolumeLabel) - -extern EFI_GUID gEfiFileSystemInfoGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/HiiFormMapMethodGuid.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/HiiFormMapMethodGuid.h deleted file mode 100644 index c8f37213f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/HiiFormMapMethodGuid.h +++ /dev/null @@ -1,27 +0,0 @@ -/** @file - Guid used to identify HII FormMap configuration method. - - Copyright (c) 2009, Intel Corporation. All rights reserved.<BR> - 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: - GUID defined in UEFI 2.2 spec. -**/ - -#ifndef __EFI_HII_FORMMAP_GUID_H__ -#define __EFI_HII_FORMMAP_GUID_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_HII_STANDARD_FORM_GUID \ - { 0x3bd2f4ec, 0xe524, 0x46e4, { 0xa9, 0xd8, 0x51, 0x1, 0x17, 0x42, 0x55, 0x62 } } - -extern EFI_GUID gEfiHiiStandardFormGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/HiiPlatformSetupFormset.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/HiiPlatformSetupFormset.h deleted file mode 100644 index fa8173630..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/HiiPlatformSetupFormset.h +++ /dev/null @@ -1,37 +0,0 @@ -/** @file - GUID indicates that the form set contains forms designed to be used - for platform configuration and this form set will be displayed. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - GUID defined in UEFI 2.1. - -**/ - -#ifndef __HII_PLATFORM_SETUP_FORMSET_GUID_H__ -#define __HII_PLATFORM_SETUP_FORMSET_GUID_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \ - { 0x93039971, 0x8545, 0x4b04, { 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe } } - -#define EFI_HII_DRIVER_HEALTH_FORMSET_GUID \ - { 0xf22fc20c, 0x8cf4, 0x45eb, { 0x8e, 0x6, 0xad, 0x4e, 0x50, 0xb9, 0x5d, 0xd3 } } - -#define EFI_HII_USER_CREDENTIAL_FORMSET_GUID \ - { 0x337f4407, 0x5aee, 0x4b83, { 0xb2, 0xa7, 0x4e, 0xad, 0xca, 0x30, 0x88, 0xcd } } - -extern EFI_GUID gEfiHiiPlatformSetupFormsetGuid; -extern EFI_GUID gEfiHiiDriverHealthFormsetGuid; -extern EFI_GUID gEfiHiiUserCredentialFormsetGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/MdeModuleHii.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/MdeModuleHii.h deleted file mode 100644 index 76890b755..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/MdeModuleHii.h +++ /dev/null @@ -1,222 +0,0 @@ -/** @file - EDKII extented HII IFR guid opcodes. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 __MDEMODULE_HII_H__ -#define __MDEMODULE_HII_H__ - -FILE_LICENCE ( BSD3 ); - -#define NARROW_CHAR 0xFFF0 -#define WIDE_CHAR 0xFFF1 -#define NON_BREAKING_CHAR 0xFFF2 - -/// -/// State defined for password statemachine . -/// -#define BROWSER_STATE_VALIDATE_PASSWORD 0 -#define BROWSER_STATE_SET_PASSWORD 1 - -/// -/// GUIDed opcodes defined for EDKII implementation. -/// -#define EFI_IFR_TIANO_GUID \ - { 0xf0b1735, 0x87a0, 0x4193, {0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce} } - -#pragma pack(1) - -/// -/// EDKII implementation extension opcodes, new extension can be added here later. -/// -#define EFI_IFR_EXTEND_OP_LABEL 0x0 -#define EFI_IFR_EXTEND_OP_BANNER 0x1 -#define EFI_IFR_EXTEND_OP_TIMEOUT 0x2 -#define EFI_IFR_EXTEND_OP_CLASS 0x3 -#define EFI_IFR_EXTEND_OP_SUBCLASS 0x4 - -/// -/// Label opcode. -/// -typedef struct _EFI_IFR_GUID_LABEL { - EFI_IFR_OP_HEADER Header; - /// - /// EFI_IFR_TIANO_GUID. - /// - EFI_GUID Guid; - /// - /// EFI_IFR_EXTEND_OP_LABEL. - /// - UINT8 ExtendOpCode; - /// - /// Label Number. - /// - UINT16 Number; -} EFI_IFR_GUID_LABEL; - -#define EFI_IFR_BANNER_ALIGN_LEFT 0 -#define EFI_IFR_BANNER_ALIGN_CENTER 1 -#define EFI_IFR_BANNER_ALIGN_RIGHT 2 - -/// -/// Banner opcode. -/// -typedef struct _EFI_IFR_GUID_BANNER { - EFI_IFR_OP_HEADER Header; - /// - /// EFI_IFR_TIANO_GUID. - /// - EFI_GUID Guid; - /// - /// EFI_IFR_EXTEND_OP_BANNER - /// - UINT8 ExtendOpCode; - EFI_STRING_ID Title; ///< The string token for the banner title. - UINT16 LineNumber; ///< 1-based line number. - UINT8 Alignment; ///< left, center, or right-aligned. -} EFI_IFR_GUID_BANNER; - -/// -/// Timeout opcode. -/// -typedef struct _EFI_IFR_GUID_TIMEOUT { - EFI_IFR_OP_HEADER Header; - /// - /// EFI_IFR_TIANO_GUID. - /// - EFI_GUID Guid; - /// - /// EFI_IFR_EXTEND_OP_TIMEOUT. - /// - UINT8 ExtendOpCode; - UINT16 TimeOut; ///< TimeOut Value. -} EFI_IFR_GUID_TIMEOUT; - -#define EFI_NON_DEVICE_CLASS 0x00 -#define EFI_DISK_DEVICE_CLASS 0x01 -#define EFI_VIDEO_DEVICE_CLASS 0x02 -#define EFI_NETWORK_DEVICE_CLASS 0x04 -#define EFI_INPUT_DEVICE_CLASS 0x08 -#define EFI_ON_BOARD_DEVICE_CLASS 0x10 -#define EFI_OTHER_DEVICE_CLASS 0x20 - -/// -/// Device Class opcode. -/// -typedef struct _EFI_IFR_GUID_CLASS { - EFI_IFR_OP_HEADER Header; - /// - /// EFI_IFR_TIANO_GUID. - /// - EFI_GUID Guid; - /// - /// EFI_IFR_EXTEND_OP_CLASS. - /// - UINT8 ExtendOpCode; - UINT16 Class; ///< Device Class from the above. -} EFI_IFR_GUID_CLASS; - -#define EFI_SETUP_APPLICATION_SUBCLASS 0x00 -#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01 -#define EFI_FRONT_PAGE_SUBCLASS 0x02 -#define EFI_SINGLE_USE_SUBCLASS 0x03 - -/// -/// SubClass opcode -/// -typedef struct _EFI_IFR_GUID_SUBCLASS { - EFI_IFR_OP_HEADER Header; - /// - /// EFI_IFR_TIANO_GUID. - /// - EFI_GUID Guid; - /// - /// EFI_IFR_EXTEND_OP_SUBCLASS. - /// - UINT8 ExtendOpCode; - UINT16 SubClass; ///< Sub Class type from the above. -} EFI_IFR_GUID_SUBCLASS; - -/// -/// GUIDed opcodes support for framework vfr. -/// -#define EFI_IFR_FRAMEWORK_GUID \ - { 0x31ca5d1a, 0xd511, 0x4931, { 0xb7, 0x82, 0xae, 0x6b, 0x2b, 0x17, 0x8c, 0xd7 } } - -/// -/// Two extended opcodes are added, and new extensions can be added here later. -/// One is for framework OneOf question Option Key value; -/// another is for framework vareqval. -/// -#define EFI_IFR_EXTEND_OP_OPTIONKEY 0x0 -#define EFI_IFR_EXTEND_OP_VAREQNAME 0x1 - -/// -/// Store the framework vfr option key value. -/// -typedef struct _EFI_IFR_GUID_OPTIONKEY { - EFI_IFR_OP_HEADER Header; - /// - /// EFI_IFR_FRAMEWORK_GUID. - /// - EFI_GUID Guid; - /// - /// EFI_IFR_EXTEND_OP_OPTIONKEY. - /// - UINT8 ExtendOpCode; - /// - /// OneOf Questiond ID binded by OneOf Option. - /// - EFI_QUESTION_ID QuestionId; - /// - /// The OneOf Option Value. - /// - EFI_IFR_TYPE_VALUE OptionValue; - /// - /// The Framework OneOf Option Key Value. - /// - UINT16 KeyValue; -} EFI_IFR_GUID_OPTIONKEY; - -/// -/// Store the framework vfr vareqval name number. -/// -typedef struct _EFI_IFR_GUID_VAREQNAME { - EFI_IFR_OP_HEADER Header; - /// - /// EFI_IFR_FRAMEWORK_GUID. - /// - EFI_GUID Guid; - /// - /// EFI_IFR_EXTEND_OP_VAREQNAME. - /// - UINT8 ExtendOpCode; - /// - /// Question ID of the Numeric Opcode created. - /// - EFI_QUESTION_ID QuestionId; - /// - /// For vareqval (0x100), NameId is 0x100. - /// This value will convert to a Unicode String following this rule; - /// sprintf(StringBuffer, "%d", NameId) . - /// The the Unicode String will be used as a EFI Variable Name. - /// - UINT16 NameId; -} EFI_IFR_GUID_VAREQNAME; - -#pragma pack() - -extern EFI_GUID gEfiIfrTianoGuid; -extern EFI_GUID gEfiIfrFrameworkGuid; - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/PcAnsi.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/PcAnsi.h deleted file mode 100644 index 8b3e63f35..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/PcAnsi.h +++ /dev/null @@ -1,60 +0,0 @@ -/** @file - Terminal Device Path Vendor Guid. - - Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -#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 DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL \ - { \ - 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/qemu/roms/ipxe/src/include/ipxe/efi/Guid/SmBios.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/SmBios.h deleted file mode 100644 index cc4a1f946..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/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 - 2009, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -#define SMBIOS_TABLE_GUID \ - { \ - 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ - } - -extern EFI_GUID gEfiSmbiosTableGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/WinCertificate.h b/qemu/roms/ipxe/src/include/ipxe/efi/Guid/WinCertificate.h deleted file mode 100644 index cf0a7c25e..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Guid/WinCertificate.h +++ /dev/null @@ -1,130 +0,0 @@ -/** @file - GUID for UEFI WIN_CERTIFICATE structure. - - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> - 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: - GUID defined in UEFI 2.0 spec. -**/ - -#ifndef __EFI_WIN_CERTIFICATE_H__ -#define __EFI_WIN_CERTIFICATE_H__ - -FILE_LICENCE ( BSD3 ); - -// -// _WIN_CERTIFICATE.wCertificateType -// -#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002 -#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 { - /// - /// 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_GUID HashType; - UINT8 PublicKey[256]; - UINT8 Signature[256]; -} EFI_CERT_BLOCK_RSA_2048_SHA256; - - -/// -/// Certificate which encapsulates a GUID-specific digital signature -/// -typedef struct { - /// - /// This is the standard WIN_CERTIFICATE header, where - /// wCertificateType is set to WIN_CERT_TYPE_EFI_GUID. - /// - WIN_CERTIFICATE Hdr; - /// - /// This is the unique id which determines the - /// format of the CertData. . - /// - EFI_GUID CertType; - /// - /// The following is the certificate data. The format of - /// the data is determined by the CertType. - /// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID, - /// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure. - /// - UINT8 CertData[1]; -} 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 { - /// - /// 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[]; - /// -} WIN_CERTIFICATE_EFI_PKCS1_15; - -extern EFI_GUID gEfiCertTypeRsa2048Sha256Guid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Ia32/ProcessorBind.h b/qemu/roms/ipxe/src/include/ipxe/efi/Ia32/ProcessorBind.h deleted file mode 100644 index 16e30b358..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Ia32/ProcessorBind.h +++ /dev/null @@ -1,294 +0,0 @@ -/** @file - Processor or Compiler specific defines and types for IA-32 architecture. - -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -/// -/// Define the processor type so other code can make processor based choices. -/// -#define MDE_CPU_IA32 - -// -// Make sure we are using the correct packing rules per EFI specification -// -#if !defined(__GNUC__) -#pragma pack() -#endif - -#if defined(__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 ) - -// -// Disable ICC's remark #593: "Variable" was set but never used. -// This is legal ANSI C code so we disable the remark that is turned on with /W4 -// -#pragma warning ( disable : 593 ) - -#endif - - -#if defined(_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) source file. For precompiled header only. -// -#pragma warning ( disable : 4206 ) - -#endif - - -#if defined(_MSC_EXTENSIONS) - - // - // use Microsoft C complier dependent integer width types - // - - /// - /// 8-byte unsigned value. - /// - typedef unsigned __int64 UINT64; - /// - /// 8-byte signed value. - /// - typedef __int64 INT64; - /// - /// 4-byte unsigned value. - /// - typedef unsigned __int32 UINT32; - /// - /// 4-byte signed value. - /// - typedef __int32 INT32; - /// - /// 2-byte unsigned value. - /// - typedef unsigned short UINT16; - /// - /// 2-byte Character. Unless otherwise specified all strings are stored in the - /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards. - /// - typedef unsigned short CHAR16; - /// - /// 2-byte signed value. - /// - typedef short INT16; - /// - /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other - /// values are undefined. - /// - typedef unsigned char BOOLEAN; - /// - /// 1-byte unsigned value. - /// - typedef unsigned char UINT8; - /// - /// 1-byte Character. - /// - typedef char CHAR8; - /// - /// 1-byte signed value. - /// - typedef signed char INT8; -#else - /// - /// 8-byte unsigned value. - /// - typedef unsigned long long UINT64; - /// - /// 8-byte signed value. - /// - typedef long long INT64; - /// - /// 4-byte unsigned value. - /// - typedef unsigned int UINT32; - /// - /// 4-byte signed value. - /// - typedef int INT32; - /// - /// 2-byte unsigned value. - /// - typedef unsigned short UINT16; - /// - /// 2-byte Character. Unless otherwise specified all strings are stored in the - /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards. - /// - typedef unsigned short CHAR16; - /// - /// 2-byte signed value. - /// - typedef short INT16; - /// - /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other - /// values are undefined. - /// - typedef unsigned char BOOLEAN; - /// - /// 1-byte unsigned value. - /// - typedef unsigned char UINT8; - /// - /// 1-byte Character - /// - typedef char CHAR8; - /// - /// 1-byte signed value - /// - typedef signed char INT8; -#endif - -/// -/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions; -/// 8 bytes on supported 64-bit processor instructions.) -/// -typedef UINT32 UINTN; -/// -/// Signed value of native width. (4 bytes on supported 32-bit processor instructions; -/// 8 bytes on supported 64-bit processor instructions.) -/// -typedef INT32 INTN; - -// -// Processor specific defines -// - -/// -/// A value of native width with the highest bit set. -/// -#define MAX_BIT 0x80000000 -/// -/// A value of native width with the two highest bits set. -/// -#define MAX_2_BITS 0xC0000000 - -/// -/// Maximum legal IA-32 address. -/// -#define MAX_ADDRESS 0xFFFFFFFF - -/// -/// Maximum legal IA-32 INTN and UINTN values. -/// -#define MAX_INTN ((INTN)0x7FFFFFFF) -#define MAX_UINTN ((UINTN)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 their member functions with EFIAPI. -// -#ifdef EFIAPI - /// - /// If EFIAPI is already defined, then we use that definition. - /// -#elif defined(_MSC_EXTENSIONS) - /// - /// Microsoft* compiler specific method for EFIAPI calling convention. - /// - #define EFIAPI __cdecl -#elif defined(__GNUC__) - /// - /// GCC specific method for EFIAPI calling convention. - /// - #define EFIAPI __attribute__((cdecl)) -#else - /// - /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI - /// is the standard. - /// - #define EFIAPI -#endif - -#if defined(__GNUC__) - /// - /// For GNU assembly code, .global or .globl can declare global symbols. - /// Define this macro to unify the usage. - /// - #define ASM_GLOBAL .globl -#endif - -/** - Return the pointer to the first instruction of a function given a function pointer. - On IA-32 CPU architectures, these two pointer values are the same, - so the implementation of this macro is very simple. - - @param FunctionPointer A pointer to a function. - - @return The pointer to the first instruction of a function given a function pointer. - -**/ -#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer) - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Acpi10.h b/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Acpi10.h deleted file mode 100644 index 78570479b..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Acpi10.h +++ /dev/null @@ -1,663 +0,0 @@ -/** @file - ACPI 1.0b definitions from the ACPI Specification, revision 1.0b - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 _ACPI_1_0_H_ -#define _ACPI_1_0_H_ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/IndustryStandard/AcpiAml.h> - -/// -/// Common table header, this prefaces all ACPI tables, including FACS, but -/// excluding the RSD PTR structure. -/// -typedef struct { - UINT32 Signature; - UINT32 Length; -} EFI_ACPI_COMMON_HEADER; - -#pragma pack(1) -/// -/// The common ACPI description table header. This structure prefaces most ACPI tables. -/// -typedef struct { - UINT32 Signature; - UINT32 Length; - UINT8 Revision; - UINT8 Checksum; - UINT8 OemId[6]; - UINT64 OemTableId; - UINT32 OemRevision; - UINT32 CreatorId; - UINT32 CreatorRevision; -} EFI_ACPI_DESCRIPTION_HEADER; -#pragma pack() - -// -// Define for Desriptor -// -#define ACPI_SMALL_ITEM_FLAG 0x00 -#define ACPI_LARGE_ITEM_FLAG 0x01 - -// -// Small Item Descriptor Name -// -#define ACPI_SMALL_IRQ_DESCRIPTOR_NAME 0x04 -#define ACPI_SMALL_DMA_DESCRIPTOR_NAME 0x05 -#define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME 0x06 -#define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME 0x07 -#define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME 0x08 -#define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME 0x09 -#define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME 0x0E -#define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME 0x0F - -// -// Large Item Descriptor Name -// -#define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x01 -#define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME 0x04 -#define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x05 -#define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06 -#define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x07 -#define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x08 -#define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME 0x09 -#define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0A - -// -// Small Item Descriptor Value -// -#define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22 -#define ACPI_IRQ_DESCRIPTOR 0x23 -#define ACPI_DMA_DESCRIPTOR 0x2A -#define ACPI_START_DEPENDENT_DESCRIPTOR 0x30 -#define ACPI_START_DEPENDENT_EX_DESCRIPTOR 0x31 -#define ACPI_END_DEPENDENT_DESCRIPTOR 0x38 -#define ACPI_IO_PORT_DESCRIPTOR 0x47 -#define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B -#define ACPI_END_TAG_DESCRIPTOR 0x79 - -// -// Large Item Descriptor Value -// -#define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR 0x81 -#define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85 -#define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86 -#define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR 0x87 -#define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR 0x88 -#define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR 0x89 -#define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR 0x8A -#define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A - -// -// Resource Type -// -#define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00 -#define ACPI_ADDRESS_SPACE_TYPE_IO 0x01 -#define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02 - -/// -/// Power Management Timer frequency is fixed at 3.579545MHz. -/// -#define ACPI_TIMER_FREQUENCY 3579545 - -// -// Ensure proper structure formats -// -#pragma pack(1) - -/// -/// The commond definition of QWORD, DWORD, and WORD -/// Address Space Descriptors. -/// -typedef PACKED struct { - UINT8 Desc; - UINT16 Len; - UINT8 ResType; - UINT8 GenFlag; - UINT8 SpecificFlag; - UINT64 AddrSpaceGranularity; - UINT64 AddrRangeMin; - UINT64 AddrRangeMax; - UINT64 AddrTranslationOffset; - UINT64 AddrLen; -} EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR; - -typedef PACKED union { - UINT8 Byte; - PACKED struct { - UINT8 Length : 3; - UINT8 Name : 4; - UINT8 Type : 1; - } Bits; -} ACPI_SMALL_RESOURCE_HEADER; - -typedef PACKED struct { - PACKED union { - UINT8 Byte; - PACKED struct { - UINT8 Name : 7; - UINT8 Type : 1; - }Bits; - } Header; - UINT16 Length; -} ACPI_LARGE_RESOURCE_HEADER; - -/// -/// IRQ Descriptor. -/// -typedef PACKED struct { - ACPI_SMALL_RESOURCE_HEADER Header; - UINT16 Mask; -} EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR; - -/// -/// IRQ Descriptor. -/// -typedef PACKED struct { - ACPI_SMALL_RESOURCE_HEADER Header; - UINT16 Mask; - UINT8 Information; -} EFI_ACPI_IRQ_DESCRIPTOR; - -/// -/// DMA Descriptor. -/// -typedef PACKED struct { - ACPI_SMALL_RESOURCE_HEADER Header; - UINT8 ChannelMask; - UINT8 Information; -} EFI_ACPI_DMA_DESCRIPTOR; - -/// -/// I/O Port Descriptor -/// -typedef PACKED struct { - ACPI_SMALL_RESOURCE_HEADER Header; - UINT8 Information; - UINT16 BaseAddressMin; - UINT16 BaseAddressMax; - UINT8 Alignment; - UINT8 Length; -} EFI_ACPI_IO_PORT_DESCRIPTOR; - -/// -/// Fixed Location I/O Port Descriptor. -/// -typedef PACKED struct { - ACPI_SMALL_RESOURCE_HEADER Header; - UINT16 BaseAddress; - UINT8 Length; -} EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR; - -/// -/// 24-Bit Memory Range Descriptor -/// -typedef PACKED struct { - ACPI_LARGE_RESOURCE_HEADER Header; - UINT8 Information; - UINT16 BaseAddressMin; - UINT16 BaseAddressMax; - UINT16 Alignment; - UINT16 Length; -} EFI_ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR; - -/// -/// 32-Bit Memory Range Descriptor -/// -typedef PACKED struct { - ACPI_LARGE_RESOURCE_HEADER Header; - UINT8 Information; - UINT32 BaseAddressMin; - UINT32 BaseAddressMax; - UINT32 Alignment; - UINT32 Length; -} EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR; - -/// -/// Fixed 32-Bit Fixed Memory Range Descriptor -/// -typedef PACKED struct { - ACPI_LARGE_RESOURCE_HEADER Header; - UINT8 Information; - UINT32 BaseAddress; - UINT32 Length; -} EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR; - -/// -/// QWORD Address Space Descriptor -/// -typedef PACKED struct { - ACPI_LARGE_RESOURCE_HEADER Header; - UINT8 ResType; - UINT8 GenFlag; - UINT8 SpecificFlag; - UINT64 AddrSpaceGranularity; - UINT64 AddrRangeMin; - UINT64 AddrRangeMax; - UINT64 AddrTranslationOffset; - UINT64 AddrLen; -} EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR; - -/// -/// DWORD Address Space Descriptor -/// -typedef PACKED struct { - ACPI_LARGE_RESOURCE_HEADER Header; - UINT8 ResType; - UINT8 GenFlag; - UINT8 SpecificFlag; - UINT32 AddrSpaceGranularity; - UINT32 AddrRangeMin; - UINT32 AddrRangeMax; - UINT32 AddrTranslationOffset; - UINT32 AddrLen; -} EFI_ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR; - -/// -/// WORD Address Space Descriptor -/// -typedef PACKED struct { - ACPI_LARGE_RESOURCE_HEADER Header; - UINT8 ResType; - UINT8 GenFlag; - UINT8 SpecificFlag; - UINT16 AddrSpaceGranularity; - UINT16 AddrRangeMin; - UINT16 AddrRangeMax; - UINT16 AddrTranslationOffset; - UINT16 AddrLen; -} EFI_ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR; - -/// -/// Extended Interrupt Descriptor -/// -typedef PACKED struct { - ACPI_LARGE_RESOURCE_HEADER Header; - UINT8 InterruptVectorFlags; - UINT8 InterruptTableLength; - UINT32 InterruptNumber[1]; -} EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR; - -#pragma pack() - -/// -/// The End tag identifies an end of resource data. -/// -typedef struct { - UINT8 Desc; - UINT8 Checksum; -} EFI_ACPI_END_TAG_DESCRIPTOR; - -// -// General use definitions -// -#define EFI_ACPI_RESERVED_BYTE 0x00 -#define EFI_ACPI_RESERVED_WORD 0x0000 -#define EFI_ACPI_RESERVED_DWORD 0x00000000 -#define EFI_ACPI_RESERVED_QWORD 0x0000000000000000 - -// -// Resource Type Specific Flags -// Ref ACPI specification 6.4.3.5.5 -// -// Bit [0] : Write Status, _RW -// -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0) -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0) -// -// Bit [2:1] : Memory Attributes, _MEM -// -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1) -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1) -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1) -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1) -// -// Bit [4:3] : Memory Attributes, _MTP -// -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3) -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3) -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3) -#define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3) -// -// Bit [5] : Memory to I/O Translation, _TTP -// -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5) -#define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5) - -// -// IRQ Information -// Ref ACPI specification 6.4.2.1 -// -#define EFI_ACPI_IRQ_SHARABLE_MASK 0x10 -#define EFI_ACPI_IRQ_SHARABLE 0x10 - -#define EFI_ACPI_IRQ_POLARITY_MASK 0x08 -#define EFI_ACPI_IRQ_HIGH_TRUE 0x00 -#define EFI_ACPI_IRQ_LOW_FALSE 0x08 - -#define EFI_ACPI_IRQ_MODE 0x01 -#define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00 -#define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01 - -// -// DMA Information -// Ref ACPI specification 6.4.2.2 -// -#define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60 -#define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00 -#define EFI_ACPI_DMA_SPEED_TYPE_A 0x20 -#define EFI_ACPI_DMA_SPEED_TYPE_B 0x40 -#define EFI_ACPI_DMA_SPEED_TYPE_F 0x60 - -#define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04 -#define EFI_ACPI_DMA_BUS_MASTER 0x04 - -#define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03 -#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00 -#define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01 -#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10 - -// -// IO Information -// Ref ACPI specification 6.4.2.5 -// -#define EFI_ACPI_IO_DECODE_MASK 0x01 -#define EFI_ACPI_IO_DECODE_16_BIT 0x01 -#define EFI_ACPI_IO_DECODE_10_BIT 0x00 - -// -// Memory Information -// Ref ACPI specification 6.4.3.4 -// -#define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01 -#define EFI_ACPI_MEMORY_WRITABLE 0x01 -#define EFI_ACPI_MEMORY_NON_WRITABLE 0x00 - -// -// Ensure proper structure formats -// -#pragma pack(1) -// -// ACPI 1.0b table structures -// - -/// -/// Root System Description Pointer Structure. -/// -typedef struct { - UINT64 Signature; - UINT8 Checksum; - UINT8 OemId[6]; - UINT8 Reserved; - UINT32 RsdtAddress; -} EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER; - -// -// Root System Description Table -// No definition needed as it is a common description table header, the same with -// EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers. -// - -/// -/// RSDT Revision (as defined in ACPI 1.0b specification). -/// -#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01 - -/// -/// Fixed ACPI Description Table Structure (FADT). -/// -typedef struct { - EFI_ACPI_DESCRIPTION_HEADER Header; - UINT32 FirmwareCtrl; - UINT32 Dsdt; - UINT8 IntModel; - UINT8 Reserved1; - UINT16 SciInt; - UINT32 SmiCmd; - UINT8 AcpiEnable; - UINT8 AcpiDisable; - UINT8 S4BiosReq; - UINT8 Reserved2; - UINT32 Pm1aEvtBlk; - UINT32 Pm1bEvtBlk; - UINT32 Pm1aCntBlk; - UINT32 Pm1bCntBlk; - UINT32 Pm2CntBlk; - UINT32 PmTmrBlk; - UINT32 Gpe0Blk; - UINT32 Gpe1Blk; - UINT8 Pm1EvtLen; - UINT8 Pm1CntLen; - UINT8 Pm2CntLen; - UINT8 PmTmLen; - UINT8 Gpe0BlkLen; - UINT8 Gpe1BlkLen; - UINT8 Gpe1Base; - UINT8 Reserved3; - UINT16 PLvl2Lat; - UINT16 PLvl3Lat; - UINT16 FlushSize; - UINT16 FlushStride; - UINT8 DutyOffset; - UINT8 DutyWidth; - UINT8 DayAlrm; - UINT8 MonAlrm; - UINT8 Century; - UINT8 Reserved4; - UINT8 Reserved5; - UINT8 Reserved6; - UINT32 Flags; -} EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE; - -/// -/// FADT Version (as defined in ACPI 1.0b specification). -/// -#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01 - -#define EFI_ACPI_1_0_INT_MODE_DUAL_PIC 0 -#define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC 1 - -// -// Fixed ACPI Description Table Fixed Feature Flags -// All other bits are reserved and must be set to 0. -// -#define EFI_ACPI_1_0_WBINVD BIT0 -#define EFI_ACPI_1_0_WBINVD_FLUSH BIT1 -#define EFI_ACPI_1_0_PROC_C1 BIT2 -#define EFI_ACPI_1_0_P_LVL2_UP BIT3 -#define EFI_ACPI_1_0_PWR_BUTTON BIT4 -#define EFI_ACPI_1_0_SLP_BUTTON BIT5 -#define EFI_ACPI_1_0_FIX_RTC BIT6 -#define EFI_ACPI_1_0_RTC_S4 BIT7 -#define EFI_ACPI_1_0_TMR_VAL_EXT BIT8 -#define EFI_ACPI_1_0_DCK_CAP BIT9 - -/// -/// Firmware ACPI Control Structure. -/// -typedef struct { - UINT32 Signature; - UINT32 Length; - UINT32 HardwareSignature; - UINT32 FirmwareWakingVector; - UINT32 GlobalLock; - UINT32 Flags; - UINT8 Reserved[40]; -} EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE; - -/// -/// Firmware Control Structure Feature Flags. -/// All other bits are reserved and must be set to 0. -/// -#define EFI_ACPI_1_0_S4BIOS_F BIT0 - -/// -/// Multiple APIC Description Table header definition. The rest of the table -/// must be defined in a platform-specific manner. -/// -typedef struct { - EFI_ACPI_DESCRIPTION_HEADER Header; - UINT32 LocalApicAddress; - UINT32 Flags; -} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER; - -/// -/// MADT Revision (as defined in ACPI 1.0b specification). -/// -#define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01 - -/// -/// Multiple APIC Flags -/// All other bits are reserved and must be set to 0. -/// -#define EFI_ACPI_1_0_PCAT_COMPAT BIT0 - -// -// Multiple APIC Description Table APIC structure types -// All other values between 0x05 an 0xFF are reserved and -// will be ignored by OSPM. -// -#define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00 -#define EFI_ACPI_1_0_IO_APIC 0x01 -#define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02 -#define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03 -#define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04 - -// -// APIC Structure Definitions -// - -/// -/// Processor Local APIC Structure Definition. -/// -typedef struct { - UINT8 Type; - UINT8 Length; - UINT8 AcpiProcessorId; - UINT8 ApicId; - UINT32 Flags; -} EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE; - -/// -/// Local APIC Flags. All other bits are reserved and must be 0. -/// -#define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0 - -/// -/// IO APIC Structure. -/// -typedef struct { - UINT8 Type; - UINT8 Length; - UINT8 IoApicId; - UINT8 Reserved; - UINT32 IoApicAddress; - UINT32 SystemVectorBase; -} EFI_ACPI_1_0_IO_APIC_STRUCTURE; - -/// -/// Interrupt Source Override Structure. -/// -typedef struct { - UINT8 Type; - UINT8 Length; - UINT8 Bus; - UINT8 Source; - UINT32 GlobalSystemInterruptVector; - UINT16 Flags; -} EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE; - -/// -/// Non-Maskable Interrupt Source Structure. -/// -typedef struct { - UINT8 Type; - UINT8 Length; - UINT16 Flags; - UINT32 GlobalSystemInterruptVector; -} EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE; - -/// -/// Local APIC NMI Structure. -/// -typedef struct { - UINT8 Type; - UINT8 Length; - UINT8 AcpiProcessorId; - UINT16 Flags; - UINT8 LocalApicInti; -} EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE; - -/// -/// Smart Battery Description Table (SBST) -/// -typedef struct { - EFI_ACPI_DESCRIPTION_HEADER Header; - UINT32 WarningEnergyLevel; - UINT32 LowEnergyLevel; - UINT32 CriticalEnergyLevel; -} EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE; - -// -// Known table signatures -// - -/// -/// "RSD PTR " Root System Description Pointer. -/// -#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ') - -/// -/// "APIC" Multiple APIC Description Table. -/// -#define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C') - -/// -/// "DSDT" Differentiated System Description Table. -/// -#define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T') - -/// -/// "FACS" Firmware ACPI Control Structure. -/// -#define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S') - -/// -/// "FACP" Fixed ACPI Description Table. -/// -#define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P') - -/// -/// "PSDT" Persistent System Description Table. -/// -#define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T') - -/// -/// "RSDT" Root System Description Table. -/// -#define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T') - -/// -/// "SBST" Smart Battery Specification Table. -/// -#define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T') - -/// -/// "SSDT" Secondary System Description Table. -/// -#define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T') - -#pragma pack() - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/AcpiAml.h b/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/AcpiAml.h deleted file mode 100644 index a9186b40f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/AcpiAml.h +++ /dev/null @@ -1,177 +0,0 @@ -/** @file - This file contains AML code definition in the latest ACPI spec. - - Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> - 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 _ACPI_AML_H_ -#define _ACPI_AML_H_ - -FILE_LICENCE ( BSD3 ); - -// -// ACPI AML definition -// - -// -// Primary OpCode -// -#define AML_ZERO_OP 0x00 -#define AML_ONE_OP 0x01 -#define AML_ALIAS_OP 0x06 -#define AML_NAME_OP 0x08 -#define AML_BYTE_PREFIX 0x0a -#define AML_WORD_PREFIX 0x0b -#define AML_DWORD_PREFIX 0x0c -#define AML_STRING_PREFIX 0x0d -#define AML_QWORD_PREFIX 0x0e -#define AML_SCOPE_OP 0x10 -#define AML_BUFFER_OP 0x11 -#define AML_PACKAGE_OP 0x12 -#define AML_VAR_PACKAGE_OP 0x13 -#define AML_METHOD_OP 0x14 -#define AML_DUAL_NAME_PREFIX 0x2e -#define AML_MULTI_NAME_PREFIX 0x2f -#define AML_NAME_CHAR_A 0x41 -#define AML_NAME_CHAR_B 0x42 -#define AML_NAME_CHAR_C 0x43 -#define AML_NAME_CHAR_D 0x44 -#define AML_NAME_CHAR_E 0x45 -#define AML_NAME_CHAR_F 0x46 -#define AML_NAME_CHAR_G 0x47 -#define AML_NAME_CHAR_H 0x48 -#define AML_NAME_CHAR_I 0x49 -#define AML_NAME_CHAR_J 0x4a -#define AML_NAME_CHAR_K 0x4b -#define AML_NAME_CHAR_L 0x4c -#define AML_NAME_CHAR_M 0x4d -#define AML_NAME_CHAR_N 0x4e -#define AML_NAME_CHAR_O 0x4f -#define AML_NAME_CHAR_P 0x50 -#define AML_NAME_CHAR_Q 0x51 -#define AML_NAME_CHAR_R 0x52 -#define AML_NAME_CHAR_S 0x53 -#define AML_NAME_CHAR_T 0x54 -#define AML_NAME_CHAR_U 0x55 -#define AML_NAME_CHAR_V 0x56 -#define AML_NAME_CHAR_W 0x57 -#define AML_NAME_CHAR_X 0x58 -#define AML_NAME_CHAR_Y 0x59 -#define AML_NAME_CHAR_Z 0x5a -#define AML_ROOT_CHAR 0x5c -#define AML_PARENT_PREFIX_CHAR 0x5e -#define AML_NAME_CHAR__ 0x5f -#define AML_LOCAL0 0x60 -#define AML_LOCAL1 0x61 -#define AML_LOCAL2 0x62 -#define AML_LOCAL3 0x63 -#define AML_LOCAL4 0x64 -#define AML_LOCAL5 0x65 -#define AML_LOCAL6 0x66 -#define AML_LOCAL7 0x67 -#define AML_ARG0 0x68 -#define AML_ARG1 0x69 -#define AML_ARG2 0x6a -#define AML_ARG3 0x6b -#define AML_ARG4 0x6c -#define AML_ARG5 0x6d -#define AML_ARG6 0x6e -#define AML_STORE_OP 0x70 -#define AML_REF_OF_OP 0x71 -#define AML_ADD_OP 0x72 -#define AML_CONCAT_OP 0x73 -#define AML_SUBTRACT_OP 0x74 -#define AML_INCREMENT_OP 0x75 -#define AML_DECREMENT_OP 0x76 -#define AML_MULTIPLY_OP 0x77 -#define AML_DIVIDE_OP 0x78 -#define AML_SHIFT_LEFT_OP 0x79 -#define AML_SHIFT_RIGHT_OP 0x7a -#define AML_AND_OP 0x7b -#define AML_NAND_OP 0x7c -#define AML_OR_OP 0x7d -#define AML_NOR_OP 0x7e -#define AML_XOR_OP 0x7f -#define AML_NOT_OP 0x80 -#define AML_FIND_SET_LEFT_BIT_OP 0x81 -#define AML_FIND_SET_RIGHT_BIT_OP 0x82 -#define AML_DEREF_OF_OP 0x83 -#define AML_CONCAT_RES_OP 0x84 -#define AML_MOD_OP 0x85 -#define AML_NOTIFY_OP 0x86 -#define AML_SIZE_OF_OP 0x87 -#define AML_INDEX_OP 0x88 -#define AML_MATCH_OP 0x89 -#define AML_CREATE_DWORD_FIELD_OP 0x8a -#define AML_CREATE_WORD_FIELD_OP 0x8b -#define AML_CREATE_BYTE_FIELD_OP 0x8c -#define AML_CREATE_BIT_FIELD_OP 0x8d -#define AML_OBJECT_TYPE_OP 0x8e -#define AML_CREATE_QWORD_FIELD_OP 0x8f -#define AML_LAND_OP 0x90 -#define AML_LOR_OP 0x91 -#define AML_LNOT_OP 0x92 -#define AML_LEQUAL_OP 0x93 -#define AML_LGREATER_OP 0x94 -#define AML_LLESS_OP 0x95 -#define AML_TO_BUFFER_OP 0x96 -#define AML_TO_DEC_STRING_OP 0x97 -#define AML_TO_HEX_STRING_OP 0x98 -#define AML_TO_INTEGER_OP 0x99 -#define AML_TO_STRING_OP 0x9c -#define AML_COPY_OBJECT_OP 0x9d -#define AML_MID_OP 0x9e -#define AML_CONTINUE_OP 0x9f -#define AML_IF_OP 0xa0 -#define AML_ELSE_OP 0xa1 -#define AML_WHILE_OP 0xa2 -#define AML_NOOP_OP 0xa3 -#define AML_RETURN_OP 0xa4 -#define AML_BREAK_OP 0xa5 -#define AML_BREAK_POINT_OP 0xcc -#define AML_ONES_OP 0xff - -// -// Extended OpCode -// -#define AML_EXT_OP 0x5b - -#define AML_EXT_MUTEX_OP 0x01 -#define AML_EXT_EVENT_OP 0x02 -#define AML_EXT_COND_REF_OF_OP 0x12 -#define AML_EXT_CREATE_FIELD_OP 0x13 -#define AML_EXT_LOAD_TABLE_OP 0x1f -#define AML_EXT_LOAD_OP 0x20 -#define AML_EXT_STALL_OP 0x21 -#define AML_EXT_SLEEP_OP 0x22 -#define AML_EXT_ACQUIRE_OP 0x23 -#define AML_EXT_SIGNAL_OP 0x24 -#define AML_EXT_WAIT_OP 0x25 -#define AML_EXT_RESET_OP 0x26 -#define AML_EXT_RELEASE_OP 0x27 -#define AML_EXT_FROM_BCD_OP 0x28 -#define AML_EXT_TO_BCD_OP 0x29 -#define AML_EXT_UNLOAD_OP 0x2a -#define AML_EXT_REVISION_OP 0x30 -#define AML_EXT_DEBUG_OP 0x31 -#define AML_EXT_FATAL_OP 0x32 -#define AML_EXT_TIMER_OP 0x33 -#define AML_EXT_REGION_OP 0x80 -#define AML_EXT_FIELD_OP 0x81 -#define AML_EXT_DEVICE_OP 0x82 -#define AML_EXT_PROCESSOR_OP 0x83 -#define AML_EXT_POWER_RES_OP 0x84 -#define AML_EXT_THERMAL_ZONE_OP 0x85 -#define AML_EXT_INDEX_FIELD_OP 0x86 -#define AML_EXT_BANK_FIELD_OP 0x87 -#define AML_EXT_DATA_REGION_OP 0x88 - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Pci22.h b/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Pci22.h deleted file mode 100644 index a73820f69..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Pci22.h +++ /dev/null @@ -1,858 +0,0 @@ -/** @file - Support for PCI 2.2 standard. - - This file includes the definitions in the following specifications, - PCI Local Bus Specification, 2.2 - PCI-to-PCI Bridge Architecture Specification, Revision 1.2 - PC Card Standard, 8.0 - - - - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> - Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> - 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_ - -FILE_LICENCE ( BSD3 ); - -#define PCI_MAX_BUS 255 -#define PCI_MAX_DEVICE 31 -#define PCI_MAX_FUNC 7 - -#pragma pack(1) - -/// -/// Common header region in PCI Configuration Space -/// Section 6.1, PCI Local Bus Specification, 2.2 -/// -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; - -/// -/// PCI Device header region in PCI Configuration Space -/// Section 6.1, PCI Local Bus Specification, 2.2 -/// -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; - -/// -/// PCI Device Configuration Space -/// Section 6.1, PCI Local Bus Specification, 2.2 -/// -typedef struct { - PCI_DEVICE_INDEPENDENT_REGION Hdr; - PCI_DEVICE_HEADER_TYPE_REGION Device; -} PCI_TYPE00; - -/// -/// PCI-PCI Bridge header region in PCI Configuration Space -/// Section 3.2, PCI-PCI Bridge Architecture, Version 1.2 -/// -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; - -/// -/// PCI-to-PCI Bridge Configuration Space -/// Section 3.2, PCI-PCI Bridge Architecture, Version 1.2 -/// -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, -/// Section 4.5.1, 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_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 0x01 -#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 0x10 -#define PCI_SUBCLASS_INPUT_OTHER 0x80 - -#define PCI_CLASS_DOCKING_STATION 0x0A -#define PCI_SUBCLASS_DOCKING_GENERIC 0x00 -#define PCI_SUBCLASS_DOCKING_OTHER 0x80 - -#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 0x10 -#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 - -/** - Macro that checks whether the Base Class code of device matched. - - @param _p Specified device. - @param c Base Class code needs matching. - - @retval TRUE Base Class code matches the specified device. - @retval FALSE Base Class code doesn't match the specified device. - -**/ -#define IS_CLASS1(_p, c) ((_p)->Hdr.ClassCode[2] == (c)) -/** - Macro that checks whether the Base Class code and Sub-Class code of device matched. - - @param _p Specified device. - @param c Base Class code needs matching. - @param s Sub-Class code needs matching. - - @retval TRUE Base Class code and Sub-Class code match the specified device. - @retval FALSE Base Class code and Sub-Class code don't match the specified device. - -**/ -#define IS_CLASS2(_p, c, s) (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s))) -/** - Macro that checks whether the Base Class code, Sub-Class code and Interface code of device matched. - - @param _p Specified device. - @param c Base Class code needs matching. - @param s Sub-Class code needs matching. - @param p Interface code needs matching. - - @retval TRUE Base Class code, Sub-Class code and Interface code match the specified device. - @retval FALSE Base Class code, Sub-Class code and Interface code don't match the specified device. - -**/ -#define IS_CLASS3(_p, c, s, p) (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p))) - -/** - Macro that checks whether device is a display controller. - - @param _p Specified device. - - @retval TRUE Device is a display controller. - @retval FALSE Device is not a display controller. - -**/ -#define IS_PCI_DISPLAY(_p) IS_CLASS1 (_p, PCI_CLASS_DISPLAY) -/** - Macro that checks whether device is a VGA-compatible controller. - - @param _p Specified device. - - @retval TRUE Device is a VGA-compatible controller. - @retval FALSE Device is not a VGA-compatible controller. - -**/ -#define IS_PCI_VGA(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, PCI_IF_VGA_VGA) -/** - Macro that checks whether device is an 8514-compatible controller. - - @param _p Specified device. - - @retval TRUE Device is an 8514-compatible controller. - @retval FALSE Device is not an 8514-compatible controller. - -**/ -#define IS_PCI_8514(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, PCI_IF_VGA_8514) -/** - Macro that checks whether device is built before the Class Code field was defined. - - @param _p Specified device. - - @retval TRUE Device is an old device. - @retval FALSE Device is not an old device. - -**/ -#define IS_PCI_OLD(_p) IS_CLASS1 (_p, PCI_CLASS_OLD) -/** - Macro that checks whether device is a VGA-compatible device built before the Class Code field was defined. - - @param _p Specified device. - - @retval TRUE Device is an old VGA-compatible device. - @retval FALSE Device is not an old VGA-compatible device. - -**/ -#define IS_PCI_OLD_VGA(_p) IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA) -/** - Macro that checks whether device is an IDE controller. - - @param _p Specified device. - - @retval TRUE Device is an IDE controller. - @retval FALSE Device is not an IDE controller. - -**/ -#define IS_PCI_IDE(_p) IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE) -/** - Macro that checks whether device is a SCSI bus controller. - - @param _p Specified device. - - @retval TRUE Device is a SCSI bus controller. - @retval FALSE Device is not a SCSI bus controller. - -**/ -#define IS_PCI_SCSI(_p) IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI) -/** - Macro that checks whether device is a RAID controller. - - @param _p Specified device. - - @retval TRUE Device is a RAID controller. - @retval FALSE Device is not a RAID controller. - -**/ -#define IS_PCI_RAID(_p) IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID) -/** - Macro that checks whether device is an ISA bridge. - - @param _p Specified device. - - @retval TRUE Device is an ISA bridge. - @retval FALSE Device is not an ISA bridge. - -**/ -#define IS_PCI_LPC(_p) IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA) -/** - Macro that checks whether device is a PCI-to-PCI bridge. - - @param _p Specified device. - - @retval TRUE Device is a PCI-to-PCI bridge. - @retval FALSE Device is not a PCI-to-PCI bridge. - -**/ -#define IS_PCI_P2P(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, PCI_IF_BRIDGE_P2P) -/** - Macro that checks whether device is a Subtractive Decode PCI-to-PCI bridge. - - @param _p Specified device. - - @retval TRUE Device is a Subtractive Decode PCI-to-PCI bridge. - @retval FALSE Device is not a Subtractive Decode PCI-to-PCI bridge. - -**/ -#define IS_PCI_P2P_SUB(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, PCI_IF_BRIDGE_P2P_SUBTRACTIVE) -/** - Macro that checks whether device is a 16550-compatible serial controller. - - @param _p Specified device. - - @retval TRUE Device is a 16550-compatible serial controller. - @retval FALSE Device is not a 16550-compatible serial controller. - -**/ -#define IS_PCI_16550_SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550) -/** - Macro that checks whether device is a Universal Serial Bus controller. - - @param _p Specified device. - - @retval TRUE Device is a Universal Serial Bus controller. - @retval FALSE Device is not a Universal Serial Bus controller. - -**/ -#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 -/** - Macro that checks whether device is a PCI-PCI bridge. - - @param _p Specified device. - - @retval TRUE Device is a PCI-PCI bridge. - @retval FALSE Device is not a PCI-PCI bridge. - -**/ -#define IS_PCI_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE)) -/** - Macro that checks whether device is a CardBus bridge. - - @param _p Specified device. - - @retval TRUE Device is a CardBus bridge. - @retval FALSE Device is not a CardBus bridge. - -**/ -#define IS_CARDBUS_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE)) -/** - Macro that checks whether device is a multiple functions device. - - @param _p Specified device. - - @retval TRUE Device is a multiple functions device. - @retval FALSE Device is not a multiple functions device. - -**/ -#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 - -/// -/// PCI Access Data Format -/// -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 - -/// -/// Capabilities List Header -/// Section 6.7, PCI Local Bus Specification, 2.2 -/// -typedef struct { - UINT8 CapabilityID; - UINT8 NextItemPtr; -} EFI_PCI_CAPABILITY_HDR; - -/// -/// Power Management Register Block Definition -/// Section 3.2, PCI Power Management Interface Specifiction, Revision 1.2 -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT16 PMC; - UINT16 PMCSR; - UINT8 BridgeExtention; - UINT8 Data; -} EFI_PCI_CAPABILITY_PMI; - -/// -/// PMC - Power Management Capabilities -/// Section 3.2.3, PCI Power Management Interface Specifiction, Revision 1.2 -/// -typedef union { - struct { - UINT16 Version : 3; - UINT16 PmeClock : 1; - UINT16 : 1; - UINT16 DeviceSpecificInitialization : 1; - UINT16 AuxCurrent : 3; - UINT16 D1Support : 1; - UINT16 D2Support : 1; - UINT16 PmeSupport : 5; - } Bits; - UINT16 Data; -} EFI_PCI_PMC; - -#define EFI_PCI_PMC_D3_COLD_MASK (BIT15) - -/// -/// PMCSR - Power Management Control/Status -/// Section 3.2.4, PCI Power Management Interface Specifiction, Revision 1.2 -/// -typedef union { - struct { - UINT16 PowerState : 2; - UINT16 : 6; - UINT16 PmeEnable : 1; - UINT16 DataSelect : 4; - UINT16 DataScale : 2; - UINT16 PmeStatus : 1; - } Bits; - UINT16 Data; -} EFI_PCI_PMCSR; - -/// -/// A.G.P Capability -/// Section 6.1.4, Accelerated Graphics Port Interface Specification, Revision 1.0 -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT8 Rev; - UINT8 Reserved; - UINT32 Status; - UINT32 Command; -} EFI_PCI_CAPABILITY_AGP; - -/// -/// VPD Capability Structure -/// Appendix I, PCI Local Bus Specification, 2.2 -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT16 AddrReg; - UINT32 DataReg; -} EFI_PCI_CAPABILITY_VPD; - -/// -/// Slot Numbering Capabilities Register -/// Section 3.2.6, PCI-to-PCI Bridge Architeture Specification, Revision 1.2 -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT8 ExpnsSlotReg; - UINT8 ChassisNo; -} EFI_PCI_CAPABILITY_SLOTID; - -/// -/// Message Capability Structure for 32-bit Message Address -/// Section 6.8.1, PCI Local Bus Specification, 2.2 -/// -typedef struct { - EFI_PCI_CAPABILITY_HDR Hdr; - UINT16 MsgCtrlReg; - UINT32 MsgAddrReg; - UINT16 MsgDataReg; -} EFI_PCI_CAPABILITY_MSI32; - -/// -/// Message Capability Structure for 64-bit Message Address -/// Section 6.8.1, PCI Local Bus Specification, 2.2 -/// -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, -/// 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. - -#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. - -/// -/// Standard PCI Expansion ROM Header -/// Section 13.4.2, Unified Extensible Firmware Interface Specification, Version 2.1 -/// -typedef struct { - UINT16 Signature; ///< 0xaa55 - UINT8 Reserved[0x16]; - UINT16 PcirOffset; -} PCI_EXPANSION_ROM_HEADER; - -/// -/// Legacy ROM Header Extensions -/// Section 6.3.3.1, PCI Local Bus Specification, 2.2 -/// -typedef struct { - UINT16 Signature; ///< 0xaa55 - UINT8 Size512; - UINT8 InitEntryPoint[3]; - UINT8 Reserved[0x12]; - UINT16 PcirOffset; -} EFI_LEGACY_EXPANSION_ROM_HEADER; - -/// -/// PCI Data Structure Format -/// Section 6.3.1.2, PCI Local Bus Specification, 2.2 -/// -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; - -/// -/// EFI PCI Expansion ROM Header -/// Section 13.4.2, Unified Extensible Firmware Interface Specification, Version 2.1 -/// -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/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/PeImage.h b/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/PeImage.h deleted file mode 100644 index 9499bb7f5..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/PeImage.h +++ /dev/null @@ -1,758 +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.3 - February 6, 2013. - This file also includes some definitions in PI Specification, Revision 1.0. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> -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__ - -FILE_LICENCE ( BSD3 ); - -// -// 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_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 -#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2 -#define IMAGE_FILE_MACHINE_ARM64 0xAA64 - -// -// 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. - -/// -/// Header Data Directories. -/// -typedef struct { - UINT32 VirtualAddress; - UINT32 Size; -} EFI_IMAGE_DATA_DIRECTORY; - -// -// 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 - -/// -/// Optional Header Standard Fields for PE32. -/// -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+. - /// - /// Optional Header Windows-Specific 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 - -/// -/// Optional Header Standard Fields for PE32+. -/// -typedef struct { - /// - /// Standard fields. - /// - UINT16 Magic; - UINT8 MajorLinkerVersion; - UINT8 MinorLinkerVersion; - UINT32 SizeOfCode; - UINT32 SizeOfInitializedData; - UINT32 SizeOfUninitializedData; - UINT32 AddressOfEntryPoint; - UINT32 BaseOfCode; - /// - /// Optional Header Windows-Specific 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 is for use ONLY by tools. -/// -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) - -/// -/// @attention -/// EFI_IMAGE_HEADERS64 is for use ONLY by tools. -/// -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) - -// -// 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 - -/// -/// Length of ShortName. -/// -#define EFI_IMAGE_SIZEOF_SHORT_NAME 8 - -/// -/// Section Table. This table immediately follows the optional header. -/// -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 BIT11 ///< 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_ARM_MOV32A 5 -#define EFI_IMAGE_REL_BASED_ARM_MOV32T 7 -#define EFI_IMAGE_REL_BASED_IA64_IMM64 9 -#define EFI_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 "// " - -/// -/// Archive Member Headers -/// -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; - -/// -/// Import Address Table RVA (Thunk Table). -/// -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 Directory 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; - - -/// -/// Debug Data Structure defined by Apple Mach-O to Coff utility. -/// -#define CODEVIEW_SIGNATURE_MTOC SIGNATURE_32('M', 'T', 'O', 'C') -typedef struct { - UINT32 Signature; ///< "MTOC". - GUID MachOUuid; - // - // Filename of .DLL (Mach-O with debug info) goes here - // -} EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY; - -/// -/// Resource format. -/// -typedef struct { - UINT32 Characteristics; - UINT32 TimeDateStamp; - UINT16 MajorVersion; - UINT16 MinorVersion; - UINT16 NumberOfNamedEntries; - UINT16 NumberOfIdEntries; - // - // Array of EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY entries goes here. - // -} EFI_IMAGE_RESOURCE_DIRECTORY; - -/// -/// Resource directory entry format. -/// -typedef struct { - union { - struct { - UINT32 NameOffset:31; - UINT32 NameIsString:1; - } s; - UINT32 Id; - } u1; - union { - UINT32 OffsetToData; - struct { - UINT32 OffsetToDirectory:31; - UINT32 DataIsDirectory:1; - } s; - } u2; -} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY; - -/// -/// Resource directory entry for string. -/// -typedef struct { - UINT16 Length; - CHAR16 String[1]; -} EFI_IMAGE_RESOURCE_DIRECTORY_STRING; - -/// -/// Resource directory entry for data array. -/// -typedef struct { - UINT32 OffsetToData; - UINT32 Size; - UINT32 CodePage; - UINT32 Reserved; -} EFI_IMAGE_RESOURCE_DATA_ENTRY; - -/// -/// Header format for TE images, defined in the PI Specification, 1.0. -/// -typedef struct { - UINT16 Signature; ///< The 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; ///< Number of 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/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Tpm12.h b/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Tpm12.h deleted file mode 100644 index 509425cc2..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/Tpm12.h +++ /dev/null @@ -1,2175 +0,0 @@ -/** @file - TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 103) - See http://trustedcomputinggroup.org for latest specification updates - - Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> - 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 _TPM12_H_ -#define _TPM12_H_ - -FILE_LICENCE ( BSD3 ); - -/// -/// The start of TPM return codes -/// -#define TPM_BASE 0 - -// -// All structures MUST be packed on a byte boundary. -// - -#pragma pack (1) - -// -// Part 2, section 2.2.3: Helper redefinitions -// -/// -/// Indicates the conditions where it is required that authorization be presented -/// -typedef UINT8 TPM_AUTH_DATA_USAGE; -/// -/// The information as to what the payload is in an encrypted structure -/// -typedef UINT8 TPM_PAYLOAD_TYPE; -/// -/// The version info breakdown -/// -typedef UINT8 TPM_VERSION_BYTE; -/// -/// The state of the dictionary attack mitigation logic -/// -typedef UINT8 TPM_DA_STATE; -/// -/// The request or response authorization type -/// -typedef UINT16 TPM_TAG; -/// -/// The protocol in use -/// -typedef UINT16 TPM_PROTOCOL_ID; -/// -/// Indicates the start state -/// -typedef UINT16 TPM_STARTUP_TYPE; -/// -/// The definition of the encryption scheme -/// -typedef UINT16 TPM_ENC_SCHEME; -/// -/// The definition of the signature scheme -/// -typedef UINT16 TPM_SIG_SCHEME; -/// -/// The definition of the migration scheme -/// -typedef UINT16 TPM_MIGRATE_SCHEME; -/// -/// Sets the state of the physical presence mechanism -/// -typedef UINT16 TPM_PHYSICAL_PRESENCE; -/// -/// Indicates the types of entity that are supported by the TPM -/// -typedef UINT16 TPM_ENTITY_TYPE; -/// -/// Indicates the permitted usage of the key -/// -typedef UINT16 TPM_KEY_USAGE; -/// -/// The type of asymmetric encrypted structure in use by the endorsement key -/// -typedef UINT16 TPM_EK_TYPE; -/// -/// The tag for the structure -/// -typedef UINT16 TPM_STRUCTURE_TAG; -/// -/// The platform specific spec to which the information relates to -/// -typedef UINT16 TPM_PLATFORM_SPECIFIC; -/// -/// The command ordinal -/// -typedef UINT32 TPM_COMMAND_CODE; -/// -/// Identifies a TPM capability area -/// -typedef UINT32 TPM_CAPABILITY_AREA; -/// -/// Indicates information regarding a key -/// -typedef UINT32 TPM_KEY_FLAGS; -/// -/// Indicates the type of algorithm -/// -typedef UINT32 TPM_ALGORITHM_ID; -/// -/// The locality modifier -/// -typedef UINT32 TPM_MODIFIER_INDICATOR; -/// -/// The actual number of a counter -/// -typedef UINT32 TPM_ACTUAL_COUNT; -/// -/// Attributes that define what options are in use for a transport session -/// -typedef UINT32 TPM_TRANSPORT_ATTRIBUTES; -/// -/// Handle to an authorization session -/// -typedef UINT32 TPM_AUTHHANDLE; -/// -/// Index to a DIR register -/// -typedef UINT32 TPM_DIRINDEX; -/// -/// The area where a key is held assigned by the TPM -/// -typedef UINT32 TPM_KEY_HANDLE; -/// -/// Index to a PCR register -/// -typedef UINT32 TPM_PCRINDEX; -/// -/// The return code from a function -/// -typedef UINT32 TPM_RESULT; -/// -/// The types of resources that a TPM may have using internal resources -/// -typedef UINT32 TPM_RESOURCE_TYPE; -/// -/// Allows for controlling of the key when loaded and how to handle TPM_Startup issues -/// -typedef UINT32 TPM_KEY_CONTROL; -/// -/// The index into the NV storage area -/// -typedef UINT32 TPM_NV_INDEX; -/// -/// The family ID. Family IDs are automatically assigned a sequence number by the TPM. -/// A trusted process can set the FamilyID value in an individual row to NULL, which -/// invalidates that row. The family ID resets to NULL on each change of TPM Owner. -/// -typedef UINT32 TPM_FAMILY_ID; -/// -/// IA value used as a label for the most recent verification of this family. Set to zero when not in use. -/// -typedef UINT32 TPM_FAMILY_VERIFICATION; -/// -/// How the TPM handles var -/// -typedef UINT32 TPM_STARTUP_EFFECTS; -/// -/// The mode of a symmetric encryption -/// -typedef UINT32 TPM_SYM_MODE; -/// -/// The family flags -/// -typedef UINT32 TPM_FAMILY_FLAGS; -/// -/// The index value for the delegate NV table -/// -typedef UINT32 TPM_DELEGATE_INDEX; -/// -/// The restrictions placed on delegation of CMK commands -/// -typedef UINT32 TPM_CMK_DELEGATE; -/// -/// The ID value of a monotonic counter -/// -typedef UINT32 TPM_COUNT_ID; -/// -/// A command to execute -/// -typedef UINT32 TPM_REDIT_COMMAND; -/// -/// A transport session handle -/// -typedef UINT32 TPM_TRANSHANDLE; -/// -/// A generic handle could be key, transport etc -/// -typedef UINT32 TPM_HANDLE; -/// -/// What operation is happening -/// -typedef UINT32 TPM_FAMILY_OPERATION; - -// -// Part 2, section 2.2.4: Vendor specific -// The following defines allow for the quick specification of a -// vendor specific item. -// -#define TPM_Vendor_Specific32 ((UINT32) 0x00000400) -#define TPM_Vendor_Specific8 ((UINT8) 0x80) - -// -// Part 2, section 3.1: TPM_STRUCTURE_TAG -// -#define TPM_TAG_CONTEXTBLOB ((TPM_STRUCTURE_TAG) 0x0001) -#define TPM_TAG_CONTEXT_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0002) -#define TPM_TAG_CONTEXTPOINTER ((TPM_STRUCTURE_TAG) 0x0003) -#define TPM_TAG_CONTEXTLIST ((TPM_STRUCTURE_TAG) 0x0004) -#define TPM_TAG_SIGNINFO ((TPM_STRUCTURE_TAG) 0x0005) -#define TPM_TAG_PCR_INFO_LONG ((TPM_STRUCTURE_TAG) 0x0006) -#define TPM_TAG_PERSISTENT_FLAGS ((TPM_STRUCTURE_TAG) 0x0007) -#define TPM_TAG_VOLATILE_FLAGS ((TPM_STRUCTURE_TAG) 0x0008) -#define TPM_TAG_PERSISTENT_DATA ((TPM_STRUCTURE_TAG) 0x0009) -#define TPM_TAG_VOLATILE_DATA ((TPM_STRUCTURE_TAG) 0x000A) -#define TPM_TAG_SV_DATA ((TPM_STRUCTURE_TAG) 0x000B) -#define TPM_TAG_EK_BLOB ((TPM_STRUCTURE_TAG) 0x000C) -#define TPM_TAG_EK_BLOB_AUTH ((TPM_STRUCTURE_TAG) 0x000D) -#define TPM_TAG_COUNTER_VALUE ((TPM_STRUCTURE_TAG) 0x000E) -#define TPM_TAG_TRANSPORT_INTERNAL ((TPM_STRUCTURE_TAG) 0x000F) -#define TPM_TAG_TRANSPORT_LOG_IN ((TPM_STRUCTURE_TAG) 0x0010) -#define TPM_TAG_TRANSPORT_LOG_OUT ((TPM_STRUCTURE_TAG) 0x0011) -#define TPM_TAG_AUDIT_EVENT_IN ((TPM_STRUCTURE_TAG) 0x0012) -#define TPM_TAG_AUDIT_EVENT_OUT ((TPM_STRUCTURE_TAG) 0x0013) -#define TPM_TAG_CURRENT_TICKS ((TPM_STRUCTURE_TAG) 0x0014) -#define TPM_TAG_KEY ((TPM_STRUCTURE_TAG) 0x0015) -#define TPM_TAG_STORED_DATA12 ((TPM_STRUCTURE_TAG) 0x0016) -#define TPM_TAG_NV_ATTRIBUTES ((TPM_STRUCTURE_TAG) 0x0017) -#define TPM_TAG_NV_DATA_PUBLIC ((TPM_STRUCTURE_TAG) 0x0018) -#define TPM_TAG_NV_DATA_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0019) -#define TPM_TAG_DELEGATIONS ((TPM_STRUCTURE_TAG) 0x001A) -#define TPM_TAG_DELEGATE_PUBLIC ((TPM_STRUCTURE_TAG) 0x001B) -#define TPM_TAG_DELEGATE_TABLE_ROW ((TPM_STRUCTURE_TAG) 0x001C) -#define TPM_TAG_TRANSPORT_AUTH ((TPM_STRUCTURE_TAG) 0x001D) -#define TPM_TAG_TRANSPORT_PUBLIC ((TPM_STRUCTURE_TAG) 0x001E) -#define TPM_TAG_PERMANENT_FLAGS ((TPM_STRUCTURE_TAG) 0x001F) -#define TPM_TAG_STCLEAR_FLAGS ((TPM_STRUCTURE_TAG) 0x0020) -#define TPM_TAG_STANY_FLAGS ((TPM_STRUCTURE_TAG) 0x0021) -#define TPM_TAG_PERMANENT_DATA ((TPM_STRUCTURE_TAG) 0x0022) -#define TPM_TAG_STCLEAR_DATA ((TPM_STRUCTURE_TAG) 0x0023) -#define TPM_TAG_STANY_DATA ((TPM_STRUCTURE_TAG) 0x0024) -#define TPM_TAG_FAMILY_TABLE_ENTRY ((TPM_STRUCTURE_TAG) 0x0025) -#define TPM_TAG_DELEGATE_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0026) -#define TPM_TAG_DELG_KEY_BLOB ((TPM_STRUCTURE_TAG) 0x0027) -#define TPM_TAG_KEY12 ((TPM_STRUCTURE_TAG) 0x0028) -#define TPM_TAG_CERTIFY_INFO2 ((TPM_STRUCTURE_TAG) 0x0029) -#define TPM_TAG_DELEGATE_OWNER_BLOB ((TPM_STRUCTURE_TAG) 0x002A) -#define TPM_TAG_EK_BLOB_ACTIVATE ((TPM_STRUCTURE_TAG) 0x002B) -#define TPM_TAG_DAA_BLOB ((TPM_STRUCTURE_TAG) 0x002C) -#define TPM_TAG_DAA_CONTEXT ((TPM_STRUCTURE_TAG) 0x002D) -#define TPM_TAG_DAA_ENFORCE ((TPM_STRUCTURE_TAG) 0x002E) -#define TPM_TAG_DAA_ISSUER ((TPM_STRUCTURE_TAG) 0x002F) -#define TPM_TAG_CAP_VERSION_INFO ((TPM_STRUCTURE_TAG) 0x0030) -#define TPM_TAG_DAA_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0031) -#define TPM_TAG_DAA_TPM ((TPM_STRUCTURE_TAG) 0x0032) -#define TPM_TAG_CMK_MIGAUTH ((TPM_STRUCTURE_TAG) 0x0033) -#define TPM_TAG_CMK_SIGTICKET ((TPM_STRUCTURE_TAG) 0x0034) -#define TPM_TAG_CMK_MA_APPROVAL ((TPM_STRUCTURE_TAG) 0x0035) -#define TPM_TAG_QUOTE_INFO2 ((TPM_STRUCTURE_TAG) 0x0036) -#define TPM_TAG_DA_INFO ((TPM_STRUCTURE_TAG) 0x0037) -#define TPM_TAG_DA_LIMITED ((TPM_STRUCTURE_TAG) 0x0038) -#define TPM_TAG_DA_ACTION_TYPE ((TPM_STRUCTURE_TAG) 0x0039) - -// -// Part 2, section 4: TPM Types -// - -// -// Part 2, section 4.1: TPM_RESOURCE_TYPE -// -#define TPM_RT_KEY ((TPM_RESOURCE_TYPE) 0x00000001) ///< The handle is a key handle and is the result of a LoadKey type operation -#define TPM_RT_AUTH ((TPM_RESOURCE_TYPE) 0x00000002) ///< The handle is an authorization handle. Auth handles come from TPM_OIAP, TPM_OSAP and TPM_DSAP -#define TPM_RT_HASH ((TPM_RESOURCE_TYPE) 0x00000003) ///< Reserved for hashes -#define TPM_RT_TRANS ((TPM_RESOURCE_TYPE) 0x00000004) ///< The handle is for a transport session. Transport handles come from TPM_EstablishTransport -#define TPM_RT_CONTEXT ((TPM_RESOURCE_TYPE) 0x00000005) ///< Resource wrapped and held outside the TPM using the context save/restore commands -#define TPM_RT_COUNTER ((TPM_RESOURCE_TYPE) 0x00000006) ///< Reserved for counters -#define TPM_RT_DELEGATE ((TPM_RESOURCE_TYPE) 0x00000007) ///< The handle is for a delegate row. These are the internal rows held in NV storage by the TPM -#define TPM_RT_DAA_TPM ((TPM_RESOURCE_TYPE) 0x00000008) ///< The value is a DAA TPM specific blob -#define TPM_RT_DAA_V0 ((TPM_RESOURCE_TYPE) 0x00000009) ///< The value is a DAA V0 parameter -#define TPM_RT_DAA_V1 ((TPM_RESOURCE_TYPE) 0x0000000A) ///< The value is a DAA V1 parameter - -// -// Part 2, section 4.2: TPM_PAYLOAD_TYPE -// -#define TPM_PT_ASYM ((TPM_PAYLOAD_TYPE) 0x01) ///< The entity is an asymmetric key -#define TPM_PT_BIND ((TPM_PAYLOAD_TYPE) 0x02) ///< The entity is bound data -#define TPM_PT_MIGRATE ((TPM_PAYLOAD_TYPE) 0x03) ///< The entity is a migration blob -#define TPM_PT_MAINT ((TPM_PAYLOAD_TYPE) 0x04) ///< The entity is a maintenance blob -#define TPM_PT_SEAL ((TPM_PAYLOAD_TYPE) 0x05) ///< The entity is sealed data -#define TPM_PT_MIGRATE_RESTRICTED ((TPM_PAYLOAD_TYPE) 0x06) ///< The entity is a restricted-migration asymmetric key -#define TPM_PT_MIGRATE_EXTERNAL ((TPM_PAYLOAD_TYPE) 0x07) ///< The entity is a external migratable key -#define TPM_PT_CMK_MIGRATE ((TPM_PAYLOAD_TYPE) 0x08) ///< The entity is a CMK migratable blob -#define TPM_PT_VENDOR_SPECIFIC ((TPM_PAYLOAD_TYPE) 0x80) ///< 0x80 - 0xFF Vendor specific payloads - -// -// Part 2, section 4.3: TPM_ENTITY_TYPE -// -#define TPM_ET_KEYHANDLE ((UINT16) 0x0001) ///< The entity is a keyHandle or key -#define TPM_ET_OWNER ((UINT16) 0x0002) ///< The entity is the TPM Owner -#define TPM_ET_DATA ((UINT16) 0x0003) ///< The entity is some data -#define TPM_ET_SRK ((UINT16) 0x0004) ///< The entity is the SRK -#define TPM_ET_KEY ((UINT16) 0x0005) ///< The entity is a key or keyHandle -#define TPM_ET_REVOKE ((UINT16) 0x0006) ///< The entity is the RevokeTrust value -#define TPM_ET_DEL_OWNER_BLOB ((UINT16) 0x0007) ///< The entity is a delegate owner blob -#define TPM_ET_DEL_ROW ((UINT16) 0x0008) ///< The entity is a delegate row -#define TPM_ET_DEL_KEY_BLOB ((UINT16) 0x0009) ///< The entity is a delegate key blob -#define TPM_ET_COUNTER ((UINT16) 0x000A) ///< The entity is a counter -#define TPM_ET_NV ((UINT16) 0x000B) ///< The entity is a NV index -#define TPM_ET_OPERATOR ((UINT16) 0x000C) ///< The entity is the operator -#define TPM_ET_RESERVED_HANDLE ((UINT16) 0x0040) ///< Reserved. This value avoids collisions with the handle MSB setting. -// -// TPM_ENTITY_TYPE MSB Values: The MSB is used to indicate the ADIP encryption sheme when applicable -// -#define TPM_ET_XOR ((UINT16) 0x0000) ///< ADIP encryption scheme: XOR -#define TPM_ET_AES128 ((UINT16) 0x0006) ///< ADIP encryption scheme: AES 128 bits - -// -// Part 2, section 4.4.1: Reserved Key Handles -// -#define TPM_KH_SRK ((TPM_KEY_HANDLE) 0x40000000) ///< The handle points to the SRK -#define TPM_KH_OWNER ((TPM_KEY_HANDLE) 0x40000001) ///< The handle points to the TPM Owner -#define TPM_KH_REVOKE ((TPM_KEY_HANDLE) 0x40000002) ///< The handle points to the RevokeTrust value -#define TPM_KH_TRANSPORT ((TPM_KEY_HANDLE) 0x40000003) ///< The handle points to the EstablishTransport static authorization -#define TPM_KH_OPERATOR ((TPM_KEY_HANDLE) 0x40000004) ///< The handle points to the Operator auth -#define TPM_KH_ADMIN ((TPM_KEY_HANDLE) 0x40000005) ///< The handle points to the delegation administration auth -#define TPM_KH_EK ((TPM_KEY_HANDLE) 0x40000006) ///< The handle points to the PUBEK, only usable with TPM_OwnerReadInternalPub - -// -// Part 2, section 4.5: TPM_STARTUP_TYPE -// -#define TPM_ST_CLEAR ((TPM_STARTUP_TYPE) 0x0001) ///< The TPM is starting up from a clean state -#define TPM_ST_STATE ((TPM_STARTUP_TYPE) 0x0002) ///< The TPM is starting up from a saved state -#define TPM_ST_DEACTIVATED ((TPM_STARTUP_TYPE) 0x0003) ///< The TPM is to startup and set the deactivated flag to TRUE - -// -// Part 2, section 4.6: TPM_STATUP_EFFECTS -// The table makeup is still an open issue. -// - -// -// Part 2, section 4.7: TPM_PROTOCOL_ID -// -#define TPM_PID_OIAP ((TPM_PROTOCOL_ID) 0x0001) ///< The OIAP protocol. -#define TPM_PID_OSAP ((TPM_PROTOCOL_ID) 0x0002) ///< The OSAP protocol. -#define TPM_PID_ADIP ((TPM_PROTOCOL_ID) 0x0003) ///< The ADIP protocol. -#define TPM_PID_ADCP ((TPM_PROTOCOL_ID) 0x0004) ///< The ADCP protocol. -#define TPM_PID_OWNER ((TPM_PROTOCOL_ID) 0x0005) ///< The protocol for taking ownership of a TPM. -#define TPM_PID_DSAP ((TPM_PROTOCOL_ID) 0x0006) ///< The DSAP protocol -#define TPM_PID_TRANSPORT ((TPM_PROTOCOL_ID) 0x0007) ///< The transport protocol - -// -// Part 2, section 4.8: TPM_ALGORITHM_ID -// The TPM MUST support the algorithms TPM_ALG_RSA, TPM_ALG_SHA, TPM_ALG_HMAC, -// TPM_ALG_MGF1 -// -#define TPM_ALG_RSA ((TPM_ALGORITHM_ID) 0x00000001) ///< The RSA algorithm. -#define TPM_ALG_DES ((TPM_ALGORITHM_ID) 0x00000002) ///< The DES algorithm -#define TPM_ALG_3DES ((TPM_ALGORITHM_ID) 0x00000003) ///< The 3DES algorithm in EDE mode -#define TPM_ALG_SHA ((TPM_ALGORITHM_ID) 0x00000004) ///< The SHA1 algorithm -#define TPM_ALG_HMAC ((TPM_ALGORITHM_ID) 0x00000005) ///< The RFC 2104 HMAC algorithm -#define TPM_ALG_AES128 ((TPM_ALGORITHM_ID) 0x00000006) ///< The AES algorithm, key size 128 -#define TPM_ALG_MGF1 ((TPM_ALGORITHM_ID) 0x00000007) ///< The XOR algorithm using MGF1 to create a string the size of the encrypted block -#define TPM_ALG_AES192 ((TPM_ALGORITHM_ID) 0x00000008) ///< AES, key size 192 -#define TPM_ALG_AES256 ((TPM_ALGORITHM_ID) 0x00000009) ///< AES, key size 256 -#define TPM_ALG_XOR ((TPM_ALGORITHM_ID) 0x0000000A) ///< XOR using the rolling nonces - -// -// Part 2, section 4.9: TPM_PHYSICAL_PRESENCE -// -#define TPM_PHYSICAL_PRESENCE_HW_DISABLE ((TPM_PHYSICAL_PRESENCE) 0x0200) ///< Sets the physicalPresenceHWEnable to FALSE -#define TPM_PHYSICAL_PRESENCE_CMD_DISABLE ((TPM_PHYSICAL_PRESENCE) 0x0100) ///< Sets the physicalPresenceCMDEnable to FALSE -#define TPM_PHYSICAL_PRESENCE_LIFETIME_LOCK ((TPM_PHYSICAL_PRESENCE) 0x0080) ///< Sets the physicalPresenceLifetimeLock to TRUE -#define TPM_PHYSICAL_PRESENCE_HW_ENABLE ((TPM_PHYSICAL_PRESENCE) 0x0040) ///< Sets the physicalPresenceHWEnable to TRUE -#define TPM_PHYSICAL_PRESENCE_CMD_ENABLE ((TPM_PHYSICAL_PRESENCE) 0x0020) ///< Sets the physicalPresenceCMDEnable to TRUE -#define TPM_PHYSICAL_PRESENCE_NOTPRESENT ((TPM_PHYSICAL_PRESENCE) 0x0010) ///< Sets PhysicalPresence = FALSE -#define TPM_PHYSICAL_PRESENCE_PRESENT ((TPM_PHYSICAL_PRESENCE) 0x0008) ///< Sets PhysicalPresence = TRUE -#define TPM_PHYSICAL_PRESENCE_LOCK ((TPM_PHYSICAL_PRESENCE) 0x0004) ///< Sets PhysicalPresenceLock = TRUE - -// -// Part 2, section 4.10: TPM_MIGRATE_SCHEME -// -#define TPM_MS_MIGRATE ((TPM_MIGRATE_SCHEME) 0x0001) ///< A public key that can be used with all TPM migration commands other than 'ReWrap' mode. -#define TPM_MS_REWRAP ((TPM_MIGRATE_SCHEME) 0x0002) ///< A public key that can be used for the ReWrap mode of TPM_CreateMigrationBlob. -#define TPM_MS_MAINT ((TPM_MIGRATE_SCHEME) 0x0003) ///< A public key that can be used for the Maintenance commands -#define TPM_MS_RESTRICT_MIGRATE ((TPM_MIGRATE_SCHEME) 0x0004) ///< The key is to be migrated to a Migration Authority. -#define TPM_MS_RESTRICT_APPROVE_DOUBLE ((TPM_MIGRATE_SCHEME) 0x0005) ///< The key is to be migrated to an entity approved by a Migration Authority using double wrapping - -// -// Part 2, section 4.11: TPM_EK_TYPE -// -#define TPM_EK_TYPE_ACTIVATE ((TPM_EK_TYPE) 0x0001) ///< The blob MUST be TPM_EK_BLOB_ACTIVATE -#define TPM_EK_TYPE_AUTH ((TPM_EK_TYPE) 0x0002) ///< The blob MUST be TPM_EK_BLOB_AUTH - -// -// Part 2, section 4.12: TPM_PLATFORM_SPECIFIC -// -#define TPM_PS_PC_11 ((TPM_PLATFORM_SPECIFIC) 0x0001) ///< PC Specific version 1.1 -#define TPM_PS_PC_12 ((TPM_PLATFORM_SPECIFIC) 0x0002) ///< PC Specific version 1.2 -#define TPM_PS_PDA_12 ((TPM_PLATFORM_SPECIFIC) 0x0003) ///< PDA Specific version 1.2 -#define TPM_PS_Server_12 ((TPM_PLATFORM_SPECIFIC) 0x0004) ///< Server Specific version 1.2 -#define TPM_PS_Mobile_12 ((TPM_PLATFORM_SPECIFIC) 0x0005) ///< Mobil Specific version 1.2 - -// -// Part 2, section 5: Basic Structures -// - -/// -/// Part 2, section 5.1: TPM_STRUCT_VER -/// -typedef struct tdTPM_STRUCT_VER { - UINT8 major; - UINT8 minor; - UINT8 revMajor; - UINT8 revMinor; -} TPM_STRUCT_VER; - -/// -/// Part 2, section 5.3: TPM_VERSION -/// -typedef struct tdTPM_VERSION { - TPM_VERSION_BYTE major; - TPM_VERSION_BYTE minor; - UINT8 revMajor; - UINT8 revMinor; -} TPM_VERSION; - - -#define TPM_SHA1_160_HASH_LEN 0x14 -#define TPM_SHA1BASED_NONCE_LEN TPM_SHA1_160_HASH_LEN - -/// -/// Part 2, section 5.4: TPM_DIGEST -/// -typedef struct tdTPM_DIGEST{ - UINT8 digest[TPM_SHA1_160_HASH_LEN]; -} TPM_DIGEST; - -/// -/// This SHALL be the digest of the chosen identityLabel and privacyCA for a new TPM identity -/// -typedef TPM_DIGEST TPM_CHOSENID_HASH; -/// -/// This SHALL be the hash of a list of PCR indexes and PCR values that a key or data is bound to -/// -typedef TPM_DIGEST TPM_COMPOSITE_HASH; -/// -/// This SHALL be the value of a DIR register -/// -typedef TPM_DIGEST TPM_DIRVALUE; - -typedef TPM_DIGEST TPM_HMAC; -/// -/// The value inside of the PCR -/// -typedef TPM_DIGEST TPM_PCRVALUE; -/// -/// This SHALL be the value of the current internal audit state -/// -typedef TPM_DIGEST TPM_AUDITDIGEST; - -/// -/// Part 2, section 5.5: TPM_NONCE -/// -typedef struct tdTPM_NONCE{ - UINT8 nonce[20]; -} TPM_NONCE; - -/// -/// This SHALL be a random value generated by a TPM immediately after the EK is installed -/// in that TPM, whenever an EK is installed in that TPM -/// -typedef TPM_NONCE TPM_DAA_TPM_SEED; -/// -/// This SHALL be a random value -/// -typedef TPM_NONCE TPM_DAA_CONTEXT_SEED; - -// -// Part 2, section 5.6: TPM_AUTHDATA -// -/// -/// The AuthData data is the information that is saved or passed to provide proof of ownership -/// 296 of an entity -/// -typedef UINT8 tdTPM_AUTHDATA[20]; - -typedef tdTPM_AUTHDATA TPM_AUTHDATA; -/// -/// A secret plaintext value used in the authorization process -/// -typedef TPM_AUTHDATA TPM_SECRET; -/// -/// A ciphertext (encrypted) version of AuthData data. The encryption mechanism depends on the context -/// -typedef TPM_AUTHDATA TPM_ENCAUTH; - -/// -/// Part 2, section 5.7: TPM_KEY_HANDLE_LIST -/// Size of handle is loaded * sizeof(TPM_KEY_HANDLE) -/// -typedef struct tdTPM_KEY_HANDLE_LIST { - UINT16 loaded; - TPM_KEY_HANDLE handle[1]; -} TPM_KEY_HANDLE_LIST; - -// -// Part 2, section 5.8: TPM_KEY_USAGE values -// -/// -/// TPM_KEY_SIGNING SHALL indicate a signing key. The [private] key SHALL be -/// used for signing operations, only. This means that it MUST be a leaf of the -/// Protected Storage key hierarchy. -/// -#define TPM_KEY_SIGNING ((UINT16) 0x0010) -/// -/// TPM_KEY_STORAGE SHALL indicate a storage key. The key SHALL be used to wrap -/// and unwrap other keys in the Protected Storage hierarchy -/// -#define TPM_KEY_STORAGE ((UINT16) 0x0011) -/// -/// TPM_KEY_IDENTITY SHALL indicate an identity key. The key SHALL be used for -/// operations that require a TPM identity, only. -/// -#define TPM_KEY_IDENTITY ((UINT16) 0x0012) -/// -/// TPM_KEY_AUTHCHANGE SHALL indicate an ephemeral key that is in use during -/// the ChangeAuthAsym process, only. -/// -#define TPM_KEY_AUTHCHANGE ((UINT16) 0x0013) -/// -/// TPM_KEY_BIND SHALL indicate a key that can be used for TPM_Bind and -/// TPM_Unbind operations only. -/// -#define TPM_KEY_BIND ((UINT16) 0x0014) -/// -/// TPM_KEY_LEGACY SHALL indicate a key that can perform signing and binding -/// operations. The key MAY be used for both signing and binding operations. -/// The TPM_KEY_LEGACY key type is to allow for use by applications where both -/// signing and encryption operations occur with the same key. The use of this -/// key type is not recommended TPM_KEY_MIGRATE 0x0016 This SHALL indicate a -/// key in use for TPM_MigrateKey -/// -#define TPM_KEY_LEGACY ((UINT16) 0x0015) -/// -/// TPM_KEY_MIGRAGE SHALL indicate a key in use for TPM_MigrateKey -/// -#define TPM_KEY_MIGRATE ((UINT16) 0x0016) - -// -// Part 2, section 5.8.1: Mandatory Key Usage Schemes -// - -#define TPM_ES_NONE ((TPM_ENC_SCHEME) 0x0001) -#define TPM_ES_RSAESPKCSv15 ((TPM_ENC_SCHEME) 0x0002) -#define TPM_ES_RSAESOAEP_SHA1_MGF1 ((TPM_ENC_SCHEME) 0x0003) -#define TPM_ES_SYM_CNT ((TPM_ENC_SCHEME) 0x0004) ///< rev94 defined -#define TPM_ES_SYM_CTR ((TPM_ENC_SCHEME) 0x0004) -#define TPM_ES_SYM_OFB ((TPM_ENC_SCHEME) 0x0005) - -#define TPM_SS_NONE ((TPM_SIG_SCHEME) 0x0001) -#define TPM_SS_RSASSAPKCS1v15_SHA1 ((TPM_SIG_SCHEME) 0x0002) -#define TPM_SS_RSASSAPKCS1v15_DER ((TPM_SIG_SCHEME) 0x0003) -#define TPM_SS_RSASSAPKCS1v15_INFO ((TPM_SIG_SCHEME) 0x0004) - -// -// Part 2, section 5.9: TPM_AUTH_DATA_USAGE values -// -#define TPM_AUTH_NEVER ((TPM_AUTH_DATA_USAGE) 0x00) -#define TPM_AUTH_ALWAYS ((TPM_AUTH_DATA_USAGE) 0x01) -#define TPM_AUTH_PRIV_USE_ONLY ((TPM_AUTH_DATA_USAGE) 0x03) - -/// -/// Part 2, section 5.10: TPM_KEY_FLAGS -/// -typedef enum tdTPM_KEY_FLAGS { - redirection = 0x00000001, - migratable = 0x00000002, - isVolatile = 0x00000004, - pcrIgnoredOnRead = 0x00000008, - migrateAuthority = 0x00000010 -} TPM_KEY_FLAGS_BITS; - -/// -/// Part 2, section 5.11: TPM_CHANGEAUTH_VALIDATE -/// -typedef struct tdTPM_CHANGEAUTH_VALIDATE { - TPM_SECRET newAuthSecret; - TPM_NONCE n1; -} TPM_CHANGEAUTH_VALIDATE; - -/// -/// Part 2, section 5.12: TPM_MIGRATIONKEYAUTH -/// decalared after section 10 to catch declaration of TPM_PUBKEY -/// -/// Part 2 section 10.1: TPM_KEY_PARMS -/// [size_is(parmSize)] BYTE* parms; -/// -typedef struct tdTPM_KEY_PARMS { - TPM_ALGORITHM_ID algorithmID; - TPM_ENC_SCHEME encScheme; - TPM_SIG_SCHEME sigScheme; - UINT32 parmSize; - UINT8 *parms; -} TPM_KEY_PARMS; - -/// -/// Part 2, section 10.4: TPM_STORE_PUBKEY -/// -typedef struct tdTPM_STORE_PUBKEY { - UINT32 keyLength; - UINT8 key[1]; -} TPM_STORE_PUBKEY; - -/// -/// Part 2, section 10.5: TPM_PUBKEY -/// -typedef struct tdTPM_PUBKEY{ - TPM_KEY_PARMS algorithmParms; - TPM_STORE_PUBKEY pubKey; -} TPM_PUBKEY; - -/// -/// Part 2, section 5.12: TPM_MIGRATIONKEYAUTH -/// -typedef struct tdTPM_MIGRATIONKEYAUTH{ - TPM_PUBKEY migrationKey; - TPM_MIGRATE_SCHEME migrationScheme; - TPM_DIGEST digest; -} TPM_MIGRATIONKEYAUTH; - -/// -/// Part 2, section 5.13: TPM_COUNTER_VALUE -/// -typedef struct tdTPM_COUNTER_VALUE{ - TPM_STRUCTURE_TAG tag; - UINT8 label[4]; - TPM_ACTUAL_COUNT counter; -} TPM_COUNTER_VALUE; - -/// -/// Part 2, section 5.14: TPM_SIGN_INFO -/// Size of data indicated by dataLen -/// -typedef struct tdTPM_SIGN_INFO { - TPM_STRUCTURE_TAG tag; - UINT8 fixed[4]; - TPM_NONCE replay; - UINT32 dataLen; - UINT8 *data; -} TPM_SIGN_INFO; - -/// -/// Part 2, section 5.15: TPM_MSA_COMPOSITE -/// Number of migAuthDigest indicated by MSAlist -/// -typedef struct tdTPM_MSA_COMPOSITE { - UINT32 MSAlist; - TPM_DIGEST migAuthDigest[1]; -} TPM_MSA_COMPOSITE; - -/// -/// Part 2, section 5.16: TPM_CMK_AUTH -/// -typedef struct tdTPM_CMK_AUTH{ - TPM_DIGEST migrationAuthorityDigest; - TPM_DIGEST destinationKeyDigest; - TPM_DIGEST sourceKeyDigest; -} TPM_CMK_AUTH; - -// -// Part 2, section 5.17: TPM_CMK_DELEGATE -// -#define TPM_CMK_DELEGATE_SIGNING ((TPM_CMK_DELEGATE) BIT31) -#define TPM_CMK_DELEGATE_STORAGE ((TPM_CMK_DELEGATE) BIT30) -#define TPM_CMK_DELEGATE_BIND ((TPM_CMK_DELEGATE) BIT29) -#define TPM_CMK_DELEGATE_LEGACY ((TPM_CMK_DELEGATE) BIT28) -#define TPM_CMK_DELEGATE_MIGRATE ((TPM_CMK_DELEGATE) BIT27) - -/// -/// Part 2, section 5.18: TPM_SELECT_SIZE -/// -typedef struct tdTPM_SELECT_SIZE { - UINT8 major; - UINT8 minor; - UINT16 reqSize; -} TPM_SELECT_SIZE; - -/// -/// Part 2, section 5,19: TPM_CMK_MIGAUTH -/// -typedef struct tdTPM_CMK_MIGAUTH{ - TPM_STRUCTURE_TAG tag; - TPM_DIGEST msaDigest; - TPM_DIGEST pubKeyDigest; -} TPM_CMK_MIGAUTH; - -/// -/// Part 2, section 5.20: TPM_CMK_SIGTICKET -/// -typedef struct tdTPM_CMK_SIGTICKET{ - TPM_STRUCTURE_TAG tag; - TPM_DIGEST verKeyDigest; - TPM_DIGEST signedData; -} TPM_CMK_SIGTICKET; - -/// -/// Part 2, section 5.21: TPM_CMK_MA_APPROVAL -/// -typedef struct tdTPM_CMK_MA_APPROVAL{ - TPM_STRUCTURE_TAG tag; - TPM_DIGEST migrationAuthorityDigest; -} TPM_CMK_MA_APPROVAL; - -// -// Part 2, section 6: Command Tags -// -#define TPM_TAG_RQU_COMMAND ((TPM_STRUCTURE_TAG) 0x00C1) -#define TPM_TAG_RQU_AUTH1_COMMAND ((TPM_STRUCTURE_TAG) 0x00C2) -#define TPM_TAG_RQU_AUTH2_COMMAND ((TPM_STRUCTURE_TAG) 0x00C3) -#define TPM_TAG_RSP_COMMAND ((TPM_STRUCTURE_TAG) 0x00C4) -#define TPM_TAG_RSP_AUTH1_COMMAND ((TPM_STRUCTURE_TAG) 0x00C5) -#define TPM_TAG_RSP_AUTH2_COMMAND ((TPM_STRUCTURE_TAG) 0x00C6) - -/// -/// Part 2, section 7.1: TPM_PERMANENT_FLAGS -/// -typedef struct tdTPM_PERMANENT_FLAGS{ - TPM_STRUCTURE_TAG tag; - BOOLEAN disable; - BOOLEAN ownership; - BOOLEAN deactivated; - BOOLEAN readPubek; - BOOLEAN disableOwnerClear; - BOOLEAN allowMaintenance; - BOOLEAN physicalPresenceLifetimeLock; - BOOLEAN physicalPresenceHWEnable; - BOOLEAN physicalPresenceCMDEnable; - BOOLEAN CEKPUsed; - BOOLEAN TPMpost; - BOOLEAN TPMpostLock; - BOOLEAN FIPS; - BOOLEAN operator; - BOOLEAN enableRevokeEK; - BOOLEAN nvLocked; - BOOLEAN readSRKPub; - BOOLEAN tpmEstablished; - BOOLEAN maintenanceDone; - BOOLEAN disableFullDALogicInfo; -} TPM_PERMANENT_FLAGS; - -// -// Part 2, section 7.1.1: Flag Restrictions (of TPM_PERMANENT_FLAGS) -// -#define TPM_PF_DISABLE ((TPM_CAPABILITY_AREA) 1) -#define TPM_PF_OWNERSHIP ((TPM_CAPABILITY_AREA) 2) -#define TPM_PF_DEACTIVATED ((TPM_CAPABILITY_AREA) 3) -#define TPM_PF_READPUBEK ((TPM_CAPABILITY_AREA) 4) -#define TPM_PF_DISABLEOWNERCLEAR ((TPM_CAPABILITY_AREA) 5) -#define TPM_PF_ALLOWMAINTENANCE ((TPM_CAPABILITY_AREA) 6) -#define TPM_PF_PHYSICALPRESENCELIFETIMELOCK ((TPM_CAPABILITY_AREA) 7) -#define TPM_PF_PHYSICALPRESENCEHWENABLE ((TPM_CAPABILITY_AREA) 8) -#define TPM_PF_PHYSICALPRESENCECMDENABLE ((TPM_CAPABILITY_AREA) 9) -#define TPM_PF_CEKPUSED ((TPM_CAPABILITY_AREA) 10) -#define TPM_PF_TPMPOST ((TPM_CAPABILITY_AREA) 11) -#define TPM_PF_TPMPOSTLOCK ((TPM_CAPABILITY_AREA) 12) -#define TPM_PF_FIPS ((TPM_CAPABILITY_AREA) 13) -#define TPM_PF_OPERATOR ((TPM_CAPABILITY_AREA) 14) -#define TPM_PF_ENABLEREVOKEEK ((TPM_CAPABILITY_AREA) 15) -#define TPM_PF_NV_LOCKED ((TPM_CAPABILITY_AREA) 16) -#define TPM_PF_READSRKPUB ((TPM_CAPABILITY_AREA) 17) -#define TPM_PF_TPMESTABLISHED ((TPM_CAPABILITY_AREA) 18) -#define TPM_PF_MAINTENANCEDONE ((TPM_CAPABILITY_AREA) 19) -#define TPM_PF_DISABLEFULLDALOGICINFO ((TPM_CAPABILITY_AREA) 20) - -/// -/// Part 2, section 7.2: TPM_STCLEAR_FLAGS -/// -typedef struct tdTPM_STCLEAR_FLAGS{ - TPM_STRUCTURE_TAG tag; - BOOLEAN deactivated; - BOOLEAN disableForceClear; - BOOLEAN physicalPresence; - BOOLEAN physicalPresenceLock; - BOOLEAN bGlobalLock; -} TPM_STCLEAR_FLAGS; - -// -// Part 2, section 7.2.1: Flag Restrictions (of TPM_STCLEAR_FLAGS) -// -#define TPM_SF_DEACTIVATED ((TPM_CAPABILITY_AREA) 1) -#define TPM_SF_DISABLEFORCECLEAR ((TPM_CAPABILITY_AREA) 2) -#define TPM_SF_PHYSICALPRESENCE ((TPM_CAPABILITY_AREA) 3) -#define TPM_SF_PHYSICALPRESENCELOCK ((TPM_CAPABILITY_AREA) 4) -#define TPM_SF_BGLOBALLOCK ((TPM_CAPABILITY_AREA) 5) - -/// -/// Part 2, section 7.3: TPM_STANY_FLAGS -/// -typedef struct tdTPM_STANY_FLAGS{ - TPM_STRUCTURE_TAG tag; - BOOLEAN postInitialise; - TPM_MODIFIER_INDICATOR localityModifier; - BOOLEAN transportExclusive; - BOOLEAN TOSPresent; -} TPM_STANY_FLAGS; - -// -// Part 2, section 7.3.1: Flag Restrictions (of TPM_STANY_FLAGS) -// -#define TPM_AF_POSTINITIALISE ((TPM_CAPABILITY_AREA) 1) -#define TPM_AF_LOCALITYMODIFIER ((TPM_CAPABILITY_AREA) 2) -#define TPM_AF_TRANSPORTEXCLUSIVE ((TPM_CAPABILITY_AREA) 3) -#define TPM_AF_TOSPRESENT ((TPM_CAPABILITY_AREA) 4) - -// -// All those structures defined in section 7.4, 7.5, 7.6 are not normative and -// thus no definitions here -// -// Part 2, section 7.4: TPM_PERMANENT_DATA -// -#define TPM_MIN_COUNTERS 4 ///< the minimum number of counters is 4 -#define TPM_DELEGATE_KEY TPM_KEY -#define TPM_NUM_PCR 16 -#define TPM_MAX_NV_WRITE_NOOWNER 64 - -// -// Part 2, section 7.4.1: PERMANENT_DATA Subcap for SetCapability -// -#define TPM_PD_REVMAJOR ((TPM_CAPABILITY_AREA) 1) -#define TPM_PD_REVMINOR ((TPM_CAPABILITY_AREA) 2) -#define TPM_PD_TPMPROOF ((TPM_CAPABILITY_AREA) 3) -#define TPM_PD_OWNERAUTH ((TPM_CAPABILITY_AREA) 4) -#define TPM_PD_OPERATORAUTH ((TPM_CAPABILITY_AREA) 5) -#define TPM_PD_MANUMAINTPUB ((TPM_CAPABILITY_AREA) 6) -#define TPM_PD_ENDORSEMENTKEY ((TPM_CAPABILITY_AREA) 7) -#define TPM_PD_SRK ((TPM_CAPABILITY_AREA) 8) -#define TPM_PD_DELEGATEKEY ((TPM_CAPABILITY_AREA) 9) -#define TPM_PD_CONTEXTKEY ((TPM_CAPABILITY_AREA) 10) -#define TPM_PD_AUDITMONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 11) -#define TPM_PD_MONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 12) -#define TPM_PD_PCRATTRIB ((TPM_CAPABILITY_AREA) 13) -#define TPM_PD_ORDINALAUDITSTATUS ((TPM_CAPABILITY_AREA) 14) -#define TPM_PD_AUTHDIR ((TPM_CAPABILITY_AREA) 15) -#define TPM_PD_RNGSTATE ((TPM_CAPABILITY_AREA) 16) -#define TPM_PD_FAMILYTABLE ((TPM_CAPABILITY_AREA) 17) -#define TPM_DELEGATETABLE ((TPM_CAPABILITY_AREA) 18) -#define TPM_PD_EKRESET ((TPM_CAPABILITY_AREA) 19) -#define TPM_PD_MAXNVBUFSIZE ((TPM_CAPABILITY_AREA) 20) -#define TPM_PD_LASTFAMILYID ((TPM_CAPABILITY_AREA) 21) -#define TPM_PD_NOOWNERNVWRITE ((TPM_CAPABILITY_AREA) 22) -#define TPM_PD_RESTRICTDELEGATE ((TPM_CAPABILITY_AREA) 23) -#define TPM_PD_TPMDAASEED ((TPM_CAPABILITY_AREA) 24) -#define TPM_PD_DAAPROOF ((TPM_CAPABILITY_AREA) 25) - -/// -/// Part 2, section 7.5: TPM_STCLEAR_DATA -/// available inside TPM only -/// - typedef struct tdTPM_STCLEAR_DATA{ - TPM_STRUCTURE_TAG tag; - TPM_NONCE contextNonceKey; - TPM_COUNT_ID countID; - UINT32 ownerReference; - BOOLEAN disableResetLock; - TPM_PCRVALUE PCR[TPM_NUM_PCR]; - UINT32 deferredPhysicalPresence; - }TPM_STCLEAR_DATA; - -// -// Part 2, section 7.5.1: STCLEAR_DATA Subcap for SetCapability -// -#define TPM_SD_CONTEXTNONCEKEY ((TPM_CAPABILITY_AREA)0x00000001) -#define TPM_SD_COUNTID ((TPM_CAPABILITY_AREA)0x00000002) -#define TPM_SD_OWNERREFERENCE ((TPM_CAPABILITY_AREA)0x00000003) -#define TPM_SD_DISABLERESETLOCK ((TPM_CAPABILITY_AREA)0x00000004) -#define TPM_SD_PCR ((TPM_CAPABILITY_AREA)0x00000005) -#define TPM_SD_DEFERREDPHYSICALPRESENCE ((TPM_CAPABILITY_AREA)0x00000006) - -// -// Part 2, section 7.6.1: STANY_DATA Subcap for SetCapability -// -#define TPM_AD_CONTEXTNONCESESSION ((TPM_CAPABILITY_AREA) 1) -#define TPM_AD_AUDITDIGEST ((TPM_CAPABILITY_AREA) 2) -#define TPM_AD_CURRENTTICKS ((TPM_CAPABILITY_AREA) 3) -#define TPM_AD_CONTEXTCOUNT ((TPM_CAPABILITY_AREA) 4) -#define TPM_AD_CONTEXTLIST ((TPM_CAPABILITY_AREA) 5) -#define TPM_AD_SESSIONS ((TPM_CAPABILITY_AREA) 6) - -// -// Part 2, section 8: PCR Structures -// - -/// -/// Part 2, section 8.1: TPM_PCR_SELECTION -/// Size of pcrSelect[] indicated by sizeOfSelect -/// -typedef struct tdTPM_PCR_SELECTION { - UINT16 sizeOfSelect; - UINT8 pcrSelect[1]; -} TPM_PCR_SELECTION; - -/// -/// Part 2, section 8.2: TPM_PCR_COMPOSITE -/// Size of pcrValue[] indicated by valueSize -/// -typedef struct tdTPM_PCR_COMPOSITE { - TPM_PCR_SELECTION select; - UINT32 valueSize; - TPM_PCRVALUE pcrValue[1]; -} TPM_PCR_COMPOSITE; - -/// -/// Part 2, section 8.3: TPM_PCR_INFO -/// -typedef struct tdTPM_PCR_INFO { - TPM_PCR_SELECTION pcrSelection; - TPM_COMPOSITE_HASH digestAtRelease; - TPM_COMPOSITE_HASH digestAtCreation; -} TPM_PCR_INFO; - -/// -/// Part 2, section 8.6: TPM_LOCALITY_SELECTION -/// -typedef UINT8 TPM_LOCALITY_SELECTION; - -#define TPM_LOC_FOUR ((UINT8) 0x10) -#define TPM_LOC_THREE ((UINT8) 0x08) -#define TPM_LOC_TWO ((UINT8) 0x04) -#define TPM_LOC_ONE ((UINT8) 0x02) -#define TPM_LOC_ZERO ((UINT8) 0x01) - -/// -/// Part 2, section 8.4: TPM_PCR_INFO_LONG -/// -typedef struct tdTPM_PCR_INFO_LONG { - TPM_STRUCTURE_TAG tag; - TPM_LOCALITY_SELECTION localityAtCreation; - TPM_LOCALITY_SELECTION localityAtRelease; - TPM_PCR_SELECTION creationPCRSelection; - TPM_PCR_SELECTION releasePCRSelection; - TPM_COMPOSITE_HASH digestAtCreation; - TPM_COMPOSITE_HASH digestAtRelease; -} TPM_PCR_INFO_LONG; - -/// -/// Part 2, section 8.5: TPM_PCR_INFO_SHORT -/// -typedef struct tdTPM_PCR_INFO_SHORT{ - TPM_PCR_SELECTION pcrSelection; - TPM_LOCALITY_SELECTION localityAtRelease; - TPM_COMPOSITE_HASH digestAtRelease; -} TPM_PCR_INFO_SHORT; - -/// -/// Part 2, section 8.8: TPM_PCR_ATTRIBUTES -/// -typedef struct tdTPM_PCR_ATTRIBUTES{ - BOOLEAN pcrReset; - TPM_LOCALITY_SELECTION pcrExtendLocal; - TPM_LOCALITY_SELECTION pcrResetLocal; -} TPM_PCR_ATTRIBUTES; - -// -// Part 2, section 9: Storage Structures -// - -/// -/// Part 2, section 9.1: TPM_STORED_DATA -/// [size_is(sealInfoSize)] BYTE* sealInfo; -/// [size_is(encDataSize)] BYTE* encData; -/// -typedef struct tdTPM_STORED_DATA { - TPM_STRUCT_VER ver; - UINT32 sealInfoSize; - UINT8 *sealInfo; - UINT32 encDataSize; - UINT8 *encData; -} TPM_STORED_DATA; - -/// -/// Part 2, section 9.2: TPM_STORED_DATA12 -/// [size_is(sealInfoSize)] BYTE* sealInfo; -/// [size_is(encDataSize)] BYTE* encData; -/// -typedef struct tdTPM_STORED_DATA12 { - TPM_STRUCTURE_TAG tag; - TPM_ENTITY_TYPE et; - UINT32 sealInfoSize; - UINT8 *sealInfo; - UINT32 encDataSize; - UINT8 *encData; -} TPM_STORED_DATA12; - -/// -/// Part 2, section 9.3: TPM_SEALED_DATA -/// [size_is(dataSize)] BYTE* data; -/// -typedef struct tdTPM_SEALED_DATA { - TPM_PAYLOAD_TYPE payload; - TPM_SECRET authData; - TPM_NONCE tpmProof; - TPM_DIGEST storedDigest; - UINT32 dataSize; - UINT8 *data; -} TPM_SEALED_DATA; - -/// -/// Part 2, section 9.4: TPM_SYMMETRIC_KEY -/// [size_is(size)] BYTE* data; -/// -typedef struct tdTPM_SYMMETRIC_KEY { - TPM_ALGORITHM_ID algId; - TPM_ENC_SCHEME encScheme; - UINT16 dataSize; - UINT8 *data; -} TPM_SYMMETRIC_KEY; - -/// -/// Part 2, section 9.5: TPM_BOUND_DATA -/// -typedef struct tdTPM_BOUND_DATA { - TPM_STRUCT_VER ver; - TPM_PAYLOAD_TYPE payload; - UINT8 payloadData[1]; -} TPM_BOUND_DATA; - -// -// Part 2 section 10: TPM_KEY complex -// - -// -// Section 10.1, 10.4, and 10.5 have been defined previously -// - -/// -/// Part 2, section 10.2: TPM_KEY -/// [size_is(encDataSize)] BYTE* encData; -/// -typedef struct tdTPM_KEY{ - TPM_STRUCT_VER ver; - TPM_KEY_USAGE keyUsage; - TPM_KEY_FLAGS keyFlags; - TPM_AUTH_DATA_USAGE authDataUsage; - TPM_KEY_PARMS algorithmParms; - UINT32 PCRInfoSize; - UINT8 *PCRInfo; - TPM_STORE_PUBKEY pubKey; - UINT32 encDataSize; - UINT8 *encData; -} TPM_KEY; - -/// -/// Part 2, section 10.3: TPM_KEY12 -/// [size_is(encDataSize)] BYTE* encData; -/// -typedef struct tdTPM_KEY12{ - TPM_STRUCTURE_TAG tag; - UINT16 fill; - TPM_KEY_USAGE keyUsage; - TPM_KEY_FLAGS keyFlags; - TPM_AUTH_DATA_USAGE authDataUsage; - TPM_KEY_PARMS algorithmParms; - UINT32 PCRInfoSize; - UINT8 *PCRInfo; - TPM_STORE_PUBKEY pubKey; - UINT32 encDataSize; - UINT8 *encData; -} TPM_KEY12; - -/// -/// Part 2, section 10.7: TPM_STORE_PRIVKEY -/// [size_is(keyLength)] BYTE* key; -/// -typedef struct tdTPM_STORE_PRIVKEY { - UINT32 keyLength; - UINT8 *key; -} TPM_STORE_PRIVKEY; - -/// -/// Part 2, section 10.6: TPM_STORE_ASYMKEY -/// -typedef struct tdTPM_STORE_ASYMKEY { // pos len total - TPM_PAYLOAD_TYPE payload; // 0 1 1 - TPM_SECRET usageAuth; // 1 20 21 - TPM_SECRET migrationAuth; // 21 20 41 - TPM_DIGEST pubDataDigest; // 41 20 61 - TPM_STORE_PRIVKEY privKey; // 61 132-151 193-214 -} TPM_STORE_ASYMKEY; - -/// -/// Part 2, section 10.8: TPM_MIGRATE_ASYMKEY -/// [size_is(partPrivKeyLen)] BYTE* partPrivKey; -/// -typedef struct tdTPM_MIGRATE_ASYMKEY { // pos len total - TPM_PAYLOAD_TYPE payload; // 0 1 1 - TPM_SECRET usageAuth; // 1 20 21 - TPM_DIGEST pubDataDigest; // 21 20 41 - UINT32 partPrivKeyLen; // 41 4 45 - UINT8 *partPrivKey; // 45 112-127 157-172 -} TPM_MIGRATE_ASYMKEY; - -/// -/// Part 2, section 10.9: TPM_KEY_CONTROL -/// -#define TPM_KEY_CONTROL_OWNER_EVICT ((UINT32) 0x00000001) - -// -// Part 2, section 11: Signed Structures -// - -/// -/// Part 2, section 11.1: TPM_CERTIFY_INFO Structure -/// -typedef struct tdTPM_CERTIFY_INFO { - TPM_STRUCT_VER version; - TPM_KEY_USAGE keyUsage; - TPM_KEY_FLAGS keyFlags; - TPM_AUTH_DATA_USAGE authDataUsage; - TPM_KEY_PARMS algorithmParms; - TPM_DIGEST pubkeyDigest; - TPM_NONCE data; - BOOLEAN parentPCRStatus; - UINT32 PCRInfoSize; - UINT8 *PCRInfo; -} TPM_CERTIFY_INFO; - -/// -/// Part 2, section 11.2: TPM_CERTIFY_INFO2 Structure -/// -typedef struct tdTPM_CERTIFY_INFO2 { - TPM_STRUCTURE_TAG tag; - UINT8 fill; - TPM_PAYLOAD_TYPE payloadType; - TPM_KEY_USAGE keyUsage; - TPM_KEY_FLAGS keyFlags; - TPM_AUTH_DATA_USAGE authDataUsage; - TPM_KEY_PARMS algorithmParms; - TPM_DIGEST pubkeyDigest; - TPM_NONCE data; - BOOLEAN parentPCRStatus; - UINT32 PCRInfoSize; - UINT8 *PCRInfo; - UINT32 migrationAuthoritySize; - UINT8 *migrationAuthority; -} TPM_CERTIFY_INFO2; - -/// -/// Part 2, section 11.3 TPM_QUOTE_INFO Structure -/// -typedef struct tdTPM_QUOTE_INFO { - TPM_STRUCT_VER version; - UINT8 fixed[4]; - TPM_COMPOSITE_HASH digestValue; - TPM_NONCE externalData; -} TPM_QUOTE_INFO; - -/// -/// Part 2, section 11.4 TPM_QUOTE_INFO2 Structure -/// -typedef struct tdTPM_QUOTE_INFO2 { - TPM_STRUCTURE_TAG tag; - UINT8 fixed[4]; - TPM_NONCE externalData; - TPM_PCR_INFO_SHORT infoShort; -} TPM_QUOTE_INFO2; - -// -// Part 2, section 12: Identity Structures -// - -/// -/// Part 2, section 12.1 TPM_EK_BLOB -/// -typedef struct tdTPM_EK_BLOB { - TPM_STRUCTURE_TAG tag; - TPM_EK_TYPE ekType; - UINT32 blobSize; - UINT8 *blob; -} TPM_EK_BLOB; - -/// -/// Part 2, section 12.2 TPM_EK_BLOB_ACTIVATE -/// -typedef struct tdTPM_EK_BLOB_ACTIVATE { - TPM_STRUCTURE_TAG tag; - TPM_SYMMETRIC_KEY sessionKey; - TPM_DIGEST idDigest; - TPM_PCR_INFO_SHORT pcrInfo; -} TPM_EK_BLOB_ACTIVATE; - -/// -/// Part 2, section 12.3 TPM_EK_BLOB_AUTH -/// -typedef struct tdTPM_EK_BLOB_AUTH { - TPM_STRUCTURE_TAG tag; - TPM_SECRET authValue; -} TPM_EK_BLOB_AUTH; - - -/// -/// Part 2, section 12.5 TPM_IDENTITY_CONTENTS -/// -typedef struct tdTPM_IDENTITY_CONTENTS { - TPM_STRUCT_VER ver; - UINT32 ordinal; - TPM_CHOSENID_HASH labelPrivCADigest; - TPM_PUBKEY identityPubKey; -} TPM_IDENTITY_CONTENTS; - -/// -/// Part 2, section 12.6 TPM_IDENTITY_REQ -/// -typedef struct tdTPM_IDENTITY_REQ { - UINT32 asymSize; - UINT32 symSize; - TPM_KEY_PARMS asymAlgorithm; - TPM_KEY_PARMS symAlgorithm; - UINT8 *asymBlob; - UINT8 *symBlob; -} TPM_IDENTITY_REQ; - -/// -/// Part 2, section 12.7 TPM_IDENTITY_PROOF -/// -typedef struct tdTPM_IDENTITY_PROOF { - TPM_STRUCT_VER ver; - UINT32 labelSize; - UINT32 identityBindingSize; - UINT32 endorsementSize; - UINT32 platformSize; - UINT32 conformanceSize; - TPM_PUBKEY identityKey; - UINT8 *labelArea; - UINT8 *identityBinding; - UINT8 *endorsementCredential; - UINT8 *platformCredential; - UINT8 *conformanceCredential; -} TPM_IDENTITY_PROOF; - -/// -/// Part 2, section 12.8 TPM_ASYM_CA_CONTENTS -/// -typedef struct tdTPM_ASYM_CA_CONTENTS { - TPM_SYMMETRIC_KEY sessionKey; - TPM_DIGEST idDigest; -} TPM_ASYM_CA_CONTENTS; - -/// -/// Part 2, section 12.9 TPM_SYM_CA_ATTESTATION -/// -typedef struct tdTPM_SYM_CA_ATTESTATION { - UINT32 credSize; - TPM_KEY_PARMS algorithm; - UINT8 *credential; -} TPM_SYM_CA_ATTESTATION; - -/// -/// Part 2, section 15: Tick Structures -/// Placed here out of order because definitions are used in section 13. -/// -typedef struct tdTPM_CURRENT_TICKS { - TPM_STRUCTURE_TAG tag; - UINT64 currentTicks; - UINT16 tickRate; - TPM_NONCE tickNonce; -} TPM_CURRENT_TICKS; - -/// -/// Part 2, section 13: Transport structures -/// - -/// -/// Part 2, section 13.1: TPM _TRANSPORT_PUBLIC -/// -typedef struct tdTPM_TRANSPORT_PUBLIC { - TPM_STRUCTURE_TAG tag; - TPM_TRANSPORT_ATTRIBUTES transAttributes; - TPM_ALGORITHM_ID algId; - TPM_ENC_SCHEME encScheme; -} TPM_TRANSPORT_PUBLIC; - -// -// Part 2, section 13.1.1 TPM_TRANSPORT_ATTRIBUTES Definitions -// -#define TPM_TRANSPORT_ENCRYPT ((UINT32)BIT0) -#define TPM_TRANSPORT_LOG ((UINT32)BIT1) -#define TPM_TRANSPORT_EXCLUSIVE ((UINT32)BIT2) - -/// -/// Part 2, section 13.2 TPM_TRANSPORT_INTERNAL -/// -typedef struct tdTPM_TRANSPORT_INTERNAL { - TPM_STRUCTURE_TAG tag; - TPM_AUTHDATA authData; - TPM_TRANSPORT_PUBLIC transPublic; - TPM_TRANSHANDLE transHandle; - TPM_NONCE transNonceEven; - TPM_DIGEST transDigest; -} TPM_TRANSPORT_INTERNAL; - -/// -/// Part 2, section 13.3 TPM_TRANSPORT_LOG_IN structure -/// -typedef struct tdTPM_TRANSPORT_LOG_IN { - TPM_STRUCTURE_TAG tag; - TPM_DIGEST parameters; - TPM_DIGEST pubKeyHash; -} TPM_TRANSPORT_LOG_IN; - -/// -/// Part 2, section 13.4 TPM_TRANSPORT_LOG_OUT structure -/// -typedef struct tdTPM_TRANSPORT_LOG_OUT { - TPM_STRUCTURE_TAG tag; - TPM_CURRENT_TICKS currentTicks; - TPM_DIGEST parameters; - TPM_MODIFIER_INDICATOR locality; -} TPM_TRANSPORT_LOG_OUT; - -/// -/// Part 2, section 13.5 TPM_TRANSPORT_AUTH structure -/// -typedef struct tdTPM_TRANSPORT_AUTH { - TPM_STRUCTURE_TAG tag; - TPM_AUTHDATA authData; -} TPM_TRANSPORT_AUTH; - -// -// Part 2, section 14: Audit Structures -// - -/// -/// Part 2, section 14.1 TPM_AUDIT_EVENT_IN structure -/// -typedef struct tdTPM_AUDIT_EVENT_IN { - TPM_STRUCTURE_TAG tag; - TPM_DIGEST inputParms; - TPM_COUNTER_VALUE auditCount; -} TPM_AUDIT_EVENT_IN; - -/// -/// Part 2, section 14.2 TPM_AUDIT_EVENT_OUT structure -/// -typedef struct tdTPM_AUDIT_EVENT_OUT { - TPM_STRUCTURE_TAG tag; - TPM_COMMAND_CODE ordinal; - TPM_DIGEST outputParms; - TPM_COUNTER_VALUE auditCount; - TPM_RESULT returnCode; -} TPM_AUDIT_EVENT_OUT; - -// -// Part 2, section 16: Return Codes -// - -#define TPM_VENDOR_ERROR TPM_Vendor_Specific32 -#define TPM_NON_FATAL 0x00000800 - -#define TPM_SUCCESS ((TPM_RESULT) TPM_BASE) -#define TPM_AUTHFAIL ((TPM_RESULT) (TPM_BASE + 1)) -#define TPM_BADINDEX ((TPM_RESULT) (TPM_BASE + 2)) -#define TPM_BAD_PARAMETER ((TPM_RESULT) (TPM_BASE + 3)) -#define TPM_AUDITFAILURE ((TPM_RESULT) (TPM_BASE + 4)) -#define TPM_CLEAR_DISABLED ((TPM_RESULT) (TPM_BASE + 5)) -#define TPM_DEACTIVATED ((TPM_RESULT) (TPM_BASE + 6)) -#define TPM_DISABLED ((TPM_RESULT) (TPM_BASE + 7)) -#define TPM_DISABLED_CMD ((TPM_RESULT) (TPM_BASE + 8)) -#define TPM_FAIL ((TPM_RESULT) (TPM_BASE + 9)) -#define TPM_BAD_ORDINAL ((TPM_RESULT) (TPM_BASE + 10)) -#define TPM_INSTALL_DISABLED ((TPM_RESULT) (TPM_BASE + 11)) -#define TPM_INVALID_KEYHANDLE ((TPM_RESULT) (TPM_BASE + 12)) -#define TPM_KEYNOTFOUND ((TPM_RESULT) (TPM_BASE + 13)) -#define TPM_INAPPROPRIATE_ENC ((TPM_RESULT) (TPM_BASE + 14)) -#define TPM_MIGRATEFAIL ((TPM_RESULT) (TPM_BASE + 15)) -#define TPM_INVALID_PCR_INFO ((TPM_RESULT) (TPM_BASE + 16)) -#define TPM_NOSPACE ((TPM_RESULT) (TPM_BASE + 17)) -#define TPM_NOSRK ((TPM_RESULT) (TPM_BASE + 18)) -#define TPM_NOTSEALED_BLOB ((TPM_RESULT) (TPM_BASE + 19)) -#define TPM_OWNER_SET ((TPM_RESULT) (TPM_BASE + 20)) -#define TPM_RESOURCES ((TPM_RESULT) (TPM_BASE + 21)) -#define TPM_SHORTRANDOM ((TPM_RESULT) (TPM_BASE + 22)) -#define TPM_SIZE ((TPM_RESULT) (TPM_BASE + 23)) -#define TPM_WRONGPCRVAL ((TPM_RESULT) (TPM_BASE + 24)) -#define TPM_BAD_PARAM_SIZE ((TPM_RESULT) (TPM_BASE + 25)) -#define TPM_SHA_THREAD ((TPM_RESULT) (TPM_BASE + 26)) -#define TPM_SHA_ERROR ((TPM_RESULT) (TPM_BASE + 27)) -#define TPM_FAILEDSELFTEST ((TPM_RESULT) (TPM_BASE + 28)) -#define TPM_AUTH2FAIL ((TPM_RESULT) (TPM_BASE + 29)) -#define TPM_BADTAG ((TPM_RESULT) (TPM_BASE + 30)) -#define TPM_IOERROR ((TPM_RESULT) (TPM_BASE + 31)) -#define TPM_ENCRYPT_ERROR ((TPM_RESULT) (TPM_BASE + 32)) -#define TPM_DECRYPT_ERROR ((TPM_RESULT) (TPM_BASE + 33)) -#define TPM_INVALID_AUTHHANDLE ((TPM_RESULT) (TPM_BASE + 34)) -#define TPM_NO_ENDORSEMENT ((TPM_RESULT) (TPM_BASE + 35)) -#define TPM_INVALID_KEYUSAGE ((TPM_RESULT) (TPM_BASE + 36)) -#define TPM_WRONG_ENTITYTYPE ((TPM_RESULT) (TPM_BASE + 37)) -#define TPM_INVALID_POSTINIT ((TPM_RESULT) (TPM_BASE + 38)) -#define TPM_INAPPROPRIATE_SIG ((TPM_RESULT) (TPM_BASE + 39)) -#define TPM_BAD_KEY_PROPERTY ((TPM_RESULT) (TPM_BASE + 40)) -#define TPM_BAD_MIGRATION ((TPM_RESULT) (TPM_BASE + 41)) -#define TPM_BAD_SCHEME ((TPM_RESULT) (TPM_BASE + 42)) -#define TPM_BAD_DATASIZE ((TPM_RESULT) (TPM_BASE + 43)) -#define TPM_BAD_MODE ((TPM_RESULT) (TPM_BASE + 44)) -#define TPM_BAD_PRESENCE ((TPM_RESULT) (TPM_BASE + 45)) -#define TPM_BAD_VERSION ((TPM_RESULT) (TPM_BASE + 46)) -#define TPM_NO_WRAP_TRANSPORT ((TPM_RESULT) (TPM_BASE + 47)) -#define TPM_AUDITFAIL_UNSUCCESSFUL ((TPM_RESULT) (TPM_BASE + 48)) -#define TPM_AUDITFAIL_SUCCESSFUL ((TPM_RESULT) (TPM_BASE + 49)) -#define TPM_NOTRESETABLE ((TPM_RESULT) (TPM_BASE + 50)) -#define TPM_NOTLOCAL ((TPM_RESULT) (TPM_BASE + 51)) -#define TPM_BAD_TYPE ((TPM_RESULT) (TPM_BASE + 52)) -#define TPM_INVALID_RESOURCE ((TPM_RESULT) (TPM_BASE + 53)) -#define TPM_NOTFIPS ((TPM_RESULT) (TPM_BASE + 54)) -#define TPM_INVALID_FAMILY ((TPM_RESULT) (TPM_BASE + 55)) -#define TPM_NO_NV_PERMISSION ((TPM_RESULT) (TPM_BASE + 56)) -#define TPM_REQUIRES_SIGN ((TPM_RESULT) (TPM_BASE + 57)) -#define TPM_KEY_NOTSUPPORTED ((TPM_RESULT) (TPM_BASE + 58)) -#define TPM_AUTH_CONFLICT ((TPM_RESULT) (TPM_BASE + 59)) -#define TPM_AREA_LOCKED ((TPM_RESULT) (TPM_BASE + 60)) -#define TPM_BAD_LOCALITY ((TPM_RESULT) (TPM_BASE + 61)) -#define TPM_READ_ONLY ((TPM_RESULT) (TPM_BASE + 62)) -#define TPM_PER_NOWRITE ((TPM_RESULT) (TPM_BASE + 63)) -#define TPM_FAMILYCOUNT ((TPM_RESULT) (TPM_BASE + 64)) -#define TPM_WRITE_LOCKED ((TPM_RESULT) (TPM_BASE + 65)) -#define TPM_BAD_ATTRIBUTES ((TPM_RESULT) (TPM_BASE + 66)) -#define TPM_INVALID_STRUCTURE ((TPM_RESULT) (TPM_BASE + 67)) -#define TPM_KEY_OWNER_CONTROL ((TPM_RESULT) (TPM_BASE + 68)) -#define TPM_BAD_COUNTER ((TPM_RESULT) (TPM_BASE + 69)) -#define TPM_NOT_FULLWRITE ((TPM_RESULT) (TPM_BASE + 70)) -#define TPM_CONTEXT_GAP ((TPM_RESULT) (TPM_BASE + 71)) -#define TPM_MAXNVWRITES ((TPM_RESULT) (TPM_BASE + 72)) -#define TPM_NOOPERATOR ((TPM_RESULT) (TPM_BASE + 73)) -#define TPM_RESOURCEMISSING ((TPM_RESULT) (TPM_BASE + 74)) -#define TPM_DELEGATE_LOCK ((TPM_RESULT) (TPM_BASE + 75)) -#define TPM_DELEGATE_FAMILY ((TPM_RESULT) (TPM_BASE + 76)) -#define TPM_DELEGATE_ADMIN ((TPM_RESULT) (TPM_BASE + 77)) -#define TPM_TRANSPORT_NOTEXCLUSIVE ((TPM_RESULT) (TPM_BASE + 78)) -#define TPM_OWNER_CONTROL ((TPM_RESULT) (TPM_BASE + 79)) -#define TPM_DAA_RESOURCES ((TPM_RESULT) (TPM_BASE + 80)) -#define TPM_DAA_INPUT_DATA0 ((TPM_RESULT) (TPM_BASE + 81)) -#define TPM_DAA_INPUT_DATA1 ((TPM_RESULT) (TPM_BASE + 82)) -#define TPM_DAA_ISSUER_SETTINGS ((TPM_RESULT) (TPM_BASE + 83)) -#define TPM_DAA_TPM_SETTINGS ((TPM_RESULT) (TPM_BASE + 84)) -#define TPM_DAA_STAGE ((TPM_RESULT) (TPM_BASE + 85)) -#define TPM_DAA_ISSUER_VALIDITY ((TPM_RESULT) (TPM_BASE + 86)) -#define TPM_DAA_WRONG_W ((TPM_RESULT) (TPM_BASE + 87)) -#define TPM_BAD_HANDLE ((TPM_RESULT) (TPM_BASE + 88)) -#define TPM_BAD_DELEGATE ((TPM_RESULT) (TPM_BASE + 89)) -#define TPM_BADCONTEXT ((TPM_RESULT) (TPM_BASE + 90)) -#define TPM_TOOMANYCONTEXTS ((TPM_RESULT) (TPM_BASE + 91)) -#define TPM_MA_TICKET_SIGNATURE ((TPM_RESULT) (TPM_BASE + 92)) -#define TPM_MA_DESTINATION ((TPM_RESULT) (TPM_BASE + 93)) -#define TPM_MA_SOURCE ((TPM_RESULT) (TPM_BASE + 94)) -#define TPM_MA_AUTHORITY ((TPM_RESULT) (TPM_BASE + 95)) -#define TPM_PERMANENTEK ((TPM_RESULT) (TPM_BASE + 97)) -#define TPM_BAD_SIGNATURE ((TPM_RESULT) (TPM_BASE + 98)) -#define TPM_NOCONTEXTSPACE ((TPM_RESULT) (TPM_BASE + 99)) - -#define TPM_RETRY ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL)) -#define TPM_NEEDS_SELFTEST ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 1)) -#define TPM_DOING_SELFTEST ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 2)) -#define TPM_DEFEND_LOCK_RUNNING ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 3)) - -// -// Part 2, section 17: Ordinals -// -// Ordinals are 32 bit values. The upper byte contains values that serve as -// flag indicators, the next byte contains values indicating what committee -// designated the ordinal, and the final two bytes contain the Command -// Ordinal Index. -// 3 2 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -// |P|C|V| Reserved| Purview | Command Ordinal Index | -// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -// -// Where: -// -// * P is Protected/Unprotected command. When 0 the command is a Protected -// command, when 1 the command is an Unprotected command. -// -// * C is Non-Connection/Connection related command. When 0 this command -// passes through to either the protected (TPM) or unprotected (TSS) -// components. -// -// * V is TPM/Vendor command. When 0 the command is TPM defined, when 1 the -// command is vendor defined. -// -// * All reserved area bits are set to 0. -// - -#define TPM_ORD_ActivateIdentity ((TPM_COMMAND_CODE) 0x0000007A) -#define TPM_ORD_AuthorizeMigrationKey ((TPM_COMMAND_CODE) 0x0000002B) -#define TPM_ORD_CertifyKey ((TPM_COMMAND_CODE) 0x00000032) -#define TPM_ORD_CertifyKey2 ((TPM_COMMAND_CODE) 0x00000033) -#define TPM_ORD_CertifySelfTest ((TPM_COMMAND_CODE) 0x00000052) -#define TPM_ORD_ChangeAuth ((TPM_COMMAND_CODE) 0x0000000C) -#define TPM_ORD_ChangeAuthAsymFinish ((TPM_COMMAND_CODE) 0x0000000F) -#define TPM_ORD_ChangeAuthAsymStart ((TPM_COMMAND_CODE) 0x0000000E) -#define TPM_ORD_ChangeAuthOwner ((TPM_COMMAND_CODE) 0x00000010) -#define TPM_ORD_CMK_ApproveMA ((TPM_COMMAND_CODE) 0x0000001D) -#define TPM_ORD_CMK_ConvertMigration ((TPM_COMMAND_CODE) 0x00000024) -#define TPM_ORD_CMK_CreateBlob ((TPM_COMMAND_CODE) 0x0000001B) -#define TPM_ORD_CMK_CreateKey ((TPM_COMMAND_CODE) 0x00000013) -#define TPM_ORD_CMK_CreateTicket ((TPM_COMMAND_CODE) 0x00000012) -#define TPM_ORD_CMK_SetRestrictions ((TPM_COMMAND_CODE) 0x0000001C) -#define TPM_ORD_ContinueSelfTest ((TPM_COMMAND_CODE) 0x00000053) -#define TPM_ORD_ConvertMigrationBlob ((TPM_COMMAND_CODE) 0x0000002A) -#define TPM_ORD_CreateCounter ((TPM_COMMAND_CODE) 0x000000DC) -#define TPM_ORD_CreateEndorsementKeyPair ((TPM_COMMAND_CODE) 0x00000078) -#define TPM_ORD_CreateMaintenanceArchive ((TPM_COMMAND_CODE) 0x0000002C) -#define TPM_ORD_CreateMigrationBlob ((TPM_COMMAND_CODE) 0x00000028) -#define TPM_ORD_CreateRevocableEK ((TPM_COMMAND_CODE) 0x0000007F) -#define TPM_ORD_CreateWrapKey ((TPM_COMMAND_CODE) 0x0000001F) -#define TPM_ORD_DAA_JOIN ((TPM_COMMAND_CODE) 0x00000029) -#define TPM_ORD_DAA_SIGN ((TPM_COMMAND_CODE) 0x00000031) -#define TPM_ORD_Delegate_CreateKeyDelegation ((TPM_COMMAND_CODE) 0x000000D4) -#define TPM_ORD_Delegate_CreateOwnerDelegation ((TPM_COMMAND_CODE) 0x000000D5) -#define TPM_ORD_Delegate_LoadOwnerDelegation ((TPM_COMMAND_CODE) 0x000000D8) -#define TPM_ORD_Delegate_Manage ((TPM_COMMAND_CODE) 0x000000D2) -#define TPM_ORD_Delegate_ReadTable ((TPM_COMMAND_CODE) 0x000000DB) -#define TPM_ORD_Delegate_UpdateVerification ((TPM_COMMAND_CODE) 0x000000D1) -#define TPM_ORD_Delegate_VerifyDelegation ((TPM_COMMAND_CODE) 0x000000D6) -#define TPM_ORD_DirRead ((TPM_COMMAND_CODE) 0x0000001A) -#define TPM_ORD_DirWriteAuth ((TPM_COMMAND_CODE) 0x00000019) -#define TPM_ORD_DisableForceClear ((TPM_COMMAND_CODE) 0x0000005E) -#define TPM_ORD_DisableOwnerClear ((TPM_COMMAND_CODE) 0x0000005C) -#define TPM_ORD_DisablePubekRead ((TPM_COMMAND_CODE) 0x0000007E) -#define TPM_ORD_DSAP ((TPM_COMMAND_CODE) 0x00000011) -#define TPM_ORD_EstablishTransport ((TPM_COMMAND_CODE) 0x000000E6) -#define TPM_ORD_EvictKey ((TPM_COMMAND_CODE) 0x00000022) -#define TPM_ORD_ExecuteTransport ((TPM_COMMAND_CODE) 0x000000E7) -#define TPM_ORD_Extend ((TPM_COMMAND_CODE) 0x00000014) -#define TPM_ORD_FieldUpgrade ((TPM_COMMAND_CODE) 0x000000AA) -#define TPM_ORD_FlushSpecific ((TPM_COMMAND_CODE) 0x000000BA) -#define TPM_ORD_ForceClear ((TPM_COMMAND_CODE) 0x0000005D) -#define TPM_ORD_GetAuditDigest ((TPM_COMMAND_CODE) 0x00000085) -#define TPM_ORD_GetAuditDigestSigned ((TPM_COMMAND_CODE) 0x00000086) -#define TPM_ORD_GetAuditEvent ((TPM_COMMAND_CODE) 0x00000082) -#define TPM_ORD_GetAuditEventSigned ((TPM_COMMAND_CODE) 0x00000083) -#define TPM_ORD_GetCapability ((TPM_COMMAND_CODE) 0x00000065) -#define TPM_ORD_GetCapabilityOwner ((TPM_COMMAND_CODE) 0x00000066) -#define TPM_ORD_GetCapabilitySigned ((TPM_COMMAND_CODE) 0x00000064) -#define TPM_ORD_GetOrdinalAuditStatus ((TPM_COMMAND_CODE) 0x0000008C) -#define TPM_ORD_GetPubKey ((TPM_COMMAND_CODE) 0x00000021) -#define TPM_ORD_GetRandom ((TPM_COMMAND_CODE) 0x00000046) -#define TPM_ORD_GetTestResult ((TPM_COMMAND_CODE) 0x00000054) -#define TPM_ORD_GetTicks ((TPM_COMMAND_CODE) 0x000000F1) -#define TPM_ORD_IncrementCounter ((TPM_COMMAND_CODE) 0x000000DD) -#define TPM_ORD_Init ((TPM_COMMAND_CODE) 0x00000097) -#define TPM_ORD_KeyControlOwner ((TPM_COMMAND_CODE) 0x00000023) -#define TPM_ORD_KillMaintenanceFeature ((TPM_COMMAND_CODE) 0x0000002E) -#define TPM_ORD_LoadAuthContext ((TPM_COMMAND_CODE) 0x000000B7) -#define TPM_ORD_LoadContext ((TPM_COMMAND_CODE) 0x000000B9) -#define TPM_ORD_LoadKey ((TPM_COMMAND_CODE) 0x00000020) -#define TPM_ORD_LoadKey2 ((TPM_COMMAND_CODE) 0x00000041) -#define TPM_ORD_LoadKeyContext ((TPM_COMMAND_CODE) 0x000000B5) -#define TPM_ORD_LoadMaintenanceArchive ((TPM_COMMAND_CODE) 0x0000002D) -#define TPM_ORD_LoadManuMaintPub ((TPM_COMMAND_CODE) 0x0000002F) -#define TPM_ORD_MakeIdentity ((TPM_COMMAND_CODE) 0x00000079) -#define TPM_ORD_MigrateKey ((TPM_COMMAND_CODE) 0x00000025) -#define TPM_ORD_NV_DefineSpace ((TPM_COMMAND_CODE) 0x000000CC) -#define TPM_ORD_NV_ReadValue ((TPM_COMMAND_CODE) 0x000000CF) -#define TPM_ORD_NV_ReadValueAuth ((TPM_COMMAND_CODE) 0x000000D0) -#define TPM_ORD_NV_WriteValue ((TPM_COMMAND_CODE) 0x000000CD) -#define TPM_ORD_NV_WriteValueAuth ((TPM_COMMAND_CODE) 0x000000CE) -#define TPM_ORD_OIAP ((TPM_COMMAND_CODE) 0x0000000A) -#define TPM_ORD_OSAP ((TPM_COMMAND_CODE) 0x0000000B) -#define TPM_ORD_OwnerClear ((TPM_COMMAND_CODE) 0x0000005B) -#define TPM_ORD_OwnerReadInternalPub ((TPM_COMMAND_CODE) 0x00000081) -#define TPM_ORD_OwnerReadPubek ((TPM_COMMAND_CODE) 0x0000007D) -#define TPM_ORD_OwnerSetDisable ((TPM_COMMAND_CODE) 0x0000006E) -#define TPM_ORD_PCR_Reset ((TPM_COMMAND_CODE) 0x000000C8) -#define TPM_ORD_PcrRead ((TPM_COMMAND_CODE) 0x00000015) -#define TPM_ORD_PhysicalDisable ((TPM_COMMAND_CODE) 0x00000070) -#define TPM_ORD_PhysicalEnable ((TPM_COMMAND_CODE) 0x0000006F) -#define TPM_ORD_PhysicalSetDeactivated ((TPM_COMMAND_CODE) 0x00000072) -#define TPM_ORD_Quote ((TPM_COMMAND_CODE) 0x00000016) -#define TPM_ORD_Quote2 ((TPM_COMMAND_CODE) 0x0000003E) -#define TPM_ORD_ReadCounter ((TPM_COMMAND_CODE) 0x000000DE) -#define TPM_ORD_ReadManuMaintPub ((TPM_COMMAND_CODE) 0x00000030) -#define TPM_ORD_ReadPubek ((TPM_COMMAND_CODE) 0x0000007C) -#define TPM_ORD_ReleaseCounter ((TPM_COMMAND_CODE) 0x000000DF) -#define TPM_ORD_ReleaseCounterOwner ((TPM_COMMAND_CODE) 0x000000E0) -#define TPM_ORD_ReleaseTransportSigned ((TPM_COMMAND_CODE) 0x000000E8) -#define TPM_ORD_Reset ((TPM_COMMAND_CODE) 0x0000005A) -#define TPM_ORD_ResetLockValue ((TPM_COMMAND_CODE) 0x00000040) -#define TPM_ORD_RevokeTrust ((TPM_COMMAND_CODE) 0x00000080) -#define TPM_ORD_SaveAuthContext ((TPM_COMMAND_CODE) 0x000000B6) -#define TPM_ORD_SaveContext ((TPM_COMMAND_CODE) 0x000000B8) -#define TPM_ORD_SaveKeyContext ((TPM_COMMAND_CODE) 0x000000B4) -#define TPM_ORD_SaveState ((TPM_COMMAND_CODE) 0x00000098) -#define TPM_ORD_Seal ((TPM_COMMAND_CODE) 0x00000017) -#define TPM_ORD_Sealx ((TPM_COMMAND_CODE) 0x0000003D) -#define TPM_ORD_SelfTestFull ((TPM_COMMAND_CODE) 0x00000050) -#define TPM_ORD_SetCapability ((TPM_COMMAND_CODE) 0x0000003F) -#define TPM_ORD_SetOperatorAuth ((TPM_COMMAND_CODE) 0x00000074) -#define TPM_ORD_SetOrdinalAuditStatus ((TPM_COMMAND_CODE) 0x0000008D) -#define TPM_ORD_SetOwnerInstall ((TPM_COMMAND_CODE) 0x00000071) -#define TPM_ORD_SetOwnerPointer ((TPM_COMMAND_CODE) 0x00000075) -#define TPM_ORD_SetRedirection ((TPM_COMMAND_CODE) 0x0000009A) -#define TPM_ORD_SetTempDeactivated ((TPM_COMMAND_CODE) 0x00000073) -#define TPM_ORD_SHA1Complete ((TPM_COMMAND_CODE) 0x000000A2) -#define TPM_ORD_SHA1CompleteExtend ((TPM_COMMAND_CODE) 0x000000A3) -#define TPM_ORD_SHA1Start ((TPM_COMMAND_CODE) 0x000000A0) -#define TPM_ORD_SHA1Update ((TPM_COMMAND_CODE) 0x000000A1) -#define TPM_ORD_Sign ((TPM_COMMAND_CODE) 0x0000003C) -#define TPM_ORD_Startup ((TPM_COMMAND_CODE) 0x00000099) -#define TPM_ORD_StirRandom ((TPM_COMMAND_CODE) 0x00000047) -#define TPM_ORD_TakeOwnership ((TPM_COMMAND_CODE) 0x0000000D) -#define TPM_ORD_Terminate_Handle ((TPM_COMMAND_CODE) 0x00000096) -#define TPM_ORD_TickStampBlob ((TPM_COMMAND_CODE) 0x000000F2) -#define TPM_ORD_UnBind ((TPM_COMMAND_CODE) 0x0000001E) -#define TPM_ORD_Unseal ((TPM_COMMAND_CODE) 0x00000018) -#define TSC_ORD_PhysicalPresence ((TPM_COMMAND_CODE) 0x4000000A) -#define TSC_ORD_ResetEstablishmentBit ((TPM_COMMAND_CODE) 0x4000000B) - -// -// Part 2, section 18: Context structures -// - -/// -/// Part 2, section 18.1: TPM_CONTEXT_BLOB -/// -typedef struct tdTPM_CONTEXT_BLOB { - TPM_STRUCTURE_TAG tag; - TPM_RESOURCE_TYPE resourceType; - TPM_HANDLE handle; - UINT8 label[16]; - UINT32 contextCount; - TPM_DIGEST integrityDigest; - UINT32 additionalSize; - UINT8 *additionalData; - UINT32 sensitiveSize; - UINT8 *sensitiveData; -} TPM_CONTEXT_BLOB; - -/// -/// Part 2, section 18.2 TPM_CONTEXT_SENSITIVE -/// -typedef struct tdTPM_CONTEXT_SENSITIVE { - TPM_STRUCTURE_TAG tag; - TPM_NONCE contextNonce; - UINT32 internalSize; - UINT8 *internalData; -} TPM_CONTEXT_SENSITIVE; - -// -// Part 2, section 19: NV Structures -// - -// -// Part 2, section 19.1.1: Required TPM_NV_INDEX values -// -#define TPM_NV_INDEX_LOCK ((UINT32)0xffffffff) -#define TPM_NV_INDEX0 ((UINT32)0x00000000) -#define TPM_NV_INDEX_DIR ((UINT32)0x10000001) -#define TPM_NV_INDEX_EKCert ((UINT32)0x0000f000) -#define TPM_NV_INDEX_TPM_CC ((UINT32)0x0000f001) -#define TPM_NV_INDEX_PlatformCert ((UINT32)0x0000f002) -#define TPM_NV_INDEX_Platform_CC ((UINT32)0x0000f003) -// -// Part 2, section 19.1.2: Reserved Index values -// -#define TPM_NV_INDEX_TSS_BASE ((UINT32)0x00011100) -#define TPM_NV_INDEX_PC_BASE ((UINT32)0x00011200) -#define TPM_NV_INDEX_SERVER_BASE ((UINT32)0x00011300) -#define TPM_NV_INDEX_MOBILE_BASE ((UINT32)0x00011400) -#define TPM_NV_INDEX_PERIPHERAL_BASE ((UINT32)0x00011500) -#define TPM_NV_INDEX_GROUP_RESV_BASE ((UINT32)0x00010000) - -/// -/// Part 2, section 19.2: TPM_NV_ATTRIBUTES -/// -typedef struct tdTPM_NV_ATTRIBUTES { - TPM_STRUCTURE_TAG tag; - UINT32 attributes; -} TPM_NV_ATTRIBUTES; - -#define TPM_NV_PER_READ_STCLEAR (BIT31) -#define TPM_NV_PER_AUTHREAD (BIT18) -#define TPM_NV_PER_OWNERREAD (BIT17) -#define TPM_NV_PER_PPREAD (BIT16) -#define TPM_NV_PER_GLOBALLOCK (BIT15) -#define TPM_NV_PER_WRITE_STCLEAR (BIT14) -#define TPM_NV_PER_WRITEDEFINE (BIT13) -#define TPM_NV_PER_WRITEALL (BIT12) -#define TPM_NV_PER_AUTHWRITE (BIT2) -#define TPM_NV_PER_OWNERWRITE (BIT1) -#define TPM_NV_PER_PPWRITE (BIT0) - -/// -/// Part 2, section 19.3: TPM_NV_DATA_PUBLIC -/// -typedef struct tdTPM_NV_DATA_PUBLIC { - TPM_STRUCTURE_TAG tag; - TPM_NV_INDEX nvIndex; - TPM_PCR_INFO_SHORT pcrInfoRead; - TPM_PCR_INFO_SHORT pcrInfoWrite; - TPM_NV_ATTRIBUTES permission; - BOOLEAN bReadSTClear; - BOOLEAN bWriteSTClear; - BOOLEAN bWriteDefine; - UINT32 dataSize; -} TPM_NV_DATA_PUBLIC; - -// -// Part 2, section 20: Delegate Structures -// - -#define TPM_DEL_OWNER_BITS ((UINT32)0x00000001) -#define TPM_DEL_KEY_BITS ((UINT32)0x00000002) -/// -/// Part 2, section 20.2: Delegate Definitions -/// -typedef struct tdTPM_DELEGATIONS { - TPM_STRUCTURE_TAG tag; - UINT32 delegateType; - UINT32 per1; - UINT32 per2; -} TPM_DELEGATIONS; - -// -// Part 2, section 20.2.1: Owner Permission Settings -// -#define TPM_DELEGATE_SetOrdinalAuditStatus (BIT30) -#define TPM_DELEGATE_DirWriteAuth (BIT29) -#define TPM_DELEGATE_CMK_ApproveMA (BIT28) -#define TPM_DELEGATE_NV_WriteValue (BIT27) -#define TPM_DELEGATE_CMK_CreateTicket (BIT26) -#define TPM_DELEGATE_NV_ReadValue (BIT25) -#define TPM_DELEGATE_Delegate_LoadOwnerDelegation (BIT24) -#define TPM_DELEGATE_DAA_Join (BIT23) -#define TPM_DELEGATE_AuthorizeMigrationKey (BIT22) -#define TPM_DELEGATE_CreateMaintenanceArchive (BIT21) -#define TPM_DELEGATE_LoadMaintenanceArchive (BIT20) -#define TPM_DELEGATE_KillMaintenanceFeature (BIT19) -#define TPM_DELEGATE_OwnerReadInteralPub (BIT18) -#define TPM_DELEGATE_ResetLockValue (BIT17) -#define TPM_DELEGATE_OwnerClear (BIT16) -#define TPM_DELEGATE_DisableOwnerClear (BIT15) -#define TPM_DELEGATE_NV_DefineSpace (BIT14) -#define TPM_DELEGATE_OwnerSetDisable (BIT13) -#define TPM_DELEGATE_SetCapability (BIT12) -#define TPM_DELEGATE_MakeIdentity (BIT11) -#define TPM_DELEGATE_ActivateIdentity (BIT10) -#define TPM_DELEGATE_OwnerReadPubek (BIT9) -#define TPM_DELEGATE_DisablePubekRead (BIT8) -#define TPM_DELEGATE_SetRedirection (BIT7) -#define TPM_DELEGATE_FieldUpgrade (BIT6) -#define TPM_DELEGATE_Delegate_UpdateVerification (BIT5) -#define TPM_DELEGATE_CreateCounter (BIT4) -#define TPM_DELEGATE_ReleaseCounterOwner (BIT3) -#define TPM_DELEGATE_DelegateManage (BIT2) -#define TPM_DELEGATE_Delegate_CreateOwnerDelegation (BIT1) -#define TPM_DELEGATE_DAA_Sign (BIT0) - -// -// Part 2, section 20.2.3: Key Permission settings -// -#define TPM_KEY_DELEGATE_CMK_ConvertMigration (BIT28) -#define TPM_KEY_DELEGATE_TickStampBlob (BIT27) -#define TPM_KEY_DELEGATE_ChangeAuthAsymStart (BIT26) -#define TPM_KEY_DELEGATE_ChangeAuthAsymFinish (BIT25) -#define TPM_KEY_DELEGATE_CMK_CreateKey (BIT24) -#define TPM_KEY_DELEGATE_MigrateKey (BIT23) -#define TPM_KEY_DELEGATE_LoadKey2 (BIT22) -#define TPM_KEY_DELEGATE_EstablishTransport (BIT21) -#define TPM_KEY_DELEGATE_ReleaseTransportSigned (BIT20) -#define TPM_KEY_DELEGATE_Quote2 (BIT19) -#define TPM_KEY_DELEGATE_Sealx (BIT18) -#define TPM_KEY_DELEGATE_MakeIdentity (BIT17) -#define TPM_KEY_DELEGATE_ActivateIdentity (BIT16) -#define TPM_KEY_DELEGATE_GetAuditDigestSigned (BIT15) -#define TPM_KEY_DELEGATE_Sign (BIT14) -#define TPM_KEY_DELEGATE_CertifyKey2 (BIT13) -#define TPM_KEY_DELEGATE_CertifyKey (BIT12) -#define TPM_KEY_DELEGATE_CreateWrapKey (BIT11) -#define TPM_KEY_DELEGATE_CMK_CreateBlob (BIT10) -#define TPM_KEY_DELEGATE_CreateMigrationBlob (BIT9) -#define TPM_KEY_DELEGATE_ConvertMigrationBlob (BIT8) -#define TPM_KEY_DELEGATE_CreateKeyDelegation (BIT7) -#define TPM_KEY_DELEGATE_ChangeAuth (BIT6) -#define TPM_KEY_DELEGATE_GetPubKey (BIT5) -#define TPM_KEY_DELEGATE_UnBind (BIT4) -#define TPM_KEY_DELEGATE_Quote (BIT3) -#define TPM_KEY_DELEGATE_Unseal (BIT2) -#define TPM_KEY_DELEGATE_Seal (BIT1) -#define TPM_KEY_DELEGATE_LoadKey (BIT0) - -// -// Part 2, section 20.3: TPM_FAMILY_FLAGS -// -#define TPM_DELEGATE_ADMIN_LOCK (BIT1) -#define TPM_FAMFLAG_ENABLE (BIT0) - -/// -/// Part 2, section 20.4: TPM_FAMILY_LABEL -/// -typedef struct tdTPM_FAMILY_LABEL { - UINT8 label; -} TPM_FAMILY_LABEL; - -/// -/// Part 2, section 20.5: TPM_FAMILY_TABLE_ENTRY -/// -typedef struct tdTPM_FAMILY_TABLE_ENTRY { - TPM_STRUCTURE_TAG tag; - TPM_FAMILY_LABEL label; - TPM_FAMILY_ID familyID; - TPM_FAMILY_VERIFICATION verificationCount; - TPM_FAMILY_FLAGS flags; -} TPM_FAMILY_TABLE_ENTRY; - -// -// Part 2, section 20.6: TPM_FAMILY_TABLE -// -#define TPM_NUM_FAMILY_TABLE_ENTRY_MIN 8 - -typedef struct tdTPM_FAMILY_TABLE{ - TPM_FAMILY_TABLE_ENTRY famTableRow[TPM_NUM_FAMILY_TABLE_ENTRY_MIN]; -} TPM_FAMILY_TABLE; - -/// -/// Part 2, section 20.7: TPM_DELEGATE_LABEL -/// -typedef struct tdTPM_DELEGATE_LABEL { - UINT8 label; -} TPM_DELEGATE_LABEL; - -/// -/// Part 2, section 20.8: TPM_DELEGATE_PUBLIC -/// -typedef struct tdTPM_DELEGATE_PUBLIC { - TPM_STRUCTURE_TAG tag; - TPM_DELEGATE_LABEL label; - TPM_PCR_INFO_SHORT pcrInfo; - TPM_DELEGATIONS permissions; - TPM_FAMILY_ID familyID; - TPM_FAMILY_VERIFICATION verificationCount; -} TPM_DELEGATE_PUBLIC; - -/// -/// Part 2, section 20.9: TPM_DELEGATE_TABLE_ROW -/// -typedef struct tdTPM_DELEGATE_TABLE_ROW { - TPM_STRUCTURE_TAG tag; - TPM_DELEGATE_PUBLIC pub; - TPM_SECRET authValue; -} TPM_DELEGATE_TABLE_ROW; - -// -// Part 2, section 20.10: TPM_DELEGATE_TABLE -// -#define TPM_NUM_DELEGATE_TABLE_ENTRY_MIN 2 - -typedef struct tdTPM_DELEGATE_TABLE{ - TPM_DELEGATE_TABLE_ROW delRow[TPM_NUM_DELEGATE_TABLE_ENTRY_MIN]; -} TPM_DELEGATE_TABLE; - -/// -/// Part 2, section 20.11: TPM_DELEGATE_SENSITIVE -/// -typedef struct tdTPM_DELEGATE_SENSITIVE { - TPM_STRUCTURE_TAG tag; - TPM_SECRET authValue; -} TPM_DELEGATE_SENSITIVE; - -/// -/// Part 2, section 20.12: TPM_DELEGATE_OWNER_BLOB -/// -typedef struct tdTPM_DELEGATE_OWNER_BLOB { - TPM_STRUCTURE_TAG tag; - TPM_DELEGATE_PUBLIC pub; - TPM_DIGEST integrityDigest; - UINT32 additionalSize; - UINT8 *additionalArea; - UINT32 sensitiveSize; - UINT8 *sensitiveArea; -} TPM_DELEGATE_OWNER_BLOB; - -/// -/// Part 2, section 20.13: TTPM_DELEGATE_KEY_BLOB -/// -typedef struct tdTPM_DELEGATE_KEY_BLOB { - TPM_STRUCTURE_TAG tag; - TPM_DELEGATE_PUBLIC pub; - TPM_DIGEST integrityDigest; - TPM_DIGEST pubKeyDigest; - UINT32 additionalSize; - UINT8 *additionalArea; - UINT32 sensitiveSize; - UINT8 *sensitiveArea; -} TPM_DELEGATE_KEY_BLOB; - -// -// Part 2, section 20.14: TPM_FAMILY_OPERATION Values -// -#define TPM_FAMILY_CREATE ((UINT32)0x00000001) -#define TPM_FAMILY_ENABLE ((UINT32)0x00000002) -#define TPM_FAMILY_ADMIN ((UINT32)0x00000003) -#define TPM_FAMILY_INVALIDATE ((UINT32)0x00000004) - -// -// Part 2, section 21.1: TPM_CAPABILITY_AREA for GetCapability -// -#define TPM_CAP_ORD ((TPM_CAPABILITY_AREA) 0x00000001) -#define TPM_CAP_ALG ((TPM_CAPABILITY_AREA) 0x00000002) -#define TPM_CAP_PID ((TPM_CAPABILITY_AREA) 0x00000003) -#define TPM_CAP_FLAG ((TPM_CAPABILITY_AREA) 0x00000004) -#define TPM_CAP_PROPERTY ((TPM_CAPABILITY_AREA) 0x00000005) -#define TPM_CAP_VERSION ((TPM_CAPABILITY_AREA) 0x00000006) -#define TPM_CAP_KEY_HANDLE ((TPM_CAPABILITY_AREA) 0x00000007) -#define TPM_CAP_CHECK_LOADED ((TPM_CAPABILITY_AREA) 0x00000008) -#define TPM_CAP_SYM_MODE ((TPM_CAPABILITY_AREA) 0x00000009) -#define TPM_CAP_KEY_STATUS ((TPM_CAPABILITY_AREA) 0x0000000C) -#define TPM_CAP_NV_LIST ((TPM_CAPABILITY_AREA) 0x0000000D) -#define TPM_CAP_MFR ((TPM_CAPABILITY_AREA) 0x00000010) -#define TPM_CAP_NV_INDEX ((TPM_CAPABILITY_AREA) 0x00000011) -#define TPM_CAP_TRANS_ALG ((TPM_CAPABILITY_AREA) 0x00000012) -#define TPM_CAP_HANDLE ((TPM_CAPABILITY_AREA) 0x00000014) -#define TPM_CAP_TRANS_ES ((TPM_CAPABILITY_AREA) 0x00000015) -#define TPM_CAP_AUTH_ENCRYPT ((TPM_CAPABILITY_AREA) 0x00000017) -#define TPM_CAP_SELECT_SIZE ((TPM_CAPABILITY_AREA) 0x00000018) -#define TPM_CAP_VERSION_VAL ((TPM_CAPABILITY_AREA) 0x0000001A) - -#define TPM_CAP_FLAG_PERMANENT ((TPM_CAPABILITY_AREA) 0x00000108) -#define TPM_CAP_FLAG_VOLATILE ((TPM_CAPABILITY_AREA) 0x00000109) - -// -// Part 2, section 21.2: CAP_PROPERTY Subcap values for GetCapability -// -#define TPM_CAP_PROP_PCR ((TPM_CAPABILITY_AREA) 0x00000101) -#define TPM_CAP_PROP_DIR ((TPM_CAPABILITY_AREA) 0x00000102) -#define TPM_CAP_PROP_MANUFACTURER ((TPM_CAPABILITY_AREA) 0x00000103) -#define TPM_CAP_PROP_KEYS ((TPM_CAPABILITY_AREA) 0x00000104) -#define TPM_CAP_PROP_MIN_COUNTER ((TPM_CAPABILITY_AREA) 0x00000107) -#define TPM_CAP_PROP_AUTHSESS ((TPM_CAPABILITY_AREA) 0x0000010A) -#define TPM_CAP_PROP_TRANSESS ((TPM_CAPABILITY_AREA) 0x0000010B) -#define TPM_CAP_PROP_COUNTERS ((TPM_CAPABILITY_AREA) 0x0000010C) -#define TPM_CAP_PROP_MAX_AUTHSESS ((TPM_CAPABILITY_AREA) 0x0000010D) -#define TPM_CAP_PROP_MAX_TRANSESS ((TPM_CAPABILITY_AREA) 0x0000010E) -#define TPM_CAP_PROP_MAX_COUNTERS ((TPM_CAPABILITY_AREA) 0x0000010F) -#define TPM_CAP_PROP_MAX_KEYS ((TPM_CAPABILITY_AREA) 0x00000110) -#define TPM_CAP_PROP_OWNER ((TPM_CAPABILITY_AREA) 0x00000111) -#define TPM_CAP_PROP_CONTEXT ((TPM_CAPABILITY_AREA) 0x00000112) -#define TPM_CAP_PROP_MAX_CONTEXT ((TPM_CAPABILITY_AREA) 0x00000113) -#define TPM_CAP_PROP_FAMILYROWS ((TPM_CAPABILITY_AREA) 0x00000114) -#define TPM_CAP_PROP_TIS_TIMEOUT ((TPM_CAPABILITY_AREA) 0x00000115) -#define TPM_CAP_PROP_STARTUP_EFFECT ((TPM_CAPABILITY_AREA) 0x00000116) -#define TPM_CAP_PROP_DELEGATE_ROW ((TPM_CAPABILITY_AREA) 0x00000117) -#define TPM_CAP_PROP_DAA_MAX ((TPM_CAPABILITY_AREA) 0x00000119) -#define CAP_PROP_SESSION_DAA ((TPM_CAPABILITY_AREA) 0x0000011A) -#define TPM_CAP_PROP_CONTEXT_DIST ((TPM_CAPABILITY_AREA) 0x0000011B) -#define TPM_CAP_PROP_DAA_INTERRUPT ((TPM_CAPABILITY_AREA) 0x0000011C) -#define TPM_CAP_PROP_SESSIONS ((TPM_CAPABILITY_AREA) 0x0000011D) -#define TPM_CAP_PROP_MAX_SESSIONS ((TPM_CAPABILITY_AREA) 0x0000011E) -#define TPM_CAP_PROP_CMK_RESTRICTION ((TPM_CAPABILITY_AREA) 0x0000011F) -#define TPM_CAP_PROP_DURATION ((TPM_CAPABILITY_AREA) 0x00000120) -#define TPM_CAP_PROP_ACTIVE_COUNTER ((TPM_CAPABILITY_AREA) 0x00000122) -#define TPM_CAP_PROP_MAX_NV_AVAILABLE ((TPM_CAPABILITY_AREA) 0x00000123) -#define TPM_CAP_PROP_INPUT_BUFFER ((TPM_CAPABILITY_AREA) 0x00000124) - -// -// Part 2, section 21.4: TPM_CAPABILITY_AREA for SetCapability -// -#define TPM_SET_PERM_FLAGS ((TPM_CAPABILITY_AREA) 0x00000001) -#define TPM_SET_PERM_DATA ((TPM_CAPABILITY_AREA) 0x00000002) -#define TPM_SET_STCLEAR_FLAGS ((TPM_CAPABILITY_AREA) 0x00000003) -#define TPM_SET_STCLEAR_DATA ((TPM_CAPABILITY_AREA) 0x00000004) -#define TPM_SET_STANY_FLAGS ((TPM_CAPABILITY_AREA) 0x00000005) -#define TPM_SET_STANY_DATA ((TPM_CAPABILITY_AREA) 0x00000006) - -/// -/// Part 2, section 21.6: TPM_CAP_VERSION_INFO -/// [size_is(vendorSpecificSize)] BYTE* vendorSpecific; -/// -typedef struct tdTPM_CAP_VERSION_INFO { - TPM_STRUCTURE_TAG tag; - TPM_VERSION version; - UINT16 specLevel; - UINT8 errataRev; - UINT8 tpmVendorID[4]; - UINT16 vendorSpecificSize; - UINT8 *vendorSpecific; -} TPM_CAP_VERSION_INFO; - -/// -/// Part 2, section 21.10: TPM_DA_ACTION_TYPE -/// -typedef struct tdTPM_DA_ACTION_TYPE { - TPM_STRUCTURE_TAG tag; - UINT32 actions; -} TPM_DA_ACTION_TYPE; - -#define TPM_DA_ACTION_FAILURE_MODE (((UINT32)1)<<3) -#define TPM_DA_ACTION_DEACTIVATE (((UINT32)1)<<2) -#define TPM_DA_ACTION_DISABLE (((UINT32)1)<<1) -#define TPM_DA_ACTION_TIMEOUT (((UINT32)1)<<0) - -/// -/// Part 2, section 21.7: TPM_DA_INFO -/// -typedef struct tdTPM_DA_INFO { - TPM_STRUCTURE_TAG tag; - TPM_DA_STATE state; - UINT16 currentCount; - UINT16 thresholdCount; - TPM_DA_ACTION_TYPE actionAtThreshold; - UINT32 actionDependValue; - UINT32 vendorDataSize; - UINT8 *vendorData; -} TPM_DA_INFO; - -/// -/// Part 2, section 21.8: TPM_DA_INFO_LIMITED -/// -typedef struct tdTPM_DA_INFO_LIMITED { - TPM_STRUCTURE_TAG tag; - TPM_DA_STATE state; - TPM_DA_ACTION_TYPE actionAtThreshold; - UINT32 vendorDataSize; - UINT8 *vendorData; -} TPM_DA_INFO_LIMITED; - -// -// Part 2, section 21.9: CAP_PROPERTY Subcap values for GetCapability -// -#define TPM_DA_STATE_INACTIVE ((UINT8)0x00) -#define TPM_DA_STATE_ACTIVE ((UINT8)0x01) - -// -// Part 2, section 22: DAA Structures -// - -// -// Part 2, section 22.1: Size definitions -// -#define TPM_DAA_SIZE_r0 (43) -#define TPM_DAA_SIZE_r1 (43) -#define TPM_DAA_SIZE_r2 (128) -#define TPM_DAA_SIZE_r3 (168) -#define TPM_DAA_SIZE_r4 (219) -#define TPM_DAA_SIZE_NT (20) -#define TPM_DAA_SIZE_v0 (128) -#define TPM_DAA_SIZE_v1 (192) -#define TPM_DAA_SIZE_NE (256) -#define TPM_DAA_SIZE_w (256) -#define TPM_DAA_SIZE_issuerModulus (256) -// -// Part 2, section 22.2: Constant definitions -// -#define TPM_DAA_power0 (104) -#define TPM_DAA_power1 (1024) - -/// -/// Part 2, section 22.3: TPM_DAA_ISSUER -/// -typedef struct tdTPM_DAA_ISSUER { - TPM_STRUCTURE_TAG tag; - TPM_DIGEST DAA_digest_R0; - TPM_DIGEST DAA_digest_R1; - TPM_DIGEST DAA_digest_S0; - TPM_DIGEST DAA_digest_S1; - TPM_DIGEST DAA_digest_n; - TPM_DIGEST DAA_digest_gamma; - UINT8 DAA_generic_q[26]; -} TPM_DAA_ISSUER; - -/// -/// Part 2, section 22.4: TPM_DAA_TPM -/// -typedef struct tdTPM_DAA_TPM { - TPM_STRUCTURE_TAG tag; - TPM_DIGEST DAA_digestIssuer; - TPM_DIGEST DAA_digest_v0; - TPM_DIGEST DAA_digest_v1; - TPM_DIGEST DAA_rekey; - UINT32 DAA_count; -} TPM_DAA_TPM; - -/// -/// Part 2, section 22.5: TPM_DAA_CONTEXT -/// -typedef struct tdTPM_DAA_CONTEXT { - TPM_STRUCTURE_TAG tag; - TPM_DIGEST DAA_digestContext; - TPM_DIGEST DAA_digest; - TPM_DAA_CONTEXT_SEED DAA_contextSeed; - UINT8 DAA_scratch[256]; - UINT8 DAA_stage; -} TPM_DAA_CONTEXT; - -/// -/// Part 2, section 22.6: TPM_DAA_JOINDATA -/// -typedef struct tdTPM_DAA_JOINDATA { - UINT8 DAA_join_u0[128]; - UINT8 DAA_join_u1[138]; - TPM_DIGEST DAA_digest_n0; -} TPM_DAA_JOINDATA; - -/// -/// Part 2, section 22.8: TPM_DAA_BLOB -/// -typedef struct tdTPM_DAA_BLOB { - TPM_STRUCTURE_TAG tag; - TPM_RESOURCE_TYPE resourceType; - UINT8 label[16]; - TPM_DIGEST blobIntegrity; - UINT32 additionalSize; - UINT8 *additionalData; - UINT32 sensitiveSize; - UINT8 *sensitiveData; -} TPM_DAA_BLOB; - -/// -/// Part 2, section 22.9: TPM_DAA_SENSITIVE -/// -typedef struct tdTPM_DAA_SENSITIVE { - TPM_STRUCTURE_TAG tag; - UINT32 internalSize; - UINT8 *internalData; -} TPM_DAA_SENSITIVE; - - -// -// Part 2, section 23: Redirection -// - -/// -/// Part 2 section 23.1: TPM_REDIR_COMMAND -/// This section defines exactly one value but does not -/// give it a name. The definition of TPM_SetRedirection in Part3 -/// refers to exactly one name but does not give its value. We join -/// them here. -/// -#define TPM_REDIR_GPIO (0x00000001) - -/// -/// TPM Command Headers defined in Part 3 -/// -typedef struct tdTPM_RQU_COMMAND_HDR { - TPM_STRUCTURE_TAG tag; - UINT32 paramSize; - TPM_COMMAND_CODE ordinal; -} TPM_RQU_COMMAND_HDR; - -/// -/// TPM Response Headers defined in Part 3 -/// -typedef struct tdTPM_RSP_COMMAND_HDR { - TPM_STRUCTURE_TAG tag; - UINT32 paramSize; - TPM_RESULT returnCode; -} TPM_RSP_COMMAND_HDR; - -#pragma pack () - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/UefiTcgPlatform.h b/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/UefiTcgPlatform.h deleted file mode 100644 index 8bb7ea389..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/IndustryStandard/UefiTcgPlatform.h +++ /dev/null @@ -1,172 +0,0 @@ -/** @file - TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final - - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> - 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_TCG_PLATFORM_H__ -#define __UEFI_TCG_PLATFORM_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/IndustryStandard/Tpm12.h> -#include <ipxe/efi/Uefi.h> - -// -// Standard event types -// -#define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001) -#define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004) -#define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007) -#define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008) -#define EV_CPU_MICROCODE ((TCG_EVENTTYPE) 0x00000009) -#define EV_TABLE_OF_DEVICES ((TCG_EVENTTYPE) 0x0000000B) - -// -// EFI specific event types -// -#define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000) -#define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1) -#define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2) -#define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3) -#define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4) -#define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5) -#define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6) -#define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7) -#define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8) -#define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9) - -#define EFI_CALLING_EFI_APPLICATION \ - "Calling EFI Application from Boot Option" -#define EFI_RETURNING_FROM_EFI_APPLICATOIN \ - "Returning from EFI Application from Boot Option" -#define EFI_EXIT_BOOT_SERVICES_INVOCATION \ - "Exit Boot Services Invocation" -#define EFI_EXIT_BOOT_SERVICES_FAILED \ - "Exit Boot Services Returned with Failure" -#define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \ - "Exit Boot Services Returned with Success" - - -#define EV_POSTCODE_INFO_POST_CODE "POST CODE" -#define POST_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_POST_CODE) - 1) - -#define EV_POSTCODE_INFO_SMM_CODE "SMM CODE" -#define SMM_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_SMM_CODE) - 1) - -#define EV_POSTCODE_INFO_ACPI_DATA "ACPI DATA" -#define ACPI_DATA_LEN (sizeof(EV_POSTCODE_INFO_ACPI_DATA) - 1) - -#define EV_POSTCODE_INFO_BIS_CODE "BIS CODE" -#define BIS_CODE_LEN (sizeof(EV_POSTCODE_INFO_BIS_CODE) - 1) - -#define EV_POSTCODE_INFO_UEFI_PI "UEFI PI" -#define UEFI_PI_LEN (sizeof(EV_POSTCODE_INFO_UEFI_PI) - 1) - -#define EV_POSTCODE_INFO_OPROM "Embedded Option ROM" -#define OPROM_LEN (sizeof(EV_POSTCODE_INFO_OPROM) - 1) - -// -// Set structure alignment to 1-byte -// -#pragma pack (1) - -typedef UINT32 TCG_EVENTTYPE; -typedef TPM_PCRINDEX TCG_PCRINDEX; -typedef TPM_DIGEST TCG_DIGEST; -/// -/// Event Log Entry Structure Definition -/// -typedef struct tdTCG_PCR_EVENT { - TCG_PCRINDEX PCRIndex; ///< PCRIndex event extended to - TCG_EVENTTYPE EventType; ///< TCG EFI event type - TCG_DIGEST Digest; ///< Value extended into PCRIndex - UINT32 EventSize; ///< Size of the event data - UINT8 Event[1]; ///< The event data -} TCG_PCR_EVENT; - -#define TSS_EVENT_DATA_MAX_SIZE 256 - -/// -/// TCG_PCR_EVENT_HDR -/// -typedef struct tdTCG_PCR_EVENT_HDR { - TCG_PCRINDEX PCRIndex; - TCG_EVENTTYPE EventType; - TCG_DIGEST Digest; - UINT32 EventSize; -} TCG_PCR_EVENT_HDR; - -/// -/// EFI_PLATFORM_FIRMWARE_BLOB -/// -/// BlobLength should be of type UINTN but we use UINT64 here -/// because PEI is 32-bit while DXE is 64-bit on x64 platforms -/// -typedef struct tdEFI_PLATFORM_FIRMWARE_BLOB { - EFI_PHYSICAL_ADDRESS BlobBase; - UINT64 BlobLength; -} EFI_PLATFORM_FIRMWARE_BLOB; - -/// -/// EFI_IMAGE_LOAD_EVENT -/// -/// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION, -/// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER -/// -typedef struct tdEFI_IMAGE_LOAD_EVENT { - EFI_PHYSICAL_ADDRESS ImageLocationInMemory; - UINTN ImageLengthInMemory; - UINTN ImageLinkTimeAddress; - UINTN LengthOfDevicePath; - EFI_DEVICE_PATH_PROTOCOL DevicePath[1]; -} EFI_IMAGE_LOAD_EVENT; - -/// -/// EFI_HANDOFF_TABLE_POINTERS -/// -/// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate -/// the measurement of given configuration tables. -/// -typedef struct tdEFI_HANDOFF_TABLE_POINTERS { - UINTN NumberOfTables; - EFI_CONFIGURATION_TABLE TableEntry[1]; -} EFI_HANDOFF_TABLE_POINTERS; - -/// -/// EFI_VARIABLE_DATA -/// -/// This structure serves as the header for measuring variables. The name of the -/// variable (in Unicode format) should immediately follow, then the variable -/// data. -/// -typedef struct tdEFI_VARIABLE_DATA { - EFI_GUID VariableName; - UINTN UnicodeNameLength; - UINTN VariableDataLength; - CHAR16 UnicodeName[1]; - INT8 VariableData[1]; ///< Driver or platform-specific data -} EFI_VARIABLE_DATA; - -typedef struct tdEFI_GPT_DATA { - EFI_PARTITION_TABLE_HEADER EfiPartitionHeader; - UINTN NumberOfPartitions; - EFI_PARTITION_ENTRY Partitions[1]; -} EFI_GPT_DATA; - -// -// Restore original structure alignment -// -#pragma pack () - -#endif - - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/LICENCE b/qemu/roms/ipxe/src/include/ipxe/efi/LICENCE deleted file mode 100644 index 6c28e6f96..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/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 iPXE GPL licence. diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Library/BaseLib.h b/qemu/roms/ipxe/src/include/ipxe/efi/Library/BaseLib.h deleted file mode 100644 index e9c31d130..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Library/BaseLib.h +++ /dev/null @@ -1,7283 +0,0 @@ -/** @file - Provides string functions, linked list functions, math functions, synchronization - functions, and CPU architecture-specific functions. - -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> -Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> -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_LIB__ -#define __BASE_LIB__ - -FILE_LICENCE ( BSD3 ); - -// -// Definitions for architecture-specific types -// -#if defined (MDE_CPU_IA32) -/// -/// The IA-32 architecture context buffer used by SetJump() and LongJump(). -/// -typedef struct { - UINT32 Ebx; - UINT32 Esi; - UINT32 Edi; - UINT32 Ebp; - UINT32 Esp; - UINT32 Eip; -} BASE_LIBRARY_JUMP_BUFFER; - -#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4 - -#endif // defined (MDE_CPU_IA32) - -#if defined (MDE_CPU_IPF) - -/// -/// The Itanium architecture context buffer used by SetJump() and LongJump(). -/// -typedef struct { - UINT64 F2[2]; - UINT64 F3[2]; - UINT64 F4[2]; - UINT64 F5[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 R4; - UINT64 R5; - UINT64 R6; - UINT64 R7; - UINT64 SP; - UINT64 BR0; - UINT64 BR1; - UINT64 BR2; - UINT64 BR3; - UINT64 BR4; - UINT64 BR5; - UINT64 InitialUNAT; - UINT64 AfterSpillUNAT; - UINT64 PFS; - UINT64 BSP; - UINT64 Predicates; - UINT64 LoopCount; - UINT64 FPSR; -} BASE_LIBRARY_JUMP_BUFFER; - -#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 0x10 - -#endif // defined (MDE_CPU_IPF) - -#if defined (MDE_CPU_X64) -/// -/// The x64 architecture context buffer used by SetJump() and LongJump(). -/// -typedef struct { - UINT64 Rbx; - UINT64 Rsp; - UINT64 Rbp; - UINT64 Rdi; - UINT64 Rsi; - UINT64 R12; - UINT64 R13; - UINT64 R14; - UINT64 R15; - UINT64 Rip; - UINT64 MxCsr; - UINT8 XmmBuffer[160]; ///< XMM6-XMM15. -} BASE_LIBRARY_JUMP_BUFFER; - -#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8 - -#endif // defined (MDE_CPU_X64) - -#if defined (MDE_CPU_EBC) -/// -/// The EBC context buffer used by SetJump() and LongJump(). -/// -typedef struct { - UINT64 R0; - UINT64 R1; - UINT64 R2; - UINT64 R3; - UINT64 IP; -} BASE_LIBRARY_JUMP_BUFFER; - -#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8 - -#endif // defined (MDE_CPU_EBC) - -#if defined (MDE_CPU_ARM) - -typedef struct { - UINT32 R3; ///< A copy of R13. - UINT32 R4; - UINT32 R5; - UINT32 R6; - UINT32 R7; - UINT32 R8; - UINT32 R9; - UINT32 R10; - UINT32 R11; - UINT32 R12; - UINT32 R14; -} BASE_LIBRARY_JUMP_BUFFER; - -#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 4 - -#endif // defined (MDE_CPU_ARM) - -#if defined (MDE_CPU_AARCH64) -typedef struct { - // GP regs - UINT64 X19; - UINT64 X20; - UINT64 X21; - UINT64 X22; - UINT64 X23; - UINT64 X24; - UINT64 X25; - UINT64 X26; - UINT64 X27; - UINT64 X28; - UINT64 FP; - UINT64 LR; - UINT64 IP0; - - // FP regs - UINT64 D8; - UINT64 D9; - UINT64 D10; - UINT64 D11; - UINT64 D12; - UINT64 D13; - UINT64 D14; - UINT64 D15; -} BASE_LIBRARY_JUMP_BUFFER; - -#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8 - -#endif // defined (MDE_CPU_AARCH64) - - -// -// String Services -// - -/** - Copies one Null-terminated Unicode string to another Null-terminated Unicode - string and returns the new Unicode string. - - This function copies the contents of the Unicode string Source to the Unicode - string Destination, and returns Destination. If Source and Destination - overlap, then the results are undefined. - - If Destination is NULL, then ASSERT(). - If Destination is not aligned on a 16-bit boundary, then ASSERT(). - If Source is NULL, then ASSERT(). - If Source is not aligned on a 16-bit boundary, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Source contains more than - PcdMaximumUnicodeStringLength Unicode characters not including the - Null-terminator, then ASSERT(). - - @param Destination The pointer to a Null-terminated Unicode string. - @param Source The pointer to a Null-terminated Unicode string. - - @return Destination. - -**/ -CHAR16 * -EFIAPI -StrCpy ( - OUT CHAR16 *Destination, - IN CONST CHAR16 *Source - ); - - -/** - Copies up to a specified length from one Null-terminated Unicode string to - another Null-terminated Unicode string and returns the new Unicode string. - - This function copies the contents of the Unicode string Source to the Unicode - string Destination, and returns Destination. At most, Length Unicode - characters are copied from Source to Destination. If Length is 0, then - Destination is returned unmodified. If Length is greater that the number of - Unicode characters in Source, then Destination is padded with Null Unicode - characters. If Source and Destination overlap, then the results are - undefined. - - If Length > 0 and Destination is NULL, then ASSERT(). - If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT(). - If Length > 0 and Source is NULL, then ASSERT(). - If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Length is greater than - PcdMaximumUnicodeStringLength, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Source contains more than - PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, - then ASSERT(). - - @param Destination The pointer to a Null-terminated Unicode string. - @param Source The pointer to a Null-terminated Unicode string. - @param Length The maximum number of Unicode characters to copy. - - @return Destination. - -**/ -CHAR16 * -EFIAPI -StrnCpy ( - OUT CHAR16 *Destination, - IN CONST CHAR16 *Source, - IN UINTN Length - ); - - -/** - Returns the length of a Null-terminated Unicode string. - - This function returns the number of Unicode characters in the Null-terminated - Unicode string specified by String. - - If String is NULL, then ASSERT(). - If String is not aligned on a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more than - PcdMaximumUnicodeStringLength Unicode characters not including the - Null-terminator, then ASSERT(). - - @param String Pointer to a Null-terminated Unicode string. - - @return The length of String. - -**/ -UINTN -EFIAPI -StrLen ( - IN CONST CHAR16 *String - ); - - -/** - Returns the size of a Null-terminated Unicode string in bytes, including the - Null terminator. - - This function returns the size, in bytes, of the Null-terminated Unicode string - specified by String. - - If String is NULL, then ASSERT(). - If String is not aligned on a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and String contains more than - PcdMaximumUnicodeStringLength Unicode characters not including the - Null-terminator, then ASSERT(). - - @param String The pointer to a Null-terminated Unicode string. - - @return The size of String. - -**/ -UINTN -EFIAPI -StrSize ( - IN CONST CHAR16 *String - ); - - -/** - Compares two Null-terminated Unicode strings, and returns the difference - between the first mismatched Unicode characters. - - This function compares the Null-terminated Unicode string FirstString to the - Null-terminated Unicode string SecondString. If FirstString is identical to - SecondString, then 0 is returned. Otherwise, the value returned is the first - mismatched Unicode character in SecondString subtracted from the first - mismatched Unicode character in FirstString. - - If FirstString is NULL, then ASSERT(). - If FirstString is not aligned on a 16-bit boundary, then ASSERT(). - If SecondString is NULL, then ASSERT(). - If SecondString is not aligned on a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more - than PcdMaximumUnicodeStringLength Unicode characters not including the - Null-terminator, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more - than PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). - - @param FirstString The pointer to a Null-terminated Unicode string. - @param SecondString The pointer to a Null-terminated Unicode string. - - @retval 0 FirstString is identical to SecondString. - @return others FirstString is not identical to SecondString. - -**/ -INTN -EFIAPI -StrCmp ( - IN CONST CHAR16 *FirstString, - IN CONST CHAR16 *SecondString - ); - - -/** - Compares up to a specified length the contents of two Null-terminated Unicode strings, - and returns the difference between the first mismatched Unicode characters. - - This function compares the Null-terminated Unicode string FirstString to the - Null-terminated Unicode string SecondString. At most, Length Unicode - characters will be compared. If Length is 0, then 0 is returned. If - FirstString is identical to SecondString, then 0 is returned. Otherwise, the - value returned is the first mismatched Unicode character in SecondString - subtracted from the first mismatched Unicode character in FirstString. - - If Length > 0 and FirstString is NULL, then ASSERT(). - If Length > 0 and FirstString is not aligned on a 16-bit boundary, then ASSERT(). - If Length > 0 and SecondString is NULL, then ASSERT(). - If Length > 0 and SecondString is not aligned on a 16-bit boundary, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Length is greater than - PcdMaximumUnicodeStringLength, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more than - PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, - then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more than - PcdMaximumUnicodeStringLength Unicode characters, not including the Null-terminator, - then ASSERT(). - - @param FirstString The pointer to a Null-terminated Unicode string. - @param SecondString The pointer to a Null-terminated Unicode string. - @param Length The maximum number of Unicode characters to compare. - - @retval 0 FirstString is identical to SecondString. - @return others FirstString is not identical to SecondString. - -**/ -INTN -EFIAPI -StrnCmp ( - IN CONST CHAR16 *FirstString, - IN CONST CHAR16 *SecondString, - IN UINTN Length - ); - - -/** - Concatenates one Null-terminated Unicode string to another Null-terminated - Unicode string, and returns the concatenated Unicode string. - - This function concatenates two Null-terminated Unicode strings. The contents - of Null-terminated Unicode string Source are concatenated to the end of - Null-terminated Unicode string Destination. The Null-terminated concatenated - Unicode String is returned. If Source and Destination overlap, then the - results are undefined. - - If Destination is NULL, then ASSERT(). - If Destination is not aligned on a 16-bit boundary, then ASSERT(). - If Source is NULL, then ASSERT(). - If Source is not aligned on a 16-bit boundary, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Destination contains more - than PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Source contains more than - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination - and Source results in a Unicode string with more than - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). - - @param Destination The pointer to a Null-terminated Unicode string. - @param Source The pointer to a Null-terminated Unicode string. - - @return Destination. - -**/ -CHAR16 * -EFIAPI -StrCat ( - IN OUT CHAR16 *Destination, - IN CONST CHAR16 *Source - ); - - -/** - Concatenates up to a specified length one Null-terminated Unicode to the end - of another Null-terminated Unicode string, and returns the concatenated - Unicode string. - - This function concatenates two Null-terminated Unicode strings. The contents - of Null-terminated Unicode string Source are concatenated to the end of - Null-terminated Unicode string Destination, and Destination is returned. At - most, Length Unicode characters are concatenated from Source to the end of - Destination, and Destination is always Null-terminated. If Length is 0, then - Destination is returned unmodified. If Source and Destination overlap, then - the results are undefined. - - If Destination is NULL, then ASSERT(). - If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT(). - If Length > 0 and Source is NULL, then ASSERT(). - If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Length is greater than - PcdMaximumUnicodeStringLength, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Destination contains more - than PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Source contains more than - PcdMaximumUnicodeStringLength Unicode characters, not including the - Null-terminator, then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination - and Source results in a Unicode string with more than PcdMaximumUnicodeStringLength - Unicode characters, not including the Null-terminator, then ASSERT(). - - @param Destination The pointer to a Null-terminated Unicode string. - @param Source The pointer to a Null-terminated Unicode string. - @param Length The maximum number of Unicode characters to concatenate from - Source. - - @return Destination. - -**/ -CHAR16 * -EFIAPI -StrnCat ( - IN OUT CHAR16 *Destination, - IN CONST CHAR16 *Source, - IN UINTN Length - ); - -/** - Returns the first occurrence of a Null-terminated Unicode sub-string - in a Null-terminated Unicode string. - - This function scans the contents of the Null-terminated Unicode string - specified by String and returns the first occurrence of SearchString. - If SearchString is not found in String, then NULL is returned. If - the length of SearchString is zero, then String is returned. - - If String is NULL, then ASSERT(). - If String is not aligned on a 16-bit boundary, then ASSERT(). - If SearchString is NULL, then ASSERT(). - If SearchString is not aligned on a 16-bit boundary, then ASSERT(). - - If PcdMaximumUnicodeStringLength is not zero, and SearchString - or String contains more than PcdMaximumUnicodeStringLength Unicode - characters, not including the Null-terminator, then ASSERT(). - - @param String The pointer to a Null-terminated Unicode string. - @param SearchString The pointer to a Null-terminated Unicode string to search for. - - @retval NULL If the SearchString does not appear in String. - @return others If there is a match. - -**/ -CHAR16 * -EFIAPI -StrStr ( - IN CONST CHAR16 *String, - IN CONST CHAR16 *SearchString - ); - -/** - Convert a Null-terminated Unicode decimal string to a value of - type UINTN. - - This function returns a value of type UINTN by interpreting the contents - of the Unicode string specified by String as a decimal number. The format - of the input Unicode string String is: - - [spaces] [decimal digits]. - - The valid decimal digit character is in the range [0-9]. The - function will ignore the pad space, which includes spaces or - tab characters, before [decimal digits]. The running zero in the - beginning of [decimal digits] will be ignored. Then, the function - stops at the first character that is a not a valid decimal character - or a Null-terminator, whichever one comes first. - - If String is NULL, then ASSERT(). - If String is not aligned in a 16-bit boundary, then ASSERT(). - If String has only pad spaces, then 0 is returned. - If String has no pad spaces or valid decimal digits, - then 0 is returned. - If the number represented by String overflows according - to the range defined by UINTN, then ASSERT(). - - If PcdMaximumUnicodeStringLength is not zero, and String contains - more than PcdMaximumUnicodeStringLength Unicode characters not including - the Null-terminator, then ASSERT(). - - @param String The pointer to a Null-terminated Unicode string. - - @retval Value translated from String. - -**/ -UINTN -EFIAPI -StrDecimalToUintn ( - IN CONST CHAR16 *String - ); - -/** - Convert a Null-terminated Unicode decimal string to a value of - type UINT64. - - This function returns a value of type UINT64 by interpreting the contents - of the Unicode string specified by String as a decimal number. The format - of the input Unicode string String is: - - [spaces] [decimal digits]. - - The valid decimal digit character is in the range [0-9]. The - function will ignore the pad space, which includes spaces or - tab characters, before [decimal digits]. The running zero in the - beginning of [decimal digits] will be ignored. Then, the function - stops at the first character that is a not a valid decimal character - or a Null-terminator, whichever one comes first. - - If String is NULL, then ASSERT(). - If String is not aligned in a 16-bit boundary, then ASSERT(). - If String has only pad spaces, then 0 is returned. - If String has no pad spaces or valid decimal digits, - then 0 is returned. - If the number represented by String overflows according - to the range defined by UINT64, then ASSERT(). - - If PcdMaximumUnicodeStringLength is not zero, and String contains - more than PcdMaximumUnicodeStringLength Unicode characters not including - the Null-terminator, then ASSERT(). - - @param String The pointer to a Null-terminated Unicode string. - - @retval Value translated from String. - -**/ -UINT64 -EFIAPI -StrDecimalToUint64 ( - IN CONST CHAR16 *String - ); - - -/** - Convert a Null-terminated Unicode hexadecimal string to a value of type UINTN. - - This function returns a value of type UINTN by interpreting the contents - of the Unicode string specified by String as a hexadecimal number. - The format of the input Unicode string String is: - - [spaces][zeros][x][hexadecimal digits]. - - The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. - The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. - If "x" appears in the input string, it must be prefixed with at least one 0. - The function will ignore the pad space, which includes spaces or tab characters, - before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or - [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the - first valid hexadecimal digit. Then, the function stops at the first character - that is a not a valid hexadecimal character or NULL, whichever one comes first. - - If String is NULL, then ASSERT(). - If String is not aligned in a 16-bit boundary, then ASSERT(). - If String has only pad spaces, then zero is returned. - If String has no leading pad spaces, leading zeros or valid hexadecimal digits, - then zero is returned. - If the number represented by String overflows according to the range defined by - UINTN, then ASSERT(). - - If PcdMaximumUnicodeStringLength is not zero, and String contains more than - PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, - then ASSERT(). - - @param String The pointer to a Null-terminated Unicode string. - - @retval Value translated from String. - -**/ -UINTN -EFIAPI -StrHexToUintn ( - IN CONST CHAR16 *String - ); - - -/** - Convert a Null-terminated Unicode hexadecimal string to a value of type UINT64. - - This function returns a value of type UINT64 by interpreting the contents - of the Unicode string specified by String as a hexadecimal number. - The format of the input Unicode string String is - - [spaces][zeros][x][hexadecimal digits]. - - The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. - The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. - If "x" appears in the input string, it must be prefixed with at least one 0. - The function will ignore the pad space, which includes spaces or tab characters, - before [zeros], [x] or [hexadecimal digit]. The running zero before [x] or - [hexadecimal digit] will be ignored. Then, the decoding starts after [x] or the - first valid hexadecimal digit. Then, the function stops at the first character that is - a not a valid hexadecimal character or NULL, whichever one comes first. - - If String is NULL, then ASSERT(). - If String is not aligned in a 16-bit boundary, then ASSERT(). - If String has only pad spaces, then zero is returned. - If String has no leading pad spaces, leading zeros or valid hexadecimal digits, - then zero is returned. - If the number represented by String overflows according to the range defined by - UINT64, then ASSERT(). - - If PcdMaximumUnicodeStringLength is not zero, and String contains more than - PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, - then ASSERT(). - - @param String The pointer to a Null-terminated Unicode string. - - @retval Value translated from String. - -**/ -UINT64 -EFIAPI -StrHexToUint64 ( - IN CONST CHAR16 *String - ); - -/** - Convert a Null-terminated Unicode string to a Null-terminated - ASCII string and returns the ASCII string. - - This function converts the content of the Unicode string Source - to the ASCII string Destination by copying the lower 8 bits of - each Unicode character. It returns Destination. - - The caller is responsible to make sure Destination points to a buffer with size - equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes. - - If any Unicode characters in Source contain non-zero value in - the upper 8 bits, then ASSERT(). - - If Destination is NULL, then ASSERT(). - If Source is NULL, then ASSERT(). - If Source is not aligned on a 16-bit boundary, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - - If PcdMaximumUnicodeStringLength is not zero, and Source contains - more than PcdMaximumUnicodeStringLength Unicode characters not including - the Null-terminator, then ASSERT(). - - If PcdMaximumAsciiStringLength is not zero, and Source contains more - than PcdMaximumAsciiStringLength Unicode characters not including the - Null-terminator, then ASSERT(). - - @param Source The pointer to a Null-terminated Unicode string. - @param Destination The pointer to a Null-terminated ASCII string. - - @return Destination. - -**/ -CHAR8 * -EFIAPI -UnicodeStrToAsciiStr ( - IN CONST CHAR16 *Source, - OUT CHAR8 *Destination - ); - - -/** - Copies one Null-terminated ASCII string to another Null-terminated ASCII - string and returns the new ASCII string. - - This function copies the contents of the ASCII string Source to the ASCII - string Destination, and returns Destination. If Source and Destination - overlap, then the results are undefined. - - If Destination is NULL, then ASSERT(). - If Source is NULL, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and Source contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - - @param Destination The pointer to a Null-terminated ASCII string. - @param Source The pointer to a Null-terminated ASCII string. - - @return Destination - -**/ -CHAR8 * -EFIAPI -AsciiStrCpy ( - OUT CHAR8 *Destination, - IN CONST CHAR8 *Source - ); - - -/** - Copies up to a specified length one Null-terminated ASCII string to another - Null-terminated ASCII string and returns the new ASCII string. - - This function copies the contents of the ASCII string Source to the ASCII - string Destination, and returns Destination. At most, Length ASCII characters - are copied from Source to Destination. If Length is 0, then Destination is - returned unmodified. If Length is greater that the number of ASCII characters - in Source, then Destination is padded with Null ASCII characters. If Source - and Destination overlap, then the results are undefined. - - If Destination is NULL, then ASSERT(). - If Source is NULL, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and Length is greater than - PcdMaximumAsciiStringLength, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and Source contains more than - PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, - then ASSERT(). - - @param Destination The pointer to a Null-terminated ASCII string. - @param Source The pointer to a Null-terminated ASCII string. - @param Length The maximum number of ASCII characters to copy. - - @return Destination - -**/ -CHAR8 * -EFIAPI -AsciiStrnCpy ( - OUT CHAR8 *Destination, - IN CONST CHAR8 *Source, - IN UINTN Length - ); - - -/** - Returns the length of a Null-terminated ASCII string. - - This function returns the number of ASCII characters in the Null-terminated - ASCII string specified by String. - - If Length > 0 and Destination is NULL, then ASSERT(). - If Length > 0 and Source is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and String contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - - @param String The pointer to a Null-terminated ASCII string. - - @return The length of String. - -**/ -UINTN -EFIAPI -AsciiStrLen ( - IN CONST CHAR8 *String - ); - - -/** - Returns the size of a Null-terminated ASCII string in bytes, including the - Null terminator. - - This function returns the size, in bytes, of the Null-terminated ASCII string - specified by String. - - If String is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and String contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - - @param String The pointer to a Null-terminated ASCII string. - - @return The size of String. - -**/ -UINTN -EFIAPI -AsciiStrSize ( - IN CONST CHAR8 *String - ); - - -/** - Compares two Null-terminated ASCII strings, and returns the difference - between the first mismatched ASCII characters. - - This function compares the Null-terminated ASCII string FirstString to the - Null-terminated ASCII string SecondString. If FirstString is identical to - SecondString, then 0 is returned. Otherwise, the value returned is the first - mismatched ASCII character in SecondString subtracted from the first - mismatched ASCII character in FirstString. - - If FirstString is NULL, then ASSERT(). - If SecondString is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and FirstString contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and SecondString contains more - than PcdMaximumAsciiStringLength ASCII characters not including the - Null-terminator, then ASSERT(). - - @param FirstString The pointer to a Null-terminated ASCII string. - @param SecondString The pointer to a Null-terminated ASCII string. - - @retval ==0 FirstString is identical to SecondString. - @retval !=0 FirstString is not identical to SecondString. - -**/ -INTN -EFIAPI -AsciiStrCmp ( - IN CONST CHAR8 *FirstString, - IN CONST CHAR8 *SecondString - ); - - -/** - Performs a case insensitive comparison of two Null-terminated ASCII strings, - and returns the difference between the first mismatched ASCII characters. - - This function performs a case insensitive comparison of the Null-terminated - ASCII string FirstString to the Null-terminated ASCII string SecondString. If - FirstString is identical to SecondString, then 0 is returned. Otherwise, the - value returned is the first mismatched lower case ASCII character in - SecondString subtracted from the first mismatched lower case ASCII character - in FirstString. - - If FirstString is NULL, then ASSERT(). - If SecondString is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and FirstString contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and SecondString contains more - than PcdMaximumAsciiStringLength ASCII characters not including the - Null-terminator, then ASSERT(). - - @param FirstString The pointer to a Null-terminated ASCII string. - @param SecondString The pointer to a Null-terminated ASCII string. - - @retval ==0 FirstString is identical to SecondString using case insensitive - comparisons. - @retval !=0 FirstString is not identical to SecondString using case - insensitive comparisons. - -**/ -INTN -EFIAPI -AsciiStriCmp ( - IN CONST CHAR8 *FirstString, - IN CONST CHAR8 *SecondString - ); - - -/** - Compares two Null-terminated ASCII strings with maximum lengths, and returns - the difference between the first mismatched ASCII characters. - - This function compares the Null-terminated ASCII string FirstString to the - Null-terminated ASCII string SecondString. At most, Length ASCII characters - will be compared. If Length is 0, then 0 is returned. If FirstString is - identical to SecondString, then 0 is returned. Otherwise, the value returned - is the first mismatched ASCII character in SecondString subtracted from the - first mismatched ASCII character in FirstString. - - If Length > 0 and FirstString is NULL, then ASSERT(). - If Length > 0 and SecondString is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and Length is greater than - PcdMaximumAsciiStringLength, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and FirstString contains more than - PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, - then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and SecondString contains more than - PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, - then ASSERT(). - - @param FirstString The pointer to a Null-terminated ASCII string. - @param SecondString The pointer to a Null-terminated ASCII string. - @param Length The maximum number of ASCII characters for compare. - - @retval ==0 FirstString is identical to SecondString. - @retval !=0 FirstString is not identical to SecondString. - -**/ -INTN -EFIAPI -AsciiStrnCmp ( - IN CONST CHAR8 *FirstString, - IN CONST CHAR8 *SecondString, - IN UINTN Length - ); - - -/** - Concatenates one Null-terminated ASCII string to another Null-terminated - ASCII string, and returns the concatenated ASCII string. - - This function concatenates two Null-terminated ASCII strings. The contents of - Null-terminated ASCII string Source are concatenated to the end of Null- - terminated ASCII string Destination. The Null-terminated concatenated ASCII - String is returned. - - If Destination is NULL, then ASSERT(). - If Source is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and Destination contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and Source contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - If PcdMaximumAsciiStringLength is not zero and concatenating Destination and - Source results in a ASCII string with more than PcdMaximumAsciiStringLength - ASCII characters, then ASSERT(). - - @param Destination The pointer to a Null-terminated ASCII string. - @param Source The pointer to a Null-terminated ASCII string. - - @return Destination - -**/ -CHAR8 * -EFIAPI -AsciiStrCat ( - IN OUT CHAR8 *Destination, - IN CONST CHAR8 *Source - ); - - -/** - Concatenates up to a specified length one Null-terminated ASCII string to - the end of another Null-terminated ASCII string, and returns the - concatenated ASCII string. - - This function concatenates two Null-terminated ASCII strings. The contents - of Null-terminated ASCII string Source are concatenated to the end of Null- - terminated ASCII string Destination, and Destination is returned. At most, - Length ASCII characters are concatenated from Source to the end of - Destination, and Destination is always Null-terminated. If Length is 0, then - Destination is returned unmodified. If Source and Destination overlap, then - the results are undefined. - - If Length > 0 and Destination is NULL, then ASSERT(). - If Length > 0 and Source is NULL, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and Length is greater than - PcdMaximumAsciiStringLength, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and Destination contains more than - PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, - then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and Source contains more than - PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator, - then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and - Source results in a ASCII string with more than PcdMaximumAsciiStringLength - ASCII characters, not including the Null-terminator, then ASSERT(). - - @param Destination The pointer to a Null-terminated ASCII string. - @param Source The pointer to a Null-terminated ASCII string. - @param Length The maximum number of ASCII characters to concatenate from - Source. - - @return Destination - -**/ -CHAR8 * -EFIAPI -AsciiStrnCat ( - IN OUT CHAR8 *Destination, - IN CONST CHAR8 *Source, - IN UINTN Length - ); - - -/** - Returns the first occurrence of a Null-terminated ASCII sub-string - in a Null-terminated ASCII string. - - This function scans the contents of the ASCII string specified by String - and returns the first occurrence of SearchString. If SearchString is not - found in String, then NULL is returned. If the length of SearchString is zero, - then String is returned. - - If String is NULL, then ASSERT(). - If SearchString is NULL, then ASSERT(). - - If PcdMaximumAsciiStringLength is not zero, and SearchString or - String contains more than PcdMaximumAsciiStringLength Unicode characters - not including the Null-terminator, then ASSERT(). - - @param String The pointer to a Null-terminated ASCII string. - @param SearchString The pointer to a Null-terminated ASCII string to search for. - - @retval NULL If the SearchString does not appear in String. - @retval others If there is a match return the first occurrence of SearchingString. - If the length of SearchString is zero,return String. - -**/ -CHAR8 * -EFIAPI -AsciiStrStr ( - IN CONST CHAR8 *String, - IN CONST CHAR8 *SearchString - ); - - -/** - Convert a Null-terminated ASCII decimal string to a value of type - UINTN. - - This function returns a value of type UINTN by interpreting the contents - of the ASCII string String as a decimal number. The format of the input - ASCII string String is: - - [spaces] [decimal digits]. - - The valid decimal digit character is in the range [0-9]. The function will - ignore the pad space, which includes spaces or tab characters, before the digits. - The running zero in the beginning of [decimal digits] will be ignored. Then, the - function stops at the first character that is a not a valid decimal character or - Null-terminator, whichever on comes first. - - If String has only pad spaces, then 0 is returned. - If String has no pad spaces or valid decimal digits, then 0 is returned. - If the number represented by String overflows according to the range defined by - UINTN, then ASSERT(). - If String is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - - @param String The pointer to a Null-terminated ASCII string. - - @retval The value translated from String. - -**/ -UINTN -EFIAPI -AsciiStrDecimalToUintn ( - IN CONST CHAR8 *String - ); - - -/** - Convert a Null-terminated ASCII decimal string to a value of type - UINT64. - - This function returns a value of type UINT64 by interpreting the contents - of the ASCII string String as a decimal number. The format of the input - ASCII string String is: - - [spaces] [decimal digits]. - - The valid decimal digit character is in the range [0-9]. The function will - ignore the pad space, which includes spaces or tab characters, before the digits. - The running zero in the beginning of [decimal digits] will be ignored. Then, the - function stops at the first character that is a not a valid decimal character or - Null-terminator, whichever on comes first. - - If String has only pad spaces, then 0 is returned. - If String has no pad spaces or valid decimal digits, then 0 is returned. - If the number represented by String overflows according to the range defined by - UINT64, then ASSERT(). - If String is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and String contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - - @param String The pointer to a Null-terminated ASCII string. - - @retval Value translated from String. - -**/ -UINT64 -EFIAPI -AsciiStrDecimalToUint64 ( - IN CONST CHAR8 *String - ); - - -/** - Convert a Null-terminated ASCII hexadecimal string to a value of type UINTN. - - This function returns a value of type UINTN by interpreting the contents of - the ASCII string String as a hexadecimal number. The format of the input ASCII - string String is: - - [spaces][zeros][x][hexadecimal digits]. - - The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. - The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" - appears in the input string, it must be prefixed with at least one 0. The function - will ignore the pad space, which includes spaces or tab characters, before [zeros], - [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits] - will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal - digit. Then, the function stops at the first character that is a not a valid - hexadecimal character or Null-terminator, whichever on comes first. - - If String has only pad spaces, then 0 is returned. - If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then - 0 is returned. - - If the number represented by String overflows according to the range defined by UINTN, - then ASSERT(). - If String is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, - and String contains more than PcdMaximumAsciiStringLength ASCII characters not including - the Null-terminator, then ASSERT(). - - @param String The pointer to a Null-terminated ASCII string. - - @retval Value translated from String. - -**/ -UINTN -EFIAPI -AsciiStrHexToUintn ( - IN CONST CHAR8 *String - ); - - -/** - Convert a Null-terminated ASCII hexadecimal string to a value of type UINT64. - - This function returns a value of type UINT64 by interpreting the contents of - the ASCII string String as a hexadecimal number. The format of the input ASCII - string String is: - - [spaces][zeros][x][hexadecimal digits]. - - The valid hexadecimal digit character is in the range [0-9], [a-f] and [A-F]. - The prefix "0x" is optional. Both "x" and "X" is allowed in "0x" prefix. If "x" - appears in the input string, it must be prefixed with at least one 0. The function - will ignore the pad space, which includes spaces or tab characters, before [zeros], - [x] or [hexadecimal digits]. The running zero before [x] or [hexadecimal digits] - will be ignored. Then, the decoding starts after [x] or the first valid hexadecimal - digit. Then, the function stops at the first character that is a not a valid - hexadecimal character or Null-terminator, whichever on comes first. - - If String has only pad spaces, then 0 is returned. - If String has no leading pad spaces, leading zeros or valid hexadecimal digits, then - 0 is returned. - - If the number represented by String overflows according to the range defined by UINT64, - then ASSERT(). - If String is NULL, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, - and String contains more than PcdMaximumAsciiStringLength ASCII characters not including - the Null-terminator, then ASSERT(). - - @param String The pointer to a Null-terminated ASCII string. - - @retval Value translated from String. - -**/ -UINT64 -EFIAPI -AsciiStrHexToUint64 ( - IN CONST CHAR8 *String - ); - - -/** - Convert one Null-terminated ASCII string to a Null-terminated - Unicode string and returns the Unicode string. - - This function converts the contents of the ASCII string Source to the Unicode - string Destination, and returns Destination. The function terminates the - Unicode string Destination by appending a Null-terminator character at the end. - The caller is responsible to make sure Destination points to a buffer with size - equal or greater than ((AsciiStrLen (Source) + 1) * sizeof (CHAR16)) in bytes. - - If Destination is NULL, then ASSERT(). - If Destination is not aligned on a 16-bit boundary, then ASSERT(). - If Source is NULL, then ASSERT(). - If Source and Destination overlap, then ASSERT(). - If PcdMaximumAsciiStringLength is not zero, and Source contains more than - PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, - then ASSERT(). - If PcdMaximumUnicodeStringLength is not zero, and Source contains more than - PcdMaximumUnicodeStringLength ASCII characters not including the - Null-terminator, then ASSERT(). - - @param Source The pointer to a Null-terminated ASCII string. - @param Destination The pointer to a Null-terminated Unicode string. - - @return Destination. - -**/ -CHAR16 * -EFIAPI -AsciiStrToUnicodeStr ( - IN CONST CHAR8 *Source, - OUT CHAR16 *Destination - ); - - -/** - Converts an 8-bit value to an 8-bit BCD value. - - Converts the 8-bit value specified by Value to BCD. The BCD value is - returned. - - If Value >= 100, then ASSERT(). - - @param Value The 8-bit value to convert to BCD. Range 0..99. - - @return The BCD value. - -**/ -UINT8 -EFIAPI -DecimalToBcd8 ( - IN UINT8 Value - ); - - -/** - Converts an 8-bit BCD value to an 8-bit value. - - Converts the 8-bit BCD value specified by Value to an 8-bit value. The 8-bit - value is returned. - - If Value >= 0xA0, then ASSERT(). - If (Value & 0x0F) >= 0x0A, then ASSERT(). - - @param Value The 8-bit BCD value to convert to an 8-bit value. - - @return The 8-bit value is returned. - -**/ -UINT8 -EFIAPI -BcdToDecimal8 ( - IN UINT8 Value - ); - - -// -// Linked List Functions and Macros -// - -/** - Initializes the head node of a doubly linked list that is declared as a - global variable in a module. - - Initializes the forward and backward links of a new linked list. After - initializing a linked list with this macro, the other linked list functions - may be used to add and remove nodes from the linked list. This macro results - in smaller executables by initializing the linked list in the data section, - instead if calling the InitializeListHead() function to perform the - equivalent operation. - - @param ListHead The head note of a list to initialize. - -**/ -#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&(ListHead), &(ListHead)} - - -/** - Initializes the head node of a doubly linked list, and returns the pointer to - the head node of the doubly linked list. - - Initializes the forward and backward links of a new linked list. After - initializing a linked list with this function, the other linked list - functions may be used to add and remove nodes from the linked list. It is up - to the caller of this function to allocate the memory for ListHead. - - If ListHead is NULL, then ASSERT(). - - @param ListHead A pointer to the head node of a new doubly linked list. - - @return ListHead - -**/ -LIST_ENTRY * -EFIAPI -InitializeListHead ( - IN OUT LIST_ENTRY *ListHead - ); - - -/** - Adds a node to the beginning of a doubly linked list, and returns the pointer - to the head node of the doubly linked list. - - Adds the node Entry at the beginning of the doubly linked list denoted by - ListHead, and returns ListHead. - - If ListHead is NULL, then ASSERT(). - If Entry is NULL, then ASSERT(). - If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or - InitializeListHead(), then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and prior to insertion the number - of nodes in ListHead, including the ListHead node, is greater than or - equal to PcdMaximumLinkedListLength, then ASSERT(). - - @param ListHead A pointer to the head node of a doubly linked list. - @param Entry A pointer to a node that is to be inserted at the beginning - of a doubly linked list. - - @return ListHead - -**/ -LIST_ENTRY * -EFIAPI -InsertHeadList ( - IN OUT LIST_ENTRY *ListHead, - IN OUT LIST_ENTRY *Entry - ); - - -/** - Adds a node to the end of a doubly linked list, and returns the pointer to - the head node of the doubly linked list. - - Adds the node Entry to the end of the doubly linked list denoted by ListHead, - and returns ListHead. - - If ListHead is NULL, then ASSERT(). - If Entry is NULL, then ASSERT(). - If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or - InitializeListHead(), then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and prior to insertion the number - of nodes in ListHead, including the ListHead node, is greater than or - equal to PcdMaximumLinkedListLength, then ASSERT(). - - @param ListHead A pointer to the head node of a doubly linked list. - @param Entry A pointer to a node that is to be added at the end of the - doubly linked list. - - @return ListHead - -**/ -LIST_ENTRY * -EFIAPI -InsertTailList ( - IN OUT LIST_ENTRY *ListHead, - IN OUT LIST_ENTRY *Entry - ); - - -/** - Retrieves the first node of a doubly linked list. - - Returns the first node of a doubly linked list. List must have been - initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). - If List is empty, then List is returned. - - If List is NULL, then ASSERT(). - If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or - InitializeListHead(), then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and the number of nodes - in List, including the List node, is greater than or equal to - PcdMaximumLinkedListLength, then ASSERT(). - - @param List A pointer to the head node of a doubly linked list. - - @return The first node of a doubly linked list. - @retval List The list is empty. - -**/ -LIST_ENTRY * -EFIAPI -GetFirstNode ( - IN CONST LIST_ENTRY *List - ); - - -/** - Retrieves the next node of a doubly linked list. - - Returns the node of a doubly linked list that follows Node. - List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE() - or InitializeListHead(). If List is empty, then List is returned. - - If List is NULL, then ASSERT(). - If Node is NULL, then ASSERT(). - If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or - InitializeListHead(), then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and List contains more than - PcdMaximumLinkedListLength nodes, then ASSERT(). - If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT(). - - @param List A pointer to the head node of a doubly linked list. - @param Node A pointer to a node in the doubly linked list. - - @return The pointer to the next node if one exists. Otherwise List is returned. - -**/ -LIST_ENTRY * -EFIAPI -GetNextNode ( - IN CONST LIST_ENTRY *List, - IN CONST LIST_ENTRY *Node - ); - - -/** - Retrieves the previous node of a doubly linked list. - - Returns the node of a doubly linked list that precedes Node. - List must have been initialized with INTIALIZE_LIST_HEAD_VARIABLE() - or InitializeListHead(). If List is empty, then List is returned. - - If List is NULL, then ASSERT(). - If Node is NULL, then ASSERT(). - If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or - InitializeListHead(), then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and List contains more than - PcdMaximumLinkedListLength nodes, then ASSERT(). - If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT(). - - @param List A pointer to the head node of a doubly linked list. - @param Node A pointer to a node in the doubly linked list. - - @return The pointer to the previous node if one exists. Otherwise List is returned. - -**/ -LIST_ENTRY * -EFIAPI -GetPreviousNode ( - IN CONST LIST_ENTRY *List, - IN CONST LIST_ENTRY *Node - ); - - -/** - Checks to see if a doubly linked list is empty or not. - - Checks to see if the doubly linked list is empty. If the linked list contains - zero nodes, this function returns TRUE. Otherwise, it returns FALSE. - - If ListHead is NULL, then ASSERT(). - If ListHead was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or - InitializeListHead(), then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and the number of nodes - in List, including the List node, is greater than or equal to - PcdMaximumLinkedListLength, then ASSERT(). - - @param ListHead A pointer to the head node of a doubly linked list. - - @retval TRUE The linked list is empty. - @retval FALSE The linked list is not empty. - -**/ -BOOLEAN -EFIAPI -IsListEmpty ( - IN CONST LIST_ENTRY *ListHead - ); - - -/** - Determines if a node in a doubly linked list is the head node of a the same - doubly linked list. This function is typically used to terminate a loop that - traverses all the nodes in a doubly linked list starting with the head node. - - Returns TRUE if Node is equal to List. Returns FALSE if Node is one of the - nodes in the doubly linked list specified by List. List must have been - initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). - - If List is NULL, then ASSERT(). - If Node is NULL, then ASSERT(). - If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(), - then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and the number of nodes - in List, including the List node, is greater than or equal to - PcdMaximumLinkedListLength, then ASSERT(). - If PcdVerifyNodeInList is TRUE and Node is not a node in List the and Node is not equal - to List, then ASSERT(). - - @param List A pointer to the head node of a doubly linked list. - @param Node A pointer to a node in the doubly linked list. - - @retval TRUE Node is the head of the doubly-linked list pointed by List. - @retval FALSE Node is not the head of the doubly-linked list pointed by List. - -**/ -BOOLEAN -EFIAPI -IsNull ( - IN CONST LIST_ENTRY *List, - IN CONST LIST_ENTRY *Node - ); - - -/** - Determines if a node the last node in a doubly linked list. - - Returns TRUE if Node is the last node in the doubly linked list specified by - List. Otherwise, FALSE is returned. List must have been initialized with - INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). - - If List is NULL, then ASSERT(). - If Node is NULL, then ASSERT(). - If List was not initialized with INTIALIZE_LIST_HEAD_VARIABLE() or - InitializeListHead(), then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and the number of nodes - in List, including the List node, is greater than or equal to - PcdMaximumLinkedListLength, then ASSERT(). - If PcdVerifyNodeInList is TRUE and Node is not a node in List, then ASSERT(). - - @param List A pointer to the head node of a doubly linked list. - @param Node A pointer to a node in the doubly linked list. - - @retval TRUE Node is the last node in the linked list. - @retval FALSE Node is not the last node in the linked list. - -**/ -BOOLEAN -EFIAPI -IsNodeAtEnd ( - IN CONST LIST_ENTRY *List, - IN CONST LIST_ENTRY *Node - ); - - -/** - Swaps the location of two nodes in a doubly linked list, and returns the - first node after the swap. - - If FirstEntry is identical to SecondEntry, then SecondEntry is returned. - Otherwise, the location of the FirstEntry node is swapped with the location - of the SecondEntry node in a doubly linked list. SecondEntry must be in the - same double linked list as FirstEntry and that double linked list must have - been initialized with INTIALIZE_LIST_HEAD_VARIABLE() or InitializeListHead(). - SecondEntry is returned after the nodes are swapped. - - If FirstEntry is NULL, then ASSERT(). - If SecondEntry is NULL, then ASSERT(). - If PcdVerifyNodeInList is TRUE and SecondEntry and FirstEntry are not in the - same linked list, then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and the number of nodes in the - linked list containing the FirstEntry and SecondEntry nodes, including - the FirstEntry and SecondEntry nodes, is greater than or equal to - PcdMaximumLinkedListLength, then ASSERT(). - - @param FirstEntry A pointer to a node in a linked list. - @param SecondEntry A pointer to another node in the same linked list. - - @return SecondEntry. - -**/ -LIST_ENTRY * -EFIAPI -SwapListEntries ( - IN OUT LIST_ENTRY *FirstEntry, - IN OUT LIST_ENTRY *SecondEntry - ); - - -/** - Removes a node from a doubly linked list, and returns the node that follows - the removed node. - - Removes the node Entry from a doubly linked list. It is up to the caller of - this function to release the memory used by this node if that is required. On - exit, the node following Entry in the doubly linked list is returned. If - Entry is the only node in the linked list, then the head node of the linked - list is returned. - - If Entry is NULL, then ASSERT(). - If Entry is the head node of an empty list, then ASSERT(). - If PcdMaximumLinkedListLength is not zero, and the number of nodes in the - linked list containing Entry, including the Entry node, is greater than - or equal to PcdMaximumLinkedListLength, then ASSERT(). - - @param Entry A pointer to a node in a linked list. - - @return Entry. - -**/ -LIST_ENTRY * -EFIAPI -RemoveEntryList ( - IN CONST LIST_ENTRY *Entry - ); - -// -// Math Services -// - -/** - Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled - with zeros. The shifted value is returned. - - This function shifts the 64-bit value Operand to the left by Count bits. The - low Count bits are set to zero. The shifted value is returned. - - If Count is greater than 63, then ASSERT(). - - @param Operand The 64-bit operand to shift left. - @param Count The number of bits to shift left. - - @return Operand << Count. - -**/ -UINT64 -EFIAPI -LShiftU64 ( - IN UINT64 Operand, - IN UINTN Count - ); - - -/** - Shifts a 64-bit integer right between 0 and 63 bits. This high bits are - filled with zeros. The shifted value is returned. - - This function shifts the 64-bit value Operand to the right by Count bits. The - high Count bits are set to zero. The shifted value is returned. - - If Count is greater than 63, then ASSERT(). - - @param Operand The 64-bit operand to shift right. - @param Count The number of bits to shift right. - - @return Operand >> Count - -**/ -UINT64 -EFIAPI -RShiftU64 ( - IN UINT64 Operand, - IN UINTN Count - ); - - -/** - Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled - with original integer's bit 63. The shifted value is returned. - - This function shifts the 64-bit value Operand to the right by Count bits. The - high Count bits are set to bit 63 of Operand. The shifted value is returned. - - If Count is greater than 63, then ASSERT(). - - @param Operand The 64-bit operand to shift right. - @param Count The number of bits to shift right. - - @return Operand >> Count - -**/ -UINT64 -EFIAPI -ARShiftU64 ( - IN UINT64 Operand, - IN UINTN Count - ); - - -/** - Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits - with the high bits that were rotated. - - This function rotates the 32-bit value Operand to the left by Count bits. The - low Count bits are fill with the high Count bits of Operand. The rotated - value is returned. - - If Count is greater than 31, then ASSERT(). - - @param Operand The 32-bit operand to rotate left. - @param Count The number of bits to rotate left. - - @return Operand << Count - -**/ -UINT32 -EFIAPI -LRotU32 ( - IN UINT32 Operand, - IN UINTN Count - ); - - -/** - Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits - with the low bits that were rotated. - - This function rotates the 32-bit value Operand to the right by Count bits. - The high Count bits are fill with the low Count bits of Operand. The rotated - value is returned. - - If Count is greater than 31, then ASSERT(). - - @param Operand The 32-bit operand to rotate right. - @param Count The number of bits to rotate right. - - @return Operand >> Count - -**/ -UINT32 -EFIAPI -RRotU32 ( - IN UINT32 Operand, - IN UINTN Count - ); - - -/** - Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits - with the high bits that were rotated. - - This function rotates the 64-bit value Operand to the left by Count bits. The - low Count bits are fill with the high Count bits of Operand. The rotated - value is returned. - - If Count is greater than 63, then ASSERT(). - - @param Operand The 64-bit operand to rotate left. - @param Count The number of bits to rotate left. - - @return Operand << Count - -**/ -UINT64 -EFIAPI -LRotU64 ( - IN UINT64 Operand, - IN UINTN Count - ); - - -/** - Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits - with the high low bits that were rotated. - - This function rotates the 64-bit value Operand to the right by Count bits. - The high Count bits are fill with the low Count bits of Operand. The rotated - value is returned. - - If Count is greater than 63, then ASSERT(). - - @param Operand The 64-bit operand to rotate right. - @param Count The number of bits to rotate right. - - @return Operand >> Count - -**/ -UINT64 -EFIAPI -RRotU64 ( - IN UINT64 Operand, - IN UINTN Count - ); - - -/** - Returns the bit position of the lowest bit set in a 32-bit value. - - This function computes the bit position of the lowest bit set in the 32-bit - value specified by Operand. If Operand is zero, then -1 is returned. - Otherwise, a value between 0 and 31 is returned. - - @param Operand The 32-bit operand to evaluate. - - @retval 0..31 The lowest bit set in Operand was found. - @retval -1 Operand is zero. - -**/ -INTN -EFIAPI -LowBitSet32 ( - IN UINT32 Operand - ); - - -/** - Returns the bit position of the lowest bit set in a 64-bit value. - - This function computes the bit position of the lowest bit set in the 64-bit - value specified by Operand. If Operand is zero, then -1 is returned. - Otherwise, a value between 0 and 63 is returned. - - @param Operand The 64-bit operand to evaluate. - - @retval 0..63 The lowest bit set in Operand was found. - @retval -1 Operand is zero. - - -**/ -INTN -EFIAPI -LowBitSet64 ( - IN UINT64 Operand - ); - - -/** - Returns the bit position of the highest bit set in a 32-bit value. Equivalent - to log2(x). - - This function computes the bit position of the highest bit set in the 32-bit - value specified by Operand. If Operand is zero, then -1 is returned. - Otherwise, a value between 0 and 31 is returned. - - @param Operand The 32-bit operand to evaluate. - - @retval 0..31 Position of the highest bit set in Operand if found. - @retval -1 Operand is zero. - -**/ -INTN -EFIAPI -HighBitSet32 ( - IN UINT32 Operand - ); - - -/** - Returns the bit position of the highest bit set in a 64-bit value. Equivalent - to log2(x). - - This function computes the bit position of the highest bit set in the 64-bit - value specified by Operand. If Operand is zero, then -1 is returned. - Otherwise, a value between 0 and 63 is returned. - - @param Operand The 64-bit operand to evaluate. - - @retval 0..63 Position of the highest bit set in Operand if found. - @retval -1 Operand is zero. - -**/ -INTN -EFIAPI -HighBitSet64 ( - IN UINT64 Operand - ); - - -/** - Returns the value of the highest bit set in a 32-bit value. Equivalent to - 1 << log2(x). - - This function computes the value of the highest bit set in the 32-bit value - specified by Operand. If Operand is zero, then zero is returned. - - @param Operand The 32-bit operand to evaluate. - - @return 1 << HighBitSet32(Operand) - @retval 0 Operand is zero. - -**/ -UINT32 -EFIAPI -GetPowerOfTwo32 ( - IN UINT32 Operand - ); - - -/** - Returns the value of the highest bit set in a 64-bit value. Equivalent to - 1 << log2(x). - - This function computes the value of the highest bit set in the 64-bit value - specified by Operand. If Operand is zero, then zero is returned. - - @param Operand The 64-bit operand to evaluate. - - @return 1 << HighBitSet64(Operand) - @retval 0 Operand is zero. - -**/ -UINT64 -EFIAPI -GetPowerOfTwo64 ( - IN UINT64 Operand - ); - - -/** - Switches the endianness of a 16-bit integer. - - This function swaps the bytes in a 16-bit unsigned value to switch the value - from little endian to big endian or vice versa. The byte swapped value is - returned. - - @param Value A 16-bit unsigned value. - - @return The byte swapped Value. - -**/ -UINT16 -EFIAPI -SwapBytes16 ( - IN UINT16 Value - ); - - -/** - Switches the endianness of a 32-bit integer. - - This function swaps the bytes in a 32-bit unsigned value to switch the value - from little endian to big endian or vice versa. The byte swapped value is - returned. - - @param Value A 32-bit unsigned value. - - @return The byte swapped Value. - -**/ -UINT32 -EFIAPI -SwapBytes32 ( - IN UINT32 Value - ); - - -/** - Switches the endianness of a 64-bit integer. - - This function swaps the bytes in a 64-bit unsigned value to switch the value - from little endian to big endian or vice versa. The byte swapped value is - returned. - - @param Value A 64-bit unsigned value. - - @return The byte swapped Value. - -**/ -UINT64 -EFIAPI -SwapBytes64 ( - IN UINT64 Value - ); - - -/** - Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and - generates a 64-bit unsigned result. - - This function multiples the 64-bit unsigned value Multiplicand by the 32-bit - unsigned value Multiplier and generates a 64-bit unsigned result. This 64- - bit unsigned result is returned. - - @param Multiplicand A 64-bit unsigned value. - @param Multiplier A 32-bit unsigned value. - - @return Multiplicand * Multiplier - -**/ -UINT64 -EFIAPI -MultU64x32 ( - IN UINT64 Multiplicand, - IN UINT32 Multiplier - ); - - -/** - Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and - generates a 64-bit unsigned result. - - This function multiples the 64-bit unsigned value Multiplicand by the 64-bit - unsigned value Multiplier and generates a 64-bit unsigned result. This 64- - bit unsigned result is returned. - - @param Multiplicand A 64-bit unsigned value. - @param Multiplier A 64-bit unsigned value. - - @return Multiplicand * Multiplier. - -**/ -UINT64 -EFIAPI -MultU64x64 ( - IN UINT64 Multiplicand, - IN UINT64 Multiplier - ); - - -/** - Multiples a 64-bit signed integer by a 64-bit signed integer and generates a - 64-bit signed result. - - This function multiples the 64-bit signed value Multiplicand by the 64-bit - signed value Multiplier and generates a 64-bit signed result. This 64-bit - signed result is returned. - - @param Multiplicand A 64-bit signed value. - @param Multiplier A 64-bit signed value. - - @return Multiplicand * Multiplier - -**/ -INT64 -EFIAPI -MultS64x64 ( - IN INT64 Multiplicand, - IN INT64 Multiplier - ); - - -/** - Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates - a 64-bit unsigned result. - - This function divides the 64-bit unsigned value Dividend by the 32-bit - unsigned value Divisor and generates a 64-bit unsigned quotient. This - function returns the 64-bit unsigned quotient. - - If Divisor is 0, then ASSERT(). - - @param Dividend A 64-bit unsigned value. - @param Divisor A 32-bit unsigned value. - - @return Dividend / Divisor. - -**/ -UINT64 -EFIAPI -DivU64x32 ( - IN UINT64 Dividend, - IN UINT32 Divisor - ); - - -/** - Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates - a 32-bit unsigned remainder. - - This function divides the 64-bit unsigned value Dividend by the 32-bit - unsigned value Divisor and generates a 32-bit remainder. This function - returns the 32-bit unsigned remainder. - - If Divisor is 0, then ASSERT(). - - @param Dividend A 64-bit unsigned value. - @param Divisor A 32-bit unsigned value. - - @return Dividend % Divisor. - -**/ -UINT32 -EFIAPI -ModU64x32 ( - IN UINT64 Dividend, - IN UINT32 Divisor - ); - - -/** - Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates - a 64-bit unsigned result and an optional 32-bit unsigned remainder. - - This function divides the 64-bit unsigned value Dividend by the 32-bit - unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder - is not NULL, then the 32-bit unsigned remainder is returned in Remainder. - This function returns the 64-bit unsigned quotient. - - If Divisor is 0, then ASSERT(). - - @param Dividend A 64-bit unsigned value. - @param Divisor A 32-bit unsigned value. - @param Remainder A pointer to a 32-bit unsigned value. This parameter is - optional and may be NULL. - - @return Dividend / Divisor. - -**/ -UINT64 -EFIAPI -DivU64x32Remainder ( - IN UINT64 Dividend, - IN UINT32 Divisor, - OUT UINT32 *Remainder OPTIONAL - ); - - -/** - Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates - a 64-bit unsigned result and an optional 64-bit unsigned remainder. - - This function divides the 64-bit unsigned value Dividend by the 64-bit - unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder - is not NULL, then the 64-bit unsigned remainder is returned in Remainder. - This function returns the 64-bit unsigned quotient. - - If Divisor is 0, then ASSERT(). - - @param Dividend A 64-bit unsigned value. - @param Divisor A 64-bit unsigned value. - @param Remainder A pointer to a 64-bit unsigned value. This parameter is - optional and may be NULL. - - @return Dividend / Divisor. - -**/ -UINT64 -EFIAPI -DivU64x64Remainder ( - IN UINT64 Dividend, - IN UINT64 Divisor, - OUT UINT64 *Remainder OPTIONAL - ); - - -/** - Divides a 64-bit signed integer by a 64-bit signed integer and generates a - 64-bit signed result and a optional 64-bit signed remainder. - - This function divides the 64-bit signed value Dividend by the 64-bit signed - value Divisor and generates a 64-bit signed quotient. If Remainder is not - NULL, then the 64-bit signed remainder is returned in Remainder. This - function returns the 64-bit signed quotient. - - It is the caller's responsibility to not call this function with a Divisor of 0. - If Divisor is 0, then the quotient and remainder should be assumed to be - the largest negative integer. - - If Divisor is 0, then ASSERT(). - - @param Dividend A 64-bit signed value. - @param Divisor A 64-bit signed value. - @param Remainder A pointer to a 64-bit signed value. This parameter is - optional and may be NULL. - - @return Dividend / Divisor. - -**/ -INT64 -EFIAPI -DivS64x64Remainder ( - IN INT64 Dividend, - IN INT64 Divisor, - OUT INT64 *Remainder OPTIONAL - ); - - -/** - Reads a 16-bit value from memory that may be unaligned. - - This function returns the 16-bit value pointed to by Buffer. The function - guarantees that the read operation does not produce an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 16-bit value that may be unaligned. - - @return The 16-bit value read from Buffer. - -**/ -UINT16 -EFIAPI -ReadUnaligned16 ( - IN CONST UINT16 *Buffer - ); - - -/** - Writes a 16-bit value to memory that may be unaligned. - - This function writes the 16-bit value specified by Value to Buffer. Value is - returned. The function guarantees that the write operation does not produce - an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 16-bit value that may be unaligned. - @param Value 16-bit value to write to Buffer. - - @return The 16-bit value to write to Buffer. - -**/ -UINT16 -EFIAPI -WriteUnaligned16 ( - OUT UINT16 *Buffer, - IN UINT16 Value - ); - - -/** - Reads a 24-bit value from memory that may be unaligned. - - This function returns the 24-bit value pointed to by Buffer. The function - guarantees that the read operation does not produce an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 24-bit value that may be unaligned. - - @return The 24-bit value read from Buffer. - -**/ -UINT32 -EFIAPI -ReadUnaligned24 ( - IN CONST UINT32 *Buffer - ); - - -/** - Writes a 24-bit value to memory that may be unaligned. - - This function writes the 24-bit value specified by Value to Buffer. Value is - returned. The function guarantees that the write operation does not produce - an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 24-bit value that may be unaligned. - @param Value 24-bit value to write to Buffer. - - @return The 24-bit value to write to Buffer. - -**/ -UINT32 -EFIAPI -WriteUnaligned24 ( - OUT UINT32 *Buffer, - IN UINT32 Value - ); - - -/** - Reads a 32-bit value from memory that may be unaligned. - - This function returns the 32-bit value pointed to by Buffer. The function - guarantees that the read operation does not produce an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 32-bit value that may be unaligned. - - @return The 32-bit value read from Buffer. - -**/ -UINT32 -EFIAPI -ReadUnaligned32 ( - IN CONST UINT32 *Buffer - ); - - -/** - Writes a 32-bit value to memory that may be unaligned. - - This function writes the 32-bit value specified by Value to Buffer. Value is - returned. The function guarantees that the write operation does not produce - an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 32-bit value that may be unaligned. - @param Value 32-bit value to write to Buffer. - - @return The 32-bit value to write to Buffer. - -**/ -UINT32 -EFIAPI -WriteUnaligned32 ( - OUT UINT32 *Buffer, - IN UINT32 Value - ); - - -/** - Reads a 64-bit value from memory that may be unaligned. - - This function returns the 64-bit value pointed to by Buffer. The function - guarantees that the read operation does not produce an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 64-bit value that may be unaligned. - - @return The 64-bit value read from Buffer. - -**/ -UINT64 -EFIAPI -ReadUnaligned64 ( - IN CONST UINT64 *Buffer - ); - - -/** - Writes a 64-bit value to memory that may be unaligned. - - This function writes the 64-bit value specified by Value to Buffer. Value is - returned. The function guarantees that the write operation does not produce - an alignment fault. - - If the Buffer is NULL, then ASSERT(). - - @param Buffer The pointer to a 64-bit value that may be unaligned. - @param Value 64-bit value to write to Buffer. - - @return The 64-bit value to write to Buffer. - -**/ -UINT64 -EFIAPI -WriteUnaligned64 ( - OUT UINT64 *Buffer, - IN UINT64 Value - ); - - -// -// Bit Field Functions -// - -/** - Returns a bit field from an 8-bit value. - - Returns the bitfield specified by the StartBit and the EndBit from Operand. - - If 8-bit operations are not supported, then ASSERT(). - If StartBit is greater than 7, then ASSERT(). - If EndBit is greater than 7, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..7. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..7. - - @return The bit field read. - -**/ -UINT8 -EFIAPI -BitFieldRead8 ( - IN UINT8 Operand, - IN UINTN StartBit, - IN UINTN EndBit - ); - - -/** - Writes a bit field to an 8-bit value, and returns the result. - - Writes Value to the bit field specified by the StartBit and the EndBit in - Operand. All other bits in Operand are preserved. The new 8-bit value is - returned. - - If 8-bit operations are not supported, then ASSERT(). - If StartBit is greater than 7, then ASSERT(). - If EndBit is greater than 7, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..7. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..7. - @param Value New value of the bit field. - - @return The new 8-bit value. - -**/ -UINT8 -EFIAPI -BitFieldWrite8 ( - IN UINT8 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT8 Value - ); - - -/** - Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the - result. - - Performs a bitwise OR between the bit field specified by StartBit - and EndBit in Operand and the value specified by OrData. All other bits in - Operand are preserved. The new 8-bit value is returned. - - If 8-bit operations are not supported, then ASSERT(). - If StartBit is greater than 7, then ASSERT(). - If EndBit is greater than 7, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..7. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..7. - @param OrData The value to OR with the read value from the value - - @return The new 8-bit value. - -**/ -UINT8 -EFIAPI -BitFieldOr8 ( - IN UINT8 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT8 OrData - ); - - -/** - Reads a bit field from an 8-bit value, performs a bitwise AND, and returns - the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData. All other bits in Operand are - preserved. The new 8-bit value is returned. - - If 8-bit operations are not supported, then ASSERT(). - If StartBit is greater than 7, then ASSERT(). - If EndBit is greater than 7, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..7. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..7. - @param AndData The value to AND with the read value from the value. - - @return The new 8-bit value. - -**/ -UINT8 -EFIAPI -BitFieldAnd8 ( - IN UINT8 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT8 AndData - ); - - -/** - Reads a bit field from an 8-bit value, performs a bitwise AND followed by a - bitwise OR, and returns the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData, followed by a bitwise - OR with value specified by OrData. All other bits in Operand are - preserved. The new 8-bit value is returned. - - If 8-bit operations are not supported, then ASSERT(). - If StartBit is greater than 7, then ASSERT(). - If EndBit is greater than 7, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..7. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..7. - @param AndData The value to AND with the read value from the value. - @param OrData The value to OR with the result of the AND operation. - - @return The new 8-bit value. - -**/ -UINT8 -EFIAPI -BitFieldAndThenOr8 ( - IN UINT8 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT8 AndData, - IN UINT8 OrData - ); - - -/** - Returns a bit field from a 16-bit value. - - Returns the bitfield specified by the StartBit and the EndBit from Operand. - - If 16-bit operations are not supported, then ASSERT(). - If StartBit is greater than 15, then ASSERT(). - If EndBit is greater than 15, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..15. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..15. - - @return The bit field read. - -**/ -UINT16 -EFIAPI -BitFieldRead16 ( - IN UINT16 Operand, - IN UINTN StartBit, - IN UINTN EndBit - ); - - -/** - Writes a bit field to a 16-bit value, and returns the result. - - Writes Value to the bit field specified by the StartBit and the EndBit in - Operand. All other bits in Operand are preserved. The new 16-bit value is - returned. - - If 16-bit operations are not supported, then ASSERT(). - If StartBit is greater than 15, then ASSERT(). - If EndBit is greater than 15, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..15. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..15. - @param Value New value of the bit field. - - @return The new 16-bit value. - -**/ -UINT16 -EFIAPI -BitFieldWrite16 ( - IN UINT16 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT16 Value - ); - - -/** - Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the - result. - - Performs a bitwise OR between the bit field specified by StartBit - and EndBit in Operand and the value specified by OrData. All other bits in - Operand are preserved. The new 16-bit value is returned. - - If 16-bit operations are not supported, then ASSERT(). - If StartBit is greater than 15, then ASSERT(). - If EndBit is greater than 15, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..15. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..15. - @param OrData The value to OR with the read value from the value - - @return The new 16-bit value. - -**/ -UINT16 -EFIAPI -BitFieldOr16 ( - IN UINT16 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT16 OrData - ); - - -/** - Reads a bit field from a 16-bit value, performs a bitwise AND, and returns - the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData. All other bits in Operand are - preserved. The new 16-bit value is returned. - - If 16-bit operations are not supported, then ASSERT(). - If StartBit is greater than 15, then ASSERT(). - If EndBit is greater than 15, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..15. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..15. - @param AndData The value to AND with the read value from the value - - @return The new 16-bit value. - -**/ -UINT16 -EFIAPI -BitFieldAnd16 ( - IN UINT16 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT16 AndData - ); - - -/** - Reads a bit field from a 16-bit value, performs a bitwise AND followed by a - bitwise OR, and returns the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData, followed by a bitwise - OR with value specified by OrData. All other bits in Operand are - preserved. The new 16-bit value is returned. - - If 16-bit operations are not supported, then ASSERT(). - If StartBit is greater than 15, then ASSERT(). - If EndBit is greater than 15, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..15. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..15. - @param AndData The value to AND with the read value from the value. - @param OrData The value to OR with the result of the AND operation. - - @return The new 16-bit value. - -**/ -UINT16 -EFIAPI -BitFieldAndThenOr16 ( - IN UINT16 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT16 AndData, - IN UINT16 OrData - ); - - -/** - Returns a bit field from a 32-bit value. - - Returns the bitfield specified by the StartBit and the EndBit from Operand. - - If 32-bit operations are not supported, then ASSERT(). - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - - @return The bit field read. - -**/ -UINT32 -EFIAPI -BitFieldRead32 ( - IN UINT32 Operand, - IN UINTN StartBit, - IN UINTN EndBit - ); - - -/** - Writes a bit field to a 32-bit value, and returns the result. - - Writes Value to the bit field specified by the StartBit and the EndBit in - Operand. All other bits in Operand are preserved. The new 32-bit value is - returned. - - If 32-bit operations are not supported, then ASSERT(). - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param Value New value of the bit field. - - @return The new 32-bit value. - -**/ -UINT32 -EFIAPI -BitFieldWrite32 ( - IN UINT32 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 Value - ); - - -/** - Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the - result. - - Performs a bitwise OR between the bit field specified by StartBit - and EndBit in Operand and the value specified by OrData. All other bits in - Operand are preserved. The new 32-bit value is returned. - - If 32-bit operations are not supported, then ASSERT(). - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param OrData The value to OR with the read value from the value. - - @return The new 32-bit value. - -**/ -UINT32 -EFIAPI -BitFieldOr32 ( - IN UINT32 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 OrData - ); - - -/** - Reads a bit field from a 32-bit value, performs a bitwise AND, and returns - the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData. All other bits in Operand are - preserved. The new 32-bit value is returned. - - If 32-bit operations are not supported, then ASSERT(). - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param AndData The value to AND with the read value from the value - - @return The new 32-bit value. - -**/ -UINT32 -EFIAPI -BitFieldAnd32 ( - IN UINT32 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 AndData - ); - - -/** - Reads a bit field from a 32-bit value, performs a bitwise AND followed by a - bitwise OR, and returns the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData, followed by a bitwise - OR with value specified by OrData. All other bits in Operand are - preserved. The new 32-bit value is returned. - - If 32-bit operations are not supported, then ASSERT(). - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param AndData The value to AND with the read value from the value. - @param OrData The value to OR with the result of the AND operation. - - @return The new 32-bit value. - -**/ -UINT32 -EFIAPI -BitFieldAndThenOr32 ( - IN UINT32 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 AndData, - IN UINT32 OrData - ); - - -/** - Returns a bit field from a 64-bit value. - - Returns the bitfield specified by the StartBit and the EndBit from Operand. - - If 64-bit operations are not supported, then ASSERT(). - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - - @return The bit field read. - -**/ -UINT64 -EFIAPI -BitFieldRead64 ( - IN UINT64 Operand, - IN UINTN StartBit, - IN UINTN EndBit - ); - - -/** - Writes a bit field to a 64-bit value, and returns the result. - - Writes Value to the bit field specified by the StartBit and the EndBit in - Operand. All other bits in Operand are preserved. The new 64-bit value is - returned. - - If 64-bit operations are not supported, then ASSERT(). - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param Value New value of the bit field. - - @return The new 64-bit value. - -**/ -UINT64 -EFIAPI -BitFieldWrite64 ( - IN UINT64 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 Value - ); - - -/** - Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the - result. - - Performs a bitwise OR between the bit field specified by StartBit - and EndBit in Operand and the value specified by OrData. All other bits in - Operand are preserved. The new 64-bit value is returned. - - If 64-bit operations are not supported, then ASSERT(). - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param OrData The value to OR with the read value from the value - - @return The new 64-bit value. - -**/ -UINT64 -EFIAPI -BitFieldOr64 ( - IN UINT64 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 OrData - ); - - -/** - Reads a bit field from a 64-bit value, performs a bitwise AND, and returns - the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData. All other bits in Operand are - preserved. The new 64-bit value is returned. - - If 64-bit operations are not supported, then ASSERT(). - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param AndData The value to AND with the read value from the value - - @return The new 64-bit value. - -**/ -UINT64 -EFIAPI -BitFieldAnd64 ( - IN UINT64 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 AndData - ); - - -/** - Reads a bit field from a 64-bit value, performs a bitwise AND followed by a - bitwise OR, and returns the result. - - Performs a bitwise AND between the bit field specified by StartBit and EndBit - in Operand and the value specified by AndData, followed by a bitwise - OR with value specified by OrData. All other bits in Operand are - preserved. The new 64-bit value is returned. - - If 64-bit operations are not supported, then ASSERT(). - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Operand Operand on which to perform the bitfield operation. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param AndData The value to AND with the read value from the value. - @param OrData The value to OR with the result of the AND operation. - - @return The new 64-bit value. - -**/ -UINT64 -EFIAPI -BitFieldAndThenOr64 ( - IN UINT64 Operand, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 AndData, - IN UINT64 OrData - ); - -// -// Base Library Checksum Functions -// - -/** - Returns the sum of all elements in a buffer in unit of UINT8. - During calculation, the carry bits are dropped. - - This function calculates the sum of all elements in a buffer - in unit of UINT8. The carry bits in result of addition are dropped. - The result is returned as UINT8. If Length is Zero, then Zero is - returned. - - If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the sum operation. - @param Length The size, in bytes, of Buffer. - - @return Sum The sum of Buffer with carry bits dropped during additions. - -**/ -UINT8 -EFIAPI -CalculateSum8 ( - IN CONST UINT8 *Buffer, - IN UINTN Length - ); - - -/** - Returns the two's complement checksum of all elements in a buffer - of 8-bit values. - - This function first calculates the sum of the 8-bit values in the - buffer specified by Buffer and Length. The carry bits in the result - of addition are dropped. Then, the two's complement of the sum is - returned. If Length is 0, then 0 is returned. - - If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the checksum operation. - @param Length The size, in bytes, of Buffer. - - @return Checksum The two's complement checksum of Buffer. - -**/ -UINT8 -EFIAPI -CalculateCheckSum8 ( - IN CONST UINT8 *Buffer, - IN UINTN Length - ); - - -/** - Returns the sum of all elements in a buffer of 16-bit values. During - calculation, the carry bits are dropped. - - This function calculates the sum of the 16-bit values in the buffer - specified by Buffer and Length. The carry bits in result of addition are dropped. - The 16-bit result is returned. If Length is 0, then 0 is returned. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 16-bit boundary, then ASSERT(). - If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the sum operation. - @param Length The size, in bytes, of Buffer. - - @return Sum The sum of Buffer with carry bits dropped during additions. - -**/ -UINT16 -EFIAPI -CalculateSum16 ( - IN CONST UINT16 *Buffer, - IN UINTN Length - ); - - -/** - Returns the two's complement checksum of all elements in a buffer of - 16-bit values. - - This function first calculates the sum of the 16-bit values in the buffer - specified by Buffer and Length. The carry bits in the result of addition - are dropped. Then, the two's complement of the sum is returned. If Length - is 0, then 0 is returned. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 16-bit boundary, then ASSERT(). - If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the checksum operation. - @param Length The size, in bytes, of Buffer. - - @return Checksum The two's complement checksum of Buffer. - -**/ -UINT16 -EFIAPI -CalculateCheckSum16 ( - IN CONST UINT16 *Buffer, - IN UINTN Length - ); - - -/** - Returns the sum of all elements in a buffer of 32-bit values. During - calculation, the carry bits are dropped. - - This function calculates the sum of the 32-bit values in the buffer - specified by Buffer and Length. The carry bits in result of addition are dropped. - The 32-bit result is returned. If Length is 0, then 0 is returned. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 32-bit boundary, then ASSERT(). - If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the sum operation. - @param Length The size, in bytes, of Buffer. - - @return Sum The sum of Buffer with carry bits dropped during additions. - -**/ -UINT32 -EFIAPI -CalculateSum32 ( - IN CONST UINT32 *Buffer, - IN UINTN Length - ); - - -/** - Returns the two's complement checksum of all elements in a buffer of - 32-bit values. - - This function first calculates the sum of the 32-bit values in the buffer - specified by Buffer and Length. The carry bits in the result of addition - are dropped. Then, the two's complement of the sum is returned. If Length - is 0, then 0 is returned. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 32-bit boundary, then ASSERT(). - If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the checksum operation. - @param Length The size, in bytes, of Buffer. - - @return Checksum The two's complement checksum of Buffer. - -**/ -UINT32 -EFIAPI -CalculateCheckSum32 ( - IN CONST UINT32 *Buffer, - IN UINTN Length - ); - - -/** - Returns the sum of all elements in a buffer of 64-bit values. During - calculation, the carry bits are dropped. - - This function calculates the sum of the 64-bit values in the buffer - specified by Buffer and Length. The carry bits in result of addition are dropped. - The 64-bit result is returned. If Length is 0, then 0 is returned. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 64-bit boundary, then ASSERT(). - If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the sum operation. - @param Length The size, in bytes, of Buffer. - - @return Sum The sum of Buffer with carry bits dropped during additions. - -**/ -UINT64 -EFIAPI -CalculateSum64 ( - IN CONST UINT64 *Buffer, - IN UINTN Length - ); - - -/** - Returns the two's complement checksum of all elements in a buffer of - 64-bit values. - - This function first calculates the sum of the 64-bit values in the buffer - specified by Buffer and Length. The carry bits in the result of addition - are dropped. Then, the two's complement of the sum is returned. If Length - is 0, then 0 is returned. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 64-bit boundary, then ASSERT(). - If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). - - @param Buffer The pointer to the buffer to carry out the checksum operation. - @param Length The size, in bytes, of Buffer. - - @return Checksum The two's complement checksum of Buffer. - -**/ -UINT64 -EFIAPI -CalculateCheckSum64 ( - IN CONST UINT64 *Buffer, - IN UINTN Length - ); - - -// -// Base Library CPU Functions -// - -/** - Function entry point used when a stack switch is requested with SwitchStack() - - @param Context1 Context1 parameter passed into SwitchStack(). - @param Context2 Context2 parameter passed into SwitchStack(). - -**/ -typedef -VOID -(EFIAPI *SWITCH_STACK_ENTRY_POINT)( - IN VOID *Context1, OPTIONAL - IN VOID *Context2 OPTIONAL - ); - - -/** - Used to serialize load and store operations. - - All loads and stores that proceed calls to this function are guaranteed to be - globally visible when this function returns. - -**/ -VOID -EFIAPI -MemoryFence ( - VOID - ); - - -/** - Saves the current CPU context that can be restored with a call to LongJump() - and returns 0. - - Saves the current CPU context in the buffer specified by JumpBuffer and - returns 0. The initial call to SetJump() must always return 0. Subsequent - calls to LongJump() cause a non-zero value to be returned by SetJump(). - - If JumpBuffer is NULL, then ASSERT(). - For Itanium processors, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT(). - - NOTE: The structure BASE_LIBRARY_JUMP_BUFFER is CPU architecture specific. - The same structure must never be used for more than one CPU architecture context. - For example, a BASE_LIBRARY_JUMP_BUFFER allocated by an IA-32 module must never be used from an x64 module. - SetJump()/LongJump() is not currently supported for the EBC processor type. - - @param JumpBuffer A pointer to CPU context buffer. - - @retval 0 Indicates a return from SetJump(). - -**/ -UINTN -EFIAPI -SetJump ( - OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer - ); - - -/** - Restores the CPU context that was saved with SetJump(). - - Restores the CPU context from the buffer specified by JumpBuffer. This - function never returns to the caller. Instead is resumes execution based on - the state of JumpBuffer. - - If JumpBuffer is NULL, then ASSERT(). - For Itanium processors, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT(). - If Value is 0, then ASSERT(). - - @param JumpBuffer A pointer to CPU context buffer. - @param Value The value to return when the SetJump() context is - restored and must be non-zero. - -**/ -VOID -EFIAPI -LongJump ( - IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, - IN UINTN Value - ); - - -/** - Enables CPU interrupts. - -**/ -VOID -EFIAPI -EnableInterrupts ( - VOID - ); - - -/** - Disables CPU interrupts. - -**/ -VOID -EFIAPI -DisableInterrupts ( - VOID - ); - - -/** - Disables CPU interrupts and returns the interrupt state prior to the disable - operation. - - @retval TRUE CPU interrupts were enabled on entry to this call. - @retval FALSE CPU interrupts were disabled on entry to this call. - -**/ -BOOLEAN -EFIAPI -SaveAndDisableInterrupts ( - VOID - ); - - -/** - Enables CPU interrupts for the smallest window required to capture any - pending interrupts. - -**/ -VOID -EFIAPI -EnableDisableInterrupts ( - VOID - ); - - -/** - Retrieves the current CPU interrupt state. - - Returns TRUE if interrupts are currently enabled. Otherwise - returns FALSE. - - @retval TRUE CPU interrupts are enabled. - @retval FALSE CPU interrupts are disabled. - -**/ -BOOLEAN -EFIAPI -GetInterruptState ( - VOID - ); - - -/** - Set the current CPU interrupt state. - - Sets the current CPU interrupt state to the state specified by - InterruptState. If InterruptState is TRUE, then interrupts are enabled. If - InterruptState is FALSE, then interrupts are disabled. InterruptState is - returned. - - @param InterruptState TRUE if interrupts should enabled. FALSE if - interrupts should be disabled. - - @return InterruptState - -**/ -BOOLEAN -EFIAPI -SetInterruptState ( - IN BOOLEAN InterruptState - ); - - -/** - Requests CPU to pause for a short period of time. - - Requests CPU to pause for a short period of time. Typically used in MP - systems to prevent memory starvation while waiting for a spin lock. - -**/ -VOID -EFIAPI -CpuPause ( - VOID - ); - - -/** - Transfers control to a function starting with a new stack. - - Transfers control to the function specified by EntryPoint using the - new stack specified by NewStack and passing in the parameters specified - by Context1 and Context2. Context1 and Context2 are optional and may - be NULL. The function EntryPoint must never return. This function - supports a variable number of arguments following the NewStack parameter. - These additional arguments are ignored on IA-32, x64, and EBC architectures. - Itanium processors expect one additional parameter of type VOID * that specifies - the new backing store pointer. - - If EntryPoint is NULL, then ASSERT(). - If NewStack is NULL, then ASSERT(). - - @param EntryPoint A pointer to function to call with the new stack. - @param Context1 A pointer to the context to pass into the EntryPoint - function. - @param Context2 A pointer to the context to pass into the EntryPoint - function. - @param NewStack A pointer to the new stack to use for the EntryPoint - function. - @param ... This variable argument list is ignored for IA-32, x64, and - EBC architectures. For Itanium processors, this variable - argument list is expected to contain a single parameter of - type VOID * that specifies the new backing store pointer. - - -**/ -VOID -EFIAPI -SwitchStack ( - IN SWITCH_STACK_ENTRY_POINT EntryPoint, - IN VOID *Context1, OPTIONAL - IN VOID *Context2, OPTIONAL - IN VOID *NewStack, - ... - ); - - -/** - Generates a breakpoint on the CPU. - - Generates a breakpoint on the CPU. The breakpoint must be implemented such - that code can resume normal execution after the breakpoint. - -**/ -VOID -EFIAPI -CpuBreakpoint ( - VOID - ); - - -/** - Executes an infinite loop. - - Forces the CPU to execute an infinite loop. A debugger may be used to skip - past the loop and the code that follows the loop must execute properly. This - implies that the infinite loop must not cause the code that follow it to be - optimized away. - -**/ -VOID -EFIAPI -CpuDeadLoop ( - VOID - ); - -#if defined (MDE_CPU_IPF) - -/** - Flush a range of cache lines in the cache coherency domain of the calling - CPU. - - Flushes the cache lines specified by Address and Length. If Address is not aligned - on a cache line boundary, then entire cache line containing Address is flushed. - If Address + Length is not aligned on a cache line boundary, then the entire cache - line containing Address + Length - 1 is flushed. This function may choose to flush - the entire cache if that is more efficient than flushing the specified range. If - Length is 0, the no cache lines are flushed. Address is returned. - This function is only available on Itanium processors. - - If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT(). - - @param Address The base address of the instruction lines to invalidate. If - the CPU is in a physical addressing mode, then Address is a - physical address. If the CPU is in a virtual addressing mode, - then Address is a virtual address. - - @param Length The number of bytes to invalidate from the instruction cache. - - @return Address. - -**/ -VOID * -EFIAPI -AsmFlushCacheRange ( - IN VOID *Address, - IN UINTN Length - ); - - -/** - Executes an FC instruction. - Executes an FC instruction on the cache line specified by Address. - The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary). - An implementation may flush a larger region. This function is only available on Itanium processors. - - @param Address The Address of cache line to be flushed. - - @return The address of FC instruction executed. - -**/ -UINT64 -EFIAPI -AsmFc ( - IN UINT64 Address - ); - - -/** - Executes an FC.I instruction. - Executes an FC.I instruction on the cache line specified by Address. - The cache line size affected is at least 32-bytes (aligned on a 32-byte boundary). - An implementation may flush a larger region. This function is only available on Itanium processors. - - @param Address The Address of cache line to be flushed. - - @return The address of the FC.I instruction executed. - -**/ -UINT64 -EFIAPI -AsmFci ( - IN UINT64 Address - ); - - -/** - Reads the current value of a Processor Identifier Register (CPUID). - - Reads and returns the current value of Processor Identifier Register specified by Index. - The Index of largest implemented CPUID (One less than the number of implemented CPUID - registers) is determined by CPUID [3] bits {7:0}. - No parameter checking is performed on Index. If the Index value is beyond the - implemented CPUID register range, a Reserved Register/Field fault may occur. The caller - must either guarantee that Index is valid, or the caller must set up fault handlers to - catch the faults. This function is only available on Itanium processors. - - @param Index The 8-bit Processor Identifier Register index to read. - - @return The current value of Processor Identifier Register specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadCpuid ( - IN UINT8 Index - ); - - -/** - Reads the current value of 64-bit Processor Status Register (PSR). - This function is only available on Itanium processors. - - @return The current value of PSR. - -**/ -UINT64 -EFIAPI -AsmReadPsr ( - VOID - ); - - -/** - Writes the current value of 64-bit Processor Status Register (PSR). - - No parameter checking is performed on Value. All bits of Value corresponding to - reserved fields of PSR must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to PSR. - - @return The 64-bit value written to the PSR. - -**/ -UINT64 -EFIAPI -AsmWritePsr ( - IN UINT64 Value - ); - - -/** - Reads the current value of 64-bit Kernel Register #0 (KR0). - - Reads and returns the current value of KR0. - This function is only available on Itanium processors. - - @return The current value of KR0. - -**/ -UINT64 -EFIAPI -AsmReadKr0 ( - VOID - ); - - -/** - Reads the current value of 64-bit Kernel Register #1 (KR1). - - Reads and returns the current value of KR1. - This function is only available on Itanium processors. - - @return The current value of KR1. - -**/ -UINT64 -EFIAPI -AsmReadKr1 ( - VOID - ); - - -/** - Reads the current value of 64-bit Kernel Register #2 (KR2). - - Reads and returns the current value of KR2. - This function is only available on Itanium processors. - - @return The current value of KR2. - -**/ -UINT64 -EFIAPI -AsmReadKr2 ( - VOID - ); - - -/** - Reads the current value of 64-bit Kernel Register #3 (KR3). - - Reads and returns the current value of KR3. - This function is only available on Itanium processors. - - @return The current value of KR3. - -**/ -UINT64 -EFIAPI -AsmReadKr3 ( - VOID - ); - - -/** - Reads the current value of 64-bit Kernel Register #4 (KR4). - - Reads and returns the current value of KR4. - This function is only available on Itanium processors. - - @return The current value of KR4. - -**/ -UINT64 -EFIAPI -AsmReadKr4 ( - VOID - ); - - -/** - Reads the current value of 64-bit Kernel Register #5 (KR5). - - Reads and returns the current value of KR5. - This function is only available on Itanium processors. - - @return The current value of KR5. - -**/ -UINT64 -EFIAPI -AsmReadKr5 ( - VOID - ); - - -/** - Reads the current value of 64-bit Kernel Register #6 (KR6). - - Reads and returns the current value of KR6. - This function is only available on Itanium processors. - - @return The current value of KR6. - -**/ -UINT64 -EFIAPI -AsmReadKr6 ( - VOID - ); - - -/** - Reads the current value of 64-bit Kernel Register #7 (KR7). - - Reads and returns the current value of KR7. - This function is only available on Itanium processors. - - @return The current value of KR7. - -**/ -UINT64 -EFIAPI -AsmReadKr7 ( - VOID - ); - - -/** - Write the current value of 64-bit Kernel Register #0 (KR0). - - Writes the current value of KR0. The 64-bit value written to - the KR0 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR0. - - @return The 64-bit value written to the KR0. - -**/ -UINT64 -EFIAPI -AsmWriteKr0 ( - IN UINT64 Value - ); - - -/** - Write the current value of 64-bit Kernel Register #1 (KR1). - - Writes the current value of KR1. The 64-bit value written to - the KR1 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR1. - - @return The 64-bit value written to the KR1. - -**/ -UINT64 -EFIAPI -AsmWriteKr1 ( - IN UINT64 Value - ); - - -/** - Write the current value of 64-bit Kernel Register #2 (KR2). - - Writes the current value of KR2. The 64-bit value written to - the KR2 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR2. - - @return The 64-bit value written to the KR2. - -**/ -UINT64 -EFIAPI -AsmWriteKr2 ( - IN UINT64 Value - ); - - -/** - Write the current value of 64-bit Kernel Register #3 (KR3). - - Writes the current value of KR3. The 64-bit value written to - the KR3 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR3. - - @return The 64-bit value written to the KR3. - -**/ -UINT64 -EFIAPI -AsmWriteKr3 ( - IN UINT64 Value - ); - - -/** - Write the current value of 64-bit Kernel Register #4 (KR4). - - Writes the current value of KR4. The 64-bit value written to - the KR4 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR4. - - @return The 64-bit value written to the KR4. - -**/ -UINT64 -EFIAPI -AsmWriteKr4 ( - IN UINT64 Value - ); - - -/** - Write the current value of 64-bit Kernel Register #5 (KR5). - - Writes the current value of KR5. The 64-bit value written to - the KR5 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR5. - - @return The 64-bit value written to the KR5. - -**/ -UINT64 -EFIAPI -AsmWriteKr5 ( - IN UINT64 Value - ); - - -/** - Write the current value of 64-bit Kernel Register #6 (KR6). - - Writes the current value of KR6. The 64-bit value written to - the KR6 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR6. - - @return The 64-bit value written to the KR6. - -**/ -UINT64 -EFIAPI -AsmWriteKr6 ( - IN UINT64 Value - ); - - -/** - Write the current value of 64-bit Kernel Register #7 (KR7). - - Writes the current value of KR7. The 64-bit value written to - the KR7 is returned. This function is only available on Itanium processors. - - @param Value The 64-bit value to write to KR7. - - @return The 64-bit value written to the KR7. - -**/ -UINT64 -EFIAPI -AsmWriteKr7 ( - IN UINT64 Value - ); - - -/** - Reads the current value of Interval Timer Counter Register (ITC). - - Reads and returns the current value of ITC. - This function is only available on Itanium processors. - - @return The current value of ITC. - -**/ -UINT64 -EFIAPI -AsmReadItc ( - VOID - ); - - -/** - Reads the current value of Interval Timer Vector Register (ITV). - - Reads and returns the current value of ITV. - This function is only available on Itanium processors. - - @return The current value of ITV. - -**/ -UINT64 -EFIAPI -AsmReadItv ( - VOID - ); - - -/** - Reads the current value of Interval Timer Match Register (ITM). - - Reads and returns the current value of ITM. - This function is only available on Itanium processors. - - @return The current value of ITM. -**/ -UINT64 -EFIAPI -AsmReadItm ( - VOID - ); - - -/** - Writes the current value of 64-bit Interval Timer Counter Register (ITC). - - Writes the current value of ITC. The 64-bit value written to the ITC is returned. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to ITC. - - @return The 64-bit value written to the ITC. - -**/ -UINT64 -EFIAPI -AsmWriteItc ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Interval Timer Match Register (ITM). - - Writes the current value of ITM. The 64-bit value written to the ITM is returned. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to ITM. - - @return The 64-bit value written to the ITM. - -**/ -UINT64 -EFIAPI -AsmWriteItm ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Interval Timer Vector Register (ITV). - - Writes the current value of ITV. The 64-bit value written to the ITV is returned. - No parameter checking is performed on Value. All bits of Value corresponding to - reserved fields of ITV must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to ITV. - - @return The 64-bit value written to the ITV. - -**/ -UINT64 -EFIAPI -AsmWriteItv ( - IN UINT64 Value - ); - - -/** - Reads the current value of Default Control Register (DCR). - - Reads and returns the current value of DCR. This function is only available on Itanium processors. - - @return The current value of DCR. - -**/ -UINT64 -EFIAPI -AsmReadDcr ( - VOID - ); - - -/** - Reads the current value of Interruption Vector Address Register (IVA). - - Reads and returns the current value of IVA. This function is only available on Itanium processors. - - @return The current value of IVA. -**/ -UINT64 -EFIAPI -AsmReadIva ( - VOID - ); - - -/** - Reads the current value of Page Table Address Register (PTA). - - Reads and returns the current value of PTA. This function is only available on Itanium processors. - - @return The current value of PTA. - -**/ -UINT64 -EFIAPI -AsmReadPta ( - VOID - ); - - -/** - Writes the current value of 64-bit Default Control Register (DCR). - - Writes the current value of DCR. The 64-bit value written to the DCR is returned. - No parameter checking is performed on Value. All bits of Value corresponding to - reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to DCR. - - @return The 64-bit value written to the DCR. - -**/ -UINT64 -EFIAPI -AsmWriteDcr ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Interruption Vector Address Register (IVA). - - Writes the current value of IVA. The 64-bit value written to the IVA is returned. - The size of vector table is 32 K bytes and is 32 K bytes aligned - the low 15 bits of Value is ignored when written. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to IVA. - - @return The 64-bit value written to the IVA. - -**/ -UINT64 -EFIAPI -AsmWriteIva ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Page Table Address Register (PTA). - - Writes the current value of PTA. The 64-bit value written to the PTA is returned. - No parameter checking is performed on Value. All bits of Value corresponding to - reserved fields of DCR must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to PTA. - - @return The 64-bit value written to the PTA. -**/ -UINT64 -EFIAPI -AsmWritePta ( - IN UINT64 Value - ); - - -/** - Reads the current value of Local Interrupt ID Register (LID). - - Reads and returns the current value of LID. This function is only available on Itanium processors. - - @return The current value of LID. - -**/ -UINT64 -EFIAPI -AsmReadLid ( - VOID - ); - - -/** - Reads the current value of External Interrupt Vector Register (IVR). - - Reads and returns the current value of IVR. This function is only available on Itanium processors. - - @return The current value of IVR. - -**/ -UINT64 -EFIAPI -AsmReadIvr ( - VOID - ); - - -/** - Reads the current value of Task Priority Register (TPR). - - Reads and returns the current value of TPR. This function is only available on Itanium processors. - - @return The current value of TPR. - -**/ -UINT64 -EFIAPI -AsmReadTpr ( - VOID - ); - - -/** - Reads the current value of External Interrupt Request Register #0 (IRR0). - - Reads and returns the current value of IRR0. This function is only available on Itanium processors. - - @return The current value of IRR0. - -**/ -UINT64 -EFIAPI -AsmReadIrr0 ( - VOID - ); - - -/** - Reads the current value of External Interrupt Request Register #1 (IRR1). - - Reads and returns the current value of IRR1. This function is only available on Itanium processors. - - @return The current value of IRR1. - -**/ -UINT64 -EFIAPI -AsmReadIrr1 ( - VOID - ); - - -/** - Reads the current value of External Interrupt Request Register #2 (IRR2). - - Reads and returns the current value of IRR2. This function is only available on Itanium processors. - - @return The current value of IRR2. - -**/ -UINT64 -EFIAPI -AsmReadIrr2 ( - VOID - ); - - -/** - Reads the current value of External Interrupt Request Register #3 (IRR3). - - Reads and returns the current value of IRR3. This function is only available on Itanium processors. - - @return The current value of IRR3. - -**/ -UINT64 -EFIAPI -AsmReadIrr3 ( - VOID - ); - - -/** - Reads the current value of Performance Monitor Vector Register (PMV). - - Reads and returns the current value of PMV. This function is only available on Itanium processors. - - @return The current value of PMV. - -**/ -UINT64 -EFIAPI -AsmReadPmv ( - VOID - ); - - -/** - Reads the current value of Corrected Machine Check Vector Register (CMCV). - - Reads and returns the current value of CMCV. This function is only available on Itanium processors. - - @return The current value of CMCV. - -**/ -UINT64 -EFIAPI -AsmReadCmcv ( - VOID - ); - - -/** - Reads the current value of Local Redirection Register #0 (LRR0). - - Reads and returns the current value of LRR0. This function is only available on Itanium processors. - - @return The current value of LRR0. - -**/ -UINT64 -EFIAPI -AsmReadLrr0 ( - VOID - ); - - -/** - Reads the current value of Local Redirection Register #1 (LRR1). - - Reads and returns the current value of LRR1. This function is only available on Itanium processors. - - @return The current value of LRR1. - -**/ -UINT64 -EFIAPI -AsmReadLrr1 ( - VOID - ); - - -/** - Writes the current value of 64-bit Page Local Interrupt ID Register (LID). - - Writes the current value of LID. The 64-bit value written to the LID is returned. - No parameter checking is performed on Value. All bits of Value corresponding to - reserved fields of LID must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to LID. - - @return The 64-bit value written to the LID. - -**/ -UINT64 -EFIAPI -AsmWriteLid ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Task Priority Register (TPR). - - Writes the current value of TPR. The 64-bit value written to the TPR is returned. - No parameter checking is performed on Value. All bits of Value corresponding to - reserved fields of TPR must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to TPR. - - @return The 64-bit value written to the TPR. - -**/ -UINT64 -EFIAPI -AsmWriteTpr ( - IN UINT64 Value - ); - - -/** - Performs a write operation on End OF External Interrupt Register (EOI). - - Writes a value of 0 to the EOI Register. This function is only available on Itanium processors. - -**/ -VOID -EFIAPI -AsmWriteEoi ( - VOID - ); - - -/** - Writes the current value of 64-bit Performance Monitor Vector Register (PMV). - - Writes the current value of PMV. The 64-bit value written to the PMV is returned. - No parameter checking is performed on Value. All bits of Value corresponding - to reserved fields of PMV must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to PMV. - - @return The 64-bit value written to the PMV. - -**/ -UINT64 -EFIAPI -AsmWritePmv ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Corrected Machine Check Vector Register (CMCV). - - Writes the current value of CMCV. The 64-bit value written to the CMCV is returned. - No parameter checking is performed on Value. All bits of Value corresponding - to reserved fields of CMCV must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to CMCV. - - @return The 64-bit value written to the CMCV. - -**/ -UINT64 -EFIAPI -AsmWriteCmcv ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Local Redirection Register #0 (LRR0). - - Writes the current value of LRR0. The 64-bit value written to the LRR0 is returned. - No parameter checking is performed on Value. All bits of Value corresponding - to reserved fields of LRR0 must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to LRR0. - - @return The 64-bit value written to the LRR0. - -**/ -UINT64 -EFIAPI -AsmWriteLrr0 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Local Redirection Register #1 (LRR1). - - Writes the current value of LRR1. The 64-bit value written to the LRR1 is returned. - No parameter checking is performed on Value. All bits of Value corresponding - to reserved fields of LRR1 must be 0 or a Reserved Register/Field fault may occur. - The caller must either guarantee that Value is valid, or the caller must - set up fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to LRR1. - - @return The 64-bit value written to the LRR1. - -**/ -UINT64 -EFIAPI -AsmWriteLrr1 ( - IN UINT64 Value - ); - - -/** - Reads the current value of Instruction Breakpoint Register (IBR). - - The Instruction Breakpoint Registers are used in pairs. The even numbered - registers contain breakpoint addresses, and the odd numbered registers contain - breakpoint mask conditions. At least four instruction registers pairs are implemented - on all processor models. Implemented registers are contiguous starting with - register 0. No parameter checking is performed on Index, and if the Index value - is beyond the implemented IBR register range, a Reserved Register/Field fault may - occur. The caller must either guarantee that Index is valid, or the caller must - set up fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Index The 8-bit Instruction Breakpoint Register index to read. - - @return The current value of Instruction Breakpoint Register specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadIbr ( - IN UINT8 Index - ); - - -/** - Reads the current value of Data Breakpoint Register (DBR). - - The Data Breakpoint Registers are used in pairs. The even numbered registers - contain breakpoint addresses, and odd numbered registers contain breakpoint - mask conditions. At least four data registers pairs are implemented on all processor - models. Implemented registers are contiguous starting with register 0. - No parameter checking is performed on Index. If the Index value is beyond - the implemented DBR register range, a Reserved Register/Field fault may occur. - The caller must either guarantee that Index is valid, or the caller must set up - fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Index The 8-bit Data Breakpoint Register index to read. - - @return The current value of Data Breakpoint Register specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadDbr ( - IN UINT8 Index - ); - - -/** - Reads the current value of Performance Monitor Configuration Register (PMC). - - All processor implementations provide at least four performance counters - (PMC/PMD [4]...PMC/PMD [7] pairs), and four performance monitor counter overflow - status registers (PMC [0]... PMC [3]). Processor implementations may provide - additional implementation-dependent PMC and PMD to increase the number of - 'generic' performance counters (PMC/PMD pairs). The remainder of PMC and PMD - register set is implementation dependent. No parameter checking is performed - on Index. If the Index value is beyond the implemented PMC register range, - zero value will be returned. - This function is only available on Itanium processors. - - @param Index The 8-bit Performance Monitor Configuration Register index to read. - - @return The current value of Performance Monitor Configuration Register - specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadPmc ( - IN UINT8 Index - ); - - -/** - Reads the current value of Performance Monitor Data Register (PMD). - - All processor implementations provide at least 4 performance counters - (PMC/PMD [4]...PMC/PMD [7] pairs), and 4 performance monitor counter - overflow status registers (PMC [0]... PMC [3]). Processor implementations may - provide additional implementation-dependent PMC and PMD to increase the number - of 'generic' performance counters (PMC/PMD pairs). The remainder of PMC and PMD - register set is implementation dependent. No parameter checking is performed - on Index. If the Index value is beyond the implemented PMD register range, - zero value will be returned. - This function is only available on Itanium processors. - - @param Index The 8-bit Performance Monitor Data Register index to read. - - @return The current value of Performance Monitor Data Register specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadPmd ( - IN UINT8 Index - ); - - -/** - Writes the current value of 64-bit Instruction Breakpoint Register (IBR). - - Writes current value of Instruction Breakpoint Register specified by Index. - The Instruction Breakpoint Registers are used in pairs. The even numbered - registers contain breakpoint addresses, and odd numbered registers contain - breakpoint mask conditions. At least four instruction registers pairs are implemented - on all processor models. Implemented registers are contiguous starting with - register 0. No parameter checking is performed on Index. If the Index value - is beyond the implemented IBR register range, a Reserved Register/Field fault may - occur. The caller must either guarantee that Index is valid, or the caller must - set up fault handlers to catch the faults. - This function is only available on Itanium processors. - - @param Index The 8-bit Instruction Breakpoint Register index to write. - @param Value The 64-bit value to write to IBR. - - @return The 64-bit value written to the IBR. - -**/ -UINT64 -EFIAPI -AsmWriteIbr ( - IN UINT8 Index, - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Data Breakpoint Register (DBR). - - Writes current value of Data Breakpoint Register specified by Index. - The Data Breakpoint Registers are used in pairs. The even numbered registers - contain breakpoint addresses, and odd numbered registers contain breakpoint - mask conditions. At least four data registers pairs are implemented on all processor - models. Implemented registers are contiguous starting with register 0. No parameter - checking is performed on Index. If the Index value is beyond the implemented - DBR register range, a Reserved Register/Field fault may occur. The caller must - either guarantee that Index is valid, or the caller must set up fault handlers to - catch the faults. - This function is only available on Itanium processors. - - @param Index The 8-bit Data Breakpoint Register index to write. - @param Value The 64-bit value to write to DBR. - - @return The 64-bit value written to the DBR. - -**/ -UINT64 -EFIAPI -AsmWriteDbr ( - IN UINT8 Index, - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Performance Monitor Configuration Register (PMC). - - Writes current value of Performance Monitor Configuration Register specified by Index. - All processor implementations provide at least four performance counters - (PMC/PMD [4]...PMC/PMD [7] pairs), and four performance monitor counter overflow status - registers (PMC [0]... PMC [3]). Processor implementations may provide additional - implementation-dependent PMC and PMD to increase the number of 'generic' performance - counters (PMC/PMD pairs). The remainder of PMC and PMD register set is implementation - dependent. No parameter checking is performed on Index. If the Index value is - beyond the implemented PMC register range, the write is ignored. - This function is only available on Itanium processors. - - @param Index The 8-bit Performance Monitor Configuration Register index to write. - @param Value The 64-bit value to write to PMC. - - @return The 64-bit value written to the PMC. - -**/ -UINT64 -EFIAPI -AsmWritePmc ( - IN UINT8 Index, - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit Performance Monitor Data Register (PMD). - - Writes current value of Performance Monitor Data Register specified by Index. - All processor implementations provide at least four performance counters - (PMC/PMD [4]...PMC/PMD [7] pairs), and four performance monitor counter overflow - status registers (PMC [0]... PMC [3]). Processor implementations may provide - additional implementation-dependent PMC and PMD to increase the number of 'generic' - performance counters (PMC/PMD pairs). The remainder of PMC and PMD register set - is implementation dependent. No parameter checking is performed on Index. If the - Index value is beyond the implemented PMD register range, the write is ignored. - This function is only available on Itanium processors. - - @param Index The 8-bit Performance Monitor Data Register index to write. - @param Value The 64-bit value to write to PMD. - - @return The 64-bit value written to the PMD. - -**/ -UINT64 -EFIAPI -AsmWritePmd ( - IN UINT8 Index, - IN UINT64 Value - ); - - -/** - Reads the current value of 64-bit Global Pointer (GP). - - Reads and returns the current value of GP. - This function is only available on Itanium processors. - - @return The current value of GP. - -**/ -UINT64 -EFIAPI -AsmReadGp ( - VOID - ); - - -/** - Write the current value of 64-bit Global Pointer (GP). - - Writes the current value of GP. The 64-bit value written to the GP is returned. - No parameter checking is performed on Value. - This function is only available on Itanium processors. - - @param Value The 64-bit value to write to GP. - - @return The 64-bit value written to the GP. - -**/ -UINT64 -EFIAPI -AsmWriteGp ( - IN UINT64 Value - ); - - -/** - Reads the current value of 64-bit Stack Pointer (SP). - - Reads and returns the current value of SP. - This function is only available on Itanium processors. - - @return The current value of SP. - -**/ -UINT64 -EFIAPI -AsmReadSp ( - VOID - ); - - -/// -/// Valid Index value for AsmReadControlRegister(). -/// -#define IPF_CONTROL_REGISTER_DCR 0 -#define IPF_CONTROL_REGISTER_ITM 1 -#define IPF_CONTROL_REGISTER_IVA 2 -#define IPF_CONTROL_REGISTER_PTA 8 -#define IPF_CONTROL_REGISTER_IPSR 16 -#define IPF_CONTROL_REGISTER_ISR 17 -#define IPF_CONTROL_REGISTER_IIP 19 -#define IPF_CONTROL_REGISTER_IFA 20 -#define IPF_CONTROL_REGISTER_ITIR 21 -#define IPF_CONTROL_REGISTER_IIPA 22 -#define IPF_CONTROL_REGISTER_IFS 23 -#define IPF_CONTROL_REGISTER_IIM 24 -#define IPF_CONTROL_REGISTER_IHA 25 -#define IPF_CONTROL_REGISTER_LID 64 -#define IPF_CONTROL_REGISTER_IVR 65 -#define IPF_CONTROL_REGISTER_TPR 66 -#define IPF_CONTROL_REGISTER_EOI 67 -#define IPF_CONTROL_REGISTER_IRR0 68 -#define IPF_CONTROL_REGISTER_IRR1 69 -#define IPF_CONTROL_REGISTER_IRR2 70 -#define IPF_CONTROL_REGISTER_IRR3 71 -#define IPF_CONTROL_REGISTER_ITV 72 -#define IPF_CONTROL_REGISTER_PMV 73 -#define IPF_CONTROL_REGISTER_CMCV 74 -#define IPF_CONTROL_REGISTER_LRR0 80 -#define IPF_CONTROL_REGISTER_LRR1 81 - -/** - Reads a 64-bit control register. - - Reads and returns the control register specified by Index. The valid Index valued - are defined above in "Related Definitions". - If Index is invalid then 0xFFFFFFFFFFFFFFFF is returned. This function is only - available on Itanium processors. - - @param Index The index of the control register to read. - - @return The control register specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadControlRegister ( - IN UINT64 Index - ); - - -/// -/// Valid Index value for AsmReadApplicationRegister(). -/// -#define IPF_APPLICATION_REGISTER_K0 0 -#define IPF_APPLICATION_REGISTER_K1 1 -#define IPF_APPLICATION_REGISTER_K2 2 -#define IPF_APPLICATION_REGISTER_K3 3 -#define IPF_APPLICATION_REGISTER_K4 4 -#define IPF_APPLICATION_REGISTER_K5 5 -#define IPF_APPLICATION_REGISTER_K6 6 -#define IPF_APPLICATION_REGISTER_K7 7 -#define IPF_APPLICATION_REGISTER_RSC 16 -#define IPF_APPLICATION_REGISTER_BSP 17 -#define IPF_APPLICATION_REGISTER_BSPSTORE 18 -#define IPF_APPLICATION_REGISTER_RNAT 19 -#define IPF_APPLICATION_REGISTER_FCR 21 -#define IPF_APPLICATION_REGISTER_EFLAG 24 -#define IPF_APPLICATION_REGISTER_CSD 25 -#define IPF_APPLICATION_REGISTER_SSD 26 -#define IPF_APPLICATION_REGISTER_CFLG 27 -#define IPF_APPLICATION_REGISTER_FSR 28 -#define IPF_APPLICATION_REGISTER_FIR 29 -#define IPF_APPLICATION_REGISTER_FDR 30 -#define IPF_APPLICATION_REGISTER_CCV 32 -#define IPF_APPLICATION_REGISTER_UNAT 36 -#define IPF_APPLICATION_REGISTER_FPSR 40 -#define IPF_APPLICATION_REGISTER_ITC 44 -#define IPF_APPLICATION_REGISTER_PFS 64 -#define IPF_APPLICATION_REGISTER_LC 65 -#define IPF_APPLICATION_REGISTER_EC 66 - -/** - Reads a 64-bit application register. - - Reads and returns the application register specified by Index. The valid Index - valued are defined above in "Related Definitions". - If Index is invalid then 0xFFFFFFFFFFFFFFFF is returned. This function is only - available on Itanium processors. - - @param Index The index of the application register to read. - - @return The application register specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadApplicationRegister ( - IN UINT64 Index - ); - - -/** - Reads the current value of a Machine Specific Register (MSR). - - Reads and returns the current value of the Machine Specific Register specified by Index. No - parameter checking is performed on Index, and if the Index value is beyond the implemented MSR - register range, a Reserved Register/Field fault may occur. The caller must either guarantee that - Index is valid, or the caller must set up fault handlers to catch the faults. This function is - only available on Itanium processors. - - @param Index The 8-bit Machine Specific Register index to read. - - @return The current value of the Machine Specific Register specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadMsr ( - IN UINT8 Index - ); - - -/** - Writes the current value of a Machine Specific Register (MSR). - - Writes Value to the Machine Specific Register specified by Index. Value is returned. No - parameter checking is performed on Index, and if the Index value is beyond the implemented MSR - register range, a Reserved Register/Field fault may occur. The caller must either guarantee that - Index is valid, or the caller must set up fault handlers to catch the faults. This function is - only available on Itanium processors. - - @param Index The 8-bit Machine Specific Register index to write. - @param Value The 64-bit value to write to the Machine Specific Register. - - @return The 64-bit value to write to the Machine Specific Register. - -**/ -UINT64 -EFIAPI -AsmWriteMsr ( - IN UINT8 Index, - IN UINT64 Value - ); - - -/** - Determines if the CPU is currently executing in virtual, physical, or mixed mode. - - Determines the current execution mode of the CPU. - If the CPU is in virtual mode(PSR.RT=1, PSR.DT=1, PSR.IT=1), then 1 is returned. - If the CPU is in physical mode(PSR.RT=0, PSR.DT=0, PSR.IT=0), then 0 is returned. - If the CPU is not in physical mode or virtual mode, then it is in mixed mode, - and -1 is returned. - This function is only available on Itanium processors. - - @retval 1 The CPU is in virtual mode. - @retval 0 The CPU is in physical mode. - @retval -1 The CPU is in mixed mode. - -**/ -INT64 -EFIAPI -AsmCpuVirtual ( - VOID - ); - - -/** - Makes a PAL procedure call. - - This is a wrapper function to make a PAL procedure call. Based on the Index - value this API will make static or stacked PAL call. The following table - describes the usage of PAL Procedure Index Assignment. Architected procedures - may be designated as required or optional. If a PAL procedure is specified - as optional, a unique return code of 0xFFFFFFFFFFFFFFFF is returned in the - Status field of the PAL_CALL_RETURN structure. - This indicates that the procedure is not present in this PAL implementation. - It is the caller's responsibility to check for this return code after calling - any optional PAL procedure. - No parameter checking is performed on the 5 input parameters, but there are - some common rules that the caller should follow when making a PAL call. Any - address passed to PAL as buffers for return parameters must be 8-byte aligned. - Unaligned addresses may cause undefined results. For those parameters defined - as reserved or some fields defined as reserved must be zero filled or the invalid - argument return value may be returned or undefined result may occur during the - execution of the procedure. If the PalEntryPoint does not point to a valid - PAL entry point then the system behavior is undefined. This function is only - available on Itanium processors. - - @param PalEntryPoint The PAL procedure calls entry point. - @param Index The PAL procedure Index number. - @param Arg2 The 2nd parameter for PAL procedure calls. - @param Arg3 The 3rd parameter for PAL procedure calls. - @param Arg4 The 4th parameter for PAL procedure calls. - - @return structure returned from the PAL Call procedure, including the status and return value. - -**/ -PAL_CALL_RETURN -EFIAPI -AsmPalCall ( - IN UINT64 PalEntryPoint, - IN UINT64 Index, - IN UINT64 Arg2, - IN UINT64 Arg3, - IN UINT64 Arg4 - ); -#endif - -#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64) -/// -/// IA32 and x64 Specific Functions. -/// Byte packed structure for 16-bit Real Mode EFLAGS. -/// -typedef union { - struct { - UINT32 CF:1; ///< Carry Flag. - UINT32 Reserved_0:1; ///< Reserved. - UINT32 PF:1; ///< Parity Flag. - UINT32 Reserved_1:1; ///< Reserved. - UINT32 AF:1; ///< Auxiliary Carry Flag. - UINT32 Reserved_2:1; ///< Reserved. - UINT32 ZF:1; ///< Zero Flag. - UINT32 SF:1; ///< Sign Flag. - UINT32 TF:1; ///< Trap Flag. - UINT32 IF:1; ///< Interrupt Enable Flag. - UINT32 DF:1; ///< Direction Flag. - UINT32 OF:1; ///< Overflow Flag. - UINT32 IOPL:2; ///< I/O Privilege Level. - UINT32 NT:1; ///< Nested Task. - UINT32 Reserved_3:1; ///< Reserved. - } Bits; - UINT16 Uint16; -} IA32_FLAGS16; - -/// -/// Byte packed structure for EFLAGS/RFLAGS. -/// 32-bits on IA-32. -/// 64-bits on x64. The upper 32-bits on x64 are reserved. -/// -typedef union { - struct { - UINT32 CF:1; ///< Carry Flag. - UINT32 Reserved_0:1; ///< Reserved. - UINT32 PF:1; ///< Parity Flag. - UINT32 Reserved_1:1; ///< Reserved. - UINT32 AF:1; ///< Auxiliary Carry Flag. - UINT32 Reserved_2:1; ///< Reserved. - UINT32 ZF:1; ///< Zero Flag. - UINT32 SF:1; ///< Sign Flag. - UINT32 TF:1; ///< Trap Flag. - UINT32 IF:1; ///< Interrupt Enable Flag. - UINT32 DF:1; ///< Direction Flag. - UINT32 OF:1; ///< Overflow Flag. - UINT32 IOPL:2; ///< I/O Privilege Level. - UINT32 NT:1; ///< Nested Task. - UINT32 Reserved_3:1; ///< Reserved. - UINT32 RF:1; ///< Resume Flag. - UINT32 VM:1; ///< Virtual 8086 Mode. - UINT32 AC:1; ///< Alignment Check. - UINT32 VIF:1; ///< Virtual Interrupt Flag. - UINT32 VIP:1; ///< Virtual Interrupt Pending. - UINT32 ID:1; ///< ID Flag. - UINT32 Reserved_4:10; ///< Reserved. - } Bits; - UINTN UintN; -} IA32_EFLAGS32; - -/// -/// Byte packed structure for Control Register 0 (CR0). -/// 32-bits on IA-32. -/// 64-bits on x64. The upper 32-bits on x64 are reserved. -/// -typedef union { - struct { - UINT32 PE:1; ///< Protection Enable. - UINT32 MP:1; ///< Monitor Coprocessor. - UINT32 EM:1; ///< Emulation. - UINT32 TS:1; ///< Task Switched. - UINT32 ET:1; ///< Extension Type. - UINT32 NE:1; ///< Numeric Error. - UINT32 Reserved_0:10; ///< Reserved. - UINT32 WP:1; ///< Write Protect. - UINT32 Reserved_1:1; ///< Reserved. - UINT32 AM:1; ///< Alignment Mask. - UINT32 Reserved_2:10; ///< Reserved. - UINT32 NW:1; ///< Mot Write-through. - UINT32 CD:1; ///< Cache Disable. - UINT32 PG:1; ///< Paging. - } Bits; - UINTN UintN; -} IA32_CR0; - -/// -/// Byte packed structure for Control Register 4 (CR4). -/// 32-bits on IA-32. -/// 64-bits on x64. The upper 32-bits on x64 are reserved. -/// -typedef union { - struct { - UINT32 VME:1; ///< Virtual-8086 Mode Extensions. - UINT32 PVI:1; ///< Protected-Mode Virtual Interrupts. - UINT32 TSD:1; ///< Time Stamp Disable. - UINT32 DE:1; ///< Debugging Extensions. - UINT32 PSE:1; ///< Page Size Extensions. - UINT32 PAE:1; ///< Physical Address Extension. - UINT32 MCE:1; ///< Machine Check Enable. - UINT32 PGE:1; ///< Page Global Enable. - UINT32 PCE:1; ///< Performance Monitoring Counter - ///< Enable. - UINT32 OSFXSR:1; ///< Operating System Support for - ///< FXSAVE and FXRSTOR instructions - UINT32 OSXMMEXCPT:1; ///< Operating System Support for - ///< Unmasked SIMD Floating Point - ///< Exceptions. - UINT32 Reserved_0:2; ///< Reserved. - UINT32 VMXE:1; ///< VMX Enable - UINT32 Reserved_1:18; ///< Reserved. - } Bits; - UINTN UintN; -} IA32_CR4; - -/// -/// Byte packed structure for a segment descriptor in a GDT/LDT. -/// -typedef union { - struct { - UINT32 LimitLow:16; - UINT32 BaseLow:16; - UINT32 BaseMid:8; - UINT32 Type:4; - UINT32 S:1; - UINT32 DPL:2; - UINT32 P:1; - UINT32 LimitHigh:4; - UINT32 AVL:1; - UINT32 L:1; - UINT32 DB:1; - UINT32 G:1; - UINT32 BaseHigh:8; - } Bits; - UINT64 Uint64; -} IA32_SEGMENT_DESCRIPTOR; - -/// -/// Byte packed structure for an IDTR, GDTR, LDTR descriptor. -/// -#pragma pack (1) -typedef struct { - UINT16 Limit; - UINTN Base; -} IA32_DESCRIPTOR; -#pragma pack () - -#define IA32_IDT_GATE_TYPE_TASK 0x85 -#define IA32_IDT_GATE_TYPE_INTERRUPT_16 0x86 -#define IA32_IDT_GATE_TYPE_TRAP_16 0x87 -#define IA32_IDT_GATE_TYPE_INTERRUPT_32 0x8E -#define IA32_IDT_GATE_TYPE_TRAP_32 0x8F - - -#if defined (MDE_CPU_IA32) -/// -/// Byte packed structure for an IA-32 Interrupt Gate Descriptor. -/// -typedef union { - struct { - UINT32 OffsetLow:16; ///< Offset bits 15..0. - UINT32 Selector:16; ///< Selector. - UINT32 Reserved_0:8; ///< Reserved. - UINT32 GateType:8; ///< Gate Type. See #defines above. - UINT32 OffsetHigh:16; ///< Offset bits 31..16. - } Bits; - UINT64 Uint64; -} IA32_IDT_GATE_DESCRIPTOR; - -#endif - -#if defined (MDE_CPU_X64) -/// -/// Byte packed structure for an x64 Interrupt Gate Descriptor. -/// -typedef union { - struct { - UINT32 OffsetLow:16; ///< Offset bits 15..0. - UINT32 Selector:16; ///< Selector. - UINT32 Reserved_0:8; ///< Reserved. - UINT32 GateType:8; ///< Gate Type. See #defines above. - UINT32 OffsetHigh:16; ///< Offset bits 31..16. - UINT32 OffsetUpper:32; ///< Offset bits 63..32. - UINT32 Reserved_1:32; ///< Reserved. - } Bits; - struct { - UINT64 Uint64; - UINT64 Uint64_1; - } Uint128; -} IA32_IDT_GATE_DESCRIPTOR; - -#endif - -/// -/// Byte packed structure for an FP/SSE/SSE2 context. -/// -typedef struct { - UINT8 Buffer[512]; -} IA32_FX_BUFFER; - -/// -/// Structures for the 16-bit real mode thunks. -/// -typedef struct { - UINT32 Reserved1; - UINT32 Reserved2; - UINT32 Reserved3; - UINT32 Reserved4; - UINT8 BL; - UINT8 BH; - UINT16 Reserved5; - UINT8 DL; - UINT8 DH; - UINT16 Reserved6; - UINT8 CL; - UINT8 CH; - UINT16 Reserved7; - UINT8 AL; - UINT8 AH; - UINT16 Reserved8; -} IA32_BYTE_REGS; - -typedef struct { - UINT16 DI; - UINT16 Reserved1; - UINT16 SI; - UINT16 Reserved2; - UINT16 BP; - UINT16 Reserved3; - UINT16 SP; - UINT16 Reserved4; - UINT16 BX; - UINT16 Reserved5; - UINT16 DX; - UINT16 Reserved6; - UINT16 CX; - UINT16 Reserved7; - UINT16 AX; - UINT16 Reserved8; -} IA32_WORD_REGS; - -typedef struct { - UINT32 EDI; - UINT32 ESI; - UINT32 EBP; - UINT32 ESP; - UINT32 EBX; - UINT32 EDX; - UINT32 ECX; - UINT32 EAX; - UINT16 DS; - UINT16 ES; - UINT16 FS; - UINT16 GS; - IA32_EFLAGS32 EFLAGS; - UINT32 Eip; - UINT16 CS; - UINT16 SS; -} IA32_DWORD_REGS; - -typedef union { - IA32_DWORD_REGS E; - IA32_WORD_REGS X; - IA32_BYTE_REGS H; -} IA32_REGISTER_SET; - -/// -/// Byte packed structure for an 16-bit real mode thunks. -/// -typedef struct { - IA32_REGISTER_SET *RealModeState; - VOID *RealModeBuffer; - UINT32 RealModeBufferSize; - UINT32 ThunkAttributes; -} THUNK_CONTEXT; - -#define THUNK_ATTRIBUTE_BIG_REAL_MODE 0x00000001 -#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 0x00000002 -#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL 0x00000004 - -/** - Retrieves CPUID information. - - Executes the CPUID instruction with EAX set to the value specified by Index. - This function always returns Index. - If Eax is not NULL, then the value of EAX after CPUID is returned in Eax. - If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx. - If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx. - If Edx is not NULL, then the value of EDX after CPUID is returned in Edx. - This function is only available on IA-32 and x64. - - @param Index The 32-bit value to load into EAX prior to invoking the CPUID - instruction. - @param Eax The pointer to the 32-bit EAX value returned by the CPUID - instruction. This is an optional parameter that may be NULL. - @param Ebx The pointer to the 32-bit EBX value returned by the CPUID - instruction. This is an optional parameter that may be NULL. - @param Ecx The pointer to the 32-bit ECX value returned by the CPUID - instruction. This is an optional parameter that may be NULL. - @param Edx The pointer to the 32-bit EDX value returned by the CPUID - instruction. This is an optional parameter that may be NULL. - - @return Index. - -**/ -UINT32 -EFIAPI -AsmCpuid ( - IN UINT32 Index, - OUT UINT32 *Eax, OPTIONAL - OUT UINT32 *Ebx, OPTIONAL - OUT UINT32 *Ecx, OPTIONAL - OUT UINT32 *Edx OPTIONAL - ); - - -/** - Retrieves CPUID information using an extended leaf identifier. - - Executes the CPUID instruction with EAX set to the value specified by Index - and ECX set to the value specified by SubIndex. This function always returns - Index. This function is only available on IA-32 and x64. - - If Eax is not NULL, then the value of EAX after CPUID is returned in Eax. - If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx. - If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx. - If Edx is not NULL, then the value of EDX after CPUID is returned in Edx. - - @param Index The 32-bit value to load into EAX prior to invoking the - CPUID instruction. - @param SubIndex The 32-bit value to load into ECX prior to invoking the - CPUID instruction. - @param Eax The pointer to the 32-bit EAX value returned by the CPUID - instruction. This is an optional parameter that may be - NULL. - @param Ebx The pointer to the 32-bit EBX value returned by the CPUID - instruction. This is an optional parameter that may be - NULL. - @param Ecx The pointer to the 32-bit ECX value returned by the CPUID - instruction. This is an optional parameter that may be - NULL. - @param Edx The pointer to the 32-bit EDX value returned by the CPUID - instruction. This is an optional parameter that may be - NULL. - - @return Index. - -**/ -UINT32 -EFIAPI -AsmCpuidEx ( - IN UINT32 Index, - IN UINT32 SubIndex, - OUT UINT32 *Eax, OPTIONAL - OUT UINT32 *Ebx, OPTIONAL - OUT UINT32 *Ecx, OPTIONAL - OUT UINT32 *Edx OPTIONAL - ); - - -/** - Set CD bit and clear NW bit of CR0 followed by a WBINVD. - - Disables the caches by setting the CD bit of CR0 to 1, clearing the NW bit of CR0 to 0, - and executing a WBINVD instruction. This function is only available on IA-32 and x64. - -**/ -VOID -EFIAPI -AsmDisableCache ( - VOID - ); - - -/** - Perform a WBINVD and clear both the CD and NW bits of CR0. - - Enables the caches by executing a WBINVD instruction and then clear both the CD and NW - bits of CR0 to 0. This function is only available on IA-32 and x64. - -**/ -VOID -EFIAPI -AsmEnableCache ( - VOID - ); - - -/** - Returns the lower 32-bits of a Machine Specific Register(MSR). - - Reads and returns the lower 32-bits of the MSR specified by Index. - No parameter checking is performed on Index, and some Index values may cause - CPU exceptions. The caller must either guarantee that Index is valid, or the - caller must set up exception handlers to catch the exceptions. This function - is only available on IA-32 and x64. - - @param Index The 32-bit MSR index to read. - - @return The lower 32 bits of the MSR identified by Index. - -**/ -UINT32 -EFIAPI -AsmReadMsr32 ( - IN UINT32 Index - ); - - -/** - Writes a 32-bit value to a Machine Specific Register(MSR), and returns the value. - The upper 32-bits of the MSR are set to zero. - - Writes the 32-bit value specified by Value to the MSR specified by Index. The - upper 32-bits of the MSR write are set to zero. The 32-bit value written to - the MSR is returned. No parameter checking is performed on Index or Value, - and some of these may cause CPU exceptions. The caller must either guarantee - that Index and Value are valid, or the caller must establish proper exception - handlers. This function is only available on IA-32 and x64. - - @param Index The 32-bit MSR index to write. - @param Value The 32-bit value to write to the MSR. - - @return Value - -**/ -UINT32 -EFIAPI -AsmWriteMsr32 ( - IN UINT32 Index, - IN UINT32 Value - ); - - -/** - Reads a 64-bit MSR, performs a bitwise OR on the lower 32-bits, and - writes the result back to the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise OR - between the lower 32-bits of the read result and the value specified by - OrData, and writes the result to the 64-bit MSR specified by Index. The lower - 32-bits of the value written to the MSR is returned. No parameter checking is - performed on Index or OrData, and some of these may cause CPU exceptions. The - caller must either guarantee that Index and OrData are valid, or the caller - must establish proper exception handlers. This function is only available on - IA-32 and x64. - - @param Index The 32-bit MSR index to write. - @param OrData The value to OR with the read value from the MSR. - - @return The lower 32-bit value written to the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrOr32 ( - IN UINT32 Index, - IN UINT32 OrData - ); - - -/** - Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes - the result back to the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND between the - lower 32-bits of the read result and the value specified by AndData, and - writes the result to the 64-bit MSR specified by Index. The lower 32-bits of - the value written to the MSR is returned. No parameter checking is performed - on Index or AndData, and some of these may cause CPU exceptions. The caller - must either guarantee that Index and AndData are valid, or the caller must - establish proper exception handlers. This function is only available on IA-32 - and x64. - - @param Index The 32-bit MSR index to write. - @param AndData The value to AND with the read value from the MSR. - - @return The lower 32-bit value written to the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrAnd32 ( - IN UINT32 Index, - IN UINT32 AndData - ); - - -/** - Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise OR - on the lower 32-bits, and writes the result back to the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND between the - lower 32-bits of the read result and the value specified by AndData - preserving the upper 32-bits, performs a bitwise OR between the - result of the AND operation and the value specified by OrData, and writes the - result to the 64-bit MSR specified by Address. The lower 32-bits of the value - written to the MSR is returned. No parameter checking is performed on Index, - AndData, or OrData, and some of these may cause CPU exceptions. The caller - must either guarantee that Index, AndData, and OrData are valid, or the - caller must establish proper exception handlers. This function is only - available on IA-32 and x64. - - @param Index The 32-bit MSR index to write. - @param AndData The value to AND with the read value from the MSR. - @param OrData The value to OR with the result of the AND operation. - - @return The lower 32-bit value written to the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrAndThenOr32 ( - IN UINT32 Index, - IN UINT32 AndData, - IN UINT32 OrData - ); - - -/** - Reads a bit field of an MSR. - - Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is - specified by the StartBit and the EndBit. The value of the bit field is - returned. The caller must either guarantee that Index is valid, or the caller - must set up exception handlers to catch the exceptions. This function is only - available on IA-32 and x64. - - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - - @param Index The 32-bit MSR index to read. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - - @return The bit field read from the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrBitFieldRead32 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit - ); - - -/** - Writes a bit field to an MSR. - - Writes Value to a bit field in the lower 32-bits of a 64-bit MSR. The bit - field is specified by the StartBit and the EndBit. All other bits in the - destination MSR are preserved. The lower 32-bits of the MSR written is - returned. The caller must either guarantee that Index and the data written - is valid, or the caller must set up exception handlers to catch the exceptions. - This function is only available on IA-32 and x64. - - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param Value New value of the bit field. - - @return The lower 32-bit of the value written to the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrBitFieldWrite32 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 Value - ); - - -/** - Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the - result back to the bit field in the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise OR - between the read result and the value specified by OrData, and writes the - result to the 64-bit MSR specified by Index. The lower 32-bits of the value - written to the MSR are returned. Extra left bits in OrData are stripped. The - caller must either guarantee that Index and the data written is valid, or - the caller must set up exception handlers to catch the exceptions. This - function is only available on IA-32 and x64. - - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param OrData The value to OR with the read value from the MSR. - - @return The lower 32-bit of the value written to the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrBitFieldOr32 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 OrData - ); - - -/** - Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the - result back to the bit field in the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND between the - read result and the value specified by AndData, and writes the result to the - 64-bit MSR specified by Index. The lower 32-bits of the value written to the - MSR are returned. Extra left bits in AndData are stripped. The caller must - either guarantee that Index and the data written is valid, or the caller must - set up exception handlers to catch the exceptions. This function is only - available on IA-32 and x64. - - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param AndData The value to AND with the read value from the MSR. - - @return The lower 32-bit of the value written to the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrBitFieldAnd32 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 AndData - ); - - -/** - Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a - bitwise OR, and writes the result back to the bit field in the - 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a - bitwise OR between the read result and the value specified by - AndData, and writes the result to the 64-bit MSR specified by Index. The - lower 32-bits of the value written to the MSR are returned. Extra left bits - in both AndData and OrData are stripped. The caller must either guarantee - that Index and the data written is valid, or the caller must set up exception - handlers to catch the exceptions. This function is only available on IA-32 - and x64. - - If StartBit is greater than 31, then ASSERT(). - If EndBit is greater than 31, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..31. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..31. - @param AndData The value to AND with the read value from the MSR. - @param OrData The value to OR with the result of the AND operation. - - @return The lower 32-bit of the value written to the MSR. - -**/ -UINT32 -EFIAPI -AsmMsrBitFieldAndThenOr32 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT32 AndData, - IN UINT32 OrData - ); - - -/** - Returns a 64-bit Machine Specific Register(MSR). - - Reads and returns the 64-bit MSR specified by Index. No parameter checking is - performed on Index, and some Index values may cause CPU exceptions. The - caller must either guarantee that Index is valid, or the caller must set up - exception handlers to catch the exceptions. This function is only available - on IA-32 and x64. - - @param Index The 32-bit MSR index to read. - - @return The value of the MSR identified by Index. - -**/ -UINT64 -EFIAPI -AsmReadMsr64 ( - IN UINT32 Index - ); - - -/** - Writes a 64-bit value to a Machine Specific Register(MSR), and returns the - value. - - Writes the 64-bit value specified by Value to the MSR specified by Index. The - 64-bit value written to the MSR is returned. No parameter checking is - performed on Index or Value, and some of these may cause CPU exceptions. The - caller must either guarantee that Index and Value are valid, or the caller - must establish proper exception handlers. This function is only available on - IA-32 and x64. - - @param Index The 32-bit MSR index to write. - @param Value The 64-bit value to write to the MSR. - - @return Value - -**/ -UINT64 -EFIAPI -AsmWriteMsr64 ( - IN UINT32 Index, - IN UINT64 Value - ); - - -/** - Reads a 64-bit MSR, performs a bitwise OR, and writes the result - back to the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise OR - between the read result and the value specified by OrData, and writes the - result to the 64-bit MSR specified by Index. The value written to the MSR is - returned. No parameter checking is performed on Index or OrData, and some of - these may cause CPU exceptions. The caller must either guarantee that Index - and OrData are valid, or the caller must establish proper exception handlers. - This function is only available on IA-32 and x64. - - @param Index The 32-bit MSR index to write. - @param OrData The value to OR with the read value from the MSR. - - @return The value written back to the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrOr64 ( - IN UINT32 Index, - IN UINT64 OrData - ); - - -/** - Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the - 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND between the - read result and the value specified by OrData, and writes the result to the - 64-bit MSR specified by Index. The value written to the MSR is returned. No - parameter checking is performed on Index or OrData, and some of these may - cause CPU exceptions. The caller must either guarantee that Index and OrData - are valid, or the caller must establish proper exception handlers. This - function is only available on IA-32 and x64. - - @param Index The 32-bit MSR index to write. - @param AndData The value to AND with the read value from the MSR. - - @return The value written back to the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrAnd64 ( - IN UINT32 Index, - IN UINT64 AndData - ); - - -/** - Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise - OR, and writes the result back to the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND between read - result and the value specified by AndData, performs a bitwise OR - between the result of the AND operation and the value specified by OrData, - and writes the result to the 64-bit MSR specified by Index. The value written - to the MSR is returned. No parameter checking is performed on Index, AndData, - or OrData, and some of these may cause CPU exceptions. The caller must either - guarantee that Index, AndData, and OrData are valid, or the caller must - establish proper exception handlers. This function is only available on IA-32 - and x64. - - @param Index The 32-bit MSR index to write. - @param AndData The value to AND with the read value from the MSR. - @param OrData The value to OR with the result of the AND operation. - - @return The value written back to the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrAndThenOr64 ( - IN UINT32 Index, - IN UINT64 AndData, - IN UINT64 OrData - ); - - -/** - Reads a bit field of an MSR. - - Reads the bit field in the 64-bit MSR. The bit field is specified by the - StartBit and the EndBit. The value of the bit field is returned. The caller - must either guarantee that Index is valid, or the caller must set up - exception handlers to catch the exceptions. This function is only available - on IA-32 and x64. - - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - - @param Index The 32-bit MSR index to read. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - - @return The value read from the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrBitFieldRead64 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit - ); - - -/** - Writes a bit field to an MSR. - - Writes Value to a bit field in a 64-bit MSR. The bit field is specified by - the StartBit and the EndBit. All other bits in the destination MSR are - preserved. The MSR written is returned. The caller must either guarantee - that Index and the data written is valid, or the caller must set up exception - handlers to catch the exceptions. This function is only available on IA-32 and x64. - - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If Value is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param Value New value of the bit field. - - @return The value written back to the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrBitFieldWrite64 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 Value - ); - - -/** - Reads a bit field in a 64-bit MSR, performs a bitwise OR, and - writes the result back to the bit field in the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise OR - between the read result and the value specified by OrData, and writes the - result to the 64-bit MSR specified by Index. The value written to the MSR is - returned. Extra left bits in OrData are stripped. The caller must either - guarantee that Index and the data written is valid, or the caller must set up - exception handlers to catch the exceptions. This function is only available - on IA-32 and x64. - - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param OrData The value to OR with the read value from the bit field. - - @return The value written back to the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrBitFieldOr64 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 OrData - ); - - -/** - Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the - result back to the bit field in the 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND between the - read result and the value specified by AndData, and writes the result to the - 64-bit MSR specified by Index. The value written to the MSR is returned. - Extra left bits in AndData are stripped. The caller must either guarantee - that Index and the data written is valid, or the caller must set up exception - handlers to catch the exceptions. This function is only available on IA-32 - and x64. - - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param AndData The value to AND with the read value from the bit field. - - @return The value written back to the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrBitFieldAnd64 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 AndData - ); - - -/** - Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a - bitwise OR, and writes the result back to the bit field in the - 64-bit MSR. - - Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by - a bitwise OR between the read result and the value specified by - AndData, and writes the result to the 64-bit MSR specified by Index. The - value written to the MSR is returned. Extra left bits in both AndData and - OrData are stripped. The caller must either guarantee that Index and the data - written is valid, or the caller must set up exception handlers to catch the - exceptions. This function is only available on IA-32 and x64. - - If StartBit is greater than 63, then ASSERT(). - If EndBit is greater than 63, then ASSERT(). - If EndBit is less than StartBit, then ASSERT(). - If AndData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - If OrData is larger than the bitmask value range specified by StartBit and EndBit, then ASSERT(). - - @param Index The 32-bit MSR index to write. - @param StartBit The ordinal of the least significant bit in the bit field. - Range 0..63. - @param EndBit The ordinal of the most significant bit in the bit field. - Range 0..63. - @param AndData The value to AND with the read value from the bit field. - @param OrData The value to OR with the result of the AND operation. - - @return The value written back to the MSR. - -**/ -UINT64 -EFIAPI -AsmMsrBitFieldAndThenOr64 ( - IN UINT32 Index, - IN UINTN StartBit, - IN UINTN EndBit, - IN UINT64 AndData, - IN UINT64 OrData - ); - - -/** - Reads the current value of the EFLAGS register. - - Reads and returns the current value of the EFLAGS register. This function is - only available on IA-32 and x64. This returns a 32-bit value on IA-32 and a - 64-bit value on x64. - - @return EFLAGS on IA-32 or RFLAGS on x64. - -**/ -UINTN -EFIAPI -AsmReadEflags ( - VOID - ); - - -/** - Reads the current value of the Control Register 0 (CR0). - - Reads and returns the current value of CR0. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of the Control Register 0 (CR0). - -**/ -UINTN -EFIAPI -AsmReadCr0 ( - VOID - ); - - -/** - Reads the current value of the Control Register 2 (CR2). - - Reads and returns the current value of CR2. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of the Control Register 2 (CR2). - -**/ -UINTN -EFIAPI -AsmReadCr2 ( - VOID - ); - - -/** - Reads the current value of the Control Register 3 (CR3). - - Reads and returns the current value of CR3. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of the Control Register 3 (CR3). - -**/ -UINTN -EFIAPI -AsmReadCr3 ( - VOID - ); - - -/** - Reads the current value of the Control Register 4 (CR4). - - Reads and returns the current value of CR4. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of the Control Register 4 (CR4). - -**/ -UINTN -EFIAPI -AsmReadCr4 ( - VOID - ); - - -/** - Writes a value to Control Register 0 (CR0). - - Writes and returns a new value to CR0. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Cr0 The value to write to CR0. - - @return The value written to CR0. - -**/ -UINTN -EFIAPI -AsmWriteCr0 ( - UINTN Cr0 - ); - - -/** - Writes a value to Control Register 2 (CR2). - - Writes and returns a new value to CR2. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Cr2 The value to write to CR2. - - @return The value written to CR2. - -**/ -UINTN -EFIAPI -AsmWriteCr2 ( - UINTN Cr2 - ); - - -/** - Writes a value to Control Register 3 (CR3). - - Writes and returns a new value to CR3. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Cr3 The value to write to CR3. - - @return The value written to CR3. - -**/ -UINTN -EFIAPI -AsmWriteCr3 ( - UINTN Cr3 - ); - - -/** - Writes a value to Control Register 4 (CR4). - - Writes and returns a new value to CR4. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Cr4 The value to write to CR4. - - @return The value written to CR4. - -**/ -UINTN -EFIAPI -AsmWriteCr4 ( - UINTN Cr4 - ); - - -/** - Reads the current value of Debug Register 0 (DR0). - - Reads and returns the current value of DR0. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 0 (DR0). - -**/ -UINTN -EFIAPI -AsmReadDr0 ( - VOID - ); - - -/** - Reads the current value of Debug Register 1 (DR1). - - Reads and returns the current value of DR1. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 1 (DR1). - -**/ -UINTN -EFIAPI -AsmReadDr1 ( - VOID - ); - - -/** - Reads the current value of Debug Register 2 (DR2). - - Reads and returns the current value of DR2. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 2 (DR2). - -**/ -UINTN -EFIAPI -AsmReadDr2 ( - VOID - ); - - -/** - Reads the current value of Debug Register 3 (DR3). - - Reads and returns the current value of DR3. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 3 (DR3). - -**/ -UINTN -EFIAPI -AsmReadDr3 ( - VOID - ); - - -/** - Reads the current value of Debug Register 4 (DR4). - - Reads and returns the current value of DR4. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 4 (DR4). - -**/ -UINTN -EFIAPI -AsmReadDr4 ( - VOID - ); - - -/** - Reads the current value of Debug Register 5 (DR5). - - Reads and returns the current value of DR5. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 5 (DR5). - -**/ -UINTN -EFIAPI -AsmReadDr5 ( - VOID - ); - - -/** - Reads the current value of Debug Register 6 (DR6). - - Reads and returns the current value of DR6. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 6 (DR6). - -**/ -UINTN -EFIAPI -AsmReadDr6 ( - VOID - ); - - -/** - Reads the current value of Debug Register 7 (DR7). - - Reads and returns the current value of DR7. This function is only available - on IA-32 and x64. This returns a 32-bit value on IA-32 and a 64-bit value on - x64. - - @return The value of Debug Register 7 (DR7). - -**/ -UINTN -EFIAPI -AsmReadDr7 ( - VOID - ); - - -/** - Writes a value to Debug Register 0 (DR0). - - Writes and returns a new value to DR0. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr0 The value to write to Dr0. - - @return The value written to Debug Register 0 (DR0). - -**/ -UINTN -EFIAPI -AsmWriteDr0 ( - UINTN Dr0 - ); - - -/** - Writes a value to Debug Register 1 (DR1). - - Writes and returns a new value to DR1. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr1 The value to write to Dr1. - - @return The value written to Debug Register 1 (DR1). - -**/ -UINTN -EFIAPI -AsmWriteDr1 ( - UINTN Dr1 - ); - - -/** - Writes a value to Debug Register 2 (DR2). - - Writes and returns a new value to DR2. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr2 The value to write to Dr2. - - @return The value written to Debug Register 2 (DR2). - -**/ -UINTN -EFIAPI -AsmWriteDr2 ( - UINTN Dr2 - ); - - -/** - Writes a value to Debug Register 3 (DR3). - - Writes and returns a new value to DR3. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr3 The value to write to Dr3. - - @return The value written to Debug Register 3 (DR3). - -**/ -UINTN -EFIAPI -AsmWriteDr3 ( - UINTN Dr3 - ); - - -/** - Writes a value to Debug Register 4 (DR4). - - Writes and returns a new value to DR4. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr4 The value to write to Dr4. - - @return The value written to Debug Register 4 (DR4). - -**/ -UINTN -EFIAPI -AsmWriteDr4 ( - UINTN Dr4 - ); - - -/** - Writes a value to Debug Register 5 (DR5). - - Writes and returns a new value to DR5. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr5 The value to write to Dr5. - - @return The value written to Debug Register 5 (DR5). - -**/ -UINTN -EFIAPI -AsmWriteDr5 ( - UINTN Dr5 - ); - - -/** - Writes a value to Debug Register 6 (DR6). - - Writes and returns a new value to DR6. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr6 The value to write to Dr6. - - @return The value written to Debug Register 6 (DR6). - -**/ -UINTN -EFIAPI -AsmWriteDr6 ( - UINTN Dr6 - ); - - -/** - Writes a value to Debug Register 7 (DR7). - - Writes and returns a new value to DR7. This function is only available on - IA-32 and x64. This writes a 32-bit value on IA-32 and a 64-bit value on x64. - - @param Dr7 The value to write to Dr7. - - @return The value written to Debug Register 7 (DR7). - -**/ -UINTN -EFIAPI -AsmWriteDr7 ( - UINTN Dr7 - ); - - -/** - Reads the current value of Code Segment Register (CS). - - Reads and returns the current value of CS. This function is only available on - IA-32 and x64. - - @return The current value of CS. - -**/ -UINT16 -EFIAPI -AsmReadCs ( - VOID - ); - - -/** - Reads the current value of Data Segment Register (DS). - - Reads and returns the current value of DS. This function is only available on - IA-32 and x64. - - @return The current value of DS. - -**/ -UINT16 -EFIAPI -AsmReadDs ( - VOID - ); - - -/** - Reads the current value of Extra Segment Register (ES). - - Reads and returns the current value of ES. This function is only available on - IA-32 and x64. - - @return The current value of ES. - -**/ -UINT16 -EFIAPI -AsmReadEs ( - VOID - ); - - -/** - Reads the current value of FS Data Segment Register (FS). - - Reads and returns the current value of FS. This function is only available on - IA-32 and x64. - - @return The current value of FS. - -**/ -UINT16 -EFIAPI -AsmReadFs ( - VOID - ); - - -/** - Reads the current value of GS Data Segment Register (GS). - - Reads and returns the current value of GS. This function is only available on - IA-32 and x64. - - @return The current value of GS. - -**/ -UINT16 -EFIAPI -AsmReadGs ( - VOID - ); - - -/** - Reads the current value of Stack Segment Register (SS). - - Reads and returns the current value of SS. This function is only available on - IA-32 and x64. - - @return The current value of SS. - -**/ -UINT16 -EFIAPI -AsmReadSs ( - VOID - ); - - -/** - Reads the current value of Task Register (TR). - - Reads and returns the current value of TR. This function is only available on - IA-32 and x64. - - @return The current value of TR. - -**/ -UINT16 -EFIAPI -AsmReadTr ( - VOID - ); - - -/** - Reads the current Global Descriptor Table Register(GDTR) descriptor. - - Reads and returns the current GDTR descriptor and returns it in Gdtr. This - function is only available on IA-32 and x64. - - If Gdtr is NULL, then ASSERT(). - - @param Gdtr The pointer to a GDTR descriptor. - -**/ -VOID -EFIAPI -AsmReadGdtr ( - OUT IA32_DESCRIPTOR *Gdtr - ); - - -/** - Writes the current Global Descriptor Table Register (GDTR) descriptor. - - Writes and the current GDTR descriptor specified by Gdtr. This function is - only available on IA-32 and x64. - - If Gdtr is NULL, then ASSERT(). - - @param Gdtr The pointer to a GDTR descriptor. - -**/ -VOID -EFIAPI -AsmWriteGdtr ( - IN CONST IA32_DESCRIPTOR *Gdtr - ); - - -/** - Reads the current Interrupt Descriptor Table Register(IDTR) descriptor. - - Reads and returns the current IDTR descriptor and returns it in Idtr. This - function is only available on IA-32 and x64. - - If Idtr is NULL, then ASSERT(). - - @param Idtr The pointer to a IDTR descriptor. - -**/ -VOID -EFIAPI -AsmReadIdtr ( - OUT IA32_DESCRIPTOR *Idtr - ); - - -/** - Writes the current Interrupt Descriptor Table Register(IDTR) descriptor. - - Writes the current IDTR descriptor and returns it in Idtr. This function is - only available on IA-32 and x64. - - If Idtr is NULL, then ASSERT(). - - @param Idtr The pointer to a IDTR descriptor. - -**/ -VOID -EFIAPI -AsmWriteIdtr ( - IN CONST IA32_DESCRIPTOR *Idtr - ); - - -/** - Reads the current Local Descriptor Table Register(LDTR) selector. - - Reads and returns the current 16-bit LDTR descriptor value. This function is - only available on IA-32 and x64. - - @return The current selector of LDT. - -**/ -UINT16 -EFIAPI -AsmReadLdtr ( - VOID - ); - - -/** - Writes the current Local Descriptor Table Register (LDTR) selector. - - Writes and the current LDTR descriptor specified by Ldtr. This function is - only available on IA-32 and x64. - - @param Ldtr 16-bit LDTR selector value. - -**/ -VOID -EFIAPI -AsmWriteLdtr ( - IN UINT16 Ldtr - ); - - -/** - Save the current floating point/SSE/SSE2 context to a buffer. - - Saves the current floating point/SSE/SSE2 state to the buffer specified by - Buffer. Buffer must be aligned on a 16-byte boundary. This function is only - available on IA-32 and x64. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 16-byte boundary, then ASSERT(). - - @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context. - -**/ -VOID -EFIAPI -AsmFxSave ( - OUT IA32_FX_BUFFER *Buffer - ); - - -/** - Restores the current floating point/SSE/SSE2 context from a buffer. - - Restores the current floating point/SSE/SSE2 state from the buffer specified - by Buffer. Buffer must be aligned on a 16-byte boundary. This function is - only available on IA-32 and x64. - - If Buffer is NULL, then ASSERT(). - If Buffer is not aligned on a 16-byte boundary, then ASSERT(). - If Buffer was not saved with AsmFxSave(), then ASSERT(). - - @param Buffer The pointer to a buffer to save the floating point/SSE/SSE2 context. - -**/ -VOID -EFIAPI -AsmFxRestore ( - IN CONST IA32_FX_BUFFER *Buffer - ); - - -/** - Reads the current value of 64-bit MMX Register #0 (MM0). - - Reads and returns the current value of MM0. This function is only available - on IA-32 and x64. - - @return The current value of MM0. - -**/ -UINT64 -EFIAPI -AsmReadMm0 ( - VOID - ); - - -/** - Reads the current value of 64-bit MMX Register #1 (MM1). - - Reads and returns the current value of MM1. This function is only available - on IA-32 and x64. - - @return The current value of MM1. - -**/ -UINT64 -EFIAPI -AsmReadMm1 ( - VOID - ); - - -/** - Reads the current value of 64-bit MMX Register #2 (MM2). - - Reads and returns the current value of MM2. This function is only available - on IA-32 and x64. - - @return The current value of MM2. - -**/ -UINT64 -EFIAPI -AsmReadMm2 ( - VOID - ); - - -/** - Reads the current value of 64-bit MMX Register #3 (MM3). - - Reads and returns the current value of MM3. This function is only available - on IA-32 and x64. - - @return The current value of MM3. - -**/ -UINT64 -EFIAPI -AsmReadMm3 ( - VOID - ); - - -/** - Reads the current value of 64-bit MMX Register #4 (MM4). - - Reads and returns the current value of MM4. This function is only available - on IA-32 and x64. - - @return The current value of MM4. - -**/ -UINT64 -EFIAPI -AsmReadMm4 ( - VOID - ); - - -/** - Reads the current value of 64-bit MMX Register #5 (MM5). - - Reads and returns the current value of MM5. This function is only available - on IA-32 and x64. - - @return The current value of MM5. - -**/ -UINT64 -EFIAPI -AsmReadMm5 ( - VOID - ); - - -/** - Reads the current value of 64-bit MMX Register #6 (MM6). - - Reads and returns the current value of MM6. This function is only available - on IA-32 and x64. - - @return The current value of MM6. - -**/ -UINT64 -EFIAPI -AsmReadMm6 ( - VOID - ); - - -/** - Reads the current value of 64-bit MMX Register #7 (MM7). - - Reads and returns the current value of MM7. This function is only available - on IA-32 and x64. - - @return The current value of MM7. - -**/ -UINT64 -EFIAPI -AsmReadMm7 ( - VOID - ); - - -/** - Writes the current value of 64-bit MMX Register #0 (MM0). - - Writes the current value of MM0. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM0. - -**/ -VOID -EFIAPI -AsmWriteMm0 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit MMX Register #1 (MM1). - - Writes the current value of MM1. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM1. - -**/ -VOID -EFIAPI -AsmWriteMm1 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit MMX Register #2 (MM2). - - Writes the current value of MM2. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM2. - -**/ -VOID -EFIAPI -AsmWriteMm2 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit MMX Register #3 (MM3). - - Writes the current value of MM3. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM3. - -**/ -VOID -EFIAPI -AsmWriteMm3 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit MMX Register #4 (MM4). - - Writes the current value of MM4. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM4. - -**/ -VOID -EFIAPI -AsmWriteMm4 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit MMX Register #5 (MM5). - - Writes the current value of MM5. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM5. - -**/ -VOID -EFIAPI -AsmWriteMm5 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit MMX Register #6 (MM6). - - Writes the current value of MM6. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM6. - -**/ -VOID -EFIAPI -AsmWriteMm6 ( - IN UINT64 Value - ); - - -/** - Writes the current value of 64-bit MMX Register #7 (MM7). - - Writes the current value of MM7. This function is only available on IA32 and - x64. - - @param Value The 64-bit value to write to MM7. - -**/ -VOID -EFIAPI -AsmWriteMm7 ( - IN UINT64 Value - ); - - -/** - Reads the current value of Time Stamp Counter (TSC). - - Reads and returns the current value of TSC. This function is only available - on IA-32 and x64. - - @return The current value of TSC - -**/ -UINT64 -EFIAPI -AsmReadTsc ( - VOID - ); - - -/** - Reads the current value of a Performance Counter (PMC). - - Reads and returns the current value of performance counter specified by - Index. This function is only available on IA-32 and x64. - - @param Index The 32-bit Performance Counter index to read. - - @return The value of the PMC specified by Index. - -**/ -UINT64 -EFIAPI -AsmReadPmc ( - IN UINT32 Index - ); - - -/** - Sets up a monitor buffer that is used by AsmMwait(). - - Executes a MONITOR instruction with the register state specified by Eax, Ecx - and Edx. Returns Eax. This function is only available on IA-32 and x64. - - @param Eax The value to load into EAX or RAX before executing the MONITOR - instruction. - @param Ecx The value to load into ECX or RCX before executing the MONITOR - instruction. - @param Edx The value to load into EDX or RDX before executing the MONITOR - instruction. - - @return Eax - -**/ -UINTN -EFIAPI -AsmMonitor ( - IN UINTN Eax, - IN UINTN Ecx, - IN UINTN Edx - ); - - -/** - Executes an MWAIT instruction. - - Executes an MWAIT instruction with the register state specified by Eax and - Ecx. Returns Eax. This function is only available on IA-32 and x64. - - @param Eax The value to load into EAX or RAX before executing the MONITOR - instruction. - @param Ecx The value to load into ECX or RCX before executing the MONITOR - instruction. - - @return Eax - -**/ -UINTN -EFIAPI -AsmMwait ( - IN UINTN Eax, - IN UINTN Ecx - ); - - -/** - Executes a WBINVD instruction. - - Executes a WBINVD instruction. This function is only available on IA-32 and - x64. - -**/ -VOID -EFIAPI -AsmWbinvd ( - VOID - ); - - -/** - Executes a INVD instruction. - - Executes a INVD instruction. This function is only available on IA-32 and - x64. - -**/ -VOID -EFIAPI -AsmInvd ( - VOID - ); - - -/** - Flushes a cache line from all the instruction and data caches within the - coherency domain of the CPU. - - Flushed the cache line specified by LinearAddress, and returns LinearAddress. - This function is only available on IA-32 and x64. - - @param LinearAddress The address of the cache line to flush. If the CPU is - in a physical addressing mode, then LinearAddress is a - physical address. If the CPU is in a virtual - addressing mode, then LinearAddress is a virtual - address. - - @return LinearAddress. -**/ -VOID * -EFIAPI -AsmFlushCacheLine ( - IN VOID *LinearAddress - ); - - -/** - Enables the 32-bit paging mode on the CPU. - - Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables - must be properly initialized prior to calling this service. This function - assumes the current execution mode is 32-bit protected mode. This function is - only available on IA-32. After the 32-bit paging mode is enabled, control is - transferred to the function specified by EntryPoint using the new stack - specified by NewStack and passing in the parameters specified by Context1 and - Context2. Context1 and Context2 are optional and may be NULL. The function - EntryPoint must never return. - - If the current execution mode is not 32-bit protected mode, then ASSERT(). - If EntryPoint is NULL, then ASSERT(). - If NewStack is NULL, then ASSERT(). - - There are a number of constraints that must be followed before calling this - function: - 1) Interrupts must be disabled. - 2) The caller must be in 32-bit protected mode with flat descriptors. This - means all descriptors must have a base of 0 and a limit of 4GB. - 3) CR0 and CR4 must be compatible with 32-bit protected mode with flat - descriptors. - 4) CR3 must point to valid page tables that will be used once the transition - is complete, and those page tables must guarantee that the pages for this - function and the stack are identity mapped. - - @param EntryPoint A pointer to function to call with the new stack after - paging is enabled. - @param Context1 A pointer to the context to pass into the EntryPoint - function as the first parameter after paging is enabled. - @param Context2 A pointer to the context to pass into the EntryPoint - function as the second parameter after paging is enabled. - @param NewStack A pointer to the new stack to use for the EntryPoint - function after paging is enabled. - -**/ -VOID -EFIAPI -AsmEnablePaging32 ( - IN SWITCH_STACK_ENTRY_POINT EntryPoint, - IN VOID *Context1, OPTIONAL - IN VOID *Context2, OPTIONAL - IN VOID *NewStack - ); - - -/** - Disables the 32-bit paging mode on the CPU. - - Disables the 32-bit paging mode on the CPU and returns to 32-bit protected - mode. This function assumes the current execution mode is 32-paged protected - mode. This function is only available on IA-32. After the 32-bit paging mode - is disabled, control is transferred to the function specified by EntryPoint - using the new stack specified by NewStack and passing in the parameters - specified by Context1 and Context2. Context1 and Context2 are optional and - may be NULL. The function EntryPoint must never return. - - If the current execution mode is not 32-bit paged mode, then ASSERT(). - If EntryPoint is NULL, then ASSERT(). - If NewStack is NULL, then ASSERT(). - - There are a number of constraints that must be followed before calling this - function: - 1) Interrupts must be disabled. - 2) The caller must be in 32-bit paged mode. - 3) CR0, CR3, and CR4 must be compatible with 32-bit paged mode. - 4) CR3 must point to valid page tables that guarantee that the pages for - this function and the stack are identity mapped. - - @param EntryPoint A pointer to function to call with the new stack after - paging is disabled. - @param Context1 A pointer to the context to pass into the EntryPoint - function as the first parameter after paging is disabled. - @param Context2 A pointer to the context to pass into the EntryPoint - function as the second parameter after paging is - disabled. - @param NewStack A pointer to the new stack to use for the EntryPoint - function after paging is disabled. - -**/ -VOID -EFIAPI -AsmDisablePaging32 ( - IN SWITCH_STACK_ENTRY_POINT EntryPoint, - IN VOID *Context1, OPTIONAL - IN VOID *Context2, OPTIONAL - IN VOID *NewStack - ); - - -/** - Enables the 64-bit paging mode on the CPU. - - Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables - must be properly initialized prior to calling this service. This function - assumes the current execution mode is 32-bit protected mode with flat - descriptors. This function is only available on IA-32. After the 64-bit - paging mode is enabled, control is transferred to the function specified by - EntryPoint using the new stack specified by NewStack and passing in the - parameters specified by Context1 and Context2. Context1 and Context2 are - optional and may be 0. The function EntryPoint must never return. - - If the current execution mode is not 32-bit protected mode with flat - descriptors, then ASSERT(). - If EntryPoint is 0, then ASSERT(). - If NewStack is 0, then ASSERT(). - - @param Cs The 16-bit selector to load in the CS before EntryPoint - is called. The descriptor in the GDT that this selector - references must be setup for long mode. - @param EntryPoint The 64-bit virtual address of the function to call with - the new stack after paging is enabled. - @param Context1 The 64-bit virtual address of the context to pass into - the EntryPoint function as the first parameter after - paging is enabled. - @param Context2 The 64-bit virtual address of the context to pass into - the EntryPoint function as the second parameter after - paging is enabled. - @param NewStack The 64-bit virtual address of the new stack to use for - the EntryPoint function after paging is enabled. - -**/ -VOID -EFIAPI -AsmEnablePaging64 ( - IN UINT16 Cs, - IN UINT64 EntryPoint, - IN UINT64 Context1, OPTIONAL - IN UINT64 Context2, OPTIONAL - IN UINT64 NewStack - ); - - -/** - Disables the 64-bit paging mode on the CPU. - - Disables the 64-bit paging mode on the CPU and returns to 32-bit protected - mode. This function assumes the current execution mode is 64-paging mode. - This function is only available on x64. After the 64-bit paging mode is - disabled, control is transferred to the function specified by EntryPoint - using the new stack specified by NewStack and passing in the parameters - specified by Context1 and Context2. Context1 and Context2 are optional and - may be 0. The function EntryPoint must never return. - - If the current execution mode is not 64-bit paged mode, then ASSERT(). - If EntryPoint is 0, then ASSERT(). - If NewStack is 0, then ASSERT(). - - @param Cs The 16-bit selector to load in the CS before EntryPoint - is called. The descriptor in the GDT that this selector - references must be setup for 32-bit protected mode. - @param EntryPoint The 64-bit virtual address of the function to call with - the new stack after paging is disabled. - @param Context1 The 64-bit virtual address of the context to pass into - the EntryPoint function as the first parameter after - paging is disabled. - @param Context2 The 64-bit virtual address of the context to pass into - the EntryPoint function as the second parameter after - paging is disabled. - @param NewStack The 64-bit virtual address of the new stack to use for - the EntryPoint function after paging is disabled. - -**/ -VOID -EFIAPI -AsmDisablePaging64 ( - IN UINT16 Cs, - IN UINT32 EntryPoint, - IN UINT32 Context1, OPTIONAL - IN UINT32 Context2, OPTIONAL - IN UINT32 NewStack - ); - - -// -// 16-bit thunking services -// - -/** - Retrieves the properties for 16-bit thunk functions. - - Computes the size of the buffer and stack below 1MB required to use the - AsmPrepareThunk16(), AsmThunk16() and AsmPrepareAndThunk16() functions. This - buffer size is returned in RealModeBufferSize, and the stack size is returned - in ExtraStackSize. If parameters are passed to the 16-bit real mode code, - then the actual minimum stack size is ExtraStackSize plus the maximum number - of bytes that need to be passed to the 16-bit real mode code. - - If RealModeBufferSize is NULL, then ASSERT(). - If ExtraStackSize is NULL, then ASSERT(). - - @param RealModeBufferSize A pointer to the size of the buffer below 1MB - required to use the 16-bit thunk functions. - @param ExtraStackSize A pointer to the extra size of stack below 1MB - that the 16-bit thunk functions require for - temporary storage in the transition to and from - 16-bit real mode. - -**/ -VOID -EFIAPI -AsmGetThunk16Properties ( - OUT UINT32 *RealModeBufferSize, - OUT UINT32 *ExtraStackSize - ); - - -/** - Prepares all structures a code required to use AsmThunk16(). - - Prepares all structures and code required to use AsmThunk16(). - - This interface is limited to be used in either physical mode or virtual modes with paging enabled where the - virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1. - - If ThunkContext is NULL, then ASSERT(). - - @param ThunkContext A pointer to the context structure that describes the - 16-bit real mode code to call. - -**/ -VOID -EFIAPI -AsmPrepareThunk16 ( - IN OUT THUNK_CONTEXT *ThunkContext - ); - - -/** - Transfers control to a 16-bit real mode entry point and returns the results. - - Transfers control to a 16-bit real mode entry point and returns the results. - AsmPrepareThunk16() must be called with ThunkContext before this function is used. - This function must be called with interrupts disabled. - - The register state from the RealModeState field of ThunkContext is restored just prior - to calling the 16-bit real mode entry point. This includes the EFLAGS field of RealModeState, - which is used to set the interrupt state when a 16-bit real mode entry point is called. - Control is transferred to the 16-bit real mode entry point specified by the CS and Eip fields of RealModeState. - The stack is initialized to the SS and ESP fields of RealModeState. Any parameters passed to - the 16-bit real mode code must be populated by the caller at SS:ESP prior to calling this function. - The 16-bit real mode entry point is invoked with a 16-bit CALL FAR instruction, - so when accessing stack contents, the 16-bit real mode code must account for the 16-bit segment - and 16-bit offset of the return address that were pushed onto the stack. The 16-bit real mode entry - point must exit with a RETF instruction. The register state is captured into RealModeState immediately - after the RETF instruction is executed. - - If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, - or any of the 16-bit real mode code makes a SW interrupt, then the caller is responsible for making sure - the IDT at address 0 is initialized to handle any HW or SW interrupts that may occur while in 16-bit real mode. - - If EFLAGS specifies interrupts enabled, or any of the 16-bit real mode code enables interrupts, - then the caller is responsible for making sure the 8259 PIC is in a state compatible with 16-bit real mode. - This includes the base vectors, the interrupt masks, and the edge/level trigger mode. - - If THUNK_ATTRIBUTE_BIG_REAL_MODE is set in the ThunkAttributes field of ThunkContext, then the user code - is invoked in big real mode. Otherwise, the user code is invoked in 16-bit real mode with 64KB segment limits. - - If neither THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 nor THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in - ThunkAttributes, then it is assumed that the user code did not enable the A20 mask, and no attempt is made to - disable the A20 mask. - - If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is set and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is clear in - ThunkAttributes, then attempt to use the INT 15 service to disable the A20 mask. If this INT 15 call fails, - then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports. - - If THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 is clear and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL is set in - ThunkAttributes, then attempt to disable the A20 mask by directly accessing the 8042 keyboard controller I/O ports. - - If ThunkContext is NULL, then ASSERT(). - If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT(). - If both THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15 and THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL are set in - ThunkAttributes, then ASSERT(). - - This interface is limited to be used in either physical mode or virtual modes with paging enabled where the - virtual to physical mappings for ThunkContext.RealModeBuffer are mapped 1:1. - - @param ThunkContext A pointer to the context structure that describes the - 16-bit real mode code to call. - -**/ -VOID -EFIAPI -AsmThunk16 ( - IN OUT THUNK_CONTEXT *ThunkContext - ); - - -/** - Prepares all structures and code for a 16-bit real mode thunk, transfers - control to a 16-bit real mode entry point, and returns the results. - - Prepares all structures and code for a 16-bit real mode thunk, transfers - control to a 16-bit real mode entry point, and returns the results. If the - caller only need to perform a single 16-bit real mode thunk, then this - service should be used. If the caller intends to make more than one 16-bit - real mode thunk, then it is more efficient if AsmPrepareThunk16() is called - once and AsmThunk16() can be called for each 16-bit real mode thunk. - - This interface is limited to be used in either physical mode or virtual modes with paging enabled where the - virtual to physical mappings for ThunkContext.RealModeBuffer is mapped 1:1. - - See AsmPrepareThunk16() and AsmThunk16() for the detailed description and ASSERT() conditions. - - @param ThunkContext A pointer to the context structure that describes the - 16-bit real mode code to call. - -**/ -VOID -EFIAPI -AsmPrepareAndThunk16 ( - IN OUT THUNK_CONTEXT *ThunkContext - ); - -#endif -#endif - - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiBootMode.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiBootMode.h deleted file mode 100644 index f462f7aad..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiBootMode.h +++ /dev/null @@ -1,44 +0,0 @@ -/** @file - Present the boot mode values in PI. - - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> - 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.2.1A - -**/ - -#ifndef __PI_BOOT_MODE_H__ -#define __PI_BOOT_MODE_H__ - -FILE_LICENCE ( BSD3 ); - -/// -/// 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_WITH_MFG_MODE_SETTINGS 0x07 -#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/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiDependency.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiDependency.h deleted file mode 100644 index b1fa399b4..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiDependency.h +++ /dev/null @@ -1,49 +0,0 @@ -/** @file - Present the dependency expression values in PI. - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -/// -/// If present, this must be the first and only opcode, -/// EFI_DEP_BEFORE may be used by DXE and SMM drivers. -/// -#define EFI_DEP_BEFORE 0x00 - -/// -/// If present, this must be the first and only opcode, -/// EFI_DEP_AFTER may be used by DXE and SMM drivers. -/// -#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/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiDxeCis.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiDxeCis.h deleted file mode 100644 index 50d25f23f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiDxeCis.h +++ /dev/null @@ -1,718 +0,0 @@ -/** @file - Include file matches things in PI. - -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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.2 - -**/ - -#ifndef __PI_DXECIS_H__ -#define __PI_DXECIS_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Uefi/UefiMultiPhase.h> -#include <ipxe/efi/Pi/PiMultiPhase.h> - -/// -/// Global Coherencey Domain types - Memory type. -/// -typedef enum { - /// - /// A memory region that is visible to the boot processor. However, there are no system - /// components that are currently decoding this memory region. - /// - EfiGcdMemoryTypeNonExistent, - /// - /// A memory region that is visible to the boot processor. This memory region is being - /// decoded by a system component, but the memory region is not considered to be either - /// system memory or memory-mapped I/O. - /// - EfiGcdMemoryTypeReserved, - /// - /// A memory region that is visible to the boot processor. A memory controller is - /// currently decoding this memory region and the memory controller is producing a - /// tested system memory region that is available to the memory services. - /// - EfiGcdMemoryTypeSystemMemory, - /// - /// A memory region that is visible to the boot processor. This memory region is - /// currently being decoded by a component as memory-mapped I/O that can be used to - /// access I/O devices in the platform. - /// - EfiGcdMemoryTypeMemoryMappedIo, - EfiGcdMemoryTypeMaximum -} EFI_GCD_MEMORY_TYPE; - -/// -/// Global Coherencey Domain types - IO type. -/// -typedef enum { - /// - /// An I/O region that is visible to the boot processor. However, there are no system - /// components that are currently decoding this I/O region. - /// - EfiGcdIoTypeNonExistent, - /// - /// An I/O region that is visible to the boot processor. This I/O region is currently being - /// decoded by a system component, but the I/O region cannot be used to access I/O devices. - /// - EfiGcdIoTypeReserved, - /// - /// An I/O region that is visible to the boot processor. This I/O region is currently being - /// decoded by a system component that is producing I/O ports that can be used to access I/O devices. - /// - EfiGcdIoTypeIo, - EfiGcdIoTypeMaximum -} EFI_GCD_IO_TYPE; - -/// -/// The type of allocation to perform. -/// -typedef enum { - /// - /// The GCD memory space map is searched from the lowest address up to the highest address - /// looking for unallocated memory ranges. - /// - EfiGcdAllocateAnySearchBottomUp, - /// - /// The GCD memory space map is searched from the lowest address up - /// to the specified MaxAddress looking for unallocated memory ranges. - /// - EfiGcdAllocateMaxAddressSearchBottomUp, - /// - /// The GCD memory space map is checked to see if the memory range starting - /// at the specified Address is available. - /// - EfiGcdAllocateAddress, - /// - /// The GCD memory space map is searched from the highest address down to the lowest address - /// looking for unallocated memory ranges. - /// - EfiGcdAllocateAnySearchTopDown, - /// - /// The GCD memory space map is searched from the specified MaxAddress - /// down to the lowest address looking for unallocated memory ranges. - /// - 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. - @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is - not available yet. -**/ -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_SPECIFICATION_MAJOR_REVISION 1 -#define DXE_SPECIFICATION_MINOR_REVISION 30 -#define DXE_SERVICES_REVISION ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION)) - -typedef struct { - /// - /// The table header for the DXE Services Table. - /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values. - /// - 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; - - -/** - The function prototype for invoking a function on an Application Processor. - - This definition is used by the UEFI MP Serices Protocol, and the - PI SMM System Table. - - @param[in,out] Buffer The pointer to private data buffer. -**/ -typedef -VOID -(EFIAPI *EFI_AP_PROCEDURE)( - IN OUT VOID *Buffer - ); - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiFirmwareFile.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiFirmwareFile.h deleted file mode 100644 index f6cf9574d..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiFirmwareFile.h +++ /dev/null @@ -1,496 +0,0 @@ -/** @file - The firmware file related definitions in PI. - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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.2. - -**/ - - -#ifndef __PI_FIRMWARE_FILE_H__ -#define __PI_FIRMWARE_FILE_H__ - -FILE_LICENCE ( BSD3 ); - -#pragma pack(1) -/// -/// Used to verify the integrity of the file. -/// -typedef union { - struct { - /// - /// The IntegrityCheck.Checksum.Header field is an 8-bit checksum of the file - /// header. The State and IntegrityCheck.Checksum.File fields are assumed - /// to be zero and the checksum is calculated such that the entire header sums to zero. - /// - UINT8 Header; - /// - /// If the FFS_ATTRIB_CHECKSUM (see definition below) bit of the Attributes - /// field is set to one, the IntegrityCheck.Checksum.File field is an 8-bit - /// checksum of the file data. - /// If the FFS_ATTRIB_CHECKSUM bit of the Attributes field is cleared to zero, - /// the IntegrityCheck.Checksum.File field must be initialized with a value of - /// 0xAA. The IntegrityCheck.Checksum.File field is valid any time the - /// EFI_FILE_DATA_VALID bit is set in the State field. - /// - UINT8 File; - } Checksum; - /// - /// This is the full 16 bits of the IntegrityCheck field. - /// - UINT16 Checksum16; -} EFI_FFS_INTEGRITY_CHECK; - -/// -/// FFS_FIXED_CHECKSUM is the checksum value used when the -/// FFS_ATTRIB_CHECKSUM attribute bit is clear. -/// -#define FFS_FIXED_CHECKSUM 0xAA - -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_SMM 0x0A -#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B -#define EFI_FV_FILETYPE_COMBINED_SMM_DXE 0x0C -#define EFI_FV_FILETYPE_SMM_CORE 0x0D -#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_LARGE_FILE 0x01 -#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 { - /// - /// This GUID is the file name. It is used to uniquely identify the file. - /// - EFI_GUID Name; - /// - /// Used to verify the integrity of the file. - /// - EFI_FFS_INTEGRITY_CHECK IntegrityCheck; - /// - /// Identifies the type of file. - /// - EFI_FV_FILETYPE Type; - /// - /// Declares various file attribute bits. - /// - EFI_FFS_FILE_ATTRIBUTES Attributes; - /// - /// The length of the file in bytes, including the FFS header. - /// - UINT8 Size[3]; - /// - /// Used to track the state of the file throughout the life of the file from creation to deletion. - /// - EFI_FFS_FILE_STATE State; -} EFI_FFS_FILE_HEADER; - -typedef struct { - /// - /// This GUID is the file name. It is used to uniquely identify the file. There may be only - /// one instance of a file with the file name GUID of Name in any given firmware - /// volume, except if the file type is EFI_FV_FILETYPE_FFS_PAD. - /// - EFI_GUID Name; - - /// - /// Used to verify the integrity of the file. - /// - EFI_FFS_INTEGRITY_CHECK IntegrityCheck; - - /// - /// Identifies the type of file. - /// - EFI_FV_FILETYPE Type; - - /// - /// Declares various file attribute bits. - /// - EFI_FFS_FILE_ATTRIBUTES Attributes; - - /// - /// The length of the file in bytes, including the FFS header. - /// The length of the file data is either (Size - sizeof(EFI_FFS_FILE_HEADER)). This calculation means a - /// zero-length file has a Size of 24 bytes, which is sizeof(EFI_FFS_FILE_HEADER). - /// Size is not required to be a multiple of 8 bytes. Given a file F, the next file header is - /// located at the next 8-byte aligned firmware volume offset following the last byte of the file F. - /// - UINT8 Size[3]; - - /// - /// Used to track the state of the file throughout the life of the file from creation to deletion. - /// - EFI_FFS_FILE_STATE State; - - /// - /// If FFS_ATTRIB_LARGE_FILE is set in Attributes, then ExtendedSize exists and Size must be set to zero. - /// If FFS_ATTRIB_LARGE_FILE is not set then EFI_FFS_FILE_HEADER is used. - /// - UINT32 ExtendedSize; -} EFI_FFS_FILE_HEADER2; - -#define IS_FFS_FILE2(FfsFileHeaderPtr) \ - (((((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Attributes) & FFS_ATTRIB_LARGE_FILE) == FFS_ATTRIB_LARGE_FILE) - -#define FFS_FILE_SIZE(FfsFileHeaderPtr) \ - ((UINT32) (*((UINT32 *) ((EFI_FFS_FILE_HEADER *) (UINTN) FfsFileHeaderPtr)->Size) & 0x00ffffff)) - -#define FFS_FILE2_SIZE(FfsFileHeaderPtr) \ - (((EFI_FFS_FILE_HEADER2 *) (UINTN) FfsFileHeaderPtr)->ExtendedSize) - -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 - -#define EFI_SECTION_DISPOSABLE 0x03 - -/// -/// 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 -#define EFI_SECTION_SMM_DEPEX 0x1C - -/// -/// Common section header. -/// -typedef struct { - /// - /// A 24-bit unsigned integer that contains the total size of the section in bytes, - /// including the EFI_COMMON_SECTION_HEADER. - /// - UINT8 Size[3]; - EFI_SECTION_TYPE Type; - /// - /// Declares the section type. - /// -} EFI_COMMON_SECTION_HEADER; - -typedef struct { - /// - /// A 24-bit unsigned integer that contains the total size of the section in bytes, - /// including the EFI_COMMON_SECTION_HEADER. - /// - UINT8 Size[3]; - - EFI_SECTION_TYPE Type; - - /// - /// If Size is 0xFFFFFF, then ExtendedSize contains the size of the section. If - /// Size is not equal to 0xFFFFFF, then this field does not exist. - /// - UINT32 ExtendedSize; -} EFI_COMMON_SECTION_HEADER2; - -/// -/// Leaf section type that contains an -/// IA-32 16-bit executable image. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2; - -/// -/// 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 { - /// - /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION. - /// - EFI_COMMON_SECTION_HEADER CommonHeader; - /// - /// The UINT32 that indicates the size of the section data after decompression. - /// - UINT32 UncompressedLength; - /// - /// Indicates which compression algorithm is used. - /// - UINT8 CompressionType; -} EFI_COMPRESSION_SECTION; - -typedef struct { - /// - /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION. - /// - EFI_COMMON_SECTION_HEADER2 CommonHeader; - /// - /// UINT32 that indicates the size of the section data after decompression. - /// - UINT32 UncompressedLength; - /// - /// Indicates which compression algorithm is used. - /// - UINT8 CompressionType; -} EFI_COMPRESSION_SECTION2; - -/// -/// An encapsulation section type in which the section data is disposable. -/// A disposable section is an encapsulation section in which the section data may be disposed of during -/// the process of creating or updating a firmware image without significant impact on the usefulness of -/// the file. The Type field in the section header is set to EFI_SECTION_DISPOSABLE. This -/// allows optional or descriptive data to be included with the firmware file which can be removed in -/// order to conserve space. The contents of this section are implementation specific, but might contain -/// debug data or detailed integration instructions. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_DISPOSABLE_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_DISPOSABLE_SECTION2; - -/// -/// The leaf section which could be used to determine the dispatch order of DXEs. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_DXE_DEPEX_SECTION2; - -/// -/// The leaf section which contains a PI FV. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_FIRMWARE_VOLUME_IMAGE_SECTION2; - -/// -/// The leaf section which contains a single GUID. -/// -typedef struct { - /// - /// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID. - /// - EFI_COMMON_SECTION_HEADER CommonHeader; - /// - /// This GUID is defined by the creator of the file. It is a vendor-defined file type. - /// - EFI_GUID SubTypeGuid; -} EFI_FREEFORM_SUBTYPE_GUID_SECTION; - -typedef struct { - /// - /// The common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID. - /// - EFI_COMMON_SECTION_HEADER2 CommonHeader; - /// - /// This GUID is defined by the creator of the file. It is a vendor-defined file type. - /// - EFI_GUID SubTypeGuid; -} EFI_FREEFORM_SUBTYPE_GUID_SECTION2; - -/// -/// Attributes of EFI_GUID_DEFINED_SECTION. -/// -#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01 -#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02 -/// -/// The leaf section which is encapsulation defined by specific GUID. -/// -typedef struct { - /// - /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED. - /// - EFI_COMMON_SECTION_HEADER CommonHeader; - /// - /// The GUID that defines the format of the data that follows. It is a vendor-defined section type. - /// - EFI_GUID SectionDefinitionGuid; - /// - /// Contains the offset in bytes from the beginning of the common header to the first byte of the data. - /// - UINT16 DataOffset; - /// - /// The bit field that declares some specific characteristics of the section contents. - /// - UINT16 Attributes; -} EFI_GUID_DEFINED_SECTION; - -typedef struct { - /// - /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED. - /// - EFI_COMMON_SECTION_HEADER2 CommonHeader; - /// - /// The GUID that defines the format of the data that follows. It is a vendor-defined section type. - /// - EFI_GUID SectionDefinitionGuid; - /// - /// Contains the offset in bytes from the beginning of the common header to the first byte of the data. - /// - UINT16 DataOffset; - /// - /// The bit field that declares some specific characteristics of the section contents. - /// - UINT16 Attributes; -} EFI_GUID_DEFINED_SECTION2; - -/// -/// The leaf section which contains PE32+ image. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_PE32_SECTION2; - -/// -/// The leaf section used to determine the dispatch order of PEIMs. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_PEI_DEPEX_SECTION2; - -/// -/// A leaf section type that contains a position-independent-code (PIC) image. -/// A PIC image section is a leaf section that contains a position-independent-code (PIC) image. -/// In addition to normal PE32+ images that contain relocation information, PEIM executables may be -/// PIC and are referred to as PIC images. A PIC image is the same as a PE32+ image except that all -/// relocation information has been stripped from the image and the image can be moved and will -/// execute correctly without performing any relocation or other fix-ups. EFI_PIC_SECTION2 must -/// be used if the section is 16MB or larger. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_PIC_SECTION2; - -/// -/// The leaf section which constains the position-independent-code image. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_TE_SECTION2; - -/// -/// The leaf section which contains an array of zero or more bytes. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_RAW_SECTION2; - -/// -/// The SMM dependency expression section is a leaf section that contains a dependency expression that -/// is used to determine the dispatch order for SMM drivers. Before the SMRAM invocation of the -/// SMM driver's entry point, this dependency expression must evaluate to TRUE. See the Platform -/// Initialization Specification, Volume 2, for details regarding the format of the dependency expression. -/// The dependency expression may refer to protocols installed in either the UEFI or the SMM protocol -/// database. EFI_SMM_DEPEX_SECTION2 must be used if the section is 16MB or larger. -/// -typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION; -typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2; - -/// -/// The 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; - -typedef struct { - EFI_COMMON_SECTION_HEADER2 CommonHeader; - CHAR16 FileNameString[1]; -} EFI_USER_INTERFACE_SECTION2; - -/// -/// The 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; - -typedef struct { - EFI_COMMON_SECTION_HEADER2 CommonHeader; - /// - /// A UINT16 that represents a particular build. Subsequent builds have monotonically - /// increasing build numbers relative to earlier builds. - /// - UINT16 BuildNumber; - CHAR16 VersionString[1]; -} EFI_VERSION_SECTION2; - -#define IS_SECTION2(SectionHeaderPtr) \ - ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff) == 0x00ffffff) - -#define SECTION_SIZE(SectionHeaderPtr) \ - ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) (UINTN) SectionHeaderPtr)->Size) & 0x00ffffff)) - -#define SECTION2_SIZE(SectionHeaderPtr) \ - (((EFI_COMMON_SECTION_HEADER2 *) (UINTN) SectionHeaderPtr)->ExtendedSize) - -#pragma pack() - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiFirmwareVolume.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiFirmwareVolume.h deleted file mode 100644 index e818861b7..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiFirmwareVolume.h +++ /dev/null @@ -1,236 +0,0 @@ -/** @file - The firmware volume related definitions in PI. - - Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> - 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.3 - -**/ - -#ifndef __PI_FIRMWAREVOLUME_H__ -#define __PI_FIRMWAREVOLUME_H__ - -FILE_LICENCE ( BSD3 ); - -/// -/// 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_ALIGNMENT_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 -#define EFI_FVB2_WEAK_ALIGNMENT 0x80000000 - -typedef struct { - /// - /// The number of sequential blocks which are of the same size. - /// - UINT32 NumBlocks; - /// - /// The size of the blocks. - /// - UINT32 Length; -} EFI_FV_BLOCK_MAP_ENTRY; - -/// -/// Describes the features and layout of the firmware volume. -/// -typedef struct { - /// - /// The first 16 bytes are reserved to allow for the reset vector of - /// processors whose reset vector is at address 0. - /// - UINT8 ZeroVector[16]; - /// - /// Declares the file system with which the firmware volume is formatted. - /// - EFI_GUID FileSystemGuid; - /// - /// Length in bytes of the complete firmware volume, including the header. - /// - UINT64 FvLength; - /// - /// Set to EFI_FVH_SIGNATURE - /// - UINT32 Signature; - /// - /// Declares capabilities and power-on defaults for the firmware volume. - /// - EFI_FVB_ATTRIBUTES_2 Attributes; - /// - /// Length in bytes of the complete firmware volume header. - /// - UINT16 HeaderLength; - /// - /// A 16-bit checksum of the firmware volume header. A valid header sums to zero. - /// - UINT16 Checksum; - /// - /// Offset, relative to the start of the header, of the extended header - /// (EFI_FIRMWARE_VOLUME_EXT_HEADER) or zero if there is no extended header. - /// - UINT16 ExtHeaderOffset; - /// - /// This field must always be set to zero. - /// - UINT8 Reserved[1]; - /// - /// Set to 2. Future versions of this specification may define new header fields and will - /// increment the Revision field accordingly. - /// - UINT8 Revision; - /// - /// An array of run-length encoded FvBlockMapEntry structures. The array is - /// terminated with an entry of {0,0}. - /// - EFI_FV_BLOCK_MAP_ENTRY BlockMap[1]; -} EFI_FIRMWARE_VOLUME_HEADER; - -#define EFI_FVH_SIGNATURE 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 { - /// - /// Firmware volume name. - /// - EFI_GUID FvName; - /// - /// Size of the rest of the extension header, including this structure. - /// - UINT32 ExtHeaderSize; -} EFI_FIRMWARE_VOLUME_EXT_HEADER; - -/// -/// Entry struture for describing FV extension header -/// -typedef struct { - /// - /// Size of this header extension. - /// - UINT16 ExtEntrySize; - /// - /// Type of the header. - /// - 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 { - /// - /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE. - /// - EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr; - /// - /// A bit mask, one bit for each file type between 0xC0 (bit 0) and 0xDF (bit 31). If a bit - /// is '1', then the GUID entry exists in Types. If a bit is '0' then no GUID entry exists in Types. - /// - UINT32 TypeMask; - /// - /// An array of GUIDs, each GUID representing an OEM file type. - /// - /// EFI_GUID Types[1]; - /// -} EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE; - -#define EFI_FV_EXT_TYPE_GUID_TYPE 0x0002 - -/// -/// This extension header EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE provides a vendor specific -/// GUID FormatType type which includes a length and a successive series of data bytes. -/// -typedef struct { - /// - /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE. - /// - EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr; - /// - /// Vendor-specific GUID. - /// - EFI_GUID FormatType; - /// - /// An arry of bytes of length Length. - /// - /// UINT8 Data[1]; - /// -} EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiHob.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiHob.h deleted file mode 100644 index c68ea3002..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiHob.h +++ /dev/null @@ -1,454 +0,0 @@ -/** @file - HOB related definitions in PI. - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -// -// 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_UNUSED 0x000A -#define EFI_HOB_TYPE_UEFI_CAPSULE 0x000B -#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 { - /// - /// Identifies the HOB data structure type. - /// - UINT16 HobType; - /// - /// The length in bytes of the HOB. - /// - UINT16 HobLength; - /// - /// This field must always be set to zero. - /// - UINT32 Reserved; -} EFI_HOB_GENERIC_HEADER; - - -/// -/// Value of version in EFI_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 { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_HANDOFF. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// The version number pertaining to the PHIT HOB definition. - /// This value is four bytes in length to provide an 8-byte aligned entry - /// when it is combined with the 4-byte BootMode. - /// - UINT32 Version; - /// - /// The system boot mode as determined during the HOB producer phase. - /// - EFI_BOOT_MODE BootMode; - /// - /// The highest address location of memory that is allocated for use by the HOB producer - /// phase. This address must be 4-KB aligned to meet page restrictions of UEFI. - /// - EFI_PHYSICAL_ADDRESS EfiMemoryTop; - /// - /// The lowest address location of memory that is allocated for use by the HOB producer phase. - /// - EFI_PHYSICAL_ADDRESS EfiMemoryBottom; - /// - /// The highest address location of free memory that is currently available - /// for use by the HOB producer phase. - /// - EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop; - /// - /// The lowest address location of free memory that is available for use by the HOB producer phase. - /// - EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom; - /// - /// The end of the HOB list. - /// - 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 { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the - /// various attributes of the logical memory allocation. - /// - 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 post-memory-installed executable -/// content in the HOB producer phase is executing. -/// -typedef struct { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the - /// various attributes of the logical memory allocation. - /// - 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 { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the - /// various attributes of the logical memory allocation. - /// - 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 { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the - /// various attributes of the logical memory allocation. - /// - EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader; - /// - /// The GUID specifying the values of the firmware file system name - /// that contains the HOB consumer phase component. - /// - EFI_GUID ModuleName; - /// - /// The address of the memory-mapped firmware volume - /// that contains the HOB consumer phase firmware file. - /// - EFI_PHYSICAL_ADDRESS EntryPoint; -} EFI_HOB_MEMORY_ALLOCATION_MODULE; - -/// -/// The 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 - -/// -/// A type of recount attribute type. -/// -typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE; - -// -// These types can be ORed together as needed. -// -// The following attributes are used to describe settings -// -#define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001 -#define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002 -#define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004 -#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080 -#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100 -#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200 -// -// The rest of the attributes are used to 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_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 -#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTABLE 0x00100000 -#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE 0x00200000 -#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTABLE 0x00400000 - -/// -/// Describes the resource properties of all fixed, -/// nonrelocatable resource ranges found on the processor -/// host bus during the HOB producer phase. -/// -typedef struct { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_RESOURCE_DESCRIPTOR. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// A GUID representing the owner of the resource. This GUID is used by HOB - /// consumer phase components to correlate device ownership of a resource. - /// - EFI_GUID Owner; - /// - /// The resource type enumeration as defined by EFI_RESOURCE_TYPE. - /// - EFI_RESOURCE_TYPE ResourceType; - /// - /// Resource attributes as defined by EFI_RESOURCE_ATTRIBUTE_TYPE. - /// - EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute; - /// - /// The physical start address of the resource region. - /// - EFI_PHYSICAL_ADDRESS PhysicalStart; - /// - /// The number of bytes of the resource region. - /// - 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 { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_GUID_EXTENSION. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// A GUID that defines the contents of this HOB. - /// - EFI_GUID Name; - // - // Guid specific data goes here - // -} EFI_HOB_GUID_TYPE; - -/// -/// Details the location of firmware volumes that contain firmware files. -/// -typedef struct { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// The physical memory-mapped base address of the firmware volume. - /// - EFI_PHYSICAL_ADDRESS BaseAddress; - /// - /// The length in bytes of the firmware volume. - /// - UINT64 Length; -} EFI_HOB_FIRMWARE_VOLUME; - -/// -/// Details the location of a firmware volume that was extracted -/// from a file within another firmware volume. -/// -typedef struct { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV2. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// The physical memory-mapped base address of the firmware volume. - /// - EFI_PHYSICAL_ADDRESS BaseAddress; - /// - /// The length in bytes of the firmware volume. - /// - UINT64 Length; - /// - /// The name of the firmware volume. - /// - EFI_GUID FvName; - /// - /// The name of the firmware file that contained this firmware volume. - /// - EFI_GUID FileName; -} EFI_HOB_FIRMWARE_VOLUME2; - - -/// -/// Describes processor information, such as address space and I/O space capabilities. -/// -typedef struct { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_CPU. - /// - EFI_HOB_GENERIC_HEADER Header; - /// - /// Identifies the maximum physical memory addressability of the processor. - /// - UINT8 SizeOfMemorySpace; - /// - /// Identifies the maximum physical I/O addressability of the processor. - /// - UINT8 SizeOfIoSpace; - /// - /// This field will always be set to zero. - /// - UINT8 Reserved[6]; -} EFI_HOB_CPU; - - -/// -/// Describes pool memory allocations. -/// -typedef struct { - /// - /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_POOL. - /// - EFI_HOB_GENERIC_HEADER Header; -} EFI_HOB_MEMORY_POOL; - -/// -/// Each UEFI capsule HOB details the location of a UEFI capsule. It includes a base address and length -/// which is based upon memory blocks with a EFI_CAPSULE_HEADER and the associated -/// CapsuleImageSize-based payloads. These HOB's shall be created by the PEI PI firmware -/// sometime after the UEFI UpdateCapsule service invocation with the -/// CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flag set in the EFI_CAPSULE_HEADER. -/// -typedef struct { - /// - /// The HOB generic header where Header.HobType = EFI_HOB_TYPE_UEFI_CAPSULE. - /// - EFI_HOB_GENERIC_HEADER Header; - - /// - /// The physical memory-mapped base address of an UEFI capsule. This value is set to - /// point to the base of the contiguous memory of the UEFI capsule. - /// The length of the contiguous memory in bytes. - /// - EFI_PHYSICAL_ADDRESS BaseAddress; - UINT64 Length; -} EFI_HOB_UEFI_CAPSULE; - -/// -/// 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; - EFI_HOB_UEFI_CAPSULE *Capsule; - UINT8 *Raw; -} EFI_PEI_HOB_POINTERS; - - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiMultiPhase.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiMultiPhase.h deleted file mode 100644 index daf6591f5..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiMultiPhase.h +++ /dev/null @@ -1,167 +0,0 @@ -/** @file - Include file matches things in PI for multiple module types. - -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 elements are defined in UEFI Platform Initialization Specification 1.2. - -**/ - -#ifndef __PI_MULTIPHASE_H__ -#define __PI_MULTIPHASE_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Pi/PiFirmwareVolume.h> -#include <ipxe/efi/Pi/PiFirmwareFile.h> -#include <ipxe/efi/Pi/PiBootMode.h> -#include <ipxe/efi/Pi/PiHob.h> -#include <ipxe/efi/Pi/PiDependency.h> -#include <ipxe/efi/Pi/PiStatusCode.h> -#include <ipxe/efi/Pi/PiS3BootScript.h> - -/** - Produces an error code in the range reserved for use by the Platform Initialization - Architecture Specification. - - The supported 32-bit range is 0xA0000000-0xBFFFFFFF - The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF - - @param StatusCode The status code value to convert into a warning code. - StatusCode must be in the range 0x00000000..0x1FFFFFFF. - - @return The value specified by StatusCode in the PI reserved range. - -**/ -#define DXE_ERROR(StatusCode) (MAX_BIT | (MAX_BIT >> 2) | StatusCode) - -/// -/// If this value is returned by an EFI image, then the image should be unloaded. -/// -#define EFI_REQUEST_UNLOAD_IMAGE DXE_ERROR (1) - -/// -/// If this value is returned by an API, it means the capability is not yet -/// installed/available/ready to use. -/// -#define EFI_NOT_AVAILABLE_YET DXE_ERROR (2) - -/// -/// Success and warning codes reserved for use by PI. -/// Supported 32-bit range is 0x20000000-0x3fffffff. -/// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff. -/// -#define PI_ENCODE_WARNING(a) ((MAX_BIT >> 2) | (a)) - -/// -/// Error codes reserved for use by PI. -/// Supported 32-bit range is 0xa0000000-0xbfffffff. -/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff. -/// -#define PI_ENCODE_ERROR(a) (MAX_BIT | (MAX_BIT >> 2) | (a)) - -/// -/// Return status codes defined in SMM CIS. -/// -#define EFI_INTERRUPT_PENDING PI_ENCODE_ERROR (0) - -#define EFI_WARN_INTERRUPT_SOURCE_PENDING PI_ENCODE_WARNING (0) -#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED PI_ENCODE_WARNING (1) - -/// -/// Bitmask of values for Authentication Status. -/// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL -/// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI -/// -/// xx00 Image was not signed. -/// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the -/// signature was tested, and the signature passed authentication test). -/// 0010 Image was signed, the signature was tested, and the signature passed authentication test. -/// 0110 Image was signed and the signature was not tested. -/// 1010 Image was signed, the signature was tested, and the signature failed the authentication test. -/// -///@{ -#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 -///@} - -/// -/// SMRAM states and capabilities -/// -#define EFI_SMRAM_OPEN 0x00000001 -#define EFI_SMRAM_CLOSED 0x00000002 -#define EFI_SMRAM_LOCKED 0x00000004 -#define EFI_CACHEABLE 0x00000008 -#define EFI_ALLOCATED 0x00000010 -#define EFI_NEEDS_TESTING 0x00000020 -#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040 - -/// -/// Structure describing a SMRAM region and its accessibility attributes. -/// -typedef struct { - /// - /// Designates the physical address of the SMRAM in memory. This view of memory is - /// the same as seen by I/O-based agents, for example, but it may not be the address seen - /// by the processors. - /// - EFI_PHYSICAL_ADDRESS PhysicalStart; - /// - /// Designates the address of the SMRAM, as seen by software executing on the - /// processors. This address may or may not match PhysicalStart. - /// - EFI_PHYSICAL_ADDRESS CpuStart; - /// - /// Describes the number of bytes in the SMRAM region. - /// - UINT64 PhysicalSize; - /// - /// Describes the accessibility attributes of the SMRAM. These attributes include the - /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical - /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC - /// initialization). - /// - UINT64 RegionState; -} EFI_SMRAM_DESCRIPTOR; - -typedef enum { - EFI_PCD_TYPE_8, - EFI_PCD_TYPE_16, - EFI_PCD_TYPE_32, - EFI_PCD_TYPE_64, - EFI_PCD_TYPE_BOOL, - EFI_PCD_TYPE_PTR -} EFI_PCD_TYPE; - -typedef struct { - /// - /// The returned information associated with the requested TokenNumber. If - /// TokenNumber is 0, then PcdType is set to EFI_PCD_TYPE_8. - /// - EFI_PCD_TYPE PcdType; - /// - /// The size of the data in bytes associated with the TokenNumber specified. If - /// TokenNumber is 0, then PcdSize is set 0. - /// - UINTN PcdSize; - /// - /// The null-terminated ASCII string associated with a given token. If the - /// TokenNumber specified was 0, then this field corresponds to the null-terminated - /// ASCII string associated with the token's namespace Guid. If NULL, there is no - /// name associated with this request. - /// - CHAR8 *PcdName; -} EFI_PCD_INFO; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiS3BootScript.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiS3BootScript.h deleted file mode 100644 index 01cae154c..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiS3BootScript.h +++ /dev/null @@ -1,61 +0,0 @@ -/** @file - This file contains the boot script defintions that are shared between the - Boot Script Executor PPI and the Boot Script Save Protocol. - - Copyright (c) 2009, Intel Corporation. All rights reserved.<BR> - 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_S3_BOOT_SCRIPT_H_ -#define _PI_S3_BOOT_SCRIPT_H_ - -FILE_LICENCE ( BSD3 ); - -//******************************************* -// EFI Boot Script Opcode definitions -//******************************************* -#define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE 0x00 -#define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE 0x01 -#define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE 0x02 -#define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE 0x03 -#define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE 0x04 -#define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE 0x05 -#define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE 0x06 -#define EFI_BOOT_SCRIPT_STALL_OPCODE 0x07 -#define EFI_BOOT_SCRIPT_DISPATCH_OPCODE 0x08 -#define EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE 0x09 -#define EFI_BOOT_SCRIPT_INFORMATION_OPCODE 0x0A -#define EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE 0x0B -#define EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE 0x0C -#define EFI_BOOT_SCRIPT_IO_POLL_OPCODE 0x0D -#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE 0x0E -#define EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE 0x0F -#define EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE 0x10 - -//******************************************* -// EFI_BOOT_SCRIPT_WIDTH -//******************************************* -typedef enum { - EfiBootScriptWidthUint8, - EfiBootScriptWidthUint16, - EfiBootScriptWidthUint32, - EfiBootScriptWidthUint64, - EfiBootScriptWidthFifoUint8, - EfiBootScriptWidthFifoUint16, - EfiBootScriptWidthFifoUint32, - EfiBootScriptWidthFifoUint64, - EfiBootScriptWidthFillUint8, - EfiBootScriptWidthFillUint16, - EfiBootScriptWidthFillUint32, - EfiBootScriptWidthFillUint64, - EfiBootScriptWidthMaximum -} EFI_BOOT_SCRIPT_WIDTH; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiStatusCode.h b/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiStatusCode.h deleted file mode 100644 index 5bef98f64..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Pi/PiStatusCode.h +++ /dev/null @@ -1,1201 +0,0 @@ -/** @file - StatusCode related definitions in PI. - -Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 status codes are defined in UEFI Platform Initialization Specification 1.2, - Volume 3: Shared Architectural Elements. - -**/ - -#ifndef __PI_STATUS_CODE_H__ -#define __PI_STATUS_CODE_H__ - -FILE_LICENCE ( BSD3 ); - -// -// Required for IA32, X64, IPF, ARM and EBC defines for CPU exception types -// -#include <ipxe/efi/Protocol/DebugSupport.h> - -/// -/// 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 { - /// - /// The size of the structure. This is specified to enable future expansion. - /// - UINT16 HeaderSize; - /// - /// The size of the data in bytes. This does not include the size of the header structure. - /// - UINT16 Size; - /// - /// The GUID defining the type of the data. - /// - EFI_GUID Type; -} EFI_STATUS_CODE_DATA; - -/// -/// General partitioning scheme for Progress and Error Codes are: -/// - 0x0000-0x0FFF Shared by all sub-classes in a given class. -/// - 0x1000-0x7FFF Subclass Specific. -/// - 0x8000-0xFFFF OEM specific. -///@{ -#define EFI_SUBCLASS_SPECIFIC 0x1000 -#define EFI_OEM_SPECIFIC 0x8000 -///@} - -/// -/// Debug Code definitions for all classes and subclass. -/// Only one debug code is defined at this point and should -/// be used for anything that is sent to the debug stream. -/// -///@{ -#define EFI_DC_UNSPECIFIED 0x0 -///@} - -/// -/// Class definitions. -/// Values of 4-127 are reserved for future use by this specification. -/// Values in the range 127-255 are reserved for OEM use. -/// -///@{ -#define EFI_COMPUTING_UNIT 0x00000000 -#define EFI_PERIPHERAL 0x01000000 -#define EFI_IO_BUS 0x02000000 -#define EFI_SOFTWARE 0x03000000 -///@} - -/// -/// Computing Unit Subclass definitions. -/// Values of 8-127 are reserved for future use by this specification. -/// Values of 128-255 are reserved for OEM use. -/// -///@{ -#define EFI_COMPUTING_UNIT_UNSPECIFIED (EFI_COMPUTING_UNIT | 0x00000000) -#define EFI_COMPUTING_UNIT_HOST_PROCESSOR (EFI_COMPUTING_UNIT | 0x00010000) -#define EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR (EFI_COMPUTING_UNIT | 0x00020000) -#define EFI_COMPUTING_UNIT_IO_PROCESSOR (EFI_COMPUTING_UNIT | 0x00030000) -#define EFI_COMPUTING_UNIT_CACHE (EFI_COMPUTING_UNIT | 0x00040000) -#define EFI_COMPUTING_UNIT_MEMORY (EFI_COMPUTING_UNIT | 0x00050000) -#define EFI_COMPUTING_UNIT_CHIPSET (EFI_COMPUTING_UNIT | 0x00060000) -///@} - -/// -/// Computing Unit Class Progress Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_CU_PC_INIT_BEGIN 0x00000000 -#define EFI_CU_PC_INIT_END 0x00000001 -///@} - -// -// Computing Unit Unspecified Subclass Progress Code definitions. -// - -/// -/// Computing Unit Host Processor Subclass Progress Code definitions. -///@{ -#define EFI_CU_HP_PC_POWER_ON_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CU_HP_PC_CACHE_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_CU_HP_PC_RAM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_CU_HP_PC_MEMORY_CONTROLLER_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_CU_HP_PC_IO_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_CU_HP_PC_BSP_SELECT (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_CU_HP_PC_BSP_RESELECT (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_CU_HP_PC_AP_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000007) -#define EFI_CU_HP_PC_SMM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000008) -///@} - -// -// Computing Unit Firmware Processor Subclass Progress Code definitions. -// - -// -// Computing Unit IO Processor Subclass Progress Code definitions. -// - -/// -/// Computing Unit Cache Subclass Progress Code definitions. -/// -///@{ -#define EFI_CU_CACHE_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CU_CACHE_PC_CONFIGURATION (EFI_SUBCLASS_SPECIFIC | 0x00000001) -///@} - -/// -/// Computing Unit Memory Subclass Progress Code definitions. -/// -///@{ -#define EFI_CU_MEMORY_PC_SPD_READ (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CU_MEMORY_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_CU_MEMORY_PC_TIMING (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_CU_MEMORY_PC_CONFIGURING (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_CU_MEMORY_PC_OPTIMIZING (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_CU_MEMORY_PC_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_CU_MEMORY_PC_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000006) -///@} - -// -// Computing Unit Chipset Subclass Progress Code definitions. -// - -/// -/// South Bridge initialization prior to memory detection. -/// -#define EFI_CHIPSET_PC_PEI_CAR_SB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000000) - -/// -/// North Bridge initialization prior to memory detection. -/// -#define EFI_CHIPSET_PC_PEI_CAR_NB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000001) - -/// -/// South Bridge initialization after memory detection. -/// -#define EFI_CHIPSET_PC_PEI_MEM_SB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000002) - -/// -/// North Bridge initialization after memory detection. -/// -#define EFI_CHIPSET_PC_PEI_MEM_NB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000003) - -/// -/// PCI Host Bridge DXE initialization. -/// -#define EFI_CHIPSET_PC_DXE_HB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000004) - -/// -/// North Bridge DXE initialization. -/// -#define EFI_CHIPSET_PC_DXE_NB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000005) - -/// -/// North Bridge specific SMM initialization in DXE. -/// -#define EFI_CHIPSET_PC_DXE_NB_SMM_INIT (EFI_SUBCLASS_SPECIFIC|0x00000006) - -/// -/// Initialization of the South Bridge specific UEFI Runtime Services. -/// -#define EFI_CHIPSET_PC_DXE_SB_RT_INIT (EFI_SUBCLASS_SPECIFIC|0x00000007) - -/// -/// South Bridge DXE initialization -/// -#define EFI_CHIPSET_PC_DXE_SB_INIT (EFI_SUBCLASS_SPECIFIC|0x00000008) - -/// -/// South Bridge specific SMM initialization in DXE. -/// -#define EFI_CHIPSET_PC_DXE_SB_SMM_INIT (EFI_SUBCLASS_SPECIFIC|0x00000009) - -/// -/// Initialization of the South Bridge devices. -/// -#define EFI_CHIPSET_PC_DXE_SB_DEVICES_INIT (EFI_SUBCLASS_SPECIFIC|0x0000000a) - -/// -/// Computing Unit Class Error Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_CU_EC_NON_SPECIFIC 0x00000000 -#define EFI_CU_EC_DISABLED 0x00000001 -#define EFI_CU_EC_NOT_SUPPORTED 0x00000002 -#define EFI_CU_EC_NOT_DETECTED 0x00000003 -#define EFI_CU_EC_NOT_CONFIGURED 0x00000004 -///@} - -// -// Computing Unit Unspecified Subclass Error Code definitions. -// - -/// -/// Computing Unit Host Processor Subclass Error Code definitions. -/// -///@{ -#define EFI_CU_HP_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CU_HP_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_CU_HP_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_CU_HP_EC_TIMER_EXPIRED (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_CU_HP_EC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_CU_HP_EC_INTERNAL (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_CU_HP_EC_THERMAL (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_CU_HP_EC_LOW_VOLTAGE (EFI_SUBCLASS_SPECIFIC | 0x00000007) -#define EFI_CU_HP_EC_HIGH_VOLTAGE (EFI_SUBCLASS_SPECIFIC | 0x00000008) -#define EFI_CU_HP_EC_CACHE (EFI_SUBCLASS_SPECIFIC | 0x00000009) -#define EFI_CU_HP_EC_MICROCODE_UPDATE (EFI_SUBCLASS_SPECIFIC | 0x0000000A) -#define EFI_CU_HP_EC_CORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x0000000B) -#define EFI_CU_HP_EC_UNCORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x0000000C) -#define EFI_CU_HP_EC_NO_MICROCODE_UPDATE (EFI_SUBCLASS_SPECIFIC | 0x0000000D) -///@} - -/// -/// Computing Unit Firmware Processor Subclass Error Code definitions. -/// -///@{ -#define EFI_CU_FP_EC_HARD_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CU_FP_EC_SOFT_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_CU_FP_EC_COMM_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002) -///@} - -// -// Computing Unit IO Processor Subclass Error Code definitions. -// - -/// -/// Computing Unit Cache Subclass Error Code definitions. -/// -///@{ -#define EFI_CU_CACHE_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CU_CACHE_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_CU_CACHE_EC_INVALID_SIZE (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_CU_CACHE_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000003) -///@} - -/// -/// Computing Unit Memory Subclass Error Code definitions. -/// -///@{ -#define EFI_CU_MEMORY_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CU_MEMORY_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_CU_MEMORY_EC_CORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_CU_MEMORY_EC_UNCORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_CU_MEMORY_EC_SPD_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_CU_MEMORY_EC_INVALID_SIZE (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_CU_MEMORY_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_CU_MEMORY_EC_S3_RESUME_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000007) -#define EFI_CU_MEMORY_EC_UPDATE_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000008) -#define EFI_CU_MEMORY_EC_NONE_DETECTED (EFI_SUBCLASS_SPECIFIC | 0x00000009) -#define EFI_CU_MEMORY_EC_NONE_USEFUL (EFI_SUBCLASS_SPECIFIC | 0x0000000A) -///@} - -/// -/// Computing Unit Chipset Subclass Error Code definitions. -/// -///@{ -#define EFI_CHIPSET_EC_BAD_BATTERY (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_CHIPSET_EC_DXE_NB_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_CHIPSET_EC_DXE_SB_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002) -///@} - -/// -/// Peripheral Subclass definitions. -/// Values of 12-127 are reserved for future use by this specification. -/// Values of 128-255 are reserved for OEM use. -/// -///@{ -#define EFI_PERIPHERAL_UNSPECIFIED (EFI_PERIPHERAL | 0x00000000) -#define EFI_PERIPHERAL_KEYBOARD (EFI_PERIPHERAL | 0x00010000) -#define EFI_PERIPHERAL_MOUSE (EFI_PERIPHERAL | 0x00020000) -#define EFI_PERIPHERAL_LOCAL_CONSOLE (EFI_PERIPHERAL | 0x00030000) -#define EFI_PERIPHERAL_REMOTE_CONSOLE (EFI_PERIPHERAL | 0x00040000) -#define EFI_PERIPHERAL_SERIAL_PORT (EFI_PERIPHERAL | 0x00050000) -#define EFI_PERIPHERAL_PARALLEL_PORT (EFI_PERIPHERAL | 0x00060000) -#define EFI_PERIPHERAL_FIXED_MEDIA (EFI_PERIPHERAL | 0x00070000) -#define EFI_PERIPHERAL_REMOVABLE_MEDIA (EFI_PERIPHERAL | 0x00080000) -#define EFI_PERIPHERAL_AUDIO_INPUT (EFI_PERIPHERAL | 0x00090000) -#define EFI_PERIPHERAL_AUDIO_OUTPUT (EFI_PERIPHERAL | 0x000A0000) -#define EFI_PERIPHERAL_LCD_DEVICE (EFI_PERIPHERAL | 0x000B0000) -#define EFI_PERIPHERAL_NETWORK (EFI_PERIPHERAL | 0x000C0000) -///@} - -/// -/// Peripheral Class Progress Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_P_PC_INIT 0x00000000 -#define EFI_P_PC_RESET 0x00000001 -#define EFI_P_PC_DISABLE 0x00000002 -#define EFI_P_PC_PRESENCE_DETECT 0x00000003 -#define EFI_P_PC_ENABLE 0x00000004 -#define EFI_P_PC_RECONFIG 0x00000005 -#define EFI_P_PC_DETECTED 0x00000006 -///@} - -// -// Peripheral Class Unspecified Subclass Progress Code definitions. -// - -/// -/// Peripheral Class Keyboard Subclass Progress Code definitions. -/// -///@{ -#define EFI_P_KEYBOARD_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_P_KEYBOARD_PC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000001) -///@} - -/// -/// Peripheral Class Mouse Subclass Progress Code definitions. -/// -///@{ -#define EFI_P_MOUSE_PC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000000) -///@} - -// -// Peripheral Class Local Console Subclass Progress Code definitions. -// - -// -// Peripheral Class Remote Console Subclass Progress Code definitions. -// - -/// -/// Peripheral Class Serial Port Subclass Progress Code definitions. -/// -///@{ -#define EFI_P_SERIAL_PORT_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000) -///@} - -// -// Peripheral Class Parallel Port Subclass Progress Code definitions. -// - -// -// Peripheral Class Fixed Media Subclass Progress Code definitions. -// - -// -// Peripheral Class Removable Media Subclass Progress Code definitions. -// - -// -// Peripheral Class Audio Input Subclass Progress Code definitions. -// - -// -// Peripheral Class Audio Output Subclass Progress Code definitions. -// - -// -// Peripheral Class LCD Device Subclass Progress Code definitions. -// - -// -// Peripheral Class Network Subclass Progress Code definitions. -// - -/// -/// Peripheral Class Error Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_P_EC_NON_SPECIFIC 0x00000000 -#define EFI_P_EC_DISABLED 0x00000001 -#define EFI_P_EC_NOT_SUPPORTED 0x00000002 -#define EFI_P_EC_NOT_DETECTED 0x00000003 -#define EFI_P_EC_NOT_CONFIGURED 0x00000004 -#define EFI_P_EC_INTERFACE_ERROR 0x00000005 -#define EFI_P_EC_CONTROLLER_ERROR 0x00000006 -#define EFI_P_EC_INPUT_ERROR 0x00000007 -#define EFI_P_EC_OUTPUT_ERROR 0x00000008 -#define EFI_P_EC_RESOURCE_CONFLICT 0x00000009 -///@} - -// -// Peripheral Class Unspecified Subclass Error Code definitions. -// - -/// -/// Peripheral Class Keyboard Subclass Error Code definitions. -/// -///@{ -#define EFI_P_KEYBOARD_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_P_KEYBOARD_EC_STUCK_KEY (EFI_SUBCLASS_SPECIFIC | 0x00000001) -///@} - -/// -/// Peripheral Class Mouse Subclass Error Code definitions. -/// -///@{ -#define EFI_P_MOUSE_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000) -///@} - -// -// Peripheral Class Local Console Subclass Error Code definitions. -// - -// -// Peripheral Class Remote Console Subclass Error Code definitions. -// - -// -// Peripheral Class Serial Port Subclass Error Code definitions. -// - -// -// Peripheral Class Parallel Port Subclass Error Code definitions. -// - -// -// Peripheral Class Fixed Media Subclass Error Code definitions. -// - -// -// Peripheral Class Removable Media Subclass Error Code definitions. -// - -// -// Peripheral Class Audio Input Subclass Error Code definitions. -// - -// -// Peripheral Class Audio Output Subclass Error Code definitions. -// - -// -// Peripheral Class LCD Device Subclass Error Code definitions. -// - -// -// Peripheral Class Network Subclass Error Code definitions. -// - -/// -/// IO Bus Subclass definitions. -/// Values of 14-127 are reserved for future use by this specification. -/// Values of 128-255 are reserved for OEM use. -/// -///@{ -#define EFI_IO_BUS_UNSPECIFIED (EFI_IO_BUS | 0x00000000) -#define EFI_IO_BUS_PCI (EFI_IO_BUS | 0x00010000) -#define EFI_IO_BUS_USB (EFI_IO_BUS | 0x00020000) -#define EFI_IO_BUS_IBA (EFI_IO_BUS | 0x00030000) -#define EFI_IO_BUS_AGP (EFI_IO_BUS | 0x00040000) -#define EFI_IO_BUS_PC_CARD (EFI_IO_BUS | 0x00050000) -#define EFI_IO_BUS_LPC (EFI_IO_BUS | 0x00060000) -#define EFI_IO_BUS_SCSI (EFI_IO_BUS | 0x00070000) -#define EFI_IO_BUS_ATA_ATAPI (EFI_IO_BUS | 0x00080000) -#define EFI_IO_BUS_FC (EFI_IO_BUS | 0x00090000) -#define EFI_IO_BUS_IP_NETWORK (EFI_IO_BUS | 0x000A0000) -#define EFI_IO_BUS_SMBUS (EFI_IO_BUS | 0x000B0000) -#define EFI_IO_BUS_I2C (EFI_IO_BUS | 0x000C0000) -///@} - -/// -/// IO Bus Class Progress Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_IOB_PC_INIT 0x00000000 -#define EFI_IOB_PC_RESET 0x00000001 -#define EFI_IOB_PC_DISABLE 0x00000002 -#define EFI_IOB_PC_DETECT 0x00000003 -#define EFI_IOB_PC_ENABLE 0x00000004 -#define EFI_IOB_PC_RECONFIG 0x00000005 -#define EFI_IOB_PC_HOTPLUG 0x00000006 -///@} - -// -// IO Bus Class Unspecified Subclass Progress Code definitions. -// - -/// -/// IO Bus Class PCI Subclass Progress Code definitions. -/// -///@{ -#define EFI_IOB_PCI_BUS_ENUM (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_IOB_PCI_RES_ALLOC (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_IOB_PCI_HPC_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000002) -///@} - -// -// IO Bus Class USB Subclass Progress Code definitions. -// - -// -// IO Bus Class IBA Subclass Progress Code definitions. -// - -// -// IO Bus Class AGP Subclass Progress Code definitions. -// - -// -// IO Bus Class PC Card Subclass Progress Code definitions. -// - -// -// IO Bus Class LPC Subclass Progress Code definitions. -// - -// -// IO Bus Class SCSI Subclass Progress Code definitions. -// - -// -// IO Bus Class ATA/ATAPI Subclass Progress Code definitions. -// -#define EFI_IOB_ATA_BUS_SMART_ENABLE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_IOB_ATA_BUS_SMART_DISABLE (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_IOB_ATA_BUS_SMART_UNDERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000003) -// -// IO Bus Class FC Subclass Progress Code definitions. -// - -// -// IO Bus Class IP Network Subclass Progress Code definitions. -// - -// -// IO Bus Class SMBUS Subclass Progress Code definitions. -// - -// -// IO Bus Class I2C Subclass Progress Code definitions. -// - -/// -/// IO Bus Class Error Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_IOB_EC_NON_SPECIFIC 0x00000000 -#define EFI_IOB_EC_DISABLED 0x00000001 -#define EFI_IOB_EC_NOT_SUPPORTED 0x00000002 -#define EFI_IOB_EC_NOT_DETECTED 0x00000003 -#define EFI_IOB_EC_NOT_CONFIGURED 0x00000004 -#define EFI_IOB_EC_INTERFACE_ERROR 0x00000005 -#define EFI_IOB_EC_CONTROLLER_ERROR 0x00000006 -#define EFI_IOB_EC_READ_ERROR 0x00000007 -#define EFI_IOB_EC_WRITE_ERROR 0x00000008 -#define EFI_IOB_EC_RESOURCE_CONFLICT 0x00000009 -///@} - -// -// IO Bus Class Unspecified Subclass Error Code definitions. -// - -/// -/// IO Bus Class PCI Subclass Error Code definitions. -/// -///@{ -#define EFI_IOB_PCI_EC_PERR (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_IOB_PCI_EC_SERR (EFI_SUBCLASS_SPECIFIC | 0x00000001) -///@} - -// -// IO Bus Class USB Subclass Error Code definitions. -// - -// -// IO Bus Class IBA Subclass Error Code definitions. -// - -// -// IO Bus Class AGP Subclass Error Code definitions. -// - -// -// IO Bus Class PC Card Subclass Error Code definitions. -// - -// -// IO Bus Class LPC Subclass Error Code definitions. -// - -// -// IO Bus Class SCSI Subclass Error Code definitions. -// - -// -// IO Bus Class ATA/ATAPI Subclass Error Code definitions. -// -#define EFI_IOB_ATA_BUS_SMART_NOTSUPPORTED (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_IOB_ATA_BUS_SMART_DISABLED (EFI_SUBCLASS_SPECIFIC | 0x00000001) - -// -// IO Bus Class FC Subclass Error Code definitions. -// - -// -// IO Bus Class IP Network Subclass Error Code definitions. -// - -// -// IO Bus Class SMBUS Subclass Error Code definitions. -// - -// -// IO Bus Class I2C Subclass Error Code definitions. -// - -/// -/// Software Subclass definitions. -/// Values of 14-127 are reserved for future use by this specification. -/// Values of 128-255 are reserved for OEM use. -/// -///@{ -#define EFI_SOFTWARE_UNSPECIFIED (EFI_SOFTWARE | 0x00000000) -#define EFI_SOFTWARE_SEC (EFI_SOFTWARE | 0x00010000) -#define EFI_SOFTWARE_PEI_CORE (EFI_SOFTWARE | 0x00020000) -#define EFI_SOFTWARE_PEI_MODULE (EFI_SOFTWARE | 0x00030000) -#define EFI_SOFTWARE_DXE_CORE (EFI_SOFTWARE | 0x00040000) -#define EFI_SOFTWARE_DXE_BS_DRIVER (EFI_SOFTWARE | 0x00050000) -#define EFI_SOFTWARE_DXE_RT_DRIVER (EFI_SOFTWARE | 0x00060000) -#define EFI_SOFTWARE_SMM_DRIVER (EFI_SOFTWARE | 0x00070000) -#define EFI_SOFTWARE_EFI_APPLICATION (EFI_SOFTWARE | 0x00080000) -#define EFI_SOFTWARE_EFI_OS_LOADER (EFI_SOFTWARE | 0x00090000) -#define EFI_SOFTWARE_RT (EFI_SOFTWARE | 0x000A0000) -#define EFI_SOFTWARE_AL (EFI_SOFTWARE | 0x000B0000) -#define EFI_SOFTWARE_EBC_EXCEPTION (EFI_SOFTWARE | 0x000C0000) -#define EFI_SOFTWARE_IA32_EXCEPTION (EFI_SOFTWARE | 0x000D0000) -#define EFI_SOFTWARE_IPF_EXCEPTION (EFI_SOFTWARE | 0x000E0000) -#define EFI_SOFTWARE_PEI_SERVICE (EFI_SOFTWARE | 0x000F0000) -#define EFI_SOFTWARE_EFI_BOOT_SERVICE (EFI_SOFTWARE | 0x00100000) -#define EFI_SOFTWARE_EFI_RUNTIME_SERVICE (EFI_SOFTWARE | 0x00110000) -#define EFI_SOFTWARE_EFI_DXE_SERVICE (EFI_SOFTWARE | 0x00120000) -#define EFI_SOFTWARE_X64_EXCEPTION (EFI_SOFTWARE | 0x00130000) -#define EFI_SOFTWARE_ARM_EXCEPTION (EFI_SOFTWARE | 0x00140000) - -///@} - -/// -/// Software Class Progress Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_SW_PC_INIT 0x00000000 -#define EFI_SW_PC_LOAD 0x00000001 -#define EFI_SW_PC_INIT_BEGIN 0x00000002 -#define EFI_SW_PC_INIT_END 0x00000003 -#define EFI_SW_PC_AUTHENTICATE_BEGIN 0x00000004 -#define EFI_SW_PC_AUTHENTICATE_END 0x00000005 -#define EFI_SW_PC_INPUT_WAIT 0x00000006 -#define EFI_SW_PC_USER_SETUP 0x00000007 -///@} - -// -// Software Class Unspecified Subclass Progress Code definitions. -// - -/// -/// Software Class SEC Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_SEC_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_SEC_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) -///@} - -/// -/// Software Class PEI Core Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_PEI_CORE_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_PEI_CORE_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002) -///@} - -/// -/// Software Class PEI Module Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_PEI_PC_RECOVERY_BEGIN (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_PEI_PC_CAPSULE_LOAD (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_PEI_PC_CAPSULE_START (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_PEI_PC_RECOVERY_USER (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_PEI_PC_RECOVERY_AUTO (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_SW_PEI_PC_S3_BOOT_SCRIPT (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_SW_PEI_PC_OS_WAKE (EFI_SUBCLASS_SPECIFIC | 0x00000006) -///@} - -/// -/// Software Class DXE Core Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_DXE_CORE_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_DXE_CORE_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_DXE_CORE_PC_START_DRIVER (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_DXE_CORE_PC_ARCH_READY (EFI_SUBCLASS_SPECIFIC | 0x00000004) -///@} - -/// -/// Software Class DXE BS Driver Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000004) -///@} - -// -// Software Class SMM Driver Subclass Progress Code definitions. -// - -// -// Software Class EFI Application Subclass Progress Code definitions. -// - -// -// Software Class EFI OS Loader Subclass Progress Code definitions. -// - -/// -/// Software Class EFI RT Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_RT_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_RT_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_RT_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002) -///@} - -// -// Software Class X64 Exception Subclass Progress Code definitions. -// - -// -// Software Class ARM Exception Subclass Progress Code definitions. -// - -// -// Software Class EBC Exception Subclass Progress Code definitions. -// - -// -// Software Class IA32 Exception Subclass Progress Code definitions. -// - -// -// Software Class X64 Exception Subclass Progress Code definitions. -// - -// -// Software Class IPF Exception Subclass Progress Code definitions. -// - -/// -/// Software Class PEI Services Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_PS_PC_INSTALL_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_PS_PC_REINSTALL_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_PS_PC_LOCATE_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_PS_PC_NOTIFY_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_PS_PC_GET_BOOT_MODE (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_SW_PS_PC_SET_BOOT_MODE (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_SW_PS_PC_GET_HOB_LIST (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_SW_PS_PC_CREATE_HOB (EFI_SUBCLASS_SPECIFIC | 0x00000007) -#define EFI_SW_PS_PC_FFS_FIND_NEXT_VOLUME (EFI_SUBCLASS_SPECIFIC | 0x00000008) -#define EFI_SW_PS_PC_FFS_FIND_NEXT_FILE (EFI_SUBCLASS_SPECIFIC | 0x00000009) -#define EFI_SW_PS_PC_FFS_FIND_SECTION_DATA (EFI_SUBCLASS_SPECIFIC | 0x0000000A) -#define EFI_SW_PS_PC_INSTALL_PEI_MEMORY (EFI_SUBCLASS_SPECIFIC | 0x0000000B) -#define EFI_SW_PS_PC_ALLOCATE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x0000000C) -#define EFI_SW_PS_PC_ALLOCATE_POOL (EFI_SUBCLASS_SPECIFIC | 0x0000000D) -#define EFI_SW_PS_PC_COPY_MEM (EFI_SUBCLASS_SPECIFIC | 0x0000000E) -#define EFI_SW_PS_PC_SET_MEM (EFI_SUBCLASS_SPECIFIC | 0x0000000F) -#define EFI_SW_PS_PC_RESET_SYSTEM (EFI_SUBCLASS_SPECIFIC | 0x00000010) -#define EFI_SW_PS_PC_FFS_FIND_FILE_BY_NAME (EFI_SUBCLASS_SPECIFIC | 0x00000013) -#define EFI_SW_PS_PC_FFS_GET_FILE_INFO (EFI_SUBCLASS_SPECIFIC | 0x00000014) -#define EFI_SW_PS_PC_FFS_GET_VOLUME_INFO (EFI_SUBCLASS_SPECIFIC | 0x00000015) -#define EFI_SW_PS_PC_FFS_REGISTER_FOR_SHADOW (EFI_SUBCLASS_SPECIFIC | 0x00000016) -///@} - -/// -/// Software Class EFI Boot Services Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_BS_PC_RAISE_TPL (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_BS_PC_RESTORE_TPL (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_BS_PC_ALLOCATE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_BS_PC_FREE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_BS_PC_GET_MEMORY_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_SW_BS_PC_ALLOCATE_POOL (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_SW_BS_PC_FREE_POOL (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_SW_BS_PC_CREATE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000007) -#define EFI_SW_BS_PC_SET_TIMER (EFI_SUBCLASS_SPECIFIC | 0x00000008) -#define EFI_SW_BS_PC_WAIT_FOR_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000009) -#define EFI_SW_BS_PC_SIGNAL_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000A) -#define EFI_SW_BS_PC_CLOSE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000B) -#define EFI_SW_BS_PC_CHECK_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000C) -#define EFI_SW_BS_PC_INSTALL_PROTOCOL_INTERFACE (EFI_SUBCLASS_SPECIFIC | 0x0000000D) -#define EFI_SW_BS_PC_REINSTALL_PROTOCOL_INTERFACE (EFI_SUBCLASS_SPECIFIC | 0x0000000E) -#define EFI_SW_BS_PC_UNINSTALL_PROTOCOL_INTERFACE (EFI_SUBCLASS_SPECIFIC | 0x0000000F) -#define EFI_SW_BS_PC_HANDLE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000010) -#define EFI_SW_BS_PC_PC_HANDLE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000011) -#define EFI_SW_BS_PC_REGISTER_PROTOCOL_NOTIFY (EFI_SUBCLASS_SPECIFIC | 0x00000012) -#define EFI_SW_BS_PC_LOCATE_HANDLE (EFI_SUBCLASS_SPECIFIC | 0x00000013) -#define EFI_SW_BS_PC_INSTALL_CONFIGURATION_TABLE (EFI_SUBCLASS_SPECIFIC | 0x00000014) -#define EFI_SW_BS_PC_LOAD_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000015) -#define EFI_SW_BS_PC_START_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000016) -#define EFI_SW_BS_PC_EXIT (EFI_SUBCLASS_SPECIFIC | 0x00000017) -#define EFI_SW_BS_PC_UNLOAD_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000018) -#define EFI_SW_BS_PC_EXIT_BOOT_SERVICES (EFI_SUBCLASS_SPECIFIC | 0x00000019) -#define EFI_SW_BS_PC_GET_NEXT_MONOTONIC_COUNT (EFI_SUBCLASS_SPECIFIC | 0x0000001A) -#define EFI_SW_BS_PC_STALL (EFI_SUBCLASS_SPECIFIC | 0x0000001B) -#define EFI_SW_BS_PC_SET_WATCHDOG_TIMER (EFI_SUBCLASS_SPECIFIC | 0x0000001C) -#define EFI_SW_BS_PC_CONNECT_CONTROLLER (EFI_SUBCLASS_SPECIFIC | 0x0000001D) -#define EFI_SW_BS_PC_DISCONNECT_CONTROLLER (EFI_SUBCLASS_SPECIFIC | 0x0000001E) -#define EFI_SW_BS_PC_OPEN_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x0000001F) -#define EFI_SW_BS_PC_CLOSE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000020) -#define EFI_SW_BS_PC_OPEN_PROTOCOL_INFORMATION (EFI_SUBCLASS_SPECIFIC | 0x00000021) -#define EFI_SW_BS_PC_PROTOCOLS_PER_HANDLE (EFI_SUBCLASS_SPECIFIC | 0x00000022) -#define EFI_SW_BS_PC_LOCATE_HANDLE_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000023) -#define EFI_SW_BS_PC_LOCATE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000024) -#define EFI_SW_BS_PC_INSTALL_MULTIPLE_INTERFACES (EFI_SUBCLASS_SPECIFIC | 0x00000025) -#define EFI_SW_BS_PC_UNINSTALL_MULTIPLE_INTERFACES (EFI_SUBCLASS_SPECIFIC | 0x00000026) -#define EFI_SW_BS_PC_CALCULATE_CRC_32 (EFI_SUBCLASS_SPECIFIC | 0x00000027) -#define EFI_SW_BS_PC_COPY_MEM (EFI_SUBCLASS_SPECIFIC | 0x00000028) -#define EFI_SW_BS_PC_SET_MEM (EFI_SUBCLASS_SPECIFIC | 0x00000029) -#define EFI_SW_BS_PC_CREATE_EVENT_EX (EFI_SUBCLASS_SPECIFIC | 0x0000002A) -///@} - -/// -/// Software Class EFI Runtime Services Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_RS_PC_GET_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_RS_PC_SET_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_RS_PC_GET_WAKEUP_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_RS_PC_SET_WAKEUP_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_SW_RS_PC_CONVERT_POINTER (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_SW_RS_PC_GET_VARIABLE (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_SW_RS_PC_GET_NEXT_VARIABLE_NAME (EFI_SUBCLASS_SPECIFIC | 0x00000007) -#define EFI_SW_RS_PC_SET_VARIABLE (EFI_SUBCLASS_SPECIFIC | 0x00000008) -#define EFI_SW_RS_PC_GET_NEXT_HIGH_MONOTONIC_COUNT (EFI_SUBCLASS_SPECIFIC | 0x00000009) -#define EFI_SW_RS_PC_RESET_SYSTEM (EFI_SUBCLASS_SPECIFIC | 0x0000000A) -#define EFI_SW_RS_PC_UPDATE_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x0000000B) -#define EFI_SW_RS_PC_QUERY_CAPSULE_CAPABILITIES (EFI_SUBCLASS_SPECIFIC | 0x0000000C) -#define EFI_SW_RS_PC_QUERY_VARIABLE_INFO (EFI_SUBCLASS_SPECIFIC | 0x0000000D) -///@} - -/// -/// Software Class EFI DXE Services Subclass Progress Code definitions -/// -///@{ -#define EFI_SW_DS_PC_ADD_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_DS_PC_ALLOCATE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_DS_PC_FREE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_DS_PC_REMOVE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_DS_PC_GET_MEMORY_SPACE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_SW_DS_PC_SET_MEMORY_SPACE_ATTRIBUTES (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_SW_DS_PC_GET_MEMORY_SPACE_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_SW_DS_PC_ADD_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000007) -#define EFI_SW_DS_PC_ALLOCATE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000008) -#define EFI_SW_DS_PC_FREE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000009) -#define EFI_SW_DS_PC_REMOVE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x0000000A) -#define EFI_SW_DS_PC_GET_IO_SPACE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x0000000B) -#define EFI_SW_DS_PC_GET_IO_SPACE_MAP (EFI_SUBCLASS_SPECIFIC | 0x0000000C) -#define EFI_SW_DS_PC_DISPATCH (EFI_SUBCLASS_SPECIFIC | 0x0000000D) -#define EFI_SW_DS_PC_SCHEDULE (EFI_SUBCLASS_SPECIFIC | 0x0000000E) -#define EFI_SW_DS_PC_TRUST (EFI_SUBCLASS_SPECIFIC | 0x0000000F) -#define EFI_SW_DS_PC_PROCESS_FIRMWARE_VOLUME (EFI_SUBCLASS_SPECIFIC | 0x00000010) -///@} - -/// -/// Software Class Error Code definitions. -/// These are shared by all subclasses. -/// -///@{ -#define EFI_SW_EC_NON_SPECIFIC 0x00000000 -#define EFI_SW_EC_LOAD_ERROR 0x00000001 -#define EFI_SW_EC_INVALID_PARAMETER 0x00000002 -#define EFI_SW_EC_UNSUPPORTED 0x00000003 -#define EFI_SW_EC_INVALID_BUFFER 0x00000004 -#define EFI_SW_EC_OUT_OF_RESOURCES 0x00000005 -#define EFI_SW_EC_ABORTED 0x00000006 -#define EFI_SW_EC_ILLEGAL_SOFTWARE_STATE 0x00000007 -#define EFI_SW_EC_ILLEGAL_HARDWARE_STATE 0x00000008 -#define EFI_SW_EC_START_ERROR 0x00000009 -#define EFI_SW_EC_BAD_DATE_TIME 0x0000000A -#define EFI_SW_EC_CFG_INVALID 0x0000000B -#define EFI_SW_EC_CFG_CLR_REQUEST 0x0000000C -#define EFI_SW_EC_CFG_DEFAULT 0x0000000D -#define EFI_SW_EC_PWD_INVALID 0x0000000E -#define EFI_SW_EC_PWD_CLR_REQUEST 0x0000000F -#define EFI_SW_EC_PWD_CLEARED 0x00000010 -#define EFI_SW_EC_EVENT_LOG_FULL 0x00000011 -///@} - -// -// Software Class Unspecified Subclass Error Code definitions. -// - -// -// Software Class SEC Subclass Error Code definitions. -// - -/// -/// Software Class PEI Core Subclass Error Code definitions. -/// -///@{ -#define EFI_SW_PEI_CORE_EC_DXE_CORRUPT (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_PEI_CORE_EC_DXEIPL_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_PEI_CORE_EC_MEMORY_NOT_INSTALLED (EFI_SUBCLASS_SPECIFIC | 0x00000002) -///@} - -/// -/// Software Class PEI Module Subclass Error Code definitions. -/// -///@{ -#define EFI_SW_PEI_EC_NO_RECOVERY_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_PEI_EC_INVALID_CAPSULE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_PEI_EC_S3_RESUME_PPI_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_PEI_EC_S3_BOOT_SCRIPT_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_PEI_EC_S3_OS_WAKE_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_SW_PEI_EC_S3_RESUME_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_SW_PEI_EC_RECOVERY_PPI_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000006) -#define EFI_SW_PEI_EC_RECOVERY_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000007) -///@} - -/// -/// Software Class DXE Foundation Subclass Error Code definitions. -/// -///@{ -#define EFI_SW_DXE_CORE_EC_NO_ARCH (EFI_SUBCLASS_SPECIFIC | 0x00000000) -///@} - - -/// -/// Software Class DXE Boot Service Driver Subclass Error Code definitions. -/// -///@{ -#define EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_DXE_BS_EC_INVALID_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_DXE_BS_EC_INVALID_IDE_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000004) -///@} - -// -// Software Class DXE Runtime Service Driver Subclass Error Code definitions. -// - -// -// Software Class SMM Driver Subclass Error Code definitions. -// - -// -// Software Class EFI Application Subclass Error Code definitions. -// - -// -// Software Class EFI OS Loader Subclass Error Code definitions. -// - -// -// Software Class EFI RT Subclass Error Code definitions. -// - -// -// Software Class EFI AL Subclass Error Code definitions. -// - -/// -/// Software Class EBC Exception Subclass Error Code definitions. -/// These exceptions are derived from the debug protocol definitions in the EFI -/// specification. -/// -///@{ -#define EFI_SW_EC_EBC_UNDEFINED 0x00000000 -#define EFI_SW_EC_EBC_DIVIDE_ERROR EXCEPT_EBC_DIVIDE_ERROR -#define EFI_SW_EC_EBC_DEBUG EXCEPT_EBC_DEBUG -#define EFI_SW_EC_EBC_BREAKPOINT EXCEPT_EBC_BREAKPOINT -#define EFI_SW_EC_EBC_OVERFLOW EXCEPT_EBC_OVERFLOW -#define EFI_SW_EC_EBC_INVALID_OPCODE EXCEPT_EBC_INVALID_OPCODE -#define EFI_SW_EC_EBC_STACK_FAULT EXCEPT_EBC_STACK_FAULT -#define EFI_SW_EC_EBC_ALIGNMENT_CHECK EXCEPT_EBC_ALIGNMENT_CHECK -#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING EXCEPT_EBC_INSTRUCTION_ENCODING -#define EFI_SW_EC_EBC_BAD_BREAK EXCEPT_EBC_BAD_BREAK -#define EFI_SW_EC_EBC_STEP EXCEPT_EBC_STEP -///@} - -/// -/// Software Class IA32 Exception Subclass Error Code definitions. -/// These exceptions are derived from the debug protocol definitions in the EFI -/// specification. -/// -///@{ -#define EFI_SW_EC_IA32_DIVIDE_ERROR EXCEPT_IA32_DIVIDE_ERROR -#define EFI_SW_EC_IA32_DEBUG EXCEPT_IA32_DEBUG -#define EFI_SW_EC_IA32_NMI EXCEPT_IA32_NMI -#define EFI_SW_EC_IA32_BREAKPOINT EXCEPT_IA32_BREAKPOINT -#define EFI_SW_EC_IA32_OVERFLOW EXCEPT_IA32_OVERFLOW -#define EFI_SW_EC_IA32_BOUND EXCEPT_IA32_BOUND -#define EFI_SW_EC_IA32_INVALID_OPCODE EXCEPT_IA32_INVALID_OPCODE -#define EFI_SW_EC_IA32_DOUBLE_FAULT EXCEPT_IA32_DOUBLE_FAULT -#define EFI_SW_EC_IA32_INVALID_TSS EXCEPT_IA32_INVALID_TSS -#define EFI_SW_EC_IA32_SEG_NOT_PRESENT EXCEPT_IA32_SEG_NOT_PRESENT -#define EFI_SW_EC_IA32_STACK_FAULT EXCEPT_IA32_STACK_FAULT -#define EFI_SW_EC_IA32_GP_FAULT EXCEPT_IA32_GP_FAULT -#define EFI_SW_EC_IA32_PAGE_FAULT EXCEPT_IA32_PAGE_FAULT -#define EFI_SW_EC_IA32_FP_ERROR EXCEPT_IA32_FP_ERROR -#define EFI_SW_EC_IA32_ALIGNMENT_CHECK EXCEPT_IA32_ALIGNMENT_CHECK -#define EFI_SW_EC_IA32_MACHINE_CHECK EXCEPT_IA32_MACHINE_CHECK -#define EFI_SW_EC_IA32_SIMD EXCEPT_IA32_SIMD -///@} - -/// -/// Software Class IPF Exception Subclass Error Code definitions. -/// These exceptions are derived from the debug protocol definitions in the EFI -/// specification. -/// -///@{ -#define EFI_SW_EC_IPF_ALT_DTLB EXCEPT_IPF_ALT_DTLB -#define EFI_SW_EC_IPF_DNESTED_TLB EXCEPT_IPF_DNESTED_TLB -#define EFI_SW_EC_IPF_BREAKPOINT EXCEPT_IPF_BREAKPOINT -#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT EXCEPT_IPF_EXTERNAL_INTERRUPT -#define EFI_SW_EC_IPF_GEN_EXCEPT EXCEPT_IPF_GEN_EXCEPT -#define EFI_SW_EC_IPF_NAT_CONSUMPTION EXCEPT_IPF_NAT_CONSUMPTION -#define EFI_SW_EC_IPF_DEBUG_EXCEPT EXCEPT_IPF_DEBUG_EXCEPT -#define EFI_SW_EC_IPF_UNALIGNED_ACCESS EXCEPT_IPF_UNALIGNED_ACCESS -#define EFI_SW_EC_IPF_FP_FAULT EXCEPT_IPF_FP_FAULT -#define EFI_SW_EC_IPF_FP_TRAP EXCEPT_IPF_FP_TRAP -#define EFI_SW_EC_IPF_TAKEN_BRANCH EXCEPT_IPF_TAKEN_BRANCH -#define EFI_SW_EC_IPF_SINGLE_STEP EXCEPT_IPF_SINGLE_STEP -///@} - -/// -/// Software Class PEI Service Subclass Error Code definitions. -/// -///@{ -#define EFI_SW_PS_EC_RESET_NOT_AVAILABLE (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_PS_EC_MEMORY_INSTALLED_TWICE (EFI_SUBCLASS_SPECIFIC | 0x00000001) -///@} - -// -// Software Class EFI Boot Service Subclass Error Code definitions. -// - -// -// Software Class EFI Runtime Service Subclass Error Code definitions. -// - -/// -/// Software Class EFI DXE Service Subclass Error Code definitions. -/// -///@{ -#define EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS (EFI_SUBCLASS_SPECIFIC | 0x00000005) -#define EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000006) -///@} - -/// -/// Software Class DXE RT Driver Subclass Progress Code definitions. -/// -///@{ -#define EFI_SW_DXE_RT_PC_S0 (EFI_SUBCLASS_SPECIFIC | 0x00000000) -#define EFI_SW_DXE_RT_PC_S1 (EFI_SUBCLASS_SPECIFIC | 0x00000001) -#define EFI_SW_DXE_RT_PC_S2 (EFI_SUBCLASS_SPECIFIC | 0x00000002) -#define EFI_SW_DXE_RT_PC_S3 (EFI_SUBCLASS_SPECIFIC | 0x00000003) -#define EFI_SW_DXE_RT_PC_S4 (EFI_SUBCLASS_SPECIFIC | 0x00000004) -#define EFI_SW_DXE_RT_PC_S5 (EFI_SUBCLASS_SPECIFIC | 0x00000005) -///@} - -/// -/// Software Class X64 Exception Subclass Error Code definitions. -/// These exceptions are derived from the debug protocol -/// definitions in the EFI specification. -/// -///@{ -#define EFI_SW_EC_X64_DIVIDE_ERROR EXCEPT_X64_DIVIDE_ERROR -#define EFI_SW_EC_X64_DEBUG EXCEPT_X64_DEBUG -#define EFI_SW_EC_X64_NMI EXCEPT_X64_NMI -#define EFI_SW_EC_X64_BREAKPOINT EXCEPT_X64_BREAKPOINT -#define EFI_SW_EC_X64_OVERFLOW EXCEPT_X64_OVERFLOW -#define EFI_SW_EC_X64_BOUND EXCEPT_X64_BOUND -#define EFI_SW_EC_X64_INVALID_OPCODE EXCEPT_X64_INVALID_OPCODE -#define EFI_SW_EC_X64_DOUBLE_FAULT EXCEPT_X64_DOUBLE_FAULT -#define EFI_SW_EC_X64_INVALID_TSS EXCEPT_X64_INVALID_TSS -#define EFI_SW_EC_X64_SEG_NOT_PRESENT EXCEPT_X64_SEG_NOT_PRESENT -#define EFI_SW_EC_X64_STACK_FAULT EXCEPT_X64_STACK_FAULT -#define EFI_SW_EC_X64_GP_FAULT EXCEPT_X64_GP_FAULT -#define EFI_SW_EC_X64_PAGE_FAULT EXCEPT_X64_PAGE_FAULT -#define EFI_SW_EC_X64_FP_ERROR EXCEPT_X64_FP_ERROR -#define EFI_SW_EC_X64_ALIGNMENT_CHECK EXCEPT_X64_ALIGNMENT_CHECK -#define EFI_SW_EC_X64_MACHINE_CHECK EXCEPT_X64_MACHINE_CHECK -#define EFI_SW_EC_X64_SIMD EXCEPT_X64_SIMD -///@} - -/// -/// Software Class ARM Exception Subclass Error Code definitions. -/// These exceptions are derived from the debug protocol -/// definitions in the EFI specification. -/// -///@{ -#define EFI_SW_EC_ARM_RESET EXCEPT_ARM_RESET -#define EFI_SW_EC_ARM_UNDEFINED_INSTRUCTION EXCEPT_ARM_UNDEFINED_INSTRUCTION -#define EFI_SW_EC_ARM_SOFTWARE_INTERRUPT EXCEPT_ARM_SOFTWARE_INTERRUPT -#define EFI_SW_EC_ARM_PREFETCH_ABORT EXCEPT_ARM_PREFETCH_ABORT -#define EFI_SW_EC_ARM_DATA_ABORT EXCEPT_ARM_DATA_ABORT -#define EFI_SW_EC_ARM_RESERVED EXCEPT_ARM_RESERVED -#define EFI_SW_EC_ARM_IRQ EXCEPT_ARM_IRQ -#define EFI_SW_EC_ARM_FIQ EXCEPT_ARM_FIQ -///@} - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/PiDxe.h b/qemu/roms/ipxe/src/include/ipxe/efi/PiDxe.h deleted file mode 100644 index 94433680d..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/PiDxe.h +++ /dev/null @@ -1,27 +0,0 @@ -/** @file - - Root include file for Mde Package DXE_CORE, DXE, RUNTIME, SMM, SAL type modules. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Uefi/UefiBaseType.h> -#include <ipxe/efi/Uefi/UefiSpec.h> - -#include <ipxe/efi/Pi/PiDxeCis.h> - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/ProcessorBind.h b/qemu/roms/ipxe/src/include/ipxe/efi/ProcessorBind.h deleted file mode 100644 index 7466814fa..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/ProcessorBind.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _IPXE_EFI_PROCESSOR_BIND_H -#define _IPXE_EFI_PROCESSOR_BIND_H - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -/* - * 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 <ipxe/efi/Ia32/ProcessorBind.h> -#endif - -#if __x86_64__ -#include <ipxe/efi/X64/ProcessorBind.h> -#endif - -#endif /* _IPXE_EFI_PROCESSOR_BIND_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Arp.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Arp.h deleted file mode 100644 index 80921f9a0..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Arp.h +++ /dev/null @@ -1,387 +0,0 @@ -/** @file - EFI ARP Protocol Definition - - The EFI ARP Service Binding Protocol is used to locate EFI - ARP Protocol drivers to create and destroy child of the - driver to communicate with other host using ARP protocol. - The EFI ARP Protocol provides services to map IP network - address to hardware address used by a data link protocol. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol was introduced in UEFI Specification 2.0. - -**/ - -#ifndef __EFI_ARP_PROTOCOL_H__ -#define __EFI_ARP_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \ - { \ - 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \ - } - -#define EFI_ARP_PROTOCOL_GUID \ - { \ - 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \ - } - -typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL; - -typedef struct { - /// - /// Length in bytes of this entry. - /// - UINT32 Size; - - /// - /// Set to TRUE if this entry is a "deny" entry. - /// Set to FALSE if this entry is a "normal" entry. - /// - BOOLEAN DenyFlag; - - /// - /// Set to TRUE if this entry will not time out. - /// Set to FALSE if this entry will time out. - /// - BOOLEAN StaticFlag; - - /// - /// 16-bit ARP hardware identifier number. - /// - UINT16 HwAddressType; - - /// - /// 16-bit protocol type number. - /// - UINT16 SwAddressType; - - /// - /// The length of the hardware address. - /// - UINT8 HwAddressLength; - - /// - /// The length of the protocol address. - /// - UINT8 SwAddressLength; -} EFI_ARP_FIND_DATA; - -typedef struct { - /// - /// 16-bit protocol type number in host byte order. - /// - UINT16 SwAddressType; - - /// - /// The length in bytes of the station's protocol address to register. - /// - UINT8 SwAddressLength; - - /// - /// The pointer to the first byte of the protocol address to register. For - /// example, if SwAddressType is 0x0800 (IP), then - /// StationAddress points to the first byte of this station's IP - /// address stored in network byte order. - /// - VOID *StationAddress; - - /// - /// The timeout value in 100-ns units that is associated with each - /// new dynamic ARP cache entry. If it is set to zero, the value is - /// implementation-specific. - /// - UINT32 EntryTimeOut; - - /// - /// The number of retries before a MAC address is resolved. If it is - /// set to zero, the value is implementation-specific. - /// - UINT32 RetryCount; - - /// - /// The timeout value in 100-ns units that is used to wait for the ARP - /// reply packet or the timeout value between two retries. Set to zero - /// to use implementation-specific value. - /// - UINT32 RetryTimeOut; -} EFI_ARP_CONFIG_DATA; - - -/** - This function is used to assign a station address to the ARP cache for this instance - of the ARP driver. - - Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will - respond to ARP requests that match this registered station address. A call to - this function with the ConfigData field set to NULL will reset this ARP instance. - - Once a protocol type and station address have been assigned to this ARP instance, - all the following ARP functions will use this information. Attempting to change - the protocol type or station address to a configured ARP instance will result in errors. - - @param This The pointer to the EFI_ARP_PROTOCOL instance. - @param ConfigData The pointer to the EFI_ARP_CONFIG_DATA structure. - - @retval EFI_SUCCESS The new station address was successfully - registered. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - * This is NULL. - * SwAddressLength is zero when ConfigData is not NULL. - * StationAddress is NULL when ConfigData is not NULL. - @retval EFI_ACCESS_DENIED The SwAddressType, SwAddressLength, or - StationAddress is different from the one that is - already registered. - @retval EFI_OUT_OF_RESOURCES Storage for the new StationAddress could not be - allocated. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ARP_CONFIGURE)( - IN EFI_ARP_PROTOCOL *This, - IN EFI_ARP_CONFIG_DATA *ConfigData OPTIONAL - ); - -/** - This function is used to insert entries into the ARP cache. - - ARP cache entries are typically inserted and updated by network protocol drivers - as network traffic is processed. Most ARP cache entries will time out and be - deleted if the network traffic stops. ARP cache entries that were inserted - by the Add() function may be static (will not time out) or dynamic (will time out). - Default ARP cache timeout values are not covered in most network protocol - specifications (although RFC 1122 comes pretty close) and will only be - discussed in general terms in this specification. The timeout values that are - used in the EFI Sample Implementation should be used only as a guideline. - Final product implementations of the EFI network stack should be tuned for - their expected network environments. - - @param This Pointer to the EFI_ARP_PROTOCOL instance. - @param DenyFlag Set to TRUE if this entry is a deny entry. Set to - FALSE if this entry is a normal entry. - @param TargetSwAddress Pointer to a protocol address to add (or deny). - May be set to NULL if DenyFlag is TRUE. - @param TargetHwAddress Pointer to a hardware address to add (or deny). - May be set to NULL if DenyFlag is TRUE. - @param TimeoutValue Time in 100-ns units that this entry will remain - in the ARP cache. A value of zero means that the - entry is permanent. A nonzero value will override - the one given by Configure() if the entry to be - added is a dynamic entry. - @param Overwrite If TRUE, the matching cache entry will be - overwritten with the supplied parameters. If - FALSE, EFI_ACCESS_DENIED is returned if the - corresponding cache entry already exists. - - @retval EFI_SUCCESS The entry has been added or updated. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - * This is NULL. - * DenyFlag is FALSE and TargetHwAddress is NULL. - * DenyFlag is FALSE and TargetSwAddress is NULL. - * TargetHwAddress is NULL and TargetSwAddress is NULL. - * Neither TargetSwAddress nor TargetHwAddress are NULL when DenyFlag is - TRUE. - @retval EFI_OUT_OF_RESOURCES The new ARP cache entry could not be allocated. - @retval EFI_ACCESS_DENIED The ARP cache entry already exists and Overwrite - is not true. - @retval EFI_NOT_STARTED The ARP driver instance has not been configured. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ARP_ADD)( - IN EFI_ARP_PROTOCOL *This, - IN BOOLEAN DenyFlag, - IN VOID *TargetSwAddress OPTIONAL, - IN VOID *TargetHwAddress OPTIONAL, - IN UINT32 TimeoutValue, - IN BOOLEAN Overwrite - ); - -/** - This function searches the ARP cache for matching entries and allocates a buffer into - which those entries are copied. - - The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which - are protocol address pairs and hardware address pairs. - When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer - is not NULL), the ARP cache timeout for the found entry is reset if Refresh is - set to TRUE. If the found ARP cache entry is a permanent entry, it is not - affected by Refresh. - - @param This The pointer to the EFI_ARP_PROTOCOL instance. - @param BySwAddress Set to TRUE to look for matching software protocol - addresses. Set to FALSE to look for matching - hardware protocol addresses. - @param AddressBuffer The pointer to the address buffer. Set to NULL - to match all addresses. - @param EntryLength The size of an entry in the entries buffer. - @param EntryCount The number of ARP cache entries that are found by - the specified criteria. - @param Entries The pointer to the buffer that will receive the ARP - cache entries. - @param Refresh Set to TRUE to refresh the timeout value of the - matching ARP cache entry. - - @retval EFI_SUCCESS The requested ARP cache entries were copied into - the buffer. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - This is NULL. Both EntryCount and EntryLength are - NULL, when Refresh is FALSE. - @retval EFI_NOT_FOUND No matching entries were found. - @retval EFI_NOT_STARTED The ARP driver instance has not been configured. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ARP_FIND)( - IN EFI_ARP_PROTOCOL *This, - IN BOOLEAN BySwAddress, - IN VOID *AddressBuffer OPTIONAL, - OUT UINT32 *EntryLength OPTIONAL, - OUT UINT32 *EntryCount OPTIONAL, - OUT EFI_ARP_FIND_DATA **Entries OPTIONAL, - IN BOOLEAN Refresh - ); - - -/** - This function removes specified ARP cache entries. - - @param This The pointer to the EFI_ARP_PROTOCOL instance. - @param BySwAddress Set to TRUE to delete matching protocol addresses. - Set to FALSE to delete matching hardware - addresses. - @param AddressBuffer The pointer to the address buffer that is used as a - key to look for the cache entry. Set to NULL to - delete all entries. - - @retval EFI_SUCCESS The entry was removed from the ARP cache. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_FOUND The specified deletion key was not found. - @retval EFI_NOT_STARTED The ARP driver instance has not been configured. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ARP_DELETE)( - IN EFI_ARP_PROTOCOL *This, - IN BOOLEAN BySwAddress, - IN VOID *AddressBuffer OPTIONAL - ); - -/** - This function delete all dynamic entries from the ARP cache that match the specified - software protocol type. - - @param This The pointer to the EFI_ARP_PROTOCOL instance. - - @retval EFI_SUCCESS The cache has been flushed. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_FOUND There are no matching dynamic cache entries. - @retval EFI_NOT_STARTED The ARP driver instance has not been configured. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ARP_FLUSH)( - IN EFI_ARP_PROTOCOL *This - ); - -/** - This function tries to resolve the TargetSwAddress and optionally returns a - TargetHwAddress if it already exists in the ARP cache. - - @param This The pointer to the EFI_ARP_PROTOCOL instance. - @param TargetSwAddress The pointer to the protocol address to resolve. - @param ResolvedEvent The pointer to the event that will be signaled when - the address is resolved or some error occurs. - @param TargetHwAddress The pointer to the buffer for the resolved hardware - address in network byte order. - - @retval EFI_SUCCESS The data is copied from the ARP cache into the - TargetHwAddress buffer. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - This is NULL. TargetHwAddress is NULL. - @retval EFI_ACCESS_DENIED The requested address is not present in the normal - ARP cache but is present in the deny address list. - Outgoing traffic to that address is forbidden. - @retval EFI_NOT_STARTED The ARP driver instance has not been configured. - @retval EFI_NOT_READY The request has been started and is not finished. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ARP_REQUEST)( - IN EFI_ARP_PROTOCOL *This, - IN VOID *TargetSwAddress OPTIONAL, - IN EFI_EVENT ResolvedEvent OPTIONAL, - OUT VOID *TargetHwAddress - ); - -/** - This function aborts the previous ARP request (identified by This, TargetSwAddress - and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request(). - - If the request is in the internal ARP request queue, the request is aborted - immediately and its ResolvedEvent is signaled. Only an asynchronous address - request needs to be canceled. If TargeSwAddress and ResolveEvent are both - NULL, all the pending asynchronous requests that have been issued by This - instance will be cancelled and their corresponding events will be signaled. - - @param This The pointer to the EFI_ARP_PROTOCOL instance. - @param TargetSwAddress The pointer to the protocol address in previous - request session. - @param ResolvedEvent Pointer to the event that is used as the - notification event in previous request session. - - @retval EFI_SUCCESS The pending request session(s) is/are aborted and - corresponding event(s) is/are signaled. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - This is NULL. TargetSwAddress is not NULL and - ResolvedEvent is NULL. TargetSwAddress is NULL and - ResolvedEvent is not NULL. - @retval EFI_NOT_STARTED The ARP driver instance has not been configured. - @retval EFI_NOT_FOUND The request is not issued by - EFI_ARP_PROTOCOL.Request(). - - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_ARP_CANCEL)( - IN EFI_ARP_PROTOCOL *This, - IN VOID *TargetSwAddress OPTIONAL, - IN EFI_EVENT ResolvedEvent OPTIONAL - ); - -/// -/// ARP is used to resolve local network protocol addresses into -/// network hardware addresses. -/// -struct _EFI_ARP_PROTOCOL { - EFI_ARP_CONFIGURE Configure; - EFI_ARP_ADD Add; - EFI_ARP_FIND Find; - EFI_ARP_DELETE Delete; - EFI_ARP_FLUSH Flush; - EFI_ARP_REQUEST Request; - EFI_ARP_CANCEL Cancel; -}; - - -extern EFI_GUID gEfiArpServiceBindingProtocolGuid; -extern EFI_GUID gEfiArpProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/BlockIo.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/BlockIo.h deleted file mode 100644 index f45154bb1..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/BlockIo.h +++ /dev/null @@ -1,243 +0,0 @@ -/** @file - Block IO protocol as defined in the UEFI 2.0 specification. - - The Block IO protocol is used to abstract block devices like hard drives, - DVD-ROMs and floppy drives. - - Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> - 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 __BLOCK_IO_H__ -#define __BLOCK_IO_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_BLOCK_IO_PROTOCOL_GUID \ - { \ - 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -typedef struct _EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL; - -/// -/// Protocol GUID name defined in EFI1.1. -/// -#define BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL_GUID - -/// -/// Protocol defined in EFI1.1. -/// -typedef EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO; - -/** - Reset the Block Device. - - @param This Indicates a pointer to the calling context. - @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_BLOCK_RESET)( - IN EFI_BLOCK_IO_PROTOCOL *This, - IN BOOLEAN ExtendedVerification - ); - -/** - Read BufferSize bytes from Lba into Buffer. - - @param This Indicates a pointer to the calling context. - @param MediaId Id of the media, changes every time the media is replaced. - @param Lba The starting Logical Block Address to read from - @param BufferSize Size of Buffer, must be a multiple of device block size. - @param Buffer A pointer to the destination buffer for the data. The caller is - responsible for either having implicit or explicit ownership of the buffer. - - @retval EFI_SUCCESS The data was read correctly from the device. - @retval EFI_DEVICE_ERROR The device reported an error while performing the read. - @retval EFI_NO_MEDIA There is no media in the device. - @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device. - @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device. - @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid, - or the buffer is not on proper alignment. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_BLOCK_READ)( - IN EFI_BLOCK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN EFI_LBA Lba, - IN UINTN BufferSize, - OUT VOID *Buffer - ); - -/** - Write BufferSize bytes from Lba into Buffer. - - @param This Indicates a pointer to the calling context. - @param MediaId The media ID that the write request is for. - @param Lba The starting logical block address to be written. The caller is - responsible for writing to only legitimate locations. - @param BufferSize Size of Buffer, must be a multiple of device block size. - @param Buffer A pointer to the source buffer for the data. - - @retval EFI_SUCCESS The data was written correctly to the device. - @retval EFI_WRITE_PROTECTED The device can not be written to. - @retval EFI_DEVICE_ERROR The device reported an error while performing the write. - @retval EFI_NO_MEDIA There is no media in the device. - @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device. - @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device. - @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid, - or the buffer is not on proper alignment. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_BLOCK_WRITE)( - IN EFI_BLOCK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN EFI_LBA Lba, - IN UINTN BufferSize, - IN VOID *Buffer - ); - -/** - Flush the Block Device. - - @param This Indicates a pointer to the calling context. - - @retval EFI_SUCCESS All outstanding data was written to the device - @retval EFI_DEVICE_ERROR The device reported an error while writting back the data - @retval EFI_NO_MEDIA There is no media in the device. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_BLOCK_FLUSH)( - IN EFI_BLOCK_IO_PROTOCOL *This - ); - -/** - Block IO read only mode data and updated only via members of BlockIO -**/ -typedef struct { - /// - /// The curent media Id. If the media changes, this value is changed. - /// - UINT32 MediaId; - - /// - /// TRUE if the media is removable; otherwise, FALSE. - /// - BOOLEAN RemovableMedia; - - /// - /// TRUE if there is a media currently present in the device; - /// othersise, FALSE. THis field shows the media present status - /// as of the most recent ReadBlocks() or WriteBlocks() call. - /// - BOOLEAN MediaPresent; - - /// - /// TRUE if LBA 0 is the first block of a partition; otherwise - /// FALSE. For media with only one partition this would be TRUE. - /// - BOOLEAN LogicalPartition; - - /// - /// TRUE if the media is marked read-only otherwise, FALSE. - /// This field shows the read-only status as of the most recent WriteBlocks () call. - /// - BOOLEAN ReadOnly; - - /// - /// TRUE if the WriteBlock () function caches write data. - /// - BOOLEAN WriteCaching; - - /// - /// The intrinsic block size of the device. If the media changes, then - /// this field is updated. - /// - UINT32 BlockSize; - - /// - /// Supplies the alignment requirement for any buffer to read or write block(s). - /// - UINT32 IoAlign; - - /// - /// The last logical block address on the device. - /// If the media changes, then this field is updated. - /// - EFI_LBA LastBlock; - - /// - /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to - /// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the first LBA is aligned to - /// a physical block boundary. - /// - EFI_LBA LowestAlignedLba; - - /// - /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to - /// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the number of logical blocks - /// per physical block. - /// - UINT32 LogicalBlocksPerPhysicalBlock; - - /// - /// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to - /// EFI_BLOCK_IO_PROTOCOL_REVISION3. Returns the optimal transfer length - /// granularity as a number of logical blocks. - /// - UINT32 OptimalTransferLengthGranularity; -} EFI_BLOCK_IO_MEDIA; - -#define EFI_BLOCK_IO_PROTOCOL_REVISION 0x00010000 -#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001 -#define EFI_BLOCK_IO_PROTOCOL_REVISION3 0x00020031 - -/// -/// Revision defined in EFI1.1. -/// -#define EFI_BLOCK_IO_INTERFACE_REVISION EFI_BLOCK_IO_PROTOCOL_REVISION - -/// -/// This protocol provides control over block devices. -/// -struct _EFI_BLOCK_IO_PROTOCOL { - /// - /// The revision to which the block IO interface adheres. All future - /// revisions must be backwards compatible. If a future version is not - /// back wards compatible, it is not the same GUID. - /// - UINT64 Revision; - /// - /// Pointer to the EFI_BLOCK_IO_MEDIA data for this device. - /// - EFI_BLOCK_IO_MEDIA *Media; - - EFI_BLOCK_RESET Reset; - EFI_BLOCK_READ ReadBlocks; - EFI_BLOCK_WRITE WriteBlocks; - EFI_BLOCK_FLUSH FlushBlocks; - -}; - -extern EFI_GUID gEfiBlockIoProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/BusSpecificDriverOverride.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/BusSpecificDriverOverride.h deleted file mode 100644 index be92323fc..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/BusSpecificDriverOverride.h +++ /dev/null @@ -1,74 +0,0 @@ -/** @file - Bus Specific Driver Override protocol as defined in the UEFI 2.0 specification. - - Bus drivers that have a bus specific algorithm for matching drivers to controllers are - required to produce this protocol for each controller. For example, a PCI Bus Driver will produce an - instance of this protocol for every PCI controller that has a PCI option ROM that contains one or - more UEFI drivers. The protocol instance is attached to the handle of the PCI controller. - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> - 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_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_ -#define _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_ - -FILE_LICENCE ( BSD3 ); - -/// -/// Global ID for the Bus Specific Driver Override Protocol -/// -#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \ - { \ - 0x3bc1b285, 0x8a15, 0x4a82, {0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65 } \ - } - -typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL; - -// -// Prototypes for the Bus Specific Driver Override Protocol -// - -/** - Uses a bus specific algorithm to retrieve a driver image handle for a controller. - - @param This A pointer to the EFI_BUS_SPECIFIC_DRIVER_ - OVERRIDE_PROTOCOL instance. - @param DriverImageHandle On input, a pointer to the previous driver image handle returned - by GetDriver(). On output, a pointer to the next driver - image handle. Passing in a NULL, will return the first driver - image handle. - - @retval EFI_SUCCESS A bus specific override driver is returned in DriverImageHandle. - @retval EFI_NOT_FOUND The end of the list of override drivers was reached. - A bus specific override driver is not returned in DriverImageHandle. - @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a - previous call to GetDriver(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER)( - IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This, - IN OUT EFI_HANDLE *DriverImageHandle - ); - -/// -/// This protocol matches one or more drivers to a controller. This protocol is produced by a bus driver, -/// and it is installed on the child handles of buses that require a bus specific algorithm for matching -/// drivers to controllers. -/// -struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL { - EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver; -}; - -extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ComponentName.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ComponentName.h deleted file mode 100644 index 87b6d61a0..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ComponentName.h +++ /dev/null @@ -1,131 +0,0 @@ -/** @file - EFI Component Name Protocol as defined in the EFI 1.1 specification. - This protocol is used to retrieve user readable names of EFI Drivers - and controllers managed by EFI Drivers. - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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_NAME_H__ -#define __EFI_COMPONENT_NAME_H__ - -FILE_LICENCE ( BSD3 ); - -/// -/// The global ID for the Component Name Protocol. -/// -#define EFI_COMPONENT_NAME_PROTOCOL_GUID \ - { \ - 0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ - } - -typedef struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL; - - -/** - Retrieves a Unicode string that is the user-readable name of the EFI Driver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance. - @param Language A pointer to a three-character ISO 639-2 language identifier. - This is the language of the driver name that 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. - @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_NAME_GET_DRIVER_NAME)( - IN EFI_COMPONENT_NAME_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_NAME_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 three character ISO 639-2 language - identifier. This is the language of the controller 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. - @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 NULL. - @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_NAME_GET_CONTROLLER_NAME)( - IN EFI_COMPONENT_NAME_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_NAME_PROTOCOL { - EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName; - EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName; - /// - /// A Null-terminated ASCII string that contains one or more - /// ISO 639-2 language codes. This is the list of language codes - /// that this protocol supports. - /// - CHAR8 *SupportedLanguages; -}; - -extern EFI_GUID gEfiComponentNameProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ComponentName2.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ComponentName2.h deleted file mode 100644 index 82d8b2561..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/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 - 2011, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -/// -/// 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 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 4646 language code - format. - - @param DriverName A pointer to the string to return. - This string is the name of the - driver specified by This in the language - specified by Language. - - @retval EFI_SUCCESS The 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 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 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 4646 language code - format. - - @param ControllerName A pointer to the string to return. - This 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 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 NULL. - - @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 4646 format. - /// - CHAR8 *SupportedLanguages; -}; - -extern EFI_GUID gEfiComponentName2ProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ConsoleControl/ConsoleControl.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ConsoleControl/ConsoleControl.h deleted file mode 100644 index 0bf5799e6..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ConsoleControl/ConsoleControl.h +++ /dev/null @@ -1,124 +0,0 @@ -/*++ - -Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR> -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: - - ConsoleControl.h - -Abstract: - - Abstraction of a Text mode or GOP/UGA screen - ---*/ - -#ifndef __CONSOLE_CONTROL_H__ -#define __CONSOLE_CONTROL_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \ - { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} } - -typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL; - - -typedef enum { - EfiConsoleControlScreenText, - EfiConsoleControlScreenGraphics, - EfiConsoleControlScreenMaxValue -} EFI_CONSOLE_CONTROL_SCREEN_MODE; - - -typedef -EFI_STATUS -(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) ( - IN EFI_CONSOLE_CONTROL_PROTOCOL *This, - OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, - OUT BOOLEAN *GopUgaExists, OPTIONAL - OUT BOOLEAN *StdInLocked OPTIONAL - ) -/*++ - - Routine Description: - Return the current video mode information. Also returns info about existence - of Graphics Output devices or UGA Draw devices in system, and if the Std In - device is locked. All the arguments are optional and only returned if a non - NULL pointer is passed in. - - Arguments: - This - Protocol instance pointer. - Mode - Are we in text of grahics mode. - GopUgaExists - TRUE if Console Spliter has found a GOP or UGA device - StdInLocked - TRUE if StdIn device is keyboard locked - - Returns: - EFI_SUCCESS - Mode information returned. - ---*/ -; - - -typedef -EFI_STATUS -(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) ( - IN EFI_CONSOLE_CONTROL_PROTOCOL *This, - IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode - ) -/*++ - - Routine Description: - Set the current mode to either text or graphics. Graphics is - for Quiet Boot. - - Arguments: - This - Protocol instance pointer. - Mode - Mode to set the - - Returns: - EFI_SUCCESS - Mode information returned. - ---*/ -; - - -typedef -EFI_STATUS -(EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) ( - IN EFI_CONSOLE_CONTROL_PROTOCOL *This, - IN CHAR16 *Password - ) -/*++ - - Routine Description: - Lock Std In devices until Password is typed. - - Arguments: - This - Protocol instance pointer. - Password - Password needed to unlock screen. NULL means unlock keyboard - - Returns: - EFI_SUCCESS - Mode information returned. - EFI_DEVICE_ERROR - Std In not locked - ---*/ -; - - - -struct _EFI_CONSOLE_CONTROL_PROTOCOL { - EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode; - EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode; - EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn; -}; - -extern EFI_GUID gEfiConsoleControlProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Cpu.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Cpu.h deleted file mode 100644 index 665924e88..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Cpu.h +++ /dev/null @@ -1,302 +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 - 2011, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/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; - -/// -/// The type of flush operation -/// -typedef enum { - EfiCpuFlushTypeWriteBackInvalidate, - EfiCpuFlushTypeWriteBack, - EfiCpuFlushTypeInvalidate, - EfiCpuMaxFlushType -} EFI_CPU_FLUSH_TYPE; - -/// -/// The type of processor INIT. -/// -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. If TimerValue does not increment at a predictable rate, then 0 is - returned. This parameter is optional and may be NULL. - - @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. - Attributes specified an illegal combination of attributes that - cannot be set together. - @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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DebugSupport.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DebugSupport.h deleted file mode 100644 index e2b4b203a..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DebugSupport.h +++ /dev/null @@ -1,780 +0,0 @@ -/** @file - DebugSupport protocol and supporting definitions as defined in the UEFI2.4 - specification. - - The DebugSupport protocol is used by source level debuggers to abstract the - processor and handle context save and restore operations. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> - -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/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 } \ - } - -/// -/// Processor exception to be hooked. -/// All exception types for IA32, X64, Itanium and EBC processors are defined. -/// -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 - -/// -/// 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; - -/// -/// IA-32 processor context definition. -/// -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 - -/// -/// 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; - -/// -/// x64 processor context definition. -/// -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; - -/// -/// Itanium Processor Family 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; - - - -/// -/// ARM processor exception types. -/// -#define EXCEPT_ARM_RESET 0 -#define EXCEPT_ARM_UNDEFINED_INSTRUCTION 1 -#define EXCEPT_ARM_SOFTWARE_INTERRUPT 2 -#define EXCEPT_ARM_PREFETCH_ABORT 3 -#define EXCEPT_ARM_DATA_ABORT 4 -#define EXCEPT_ARM_RESERVED 5 -#define EXCEPT_ARM_IRQ 6 -#define EXCEPT_ARM_FIQ 7 - -/// -/// For coding convenience, define the maximum valid ARM exception. -/// -#define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ - -/// -/// ARM processor context definition. -/// -typedef struct { - UINT32 R0; - UINT32 R1; - UINT32 R2; - UINT32 R3; - UINT32 R4; - UINT32 R5; - UINT32 R6; - UINT32 R7; - UINT32 R8; - UINT32 R9; - UINT32 R10; - UINT32 R11; - UINT32 R12; - UINT32 SP; - UINT32 LR; - UINT32 PC; - UINT32 CPSR; - UINT32 DFSR; - UINT32 DFAR; - UINT32 IFSR; - UINT32 IFAR; -} EFI_SYSTEM_CONTEXT_ARM; - - -/// -/// AARCH64 processor exception types. -/// -#define EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS 0 -#define EXCEPT_AARCH64_IRQ 1 -#define EXCEPT_AARCH64_FIQ 2 -#define EXCEPT_AARCH64_SERROR 3 - -/// -/// For coding convenience, define the maximum valid ARM exception. -/// -#define MAX_AARCH64_EXCEPTION EXCEPT_AARCH64_SERROR - -typedef struct { - // General Purpose Registers - UINT64 X0; - UINT64 X1; - UINT64 X2; - UINT64 X3; - UINT64 X4; - UINT64 X5; - UINT64 X6; - UINT64 X7; - UINT64 X8; - UINT64 X9; - UINT64 X10; - UINT64 X11; - UINT64 X12; - UINT64 X13; - UINT64 X14; - UINT64 X15; - UINT64 X16; - UINT64 X17; - UINT64 X18; - UINT64 X19; - UINT64 X20; - UINT64 X21; - UINT64 X22; - UINT64 X23; - UINT64 X24; - UINT64 X25; - UINT64 X26; - UINT64 X27; - UINT64 X28; - UINT64 FP; // x29 - Frame pointer - UINT64 LR; // x30 - Link Register - UINT64 SP; // x31 - Stack pointer - - // FP/SIMD Registers - UINT64 V0[2]; - UINT64 V1[2]; - UINT64 V2[2]; - UINT64 V3[2]; - UINT64 V4[2]; - UINT64 V5[2]; - UINT64 V6[2]; - UINT64 V7[2]; - UINT64 V8[2]; - UINT64 V9[2]; - UINT64 V10[2]; - UINT64 V11[2]; - UINT64 V12[2]; - UINT64 V13[2]; - UINT64 V14[2]; - UINT64 V15[2]; - UINT64 V16[2]; - UINT64 V17[2]; - UINT64 V18[2]; - UINT64 V19[2]; - UINT64 V20[2]; - UINT64 V21[2]; - UINT64 V22[2]; - UINT64 V23[2]; - UINT64 V24[2]; - UINT64 V25[2]; - UINT64 V26[2]; - UINT64 V27[2]; - UINT64 V28[2]; - UINT64 V29[2]; - UINT64 V30[2]; - UINT64 V31[2]; - - UINT64 ELR; // Exception Link Register - UINT64 SPSR; // Saved Processor Status Register - UINT64 FPSR; // Floating Point Status Register - UINT64 ESR; // Exception syndrome register - UINT64 FAR; // Fault Address Register -} EFI_SYSTEM_CONTEXT_AARCH64; - - -/// -/// 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_ARM *SystemContextArm; - EFI_SYSTEM_CONTEXT_AARCH64 *SystemContextAArch64; -} 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 -(EFIAPI *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 -(EFIAPI *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 - IsaArm = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2 - IsaAArch64 = IMAGE_FILE_MACHINE_ARM64 ///< 0xAA64 -} 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 ExceptionCallback 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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DevicePath.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DevicePath.h deleted file mode 100644 index a305df575..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DevicePath.h +++ /dev/null @@ -1,1171 +0,0 @@ -/** @file - The device path protocol as defined in UEFI 2.0. - - The device path represents a programmatic path to a device, - from a software point of view. The path 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 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Guid/PcAnsi.h> - -/// -/// Device Path protocol. -/// -#define EFI_DEVICE_PATH_PROTOCOL_GUID \ - { \ - 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -/// -/// Device Path guid definition for backward-compatible with EFI1.1. -/// -#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; - -/// -/// Device Path protocol definition for backward-compatible with EFI1.1. -/// -typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH; - -/// -/// Hardware Device Paths. -/// -#define HARDWARE_DEVICE_PATH 0x01 - -/// -/// PCI Device Path SubType. -/// -#define HW_PCI_DP 0x01 - -/// -/// PCI Device Path. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// PCI Function Number. - /// - UINT8 Function; - /// - /// PCI Device Number. - /// - UINT8 Device; -} PCI_DEVICE_PATH; - -/// -/// PCCARD Device Path SubType. -/// -#define HW_PCCARD_DP 0x02 - -/// -/// PCCARD Device Path. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Function Number (0 = First Function). - /// - UINT8 FunctionNumber; -} PCCARD_DEVICE_PATH; - -/// -/// Memory Mapped Device Path SubType. -/// -#define HW_MEMMAP_DP 0x03 - -/// -/// Memory Mapped Device Path. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// EFI_MEMORY_TYPE - /// - UINT32 MemoryType; - /// - /// Starting Memory Address. - /// - EFI_PHYSICAL_ADDRESS StartingAddress; - /// - /// Ending Memory Address. - /// - EFI_PHYSICAL_ADDRESS EndingAddress; -} MEMMAP_DEVICE_PATH; - -/// -/// Hardware Vendor Device Path SubType. -/// -#define HW_VENDOR_DP 0x04 - -/// -/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must -/// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the -/// contents on the n bytes that follow in the Vendor Device Path node. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Vendor-assigned GUID that defines the data that follows. - /// - EFI_GUID Guid; - /// - /// Vendor-defined variable size data. - /// -} VENDOR_DEVICE_PATH; - -/// -/// Controller Device Path SubType. -/// -#define HW_CONTROLLER_DP 0x05 - -/// -/// Controller Device Path. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Controller number. - /// - UINT32 ControllerNumber; -} CONTROLLER_DEVICE_PATH; - -/// -/// ACPI Device Paths. -/// -#define ACPI_DEVICE_PATH 0x02 - -/// -/// ACPI Device Path SubType. -/// -#define ACPI_DP 0x01 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Device's PnP hardware ID stored in a numeric 32-bit - /// compressed EISA-type ID. This value must match the - /// corresponding _HID in the ACPI name space. - /// - UINT32 HID; - /// - /// Unique ID that is required by ACPI if two devices have the - /// same _HID. This value must also match the corresponding - /// _UID/_HID pair in the ACPI name space. Only the 32-bit - /// numeric value type of _UID is supported. Thus, strings must - /// not be used for the _UID in the ACPI name space. - /// - UINT32 UID; -} ACPI_HID_DEVICE_PATH; - -/// -/// Expanded ACPI Device Path SubType. -/// -#define ACPI_EXTENDED_DP 0x02 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Device's PnP hardware ID stored in a numeric 32-bit - /// compressed EISA-type ID. This value must match the - /// corresponding _HID in the ACPI name space. - /// - UINT32 HID; - /// - /// Unique ID that is required by ACPI if two devices have the - /// same _HID. This value must also match the corresponding - /// _UID/_HID pair in the ACPI name space. - /// - UINT32 UID; - /// - /// Device's compatible PnP hardware ID stored in a numeric - /// 32-bit compressed EISA-type ID. This value must match at - /// least one of the compatible device IDs returned by the - /// corresponding _CID in the ACPI name space. - /// - 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) - -/// -/// ACPI _ADR Device Path SubType. -/// -#define ACPI_ADR_DP 0x03 - -/// -/// The _ADR device path is used to contain video output device attributes to support the Graphics -/// Output Protocol. The device path can contain multiple _ADR entries if multiple video output -/// devices are displaying the same output. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// _ADR value. For video output devices the value of this - /// field comes from Table B-2 of the ACPI 3.0 specification. At - /// least one _ADR value is required. - /// - UINT32 ADR; - // - // This device path may optionally contain more than one _ADR entry. - // -} 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. -/// This Device Path is used to describe the connection of devices outside the resource domain of the -/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract -/// information like networking protocol IP addresses. -/// -#define MESSAGING_DEVICE_PATH 0x03 - -/// -/// ATAPI Device Path SubType -/// -#define MSG_ATAPI_DP 0x01 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Set to zero for primary, or one for secondary. - /// - UINT8 PrimarySecondary; - /// - /// Set to zero for master, or one for slave mode. - /// - UINT8 SlaveMaster; - /// - /// Logical Unit Number. - /// - UINT16 Lun; -} ATAPI_DEVICE_PATH; - -/// -/// SCSI Device Path SubType. -/// -#define MSG_SCSI_DP 0x02 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Target ID on the SCSI bus (PUN). - /// - UINT16 Pun; - /// - /// Logical Unit Number (LUN). - /// - UINT16 Lun; -} SCSI_DEVICE_PATH; - -/// -/// Fibre Channel SubType. -/// -#define MSG_FIBRECHANNEL_DP 0x03 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Reserved for the future. - /// - UINT32 Reserved; - /// - /// Fibre Channel World Wide Number. - /// - UINT64 WWN; - /// - /// Fibre Channel Logical Unit Number. - /// - UINT64 Lun; -} FIBRECHANNEL_DEVICE_PATH; - -/// -/// Fibre Channel Ex SubType. -/// -#define MSG_FIBRECHANNELEX_DP 0x15 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Reserved for the future. - /// - UINT32 Reserved; - /// - /// 8 byte array containing Fibre Channel End Device Port Name. - /// - UINT8 WWN[8]; - /// - /// 8 byte array containing Fibre Channel Logical Unit Number. - /// - UINT8 Lun[8]; -} FIBRECHANNELEX_DEVICE_PATH; - -/// -/// 1394 Device Path SubType -/// -#define MSG_1394_DP 0x04 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Reserved for the future. - /// - UINT32 Reserved; - /// - /// 1394 Global Unique ID (GUID). - /// - UINT64 Guid; -} F1394_DEVICE_PATH; - -/// -/// USB Device Path SubType. -/// -#define MSG_USB_DP 0x05 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// USB Parent Port Number. - /// - UINT8 ParentPortNumber; - /// - /// USB Interface Number. - /// - UINT8 InterfaceNumber; -} USB_DEVICE_PATH; - -/// -/// USB Class Device Path SubType. -/// -#define MSG_USB_CLASS_DP 0x0f -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Vendor ID assigned by USB-IF. A value of 0xFFFF will - /// match any Vendor ID. - /// - UINT16 VendorId; - /// - /// Product ID assigned by USB-IF. A value of 0xFFFF will - /// match any Product ID. - /// - UINT16 ProductId; - /// - /// The class code assigned by the USB-IF. A value of 0xFF - /// will match any class code. - /// - UINT8 DeviceClass; - /// - /// The subclass code assigned by the USB-IF. A value of - /// 0xFF will match any subclass code. - /// - UINT8 DeviceSubClass; - /// - /// The protocol code assigned by the USB-IF. A value of - /// 0xFF will match any protocol code. - /// - UINT8 DeviceProtocol; -} USB_CLASS_DEVICE_PATH; - -/// -/// USB WWID Device Path SubType. -/// -#define MSG_USB_WWID_DP 0x10 - -/// -/// This device path describes a USB device using its serial number. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// USB interface number. - /// - UINT16 InterfaceNumber; - /// - /// USB vendor id of the device. - /// - UINT16 VendorId; - /// - /// USB product id of the device. - /// - UINT16 ProductId; - /// - /// Last 64-or-fewer UTF-16 characters of the USB - /// serial number. The length of the string is - /// determined by the Length field less the offset of the - /// Serial Number field (10) - /// - /// CHAR16 SerialNumber[...]; -} USB_WWID_DEVICE_PATH; - -/// -/// Device Logical Unit SubType. -/// -#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Logical Unit Number for the interface. - /// - UINT8 Lun; -} DEVICE_LOGICAL_UNIT_DEVICE_PATH; - -/// -/// SATA Device Path SubType. -/// -#define MSG_SATA_DP 0x12 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// The HBA port number that facilitates the connection to the - /// device or a port multiplier. The value 0xFFFF is reserved. - /// - UINT16 HBAPortNumber; - /// - /// The Port multiplier port number that facilitates the connection - /// to the device. Bit 15 should be set if the device is directly - /// connected to the HBA. - /// - UINT16 PortMultiplierPortNumber; - /// - /// Logical Unit Number. - /// - UINT16 Lun; -} SATA_DEVICE_PATH; - -/// -/// Flag for if the device is directly connected to the HBA. -/// -#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000 - -/// -/// I2O Device Path SubType. -/// -#define MSG_I2O_DP 0x06 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Target ID (TID) for a device. - /// - UINT32 Tid; -} I2O_DEVICE_PATH; - -/// -/// MAC Address Device Path SubType. -/// -#define MSG_MAC_ADDR_DP 0x0b -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// The MAC address for a network interface padded with 0s. - /// - EFI_MAC_ADDRESS MacAddress; - /// - /// Network interface type(i.e. 802.3, FDDI). - /// - UINT8 IfType; -} MAC_ADDR_DEVICE_PATH; - -/// -/// IPv4 Device Path SubType -/// -#define MSG_IPv4_DP 0x0c -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// The local IPv4 address. - /// - EFI_IPv4_ADDRESS LocalIpAddress; - /// - /// The remote IPv4 address. - /// - EFI_IPv4_ADDRESS RemoteIpAddress; - /// - /// The local port number. - /// - UINT16 LocalPort; - /// - /// The remote port number. - /// - UINT16 RemotePort; - /// - /// The network protocol(i.e. UDP, TCP). - /// - UINT16 Protocol; - /// - /// 0x00 - The Source IP Address was assigned though DHCP. - /// 0x01 - The Source IP Address is statically bound. - /// - BOOLEAN StaticIpAddress; - /// - /// The gateway IP address - /// - EFI_IPv4_ADDRESS GatewayIpAddress; - /// - /// The subnet mask - /// - EFI_IPv4_ADDRESS SubnetMask; -} IPv4_DEVICE_PATH; - -/// -/// IPv6 Device Path SubType. -/// -#define MSG_IPv6_DP 0x0d -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// The local IPv6 address. - /// - EFI_IPv6_ADDRESS LocalIpAddress; - /// - /// The remote IPv6 address. - /// - EFI_IPv6_ADDRESS RemoteIpAddress; - /// - /// The local port number. - /// - UINT16 LocalPort; - /// - /// The remote port number. - /// - UINT16 RemotePort; - /// - /// The network protocol(i.e. UDP, TCP). - /// - UINT16 Protocol; - /// - /// 0x00 - The Local IP Address was manually configured. - /// 0x01 - The Local IP Address is assigned through IPv6 - /// stateless auto-configuration. - /// 0x02 - The Local IP Address is assigned through IPv6 - /// stateful configuration. - /// - UINT8 IpAddressOrigin; - /// - /// The prefix length - /// - UINT8 PrefixLength; - /// - /// The gateway IP address - /// - EFI_IPv6_ADDRESS GatewayIpAddress; -} IPv6_DEVICE_PATH; - -/// -/// InfiniBand Device Path SubType. -/// -#define MSG_INFINIBAND_DP 0x09 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Flags to help identify/manage InfiniBand device path elements: - /// Bit 0 - IOC/Service (0b = IOC, 1b = Service). - /// Bit 1 - Extend Boot Environment. - /// Bit 2 - Console Protocol. - /// Bit 3 - Storage Protocol. - /// Bit 4 - Network Protocol. - /// All other bits are reserved. - /// - UINT32 ResourceFlags; - /// - /// 128-bit Global Identifier for remote fabric port. - /// - UINT8 PortGid[16]; - /// - /// 64-bit unique identifier to remote IOC or server process. - /// Interpretation of field specified by Resource Flags (bit 0). - /// - UINT64 ServiceId; - /// - /// 64-bit persistent ID of remote IOC port. - /// - UINT64 TargetPortId; - /// - /// 64-bit persistent ID of remote device. - /// - 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 - -/// -/// UART Device Path SubType. -/// -#define MSG_UART_DP 0x0e -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Reserved. - /// - UINT32 Reserved; - /// - /// The baud rate setting for the UART style device. A value of 0 - /// means that the device's default baud rate will be used. - /// - UINT64 BaudRate; - /// - /// The number of data bits for the UART style device. A value - /// of 0 means that the device's default number of data bits will be used. - /// - UINT8 DataBits; - /// - /// The parity setting for the UART style device. - /// Parity 0x00 - Default Parity. - /// Parity 0x01 - No Parity. - /// Parity 0x02 - Even Parity. - /// Parity 0x03 - Odd Parity. - /// Parity 0x04 - Mark Parity. - /// Parity 0x05 - Space Parity. - /// - UINT8 Parity; - /// - /// The number of stop bits for the UART style device. - /// Stop Bits 0x00 - Default Stop Bits. - /// Stop Bits 0x01 - 1 Stop Bit. - /// Stop Bits 0x02 - 1.5 Stop Bits. - /// Stop Bits 0x03 - 2 Stop Bits. - /// - 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 - -/// -/// A new device path node is defined to declare flow control characteristics. -/// UART Flow Control Messaging Device Path -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID. - /// - EFI_GUID Guid; - /// - /// Bitmap of supported flow control types. - /// Bit 0 set indicates hardware flow control. - /// Bit 1 set indicates Xon/Xoff flow control. - /// All other bits are reserved and are clear. - /// - UINT32 FlowControlMap; -} UART_FLOW_CONTROL_DEVICE_PATH; - -#define UART_FLOW_CONTROL_HARDWARE 0x00000001 -#define UART_FLOW_CONTROL_XON_XOFF 0x00000010 - -#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID -/// -/// Serial Attached SCSI (SAS) Device Path. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// DEVICE_PATH_MESSAGING_SAS GUID. - /// - EFI_GUID Guid; - /// - /// Reserved for future use. - /// - UINT32 Reserved; - /// - /// SAS Address for Serial Attached SCSI Target. - /// - UINT64 SasAddress; - /// - /// SAS Logical Unit Number. - /// - UINT64 Lun; - /// - /// More Information about the device and its interconnect. - /// - UINT16 DeviceTopology; - /// - /// Relative Target Port (RTP). - /// - UINT16 RelativeTargetPort; -} SAS_DEVICE_PATH; - -/// -/// Serial Attached SCSI (SAS) Ex Device Path SubType -/// -#define MSG_SASEX_DP 0x16 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// 8-byte array of the SAS Address for Serial Attached SCSI Target Port. - /// - UINT8 SasAddress[8]; - /// - /// 8-byte array of the SAS Logical Unit Number. - /// - UINT8 Lun[8]; - /// - /// More Information about the device and its interconnect. - /// - UINT16 DeviceTopology; - /// - /// Relative Target Port (RTP). - /// - UINT16 RelativeTargetPort; -} SASEX_DEVICE_PATH; - -/// -/// NvmExpress Namespace Device Path SubType. -/// -#define MSG_NVME_NAMESPACE_DP 0x17 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 NamespaceId; - UINT64 NamespaceUuid; -} NVME_NAMESPACE_DEVICE_PATH; - -/// -/// iSCSI Device Path SubType -/// -#define MSG_ISCSI_DP 0x13 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Network Protocol (0 = TCP, 1+ = reserved). - /// - UINT16 NetworkProtocol; - /// - /// iSCSI Login Options. - /// - UINT16 LoginOption; - /// - /// iSCSI Logical Unit Number. - /// - UINT64 Lun; - /// - /// iSCSI Target Portal group tag the initiator intends - /// to establish a session with. - /// - UINT16 TargetPortalGroupTag; - /// - /// iSCSI NodeTarget Name. The length of the name - /// is determined by subtracting the offset of this field from Length. - /// - /// 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 - -/// -/// VLAN Device Path SubType. -/// -#define MSG_VLAN_DP 0x14 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// VLAN identifier (0-4094). - /// - UINT16 VlanId; -} VLAN_DEVICE_PATH; - -// -// Media Device Path -// -#define MEDIA_DEVICE_PATH 0x04 - -/// -/// Hard Drive Media Device Path SubType. -/// -#define MEDIA_HARDDRIVE_DP 0x01 - -/// -/// The Hard Drive Media Device Path is used to represent a partition on a hard drive. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Describes the entry in a partition table, starting with entry 1. - /// Partition number zero represents the entire device. Valid - /// partition numbers for a MBR partition are [1, 4]. Valid - /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries]. - /// - UINT32 PartitionNumber; - /// - /// Starting LBA of the partition on the hard drive. - /// - UINT64 PartitionStart; - /// - /// Size of the partition in units of Logical Blocks. - /// - UINT64 PartitionSize; - /// - /// Signature unique to this partition: - /// If SignatureType is 0, this field has to be initialized with 16 zeros. - /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field. - /// The other 12 bytes are initialized with zeros. - /// If SignatureType is 2, this field contains a 16 byte signature. - /// - UINT8 Signature[16]; - /// - /// Partition Format: (Unused values reserved). - /// 0x01 - PC-AT compatible legacy MBR. - /// 0x02 - GUID Partition Table. - /// - UINT8 MBRType; - /// - /// Type of Disk Signature: (Unused values reserved). - /// 0x00 - No Disk Signature. - /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR. - /// 0x02 - GUID signature. - /// - UINT8 SignatureType; -} HARDDRIVE_DEVICE_PATH; - -#define MBR_TYPE_PCAT 0x01 -#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02 - -#define NO_DISK_SIGNATURE 0x00 -#define SIGNATURE_TYPE_MBR 0x01 -#define SIGNATURE_TYPE_GUID 0x02 - -/// -/// CD-ROM Media Device Path SubType. -/// -#define MEDIA_CDROM_DP 0x02 - -/// -/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero. - /// - UINT32 BootEntry; - /// - /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing. - /// - UINT64 PartitionStart; - /// - /// Size of the partition in units of Blocks, also called Sectors. - /// - UINT64 PartitionSize; -} CDROM_DEVICE_PATH; - -// -// Use VENDOR_DEVICE_PATH struct -// -#define MEDIA_VENDOR_DP 0x03 ///< Media vendor device path subtype. - -/// -/// File Path Media Device Path SubType -/// -#define MEDIA_FILEPATH_DP 0x04 -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// A NULL-terminated Path string including directory and file names. - /// - CHAR16 PathName[1]; -} FILEPATH_DEVICE_PATH; - -#define SIZE_OF_FILEPATH_DEVICE_PATH OFFSET_OF(FILEPATH_DEVICE_PATH,PathName) - -/// -/// Media Protocol Device Path SubType. -/// -#define MEDIA_PROTOCOL_DP 0x05 - -/// -/// The Media Protocol Device Path is used to denote the protocol that is being -/// used in a device path at the location of the path specified. -/// Many protocols are inherent to the style of device path. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// The ID of the protocol. - /// - EFI_GUID Protocol; -} MEDIA_PROTOCOL_DEVICE_PATH; - -/// -/// PIWG Firmware File SubType. -/// -#define MEDIA_PIWG_FW_FILE_DP 0x06 - -/// -/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Firmware file name - /// - EFI_GUID FvFileName; -} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH; - -/// -/// PIWG Firmware Volume Device Path SubType. -/// -#define MEDIA_PIWG_FW_VOL_DP 0x07 - -/// -/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Firmware volume name. - /// - EFI_GUID FvName; -} MEDIA_FW_VOL_DEVICE_PATH; - -/// -/// Media relative offset range device path. -/// -#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08 - -/// -/// Used to describe the offset range of media relative. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - UINT32 Reserved; - UINT64 StartingOffset; - UINT64 EndingOffset; -} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH; - -/// -/// BIOS Boot Specification Device Path. -/// -#define BBS_DEVICE_PATH 0x05 - -/// -/// BIOS Boot Specification Device Path SubType. -/// -#define BBS_BBS_DP 0x01 - -/// -/// This Device Path is used to describe the booting of non-EFI-aware operating systems. -/// -typedef struct { - EFI_DEVICE_PATH_PROTOCOL Header; - /// - /// Device Type as defined by the BIOS Boot Specification. - /// - UINT16 DeviceType; - /// - /// Status Flags as defined by the BIOS Boot Specification. - /// - UINT16 StatusFlag; - /// - /// Null-terminated ASCII string that describes the boot device to a user. - /// - 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; - ACPI_EXTENDED_HID_DEVICE_PATH ExtendedAcpi; - ACPI_ADR_DEVICE_PATH AcpiAdr; - - ATAPI_DEVICE_PATH Atapi; - SCSI_DEVICE_PATH Scsi; - ISCSI_DEVICE_PATH Iscsi; - FIBRECHANNEL_DEVICE_PATH FibreChannel; - FIBRECHANNELEX_DEVICE_PATH FibreChannelEx; - - F1394_DEVICE_PATH F1394; - USB_DEVICE_PATH Usb; - SATA_DEVICE_PATH Sata; - USB_CLASS_DEVICE_PATH UsbClass; - USB_WWID_DEVICE_PATH UsbWwid; - DEVICE_LOGICAL_UNIT_DEVICE_PATH LogicUnit; - I2O_DEVICE_PATH I2O; - MAC_ADDR_DEVICE_PATH MacAddr; - IPv4_DEVICE_PATH Ipv4; - IPv6_DEVICE_PATH Ipv6; - VLAN_DEVICE_PATH Vlan; - INFINIBAND_DEVICE_PATH InfiniBand; - UART_DEVICE_PATH Uart; - UART_FLOW_CONTROL_DEVICE_PATH UartFlowControl; - SAS_DEVICE_PATH Sas; - SASEX_DEVICE_PATH SasEx; - NVME_NAMESPACE_DEVICE_PATH NvmeNamespace; - HARDDRIVE_DEVICE_PATH HardDrive; - CDROM_DEVICE_PATH CD; - - FILEPATH_DEVICE_PATH FilePath; - MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol; - - MEDIA_FW_VOL_DEVICE_PATH FirmwareVolume; - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FirmwareFile; - MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset; - - 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; - ACPI_ADR_DEVICE_PATH *AcpiAdr; - - ATAPI_DEVICE_PATH *Atapi; - SCSI_DEVICE_PATH *Scsi; - ISCSI_DEVICE_PATH *Iscsi; - FIBRECHANNEL_DEVICE_PATH *FibreChannel; - FIBRECHANNELEX_DEVICE_PATH *FibreChannelEx; - - F1394_DEVICE_PATH *F1394; - USB_DEVICE_PATH *Usb; - SATA_DEVICE_PATH *Sata; - USB_CLASS_DEVICE_PATH *UsbClass; - USB_WWID_DEVICE_PATH *UsbWwid; - DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicUnit; - I2O_DEVICE_PATH *I2O; - MAC_ADDR_DEVICE_PATH *MacAddr; - IPv4_DEVICE_PATH *Ipv4; - IPv6_DEVICE_PATH *Ipv6; - VLAN_DEVICE_PATH *Vlan; - INFINIBAND_DEVICE_PATH *InfiniBand; - UART_DEVICE_PATH *Uart; - UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl; - SAS_DEVICE_PATH *Sas; - SASEX_DEVICE_PATH *SasEx; - NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace; - HARDDRIVE_DEVICE_PATH *HardDrive; - CDROM_DEVICE_PATH *CD; - - FILEPATH_DEVICE_PATH *FilePath; - MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol; - - MEDIA_FW_VOL_DEVICE_PATH *FirmwareVolume; - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FirmwareFile; - MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset; - - 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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DevicePathToText.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DevicePathToText.h deleted file mode 100644 index edca965bc..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DevicePathToText.h +++ /dev/null @@ -1,87 +0,0 @@ -/** @file - EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0. - This protocol provides service to convert device nodes and paths to text. - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> - 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 __DEVICE_PATH_TO_TEXT_PROTOCOL_H__ -#define __DEVICE_PATH_TO_TEXT_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -/// -/// Device Path To Text protocol -/// -#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ - { \ - 0x8b843e20, 0x8132, 0x4852, {0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \ - } - -/** - Convert a device node to its text representation. - - @param DeviceNode Points to the device node to be converted. - @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation - of the display node is used, where applicable. If DisplayOnly - is FALSE, then the longer text representation of the display node - is used. - @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text - representation for a device node can be used, where applicable. - - @retval a_pointer a pointer to the allocated text representation of the device node data - @retval NULL if DeviceNode is NULL or there was insufficient memory. - -**/ -typedef -CHAR16* -(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE)( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode, - IN BOOLEAN DisplayOnly, - IN BOOLEAN AllowShortcuts - ); - -/** - Convert a device path to its text representation. - - @param DevicePath Points to the device path to be converted. - @param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation - of the display node is used, where applicable. If DisplayOnly - is FALSE, then the longer text representation of the display node - is used. - @param AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of - text representation for a device node cannot be used. - - @retval a_pointer a pointer to the allocated text representation of the device node. - @retval NULL if DevicePath is NULL or there was insufficient memory. - -**/ -typedef -CHAR16* -(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH)( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN BOOLEAN DisplayOnly, - IN BOOLEAN AllowShortcuts - ); - -/// -/// This protocol converts device paths and device nodes to text. -/// -typedef struct { - EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText; - EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText; -} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL; - -extern EFI_GUID gEfiDevicePathToTextProtocolGuid; - -#endif - - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Dhcp4.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Dhcp4.h deleted file mode 100644 index 560ee3224..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Dhcp4.h +++ /dev/null @@ -1,782 +0,0 @@ -/** @file - EFI_DHCP4_PROTOCOL as defined in UEFI 2.0. - EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0. - These protocols are used to collect configuration information for the EFI IPv4 Protocol - drivers and to provide DHCPv4 server and PXE boot server discovery services. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol was introduced in UEFI Specification 2.0. - -**/ - -#ifndef __EFI_DHCP4_PROTOCOL_H__ -#define __EFI_DHCP4_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_DHCP4_PROTOCOL_GUID \ - { \ - 0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \ - } - -#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \ - { \ - 0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \ - } - -typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL; - - -#pragma pack(1) -typedef struct { - /// - /// DHCP option code. - /// - UINT8 OpCode; - /// - /// Length of the DHCP option data. Not present if OpCode is 0 or 255. - /// - UINT8 Length; - /// - /// Start of the DHCP option data. Not present if OpCode is 0 or 255 or if Length is zero. - /// - UINT8 Data[1]; -} EFI_DHCP4_PACKET_OPTION; -#pragma pack() - - -#pragma pack(1) -/// -/// EFI_DHCP4_PACKET defines the format of DHCPv4 packets. See RFC 2131 for more information. -/// -typedef struct { - UINT8 OpCode; - UINT8 HwType; - UINT8 HwAddrLen; - UINT8 Hops; - UINT32 Xid; - UINT16 Seconds; - UINT16 Reserved; - EFI_IPv4_ADDRESS ClientAddr; ///< Client IP address from client. - EFI_IPv4_ADDRESS YourAddr; ///< Client IP address from server. - EFI_IPv4_ADDRESS ServerAddr; ///< IP address of next server in bootstrap. - EFI_IPv4_ADDRESS GatewayAddr; ///< Relay agent IP address. - UINT8 ClientHwAddr[16]; ///< Client hardware address. - CHAR8 ServerName[64]; - CHAR8 BootFileName[128]; -}EFI_DHCP4_HEADER; -#pragma pack() - - -#pragma pack(1) -typedef struct { - /// - /// Size of the EFI_DHCP4_PACKET buffer. - /// - UINT32 Size; - /// - /// Length of the EFI_DHCP4_PACKET from the first byte of the Header field - /// to the last byte of the Option[] field. - /// - UINT32 Length; - - struct { - /// - /// DHCP packet header. - /// - EFI_DHCP4_HEADER Header; - /// - /// DHCP magik cookie in network byte order. - /// - UINT32 Magik; - /// - /// Start of the DHCP packed option data. - /// - UINT8 Option[1]; - } Dhcp4; -} EFI_DHCP4_PACKET; -#pragma pack() - - -typedef enum { - /// - /// The EFI DHCPv4 Protocol driver is stopped. - /// - Dhcp4Stopped = 0x0, - /// - /// The EFI DHCPv4 Protocol driver is inactive. - /// - Dhcp4Init = 0x1, - /// - /// The EFI DHCPv4 Protocol driver is collecting DHCP offer packets from DHCP servers. - /// - Dhcp4Selecting = 0x2, - /// - /// The EFI DHCPv4 Protocol driver has sent the request to the DHCP server and is waiting for a response. - /// - Dhcp4Requesting = 0x3, - /// - /// The DHCP configuration has completed. - /// - Dhcp4Bound = 0x4, - /// - /// The DHCP configuration is being renewed and another request has - /// been sent out, but it has not received a response from the server yet. - /// - Dhcp4Renewing = 0x5, - /// - /// The DHCP configuration has timed out and the EFI DHCPv4 - /// Protocol driver is trying to extend the lease time. - /// - Dhcp4Rebinding = 0x6, - /// - /// The EFI DHCPv4 Protocol driver was initialized with a previously - /// allocated or known IP address. - /// - Dhcp4InitReboot = 0x7, - /// - /// The EFI DHCPv4 Protocol driver is seeking to reuse the previously - /// allocated IP address by sending a request to the DHCP server. - /// - Dhcp4Rebooting = 0x8 -} EFI_DHCP4_STATE; - - -typedef enum{ - /// - /// The packet to start the configuration sequence is about to be sent. - /// - Dhcp4SendDiscover = 0x01, - /// - /// A reply packet was just received. - /// - Dhcp4RcvdOffer = 0x02, - /// - /// It is time for Dhcp4Callback to select an offer. - /// - Dhcp4SelectOffer = 0x03, - /// - /// A request packet is about to be sent. - /// - Dhcp4SendRequest = 0x04, - /// - /// A DHCPACK packet was received and will be passed to Dhcp4Callback. - /// - Dhcp4RcvdAck = 0x05, - /// - /// A DHCPNAK packet was received and will be passed to Dhcp4Callback. - /// - Dhcp4RcvdNak = 0x06, - /// - /// A decline packet is about to be sent. - /// - Dhcp4SendDecline = 0x07, - /// - /// The DHCP configuration process has completed. No packet is associated with this event. - /// - Dhcp4BoundCompleted = 0x08, - /// - /// It is time to enter the Dhcp4Renewing state and to contact the server - /// that originally issued the network address. No packet is associated with this event. - /// - Dhcp4EnterRenewing = 0x09, - /// - /// It is time to enter the Dhcp4Rebinding state and to contact any server. - /// No packet is associated with this event. - /// - Dhcp4EnterRebinding = 0x0a, - /// - /// The configured IP address was lost either because the lease has expired, - /// the user released the configuration, or a DHCPNAK packet was received in - /// the Dhcp4Renewing or Dhcp4Rebinding state. No packet is associated with this event. - /// - Dhcp4AddressLost = 0x0b, - /// - /// The DHCP process failed because a DHCPNAK packet was received or the user - /// aborted the DHCP process at a time when the configuration was not available yet. - /// No packet is associated with this event. - /// - Dhcp4Fail = 0x0c -} EFI_DHCP4_EVENT; - -/** - Callback routine. - - EFI_DHCP4_CALLBACK is provided by the consumer of the EFI DHCPv4 Protocol driver - to intercept events that occurred in the configuration process. This structure - provides advanced control of each state transition of the DHCP process. The - returned status code determines the behavior of the EFI DHCPv4 Protocol driver. - There are three possible returned values, which are described in the following - table. - - @param This The pointer to the EFI DHCPv4 Protocol instance that is used to - configure this callback function. - @param Context The pointer to the context that is initialized by - EFI_DHCP4_PROTOCOL.Configure(). - @param CurrentState The current operational state of the EFI DHCPv4 Protocol - driver. - @param Dhcp4Event The event that occurs in the current state, which usually means a - state transition. - @param Packet The DHCP packet that is going to be sent or already received. - @param NewPacket The packet that is used to replace the above Packet. - - @retval EFI_SUCCESS Tells the EFI DHCPv4 Protocol driver to continue the DHCP process. - When it is in the Dhcp4Selecting state, it tells the EFI DHCPv4 Protocol - driver to stop collecting additional packets. The driver will exit - the Dhcp4Selecting state and enter the Dhcp4Requesting state. - @retval EFI_NOT_READY Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol - driver will continue to wait for more packets until the retry - timeout expires. - @retval EFI_ABORTED Tells the EFI DHCPv4 Protocol driver to abort the current process and - return to the Dhcp4Init or Dhcp4InitReboot state. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_CALLBACK)( - IN EFI_DHCP4_PROTOCOL *This, - IN VOID *Context, - IN EFI_DHCP4_STATE CurrentState, - IN EFI_DHCP4_EVENT Dhcp4Event, - IN EFI_DHCP4_PACKET *Packet OPTIONAL, - OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL - ); - -typedef struct { - /// - /// The number of times to try sending a packet during the Dhcp4SendDiscover - /// event and waiting for a response during the Dhcp4RcvdOffer event. - /// Set to zero to use the default try counts and timeout values. - /// - UINT32 DiscoverTryCount; - /// - /// The maximum amount of time (in seconds) to wait for returned packets in each - /// of the retries. Timeout values of zero will default to a timeout value - /// of one second. Set to NULL to use default timeout values. - /// - UINT32 *DiscoverTimeout; - /// - /// The number of times to try sending a packet during the Dhcp4SendRequest event - /// and waiting for a response during the Dhcp4RcvdAck event before accepting - /// failure. Set to zero to use the default try counts and timeout values. - /// - UINT32 RequestTryCount; - /// - /// The maximum amount of time (in seconds) to wait for return packets in each of the retries. - /// Timeout values of zero will default to a timeout value of one second. - /// Set to NULL to use default timeout values. - /// - UINT32 *RequestTimeout; - /// - /// For a DHCPDISCOVER, setting this parameter to the previously allocated IP - /// address will cause the EFI DHCPv4 Protocol driver to enter the Dhcp4InitReboot state. - /// And set this field to 0.0.0.0 to enter the Dhcp4Init state. - /// For a DHCPINFORM this parameter should be set to the client network address - /// which was assigned to the client during a DHCPDISCOVER. - /// - EFI_IPv4_ADDRESS ClientAddress; - /// - /// The callback function to intercept various events that occurred in - /// the DHCP configuration process. Set to NULL to ignore all those events. - /// - EFI_DHCP4_CALLBACK Dhcp4Callback; - /// - /// The pointer to the context that will be passed to Dhcp4Callback when it is called. - /// - VOID *CallbackContext; - /// - /// Number of DHCP options in the OptionList. - /// - UINT32 OptionCount; - /// - /// List of DHCP options to be included in every packet that is sent during the - /// Dhcp4SendDiscover event. Pad options are appended automatically by DHCP driver - /// in outgoing DHCP packets. If OptionList itself contains pad option, they are - /// ignored by the driver. OptionList can be freed after EFI_DHCP4_PROTOCOL.Configure() - /// returns. Ignored if OptionCount is zero. - /// - EFI_DHCP4_PACKET_OPTION **OptionList; -} EFI_DHCP4_CONFIG_DATA; - - -typedef struct { - /// - /// The EFI DHCPv4 Protocol driver operating state. - /// - EFI_DHCP4_STATE State; - /// - /// The configuration data of the current EFI DHCPv4 Protocol driver instance. - /// - EFI_DHCP4_CONFIG_DATA ConfigData; - /// - /// The client IP address that was acquired from the DHCP server. If it is zero, - /// the DHCP acquisition has not completed yet and the following fields in this structure are undefined. - /// - EFI_IPv4_ADDRESS ClientAddress; - /// - /// The local hardware address. - /// - EFI_MAC_ADDRESS ClientMacAddress; - /// - /// The server IP address that is providing the DHCP service to this client. - /// - EFI_IPv4_ADDRESS ServerAddress; - /// - /// The router IP address that was acquired from the DHCP server. - /// May be zero if the server does not offer this address. - /// - EFI_IPv4_ADDRESS RouterAddress; - /// - /// The subnet mask of the connected network that was acquired from the DHCP server. - /// - EFI_IPv4_ADDRESS SubnetMask; - /// - /// The lease time (in 1-second units) of the configured IP address. - /// The value 0xFFFFFFFF means that the lease time is infinite. - /// A default lease of 7 days is used if the DHCP server does not provide a value. - /// - UINT32 LeaseTime; - /// - /// The cached latest DHCPACK or DHCPNAK or BOOTP REPLY packet. May be NULL if no packet is cached. - /// - EFI_DHCP4_PACKET *ReplyPacket; -} EFI_DHCP4_MODE_DATA; - - -typedef struct { - /// - /// Alternate listening address. It can be a unicast, multicast, or broadcast address. - /// - EFI_IPv4_ADDRESS ListenAddress; - /// - /// The subnet mask of above listening unicast/broadcast IP address. - /// Ignored if ListenAddress is a multicast address. - /// - EFI_IPv4_ADDRESS SubnetMask; - /// - /// Alternate station source (or listening) port number. - /// If zero, then the default station port number (68) will be used. - /// - UINT16 ListenPort; -} EFI_DHCP4_LISTEN_POINT; - - -typedef struct { - /// - /// The completion status of transmitting and receiving. - /// - EFI_STATUS Status; - /// - /// If not NULL, the event that will be signaled when the collection process - /// completes. If NULL, this function will busy-wait until the collection process competes. - /// - EFI_EVENT CompletionEvent; - /// - /// The pointer to the server IP address. This address may be a unicast, multicast, or broadcast address. - /// - EFI_IPv4_ADDRESS RemoteAddress; - /// - /// The server listening port number. If zero, the default server listening port number (67) will be used. - /// - UINT16 RemotePort; - /// - /// The pointer to the gateway address to override the existing setting. - /// - EFI_IPv4_ADDRESS GatewayAddress; - /// - /// The number of entries in ListenPoints. If zero, the default station address and port number 68 are used. - /// - UINT32 ListenPointCount; - /// - /// An array of station address and port number pairs that are used as receiving filters. - /// The first entry is also used as the source address and source port of the outgoing packet. - /// - EFI_DHCP4_LISTEN_POINT *ListenPoints; - /// - /// The number of seconds to collect responses. Zero is invalid. - /// - UINT32 TimeoutValue; - /// - /// The pointer to the packet to be transmitted. - /// - EFI_DHCP4_PACKET *Packet; - /// - /// Number of received packets. - /// - UINT32 ResponseCount; - /// - /// The pointer to the allocated list of received packets. - /// - EFI_DHCP4_PACKET *ResponseList; -} EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN; - - -/** - Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver. - - The GetModeData() function returns the current operating mode and cached data - packet for the EFI DHCPv4 Protocol driver. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - @param Dhcp4ModeData The pointer to storage for the EFI_DHCP4_MODE_DATA structure. - - @retval EFI_SUCCESS The mode data was returned. - @retval EFI_INVALID_PARAMETER This is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_GET_MODE_DATA)( - IN EFI_DHCP4_PROTOCOL *This, - OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData - ); - -/** - Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver. - - The Configure() function is used to initialize, change, or reset the operational - settings of the EFI DHCPv4 Protocol driver for the communication device on which - the EFI DHCPv4 Service Binding Protocol is installed. This function can be - successfully called only if both of the following are true: - * This instance of the EFI DHCPv4 Protocol driver is in the Dhcp4Stopped, Dhcp4Init, - Dhcp4InitReboot, or Dhcp4Bound states. - * No other EFI DHCPv4 Protocol driver instance that is controlled by this EFI - DHCPv4 Service Binding Protocol driver instance has configured this EFI DHCPv4 - Protocol driver. - When this driver is in the Dhcp4Stopped state, it can transfer into one of the - following two possible initial states: - * Dhcp4Init - * Dhcp4InitReboot. - The driver can transfer into these states by calling Configure() with a non-NULL - Dhcp4CfgData. The driver will transfer into the appropriate state based on the - supplied client network address in the ClientAddress parameter and DHCP options - in the OptionList parameter as described in RFC 2131. - When Configure() is called successfully while Dhcp4CfgData is set to NULL, the - default configuring data will be reset in the EFI DHCPv4 Protocol driver and - the state of the EFI DHCPv4 Protocol driver will not be changed. If one instance - wants to make it possible for another instance to configure the EFI DHCPv4 Protocol - driver, it must call this function with Dhcp4CfgData set to NULL. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - @param Dhcp4CfgData The pointer to the EFI_DHCP4_CONFIG_DATA. - - @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or - Dhcp4InitReboot state, if the original state of this driver - was Dhcp4Stopped, Dhcp4Init,Dhcp4InitReboot, or Dhcp4Bound - and the value of Dhcp4CfgData was not NULL. - Otherwise, the state was left unchanged. - @retval EFI_ACCESS_DENIED This instance of the EFI DHCPv4 Protocol driver was not in the - Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state; - Or onother instance of this EFI DHCPv4 Protocol driver is already - in a valid configured state. - @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE: - This is NULL. - DiscoverTryCount > 0 and DiscoverTimeout is NULL - RequestTryCount > 0 and RequestTimeout is NULL. - OptionCount >0 and OptionList is NULL. - ClientAddress is not a valid unicast address. - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_CONFIGURE)( - IN EFI_DHCP4_PROTOCOL *This, - IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL - ); - - -/** - Starts the DHCP configuration process. - - The Start() function starts the DHCP configuration process. This function can - be called only when the EFI DHCPv4 Protocol driver is in the Dhcp4Init or - Dhcp4InitReboot state. - If the DHCP process completes successfully, the state of the EFI DHCPv4 Protocol - driver will be transferred through Dhcp4Selecting and Dhcp4Requesting to the - Dhcp4Bound state. The CompletionEvent will then be signaled if it is not NULL. - If the process aborts, either by the user or by some unexpected network error, - the state is restored to the Dhcp4Init state. The Start() function can be called - again to restart the process. - Refer to RFC 2131 for precise state transitions during this process. At the - time when each event occurs in this process, the callback function that was set - by EFI_DHCP4_PROTOCOL.Configure() will be called and the user can take this - opportunity to control the process. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - @param CompletionEvent If not NULL, it indicates the event that will be signaled when the - EFI DHCPv4 Protocol driver is transferred into the - Dhcp4Bound state or when the DHCP process is aborted. - EFI_DHCP4_PROTOCOL.GetModeData() can be called to - check the completion status. If NULL, - EFI_DHCP4_PROTOCOL.Start() will wait until the driver - is transferred into the Dhcp4Bound state or the process fails. - - @retval EFI_SUCCESS The DHCP configuration process has started, or it has completed - when CompletionEvent is NULL. - @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped - state. EFI_DHCP4_PROTOCOL. Configure() needs to be called. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_TIMEOUT The DHCP configuration process failed because no response was - received from the server within the specified timeout value. - @retval EFI_ABORTED The user aborted the DHCP process. - @retval EFI_ALREADY_STARTED Some other EFI DHCPv4 Protocol instance already started the - DHCP process. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_NO_MEDIA There was a media error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_START)( - IN EFI_DHCP4_PROTOCOL *This, - IN EFI_EVENT CompletionEvent OPTIONAL - ); - -/** - Extends the lease time by sending a request packet. - - The RenewRebind() function is used to manually extend the lease time when the - EFI DHCPv4 Protocol driver is in the Dhcp4Bound state, and the lease time has - not expired yet. This function will send a request packet to the previously - found server (or to any server when RebindRequest is TRUE) and transfer the - state into the Dhcp4Renewing state (or Dhcp4Rebinding when RebindingRequest is - TRUE). When a response is received, the state is returned to Dhcp4Bound. - If no response is received before the try count is exceeded (the RequestTryCount - field that is specified in EFI_DHCP4_CONFIG_DATA) but before the lease time that - was issued by the previous server expires, the driver will return to the Dhcp4Bound - state, and the previous configuration is restored. The outgoing and incoming packets - can be captured by the EFI_DHCP4_CALLBACK function. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - @param RebindRequest If TRUE, this function broadcasts the request packets and enters - the Dhcp4Rebinding state. Otherwise, it sends a unicast - request packet and enters the Dhcp4Renewing state. - @param CompletionEvent If not NULL, this event is signaled when the renew/rebind phase - completes or some error occurs. - EFI_DHCP4_PROTOCOL.GetModeData() can be called to - check the completion status. If NULL, - EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait - until the DHCP process finishes. - - @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the - Dhcp4Renewing state or is back to the Dhcp4Bound state. - @retval EFI_NOT_STARTED The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped - state. EFI_DHCP4_PROTOCOL.Configure() needs to - be called. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_TIMEOUT There was no response from the server when the try count was - exceeded. - @retval EFI_ACCESS_DENIED The driver is not in the Dhcp4Bound state. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_RENEW_REBIND)( - IN EFI_DHCP4_PROTOCOL *This, - IN BOOLEAN RebindRequest, - IN EFI_EVENT CompletionEvent OPTIONAL - ); - -/** - Releases the current address configuration. - - The Release() function releases the current configured IP address by doing either - of the following: - * Sending a DHCPRELEASE packet when the EFI DHCPv4 Protocol driver is in the - Dhcp4Bound state - * Setting the previously assigned IP address that was provided with the - EFI_DHCP4_PROTOCOL.Configure() function to 0.0.0.0 when the driver is in - Dhcp4InitReboot state - After a successful call to this function, the EFI DHCPv4 Protocol driver returns - to the Dhcp4Init state, and any subsequent incoming packets will be discarded silently. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - - @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_ACCESS_DENIED The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_RELEASE)( - IN EFI_DHCP4_PROTOCOL *This - ); - -/** - Stops the current address configuration. - - The Stop() function is used to stop the DHCP configuration process. After this - function is called successfully, the EFI DHCPv4 Protocol driver is transferred - into the Dhcp4Stopped state. EFI_DHCP4_PROTOCOL.Configure() needs to be called - before DHCP configuration process can be started again. This function can be - called when the EFI DHCPv4 Protocol driver is in any state. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - - @retval EFI_SUCCESS The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase. - @retval EFI_INVALID_PARAMETER This is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_STOP)( - IN EFI_DHCP4_PROTOCOL *This - ); - -/** - Builds a DHCP packet, given the options to be appended or deleted or replaced. - - The Build() function is used to assemble a new packet from the original packet - by replacing or deleting existing options or appending new options. This function - does not change any state of the EFI DHCPv4 Protocol driver and can be used at - any time. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - @param SeedPacket Initial packet to be used as a base for building new packet. - @param DeleteCount Number of opcodes in the DeleteList. - @param DeleteList List of opcodes to be deleted from the seed packet. - Ignored if DeleteCount is zero. - @param AppendCount Number of entries in the OptionList. - @param AppendList The pointer to a DHCP option list to be appended to SeedPacket. - If SeedPacket also contains options in this list, they are - replaced by new options (except pad option). Ignored if - AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION - @param NewPacket The pointer to storage for the pointer to the new allocated packet. - Use the EFI Boot Service FreePool() on the resulting pointer - when done with the packet. - - @retval EFI_SUCCESS The new packet was built. - @retval EFI_OUT_OF_RESOURCES Storage for the new packet could not be allocated. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - This is NULL. - SeedPacket is NULL. - SeedPacket is not a well-formed DHCP packet. - AppendCount is not zero and AppendList is NULL. - DeleteCount is not zero and DeleteList is NULL. - NewPacket is NULL - Both DeleteCount and AppendCount are zero and - NewPacket is not NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_BUILD)( - IN EFI_DHCP4_PROTOCOL *This, - IN EFI_DHCP4_PACKET *SeedPacket, - IN UINT32 DeleteCount, - IN UINT8 *DeleteList OPTIONAL, - IN UINT32 AppendCount, - IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL, - OUT EFI_DHCP4_PACKET **NewPacket - ); - - -/** - Transmits a DHCP formatted packet and optionally waits for responses. - - The TransmitReceive() function is used to transmit a DHCP packet and optionally - wait for the response from servers. This function does not change the state of - the EFI DHCPv4 Protocol driver. It can be used at any time because of this. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - @param Token The pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure. - - @retval EFI_SUCCESS The packet was successfully queued for transmission. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - This is NULL. - Token.RemoteAddress is zero. - Token.Packet is NULL. - Token.Packet is not a well-formed DHCP packet. - The transaction ID in Token.Packet is in use by another DHCP process. - @retval EFI_NOT_READY The previous call to this function has not finished yet. Try to call - this function after collection process completes. - @retval EFI_NO_MAPPING The default station address is not available yet. - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_UNSUPPORTED The implementation doesn't support this function - @retval Others Some other unexpected error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE)( - IN EFI_DHCP4_PROTOCOL *This, - IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token - ); - - -/** - Parses the packed DHCP option data. - - The Parse() function is used to retrieve the option list from a DHCP packet. - If *OptionCount isn't zero, and there is enough space for all the DHCP options - in the Packet, each element of PacketOptionList is set to point to somewhere in - the Packet->Dhcp4.Option where a new DHCP option begins. If RFC3396 is supported, - the caller should reassemble the parsed DHCP options to get the final result. - If *OptionCount is zero or there isn't enough space for all of them, the number - of DHCP options in the Packet is returned in OptionCount. - - @param This The pointer to the EFI_DHCP4_PROTOCOL instance. - @param Packet The pointer to packet to be parsed. - @param OptionCount On input, the number of entries in the PacketOptionList. - On output, the number of entries that were written into the - PacketOptionList. - @param PacketOptionList A list of packet option entries to be filled in. End option or pad - options are not included. - - @retval EFI_SUCCESS The packet was successfully parsed. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - This is NULL. - The packet is NULL. - The packet is not a well-formed DHCP packet. - OptionCount is NULL. - @retval EFI_BUFFER_TOO_SMALL One or more of the following conditions is TRUE: - 1) *OptionCount is smaller than the number of options that - were found in the Packet. - 2) PacketOptionList is NULL. - @retval EFI_OUT_OF_RESOURCE The packet failed to parse because of a resource shortage. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DHCP4_PARSE)( - IN EFI_DHCP4_PROTOCOL *This, - IN EFI_DHCP4_PACKET *Packet, - IN OUT UINT32 *OptionCount, - OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL - ); - -/// -/// This protocol is used to collect configuration information for the EFI IPv4 Protocol drivers -/// and to provide DHCPv4 server and PXE boot server discovery services. -/// -struct _EFI_DHCP4_PROTOCOL { - EFI_DHCP4_GET_MODE_DATA GetModeData; - EFI_DHCP4_CONFIGURE Configure; - EFI_DHCP4_START Start; - EFI_DHCP4_RENEW_REBIND RenewRebind; - EFI_DHCP4_RELEASE Release; - EFI_DHCP4_STOP Stop; - EFI_DHCP4_BUILD Build; - EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive; - EFI_DHCP4_PARSE Parse; -}; - -extern EFI_GUID gEfiDhcp4ProtocolGuid; -extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DiskIo.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DiskIo.h deleted file mode 100644 index 1b47ce520..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DiskIo.h +++ /dev/null @@ -1,119 +0,0 @@ -/** @file - Disk IO protocol as defined in the UEFI 2.0 specification. - - The Disk IO protocol is used to convert block oriented devices into byte - oriented devices. The Disk IO protocol is intended to layer on top of the - Block IO protocol. - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> - 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 __DISK_IO_H__ -#define __DISK_IO_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_DISK_IO_PROTOCOL_GUID \ - { \ - 0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -/// -/// Protocol GUID name defined in EFI1.1. -/// -#define DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL_GUID - -typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL; - -/// -/// Protocol defined in EFI1.1. -/// -typedef EFI_DISK_IO_PROTOCOL EFI_DISK_IO; - -/** - Read BufferSize bytes from Offset into Buffer. - - @param This Protocol instance pointer. - @param MediaId Id of the media, changes every time the media is replaced. - @param Offset The starting byte offset to read from - @param BufferSize Size of Buffer - @param Buffer Buffer containing read data - - @retval EFI_SUCCESS The data was read correctly from the device. - @retval EFI_DEVICE_ERROR The device reported an error while performing the read. - @retval EFI_NO_MEDIA There is no media in the device. - @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device. - @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not - valid for the device. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DISK_READ)( - IN EFI_DISK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN UINT64 Offset, - IN UINTN BufferSize, - OUT VOID *Buffer - ); - -/** - Writes a specified number of bytes to a device. - - @param This Indicates a pointer to the calling context. - @param MediaId ID of the medium to be written. - @param Offset The starting byte offset on the logical block I/O device to write. - @param BufferSize The size in bytes of Buffer. The number of bytes to write to the device. - @param Buffer A pointer to the buffer containing the data to be written. - - @retval EFI_SUCCESS The data was written correctly to the device. - @retval EFI_WRITE_PROTECTED The device can not be written to. - @retval EFI_DEVICE_ERROR The device reported an error while performing the write. - @retval EFI_NO_MEDIA There is no media in the device. - @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device. - @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not - valid for the device. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_DISK_WRITE)( - IN EFI_DISK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN UINT64 Offset, - IN UINTN BufferSize, - IN VOID *Buffer - ); - -#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000 - -/// -/// Revision defined in EFI1.1 -/// -#define EFI_DISK_IO_INTERFACE_REVISION EFI_DISK_IO_PROTOCOL_REVISION - -/// -/// This protocol is used to abstract Block I/O interfaces. -/// -struct _EFI_DISK_IO_PROTOCOL { - /// - /// The revision to which the disk I/O interface adheres. All future - /// revisions must be backwards compatible. If a future version is not - /// backwards compatible, it is not the same GUID. - /// - UINT64 Revision; - EFI_DISK_READ ReadDisk; - EFI_DISK_WRITE WriteDisk; -}; - -extern EFI_GUID gEfiDiskIoProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DriverBinding.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DriverBinding.h deleted file mode 100644 index 1f464a730..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/DriverBinding.h +++ /dev/null @@ -1,203 +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 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -/// -/// The 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; - -/** - Tests to see if this driver supports a given controller. If a child device is provided, - it further tests to see if this driver supports creating a handle for the specified child device. - - This function checks to see if the driver specified by This supports the device specified by - ControllerHandle. Drivers will typically use the device path attached to - ControllerHandle and/or the services from the bus I/O abstraction attached to - ControllerHandle to determine if the driver supports ControllerHandle. This function - may be called many times during platform initialization. In order to reduce boot times, the tests - performed by this function must be very small, and take as little time as possible to execute. This - function must not change the state of any hardware devices, and this function must be aware that the - device specified by ControllerHandle may already be managed by the same driver or a - different driver. This function must match its calls to AllocatePages() with FreePages(), - AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). - Because ControllerHandle may have been previously started by the same driver, if a protocol is - already in the opened state, then it must not be closed with CloseProtocol(). This is required - to guarantee the state of ControllerHandle is not modified by this function. - - @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. - @param[in] ControllerHandle The handle of the controller to test. This handle - must support a protocol interface that supplies - an I/O abstraction to the driver. - @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This - parameter is ignored by device drivers, and is optional for bus - drivers. For bus drivers, if this parameter is not NULL, then - the bus driver must determine if the bus controller specified - by ControllerHandle and the child controller specified - by RemainingDevicePath are both supported by this - bus driver. - - @retval EFI_SUCCESS The device specified by ControllerHandle and - RemainingDevicePath is supported by the driver specified by This. - @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and - RemainingDevicePath is already being managed by the driver - specified by This. - @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and - RemainingDevicePath is already being managed by a different - driver or an application that requires exclusive access. - Currently not implemented. - @retval EFI_UNSUPPORTED The device specified by ControllerHandle and - RemainingDevicePath is not supported by the driver specified by This. -**/ -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 - ); - -/** - Starts a device controller or a bus controller. - - The Start() function is designed to be invoked from the EFI boot service ConnectController(). - As a result, much of the error checking on the parameters to Start() has been moved into this - common boot service. It is legal to call Start() from other locations, - but the following calling restrictions must be followed, or the system behavior will not be deterministic. - 1. ControllerHandle must be a valid EFI_HANDLE. - 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned - EFI_DEVICE_PATH_PROTOCOL. - 3. Prior to calling Start(), the Supported() function for the driver specified by This must - have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. - - @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. - @param[in] ControllerHandle The handle of the controller to start. This handle - must support a protocol interface that supplies - an I/O abstraction to the driver. - @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This - parameter is ignored by device drivers, and is optional for bus - drivers. For a bus driver, if this parameter is NULL, then handles - for all the children of Controller are created by this driver. - If this parameter is not NULL and the first Device Path Node is - not the End of Device Path Node, then only the handle for the - child device specified by the first Device Path Node of - RemainingDevicePath is created by this driver. - If the first Device Path Node of RemainingDevicePath is - the End of Device Path Node, no child handle is created by this - driver. - - @retval EFI_SUCCESS The device was started. - @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented. - @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. - @retval Others The driver failded to start the 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 - ); - -/** - Stops a device controller or a bus controller. - - The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). - As a result, much of the error checking on the parameters to Stop() has been moved - into this common boot service. It is legal to call Stop() from other locations, - but the following calling restrictions must be followed, or the system behavior will not be deterministic. - 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this - same driver's Start() function. - 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid - EFI_HANDLE. In addition, all of these handles must have been created in this driver's - Start() function, and the Start() function must have called OpenProtocol() on - ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER. - - @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance. - @param[in] ControllerHandle A handle to the device being stopped. The handle must - support a bus specific I/O protocol for the driver - to use to stop the device. - @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer. - @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL - if NumberOfChildren is 0. - - @retval EFI_SUCCESS The device was stopped. - @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error. - -**/ -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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/FormBrowser2.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/FormBrowser2.h deleted file mode 100644 index 0c0f56d73..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/FormBrowser2.h +++ /dev/null @@ -1,181 +0,0 @@ -/** @file - This protocol is defined in UEFI spec. - - The EFI_FORM_BROWSER2_PROTOCOL is the interface to call for drivers to - leverage the EFI configuration driver interface. - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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_FORM_BROWSER2_H__ -#define __EFI_FORM_BROWSER2_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Guid/HiiPlatformSetupFormset.h> - -#define EFI_FORM_BROWSER2_PROTOCOL_GUID \ - {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }} - - -typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL; - - - -/** - - @param LeftColumn The value that designates the text column - where the browser window will begin from - the left-hand side of the screen - - @param RightColumn The value that designates the text - column where the browser window will end - on the right-hand side of the screen. - - @param TopRow The value that designates the text row from the - top of the screen where the browser window - will start. - - @param BottomRow The value that designates the text row from the - bottom of the screen where the browser - window will end. -**/ -typedef struct { - UINTN LeftColumn; - UINTN RightColumn; - UINTN TopRow; - UINTN BottomRow; -} EFI_SCREEN_DESCRIPTOR; - -typedef UINTN EFI_BROWSER_ACTION_REQUEST; - -#define EFI_BROWSER_ACTION_REQUEST_NONE 0 -#define EFI_BROWSER_ACTION_REQUEST_RESET 1 -#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2 -#define EFI_BROWSER_ACTION_REQUEST_EXIT 3 -#define EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT 4 -#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT 5 -#define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY 6 -#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD 7 - - -/** - Initialize the browser to display the specified configuration forms. - - This function is the primary interface to the internal forms-based browser. - The forms browser will display forms associated with the specified Handles. - The browser will select all forms in packages which have the specified Type - and (for EFI_HII_PACKAGE_TYPE_GUID) the specified PackageGuid. - - @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance - - @param Handles A pointer to an array of Handles. This value should correspond - to the value of the HII form package that is required to be displayed. - - @param HandleCount The number of Handles specified in Handle. - - @param FormSetGuid This field points to the EFI_GUID which must match the Guid field or one of the - elements of the ClassId field in the EFI_IFR_FORM_SET op-code. If - FormsetGuid is NULL, then this function will display the form set class - EFI_HII_PLATFORM_SETUP_FORMSET_GUID. - - @param FormId This field specifies the identifier of the form within the form set to render as the first - displayable page. If this field has a value of 0x0000, then the Forms Browser will - render the first enabled form in the form set. - - @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in - characters. - - @param ActionRequest Points to the action recommended by the form. - - @retval EFI_SUCCESS The function completed successfully - - @retval EFI_NOT_FOUND The variable was not found. - - @retval EFI_INVALID_PARAMETER One of the parameters has an - invalid value. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SEND_FORM2)( - IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, - IN EFI_HII_HANDLE *Handle, - IN UINTN HandleCount, - IN EFI_GUID *FormSetGuid, OPTIONAL - IN EFI_FORM_ID FormId, OPTIONAL - IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL - OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL -); - - -/** - This function is called by a callback handler to retrieve uncommitted state data from the browser. - - This routine is called by a routine which was called by the - browser. This routine called this service in the browser to - retrieve or set certain uncommitted state information. - - @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance. - - @param ResultsDataSize A pointer to the size of the buffer - associated with ResultsData. On input, the size in - bytes of ResultsData. On output, the size of data - returned in ResultsData. - - @param ResultsData A string returned from an IFR browser or - equivalent. The results string will have - no routing information in them. - - @param RetrieveData A BOOLEAN field which allows an agent to - retrieve (if RetrieveData = TRUE) data - from the uncommitted browser state - information or set (if RetrieveData = - FALSE) data in the uncommitted browser - state information. - - @param VariableGuid An optional field to indicate the target - variable GUID name to use. - - @param VariableName An optional field to indicate the target - human-readable variable name. - - @retval EFI_SUCCESS The results have been distributed or are - awaiting distribution. - - @retval EFI_OUT_OF_RESOURCES The ResultsDataSize specified - was too small to contain the - results data. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_BROWSER_CALLBACK2)( - IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, - IN OUT UINTN *ResultsDataSize, - IN OUT EFI_STRING ResultsData, - IN CONST BOOLEAN RetrieveData, - IN CONST EFI_GUID *VariableGuid, OPTIONAL - IN CONST CHAR16 *VariableName OPTIONAL -); - -/// -/// This interface will allow the caller to direct the configuration -/// driver to use either the HII database or use the passed-in packet of data. -/// -struct _EFI_FORM_BROWSER2_PROTOCOL { - EFI_SEND_FORM2 SendForm; - EFI_BROWSER_CALLBACK2 BrowserCallback; -} ; - -extern EFI_GUID gEfiFormBrowser2ProtocolGuid; - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/GraphicsOutput.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/GraphicsOutput.h deleted file mode 100644 index 98ca8c9c0..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/GraphicsOutput.h +++ /dev/null @@ -1,278 +0,0 @@ -/** @file - Graphics Output Protocol from the UEFI 2.0 specification. - - Abstraction of a very simple graphics device. - - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> - 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 __GRAPHICS_OUTPUT_H__ -#define __GRAPHICS_OUTPUT_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ - { \ - 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \ - } - -typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL; - -typedef struct { - UINT32 RedMask; - UINT32 GreenMask; - UINT32 BlueMask; - UINT32 ReservedMask; -} EFI_PIXEL_BITMASK; - -typedef enum { - /// - /// A pixel is 32-bits and byte zero represents red, byte one represents green, - /// byte two represents blue, and byte three is reserved. This is the definition - /// for the physical frame buffer. The byte values for the red, green, and blue - /// components represent the color intensity. This color intensity value range - /// from a minimum intensity of 0 to maximum intensity of 255. - /// - PixelRedGreenBlueReserved8BitPerColor, - /// - /// A pixel is 32-bits and byte zero represents blue, byte one represents green, - /// byte two represents red, and byte three is reserved. This is the definition - /// for the physical frame buffer. The byte values for the red, green, and blue - /// components represent the color intensity. This color intensity value range - /// from a minimum intensity of 0 to maximum intensity of 255. - /// - PixelBlueGreenRedReserved8BitPerColor, - /// - /// The Pixel definition of the physical frame buffer. - /// - PixelBitMask, - /// - /// This mode does not support a physical frame buffer. - /// - PixelBltOnly, - /// - /// Valid EFI_GRAPHICS_PIXEL_FORMAT enum values are less than this value. - /// - PixelFormatMax -} EFI_GRAPHICS_PIXEL_FORMAT; - -typedef struct { - /// - /// The version of this data structure. A value of zero represents the - /// EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure as defined in this specification. - /// - UINT32 Version; - /// - /// The size of video screen in pixels in the X dimension. - /// - UINT32 HorizontalResolution; - /// - /// The size of video screen in pixels in the Y dimension. - /// - UINT32 VerticalResolution; - /// - /// Enumeration that defines the physical format of the pixel. A value of PixelBltOnly - /// implies that a linear frame buffer is not available for this mode. - /// - EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; - /// - /// This bit-mask is only valid if PixelFormat is set to PixelPixelBitMask. - /// A bit being set defines what bits are used for what purpose such as Red, Green, Blue, or Reserved. - /// - EFI_PIXEL_BITMASK PixelInformation; - /// - /// Defines the number of pixel elements per video memory line. - /// - UINT32 PixelsPerScanLine; -} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION; - -/** - Returns information for an available graphics mode that the graphics device - and the set of active video output devices supports. - - @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance. - @param ModeNumber The mode number to return information on. - @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer. - @param Info A pointer to callee allocated buffer that returns information about ModeNumber. - - @retval EFI_SUCCESS Valid mode information was returned. - @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode. - @retval EFI_INVALID_PARAMETER ModeNumber is not valid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE)( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN UINT32 ModeNumber, - OUT UINTN *SizeOfInfo, - OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info - ); - -/** - Set the video device into the specified mode and clears the visible portions of - the output display to black. - - @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance. - @param ModeNumber Abstraction that defines the current video mode. - - @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected. - @retval EFI_DEVICE_ERROR The device had an error and could not complete the request. - @retval EFI_UNSUPPORTED ModeNumber is not supported by this device. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE)( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN UINT32 ModeNumber - ); - -typedef struct { - UINT8 Blue; - UINT8 Green; - UINT8 Red; - UINT8 Reserved; -} EFI_GRAPHICS_OUTPUT_BLT_PIXEL; - -typedef union { - EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel; - UINT32 Raw; -} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION; - -/// -/// actions for BltOperations -/// -typedef enum { - /// - /// Write data from the BltBuffer pixel (0, 0) - /// directly to every pixel of the video display rectangle - /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). - /// Only one pixel will be used from the BltBuffer. Delta is NOT used. - /// - EfiBltVideoFill, - - /// - /// Read data from the video display rectangle - /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in - /// the BltBuffer rectangle (DestinationX, DestinationY ) - /// (DestinationX + Width, DestinationY + Height). If DestinationX or - /// DestinationY is not zero then Delta must be set to the length in bytes - /// of a row in the BltBuffer. - /// - EfiBltVideoToBltBuffer, - - /// - /// Write data from the BltBuffer rectangle - /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the - /// video display rectangle (DestinationX, DestinationY) - /// (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is - /// not zero then Delta must be set to the length in bytes of a row in the - /// BltBuffer. - /// - EfiBltBufferToVideo, - - /// - /// Copy from the video display rectangle (SourceX, SourceY) - /// (SourceX + Width, SourceY + Height) to the video display rectangle - /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). - /// The BltBuffer and Delta are not used in this mode. - /// - EfiBltVideoToVideo, - - EfiGraphicsOutputBltOperationMax -} EFI_GRAPHICS_OUTPUT_BLT_OPERATION; - -/** - Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer. - - @param This Protocol instance pointer. - @param BltBuffer The data to transfer to the graphics screen. - Size is at least Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL). - @param BltOperation The operation to perform when copying BltBuffer on to the graphics screen. - @param SourceX The X coordinate of source for the BltOperation. - @param SourceY The Y coordinate of source for the BltOperation. - @param DestinationX The X coordinate of destination for the BltOperation. - @param DestinationY The Y coordinate of destination for the BltOperation. - @param Width The width of a rectangle in the blt rectangle in pixels. - @param Height The height of a rectangle in the blt rectangle in pixels. - @param Delta Not used for EfiBltVideoFill or the EfiBltVideoToVideo operation. - If a Delta of zero is used, the entire BltBuffer is being operated on. - If a subrectangle of the BltBuffer is being used then Delta - represents the number of bytes in a row of the BltBuffer. - - @retval EFI_SUCCESS BltBuffer was drawn to the graphics screen. - @retval EFI_INVALID_PARAMETER BltOperation is not valid. - @retval EFI_DEVICE_ERROR The device had an error and could not complete the request. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT)( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL - IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta OPTIONAL - ); - -typedef struct { - /// - /// The number of modes supported by QueryMode() and SetMode(). - /// - UINT32 MaxMode; - /// - /// Current Mode of the graphics device. Valid mode numbers are 0 to MaxMode -1. - /// - UINT32 Mode; - /// - /// Pointer to read-only EFI_GRAPHICS_OUTPUT_MODE_INFORMATION data. - /// - EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info; - /// - /// Size of Info structure in bytes. - /// - UINTN SizeOfInfo; - /// - /// Base address of graphics linear frame buffer. - /// Offset zero in FrameBufferBase represents the upper left pixel of the display. - /// - EFI_PHYSICAL_ADDRESS FrameBufferBase; - /// - /// Amount of frame buffer needed to support the active mode as defined by - /// PixelsPerScanLine xVerticalResolution x PixelElementSize. - /// - UINTN FrameBufferSize; -} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE; - -/// -/// Provides a basic abstraction to set video modes and copy pixels to and from -/// the graphics controller's frame buffer. The linear address of the hardware -/// frame buffer is also exposed so software can write directly to the video hardware. -/// -struct _EFI_GRAPHICS_OUTPUT_PROTOCOL { - EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode; - EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode; - EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt; - /// - /// Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data. - /// - EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode; -}; - -extern EFI_GUID gEfiGraphicsOutputProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/HiiConfigAccess.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/HiiConfigAccess.h deleted file mode 100644 index 17ce3fdcc..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/HiiConfigAccess.h +++ /dev/null @@ -1,224 +0,0 @@ -/** @file - - The EFI HII results processing protocol invokes this type of protocol - when it needs to forward results to a driver's configuration handler. - This protocol is published by drivers providing and requesting - configuration data from HII. It may only be invoked by HII. - -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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_HII_CONFIG_ACCESS_H__ -#define __EFI_HII_CONFIG_ACCESS_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Protocol/FormBrowser2.h> - -#define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \ - { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } } - -typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL; - -typedef UINTN EFI_BROWSER_ACTION; - -#define EFI_BROWSER_ACTION_CHANGING 0 -#define EFI_BROWSER_ACTION_CHANGED 1 -#define EFI_BROWSER_ACTION_RETRIEVE 2 -#define EFI_BROWSER_ACTION_FORM_OPEN 3 -#define EFI_BROWSER_ACTION_FORM_CLOSE 4 -#define EFI_BROWSER_ACTION_DEFAULT_STANDARD 0x1000 -#define EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING 0x1001 -#define EFI_BROWSER_ACTION_DEFAULT_SAFE 0x1002 -#define EFI_BROWSER_ACTION_DEFAULT_PLATFORM 0x2000 -#define EFI_BROWSER_ACTION_DEFAULT_HARDWARE 0x3000 -#define EFI_BROWSER_ACTION_DEFAULT_FIRMWARE 0x4000 - -/** - - This function allows the caller to request the current - configuration for one or more named elements. The resulting - string is in <ConfigAltResp> format. Any and all alternative - configuration strings shall also be appended to the end of the - current configuration string. If they are, they must appear - after the current configuration. They must contain the same - routing (GUID, NAME, PATH) as the current configuration string. - They must have an additional description indicating the type of - alternative configuration the string represents, - "ALTCFG=<StringToken>". That <StringToken> (when - converted from Hex UNICODE to binary) is a reference to a - string in the associated string pack. - - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. - - @param Request A null-terminated Unicode string in - <ConfigRequest> format. Note that this - includes the routing information as well as - the configurable name / value pairs. It is - invalid for this string to be in - <MultiConfigRequest> format. - If a NULL is passed in for the Request field, - all of the settings being abstracted by this function - will be returned in the Results field. In addition, - if a ConfigHdr is passed in with no request elements, - all of the settings being abstracted for that particular - ConfigHdr reference will be returned in the Results Field. - - @param Progress On return, points to a character in the - Request string. Points to the string's null - terminator if request was successful. Points - to the most recent "&" before the first - failing name / value pair (or the beginning - of the string if the failure is in the first - name / value pair) if the request was not - successful. - - @param Results A null-terminated Unicode string in - <MultiConfigAltResp> format which has all values - filled in for the names in the Request string. - String to be allocated by the called function. - - @retval EFI_SUCCESS The Results string is filled with the - values corresponding to all requested - names. - - @retval EFI_OUT_OF_RESOURCES Not enough memory to store the - parts of the results that must be - stored awaiting possible future - protocols. - - @retval EFI_NOT_FOUND A configuration element matching - the routing data is not found. - Progress set to the first character - in the routing header. - - @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set - to most recent "&" before the - error or the beginning of the - string. - - @retval EFI_INVALID_PARAMETER Unknown name. Progress points - to the & before the name in - question. - -**/ -typedef -EFI_STATUS -(EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG)( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN CONST EFI_STRING Request, - OUT EFI_STRING *Progress, - OUT EFI_STRING *Results -); - - -/** - - This function applies changes in a driver's configuration. - Input is a Configuration, which has the routing data for this - driver followed by name / value configuration pairs. The driver - must apply those pairs to its configurable storage. If the - driver's configuration is stored in a linear block of data - and the driver's name / value pairs are in <BlockConfig> - format, it may use the ConfigToBlock helper function (above) to - simplify the job. - - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. - - @param Configuration A null-terminated Unicode string in - <ConfigString> format. - - @param Progress A pointer to a string filled in with the - offset of the most recent '&' before the - first failing name / value pair (or the - beginn ing of the string if the failure - is in the first name / value pair) or - the terminating NULL if all was - successful. - - @retval EFI_SUCCESS The results have been distributed or are - awaiting distribution. - - @retval EFI_OUT_OF_RESOURCES Not enough memory to store the - parts of the results that must be - stored awaiting possible future - protocols. - - @retval EFI_INVALID_PARAMETERS Passing in a NULL for the - Results parameter would result - in this type of error. - - @retval EFI_NOT_FOUND Target for the specified routing data - was not found - -**/ -typedef -EFI_STATUS -(EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG)( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN CONST EFI_STRING Configuration, - OUT EFI_STRING *Progress -); - -/** - - This function is called to provide results data to the driver. - This data consists of a unique key that is used to identify - which data is either being passed back or being asked for. - - @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. - @param Action Specifies the type of action taken by the browser. - @param QuestionId A unique value which is sent to the original - exporting driver so that it can identify the type - of data to expect. The format of the data tends to - vary based on the opcode that generated the callback. - @param Type The type of value for the question. - @param Value A pointer to the data being sent to the original - exporting driver. - @param ActionRequest On return, points to the action requested by the - callback function. - - @retval EFI_SUCCESS The callback successfully handled the action. - @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 saved. - @retval EFI_UNSUPPORTED The specified Action is not supported by the - callback. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK)( - IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, - IN EFI_BROWSER_ACTION Action, - IN EFI_QUESTION_ID QuestionId, - IN UINT8 Type, - IN OUT EFI_IFR_TYPE_VALUE *Value, - OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest - ) - ; - -/// -/// This protocol provides a callable interface between the HII and -/// drivers. Only drivers which provide IFR data to HII are required -/// to publish this protocol. -/// -struct _EFI_HII_CONFIG_ACCESS_PROTOCOL { - EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig; - EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig; - EFI_HII_ACCESS_FORM_CALLBACK Callback; -} ; - -extern EFI_GUID gEfiHiiConfigAccessProtocolGuid; - -#endif - - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/HiiDatabase.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/HiiDatabase.h deleted file mode 100644 index cbc0108b0..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/HiiDatabase.h +++ /dev/null @@ -1,533 +0,0 @@ -/** @file - The file provides Database manager for HII-related data - structures. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 __HII_DATABASE_H__ -#define __HII_DATABASE_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_HII_DATABASE_PROTOCOL_GUID \ - { 0xef9fc172, 0xa1b2, 0x4693, { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } } - - -typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL; - - -/// -/// EFI_HII_DATABASE_NOTIFY_TYPE. -/// -typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE; - -#define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001 -#define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002 -#define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004 -#define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008 -/** - - Functions which are registered to receive notification of - database events have this prototype. The actual event is encoded - in NotifyType. The following table describes how PackageType, - PackageGuid, Handle, and Package are used for each of the - notification types. - - @param PackageType Package type of the notification. - - @param PackageGuid If PackageType is - EFI_HII_PACKAGE_TYPE_GUID, then this is - the pointer to the GUID from the Guid - field of EFI_HII_PACKAGE_GUID_HEADER. - Otherwise, it must be NULL. - - @param Package Points to the package referred to by the notification. - - @param Handle The handle of the package - list which contains the specified package. - - @param NotifyType The type of change concerning the - database. See - EFI_HII_DATABASE_NOTIFY_TYPE. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_NOTIFY)( - IN UINT8 PackageType, - IN CONST EFI_GUID *PackageGuid, - IN CONST EFI_HII_PACKAGE_HEADER *Package, - IN EFI_HII_HANDLE Handle, - IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType -); - -/** - - This function adds the packages in the package list to the - database and returns a handle. If there is a - EFI_DEVICE_PATH_PROTOCOL associated with the DriverHandle, then - this function will create a package of type - EFI_PACKAGE_TYPE_DEVICE_PATH and add it to the package list. For - each package in the package list, registered functions with the - notification type NEW_PACK and having the same package type will - be called. For each call to NewPackageList(), there should be a - corresponding call to - EFI_HII_DATABASE_PROTOCOL.RemovePackageList(). - - @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - - @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure. - - @param DriverHandle Associate the package list with this EFI handle. - If a NULL is specified, this data will not be associate - with any drivers and cannot have a callback induced. - - @param Handle A pointer to the EFI_HII_HANDLE instance. - - @retval EFI_SUCCESS The package list associated with the - Handle was added to the HII database. - - @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary - resources for the new database - contents. - - @retval EFI_INVALID_PARAMETER PackageList is NULL, or Handle is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_NEW_PACK)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, - IN EFI_HANDLE DriverHandle, OPTIONAL - OUT EFI_HII_HANDLE *Handle -); - - -/** - - This function removes the package list that is associated with a - handle Handle from the HII database. Before removing the - package, any registered functions with the notification type - REMOVE_PACK and the same package type will be called. For each - call to EFI_HII_DATABASE_PROTOCOL.NewPackageList(), there should - be a corresponding call to RemovePackageList. - - @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - - @param Handle The handle that was registered to the data - that is requested for removal. - - @retval EFI_SUCCESS The data associated with the Handle was - removed from the HII database. - @retval EFI_NOT_FOUND The specified Handle is not in database. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN EFI_HII_HANDLE Handle -); - - -/** - - This function updates the existing package list (which has the - specified Handle) in the HII databases, using the new package - list specified by PackageList. The update process has the - following steps: Collect all the package types in the package - list specified by PackageList. A package type consists of the - Type field of EFI_HII_PACKAGE_HEADER and, if the Type is - EFI_HII_PACKAGE_TYPE_GUID, the Guid field, as defined in - EFI_HII_PACKAGE_GUID_HEADER. Iterate through the packages within - the existing package list in the HII database specified by - Handle. If a package's type matches one of the collected types collected - in step 1, then perform the following steps: - - Call any functions registered with the notification type - REMOVE_PACK. - - Remove the package from the package list and the HII - database. - Add all of the packages within the new package list specified - by PackageList, using the following steps: - - Add the package to the package list and the HII database. - - Call any functions registered with the notification type - ADD_PACK. - - @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - - @param Handle The handle that was registered to the data - that is requested for removal. - - @param PackageList A pointer to an EFI_HII_PACKAGE_LIST - package. - - @retval EFI_SUCCESS The HII database was successfully updated. - - @retval EFI_OUT_OF_RESOURCES Unable to allocate enough memory - for the updated database. - - @retval EFI_INVALID_PARAMETER PackageList was NULL. - @retval EFI_NOT_FOUND The specified Handle is not in database. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN EFI_HII_HANDLE Handle, - IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList -); - - -/** - - This function returns a list of the package handles of the - specified type that are currently active in the database. The - pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package - handles to be listed. - - @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - - @param PackageType Specifies the package type of the packages - to list or EFI_HII_PACKAGE_TYPE_ALL for - all packages to be listed. - - @param PackageGuid If PackageType is - EFI_HII_PACKAGE_TYPE_GUID, then this is - the pointer to the GUID which must match - the Guid field of - EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it - must be NULL. - - @param HandleBufferLength On input, a pointer to the length - of the handle buffer. On output, - the length of the handle buffer - that is required for the handles found. - - @param Handle An array of EFI_HII_HANDLE instances returned. - - @retval EFI_SUCCESS The matching handles are outputed successfully. - HandleBufferLength is updated with the actual length. - @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter - indicates that Handle is too - small to support the number of - handles. HandleBufferLength is - updated with a value that will - enable the data to fit. - @retval EFI_NOT_FOUND No matching handle could be found in database. - @retval EFI_INVALID_PARAMETER HandleBufferLength was NULL. - @retval EFI_INVALID_PARAMETER The value referenced by HandleBufferLength was not - zero and Handle was NULL. - @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but - PackageGuid is not NULL, PackageType is a EFI_HII_ - PACKAGE_TYPE_GUID but PackageGuid is NULL. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_LIST_PACKS)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN UINT8 PackageType, - IN CONST EFI_GUID *PackageGuid, - IN OUT UINTN *HandleBufferLength, - OUT EFI_HII_HANDLE *Handle -); - -/** - - This function will export one or all package lists in the - database to a buffer. For each package list exported, this - function will call functions registered with EXPORT_PACK and - then copy the package list to the buffer. The registered - functions may call EFI_HII_DATABASE_PROTOCOL.UpdatePackageList() - to modify the package list before it is copied to the buffer. If - the specified BufferSize is too small, then the status - EFI_OUT_OF_RESOURCES will be returned and the actual package - size will be returned in BufferSize. - - @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - - - @param Handle An EFI_HII_HANDLE that corresponds to the - desired package list in the HII database to - export or NULL to indicate all package lists - should be exported. - - @param BufferSize On input, a pointer to the length of the - buffer. On output, the length of the - buffer that is required for the exported - data. - - @param Buffer A pointer to a buffer that will contain the - results of the export function. - - - @retval EFI_SUCCESS Package exported. - - @retval EFI_OUT_OF_RESOURCES BufferSize is too small to hold the package. - - @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the - current database. - - @retval EFI_INVALID_PARAMETER BufferSize was NULL. - - @retval EFI_INVALID_PARAMETER The value referenced by BufferSize was not zero - and Buffer was NULL. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN EFI_HII_HANDLE Handle, - IN OUT UINTN *BufferSize, - OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer -); - - -/** - - - This function registers a function which will be called when - specified actions related to packages of the specified type - occur in the HII database. By registering a function, other - HII-related drivers are notified when specific package types - are added, removed or updated in the HII database. Each driver - or application which registers a notification should use - EFI_HII_DATABASE_PROTOCOL.UnregisterPackageNotify() before - exiting. - - - @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - - @param PackageType The package type. See - EFI_HII_PACKAGE_TYPE_x in EFI_HII_PACKAGE_HEADER. - - @param PackageGuid If PackageType is - EFI_HII_PACKAGE_TYPE_GUID, then this is - the pointer to the GUID which must match - the Guid field of - EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it - must be NULL. - - @param PackageNotifyFn Points to the function to be called - when the event specified by - NotificationType occurs. See - EFI_HII_DATABASE_NOTIFY. - - @param NotifyType Describes the types of notification which - this function will be receiving. See - EFI_HII_DATABASE_NOTIFY_TYPE for a - list of types. - - @param NotifyHandle Points to the unique handle assigned to - the registered notification. Can be used - in EFI_HII_DATABASE_PROTOCOL.UnregisterPack - to stop notifications. - - - @retval EFI_SUCCESS Notification registered successfully. - - @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary - data structures. - - @retval EFI_INVALID_PARAMETER PackageGuid is not NULL when - PackageType is not - EFI_HII_PACKAGE_TYPE_GUID. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN UINT8 PackageType, - IN CONST EFI_GUID *PackageGuid, - IN EFI_HII_DATABASE_NOTIFY PackageNotifyFn, - IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, - OUT EFI_HANDLE *NotifyHandle -); - - -/** - - Removes the specified HII database package-related notification. - - @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - - @param NotificationHandle The handle of the notification - function being unregistered. - - @retval EFI_SUCCESS Successsfully unregistered the notification. - - @retval EFI_NOT_FOUND The incoming notification handle does not exist - in the current hii database. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN EFI_HANDLE NotificationHandle -); - - -/** - - This routine retrieves an array of GUID values for each keyboard - layout that was previously registered in the system. - - @param This A pointer to the EFI_HII_PROTOCOL instance. - - @param KeyGuidBufferLength On input, a pointer to the length - of the keyboard GUID buffer. On - output, the length of the handle - buffer that is required for the - handles found. - - @param KeyGuidBuffer An array of keyboard layout GUID - instances returned. - - @retval EFI_SUCCESS KeyGuidBuffer was updated successfully. - - @retval EFI_BUFFER_TOO_SMALL The KeyGuidBufferLength - parameter indicates that - KeyGuidBuffer is too small to - support the number of GUIDs. - KeyGuidBufferLength is updated - with a value that will enable - the data to fit. - @retval EFI_INVALID_PARAMETER The KeyGuidBufferLength is NULL. - @retval EFI_INVALID_PARAMETER The value referenced by - KeyGuidBufferLength is not - zero and KeyGuidBuffer is NULL. - @retval EFI_NOT_FOUND There was no keyboard layout. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN OUT UINT16 *KeyGuidBufferLength, - OUT EFI_GUID *KeyGuidBuffer -); - - -/** - - This routine retrieves the requested keyboard layout. The layout - is a physical description of the keys on a keyboard, and the - character(s) that are associated with a particular set of key - strokes. - - @param This A pointer to the EFI_HII_PROTOCOL instance. - - @param KeyGuid A pointer to the unique ID associated with a - given keyboard layout. If KeyGuid is NULL then - the current layout will be retrieved. - - @param KeyboardLayoutLength On input, a pointer to the length of the - KeyboardLayout buffer. On output, the length of - the data placed into KeyboardLayout. - - @param KeyboardLayout A pointer to a buffer containing the - retrieved keyboard layout. - - @retval EFI_SUCCESS The keyboard layout was retrieved - successfully. - - @retval EFI_NOT_FOUND The requested keyboard layout was not found. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_GUID *KeyGuid, - IN OUT UINT16 *KeyboardLayoutLength, - OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout -); - -/** - - This routine sets the default keyboard layout to the one - referenced by KeyGuid. When this routine is called, an event - will be signaled of the EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID - group type. This is so that agents which are sensitive to the - current keyboard layout being changed can be notified of this - change. - - @param This A pointer to the EFI_HII_PROTOCOL instance. - - @param KeyGuid A pointer to the unique ID associated with a - given keyboard layout. - - @retval EFI_SUCCESS The current keyboard layout was successfully set. - - @retval EFI_NOT_FOUND The referenced keyboard layout was not - found, so action was taken. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_GUID *KeyGuid -); - -/** - - Return the EFI handle associated with a package list. - - @param This A pointer to the EFI_HII_PROTOCOL instance. - - @param PackageListHandle An EFI_HII_HANDLE that corresponds - to the desired package list in the - HIIdatabase. - - @param DriverHandle On return, contains the EFI_HANDLE which - was registered with the package list in - NewPackageList(). - - @retval EFI_SUCCESS The DriverHandle was returned successfully. - - @retval EFI_INVALID_PARAMETER The PackageListHandle was not valid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE)( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN EFI_HII_HANDLE PackageListHandle, - OUT EFI_HANDLE *DriverHandle -); - -/// -/// Database manager for HII-related data structures. -/// -struct _EFI_HII_DATABASE_PROTOCOL { - EFI_HII_DATABASE_NEW_PACK NewPackageList; - EFI_HII_DATABASE_REMOVE_PACK RemovePackageList; - EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList; - EFI_HII_DATABASE_LIST_PACKS ListPackageLists; - EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists; - EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify; - EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify; - EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts; - EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; - EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout; - EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle; -}; - -extern EFI_GUID gEfiHiiDatabaseProtocolGuid; - -#endif - - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Ip4.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Ip4.h deleted file mode 100644 index f174c0cfb..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Ip4.h +++ /dev/null @@ -1,614 +0,0 @@ -/** @file - This file defines the EFI IPv4 (Internet Protocol version 4) - Protocol interface. It is split into the following three main - sections: - - EFI IPv4 Service Binding Protocol - - EFI IPv4 Variable (deprecated in UEFI 2.4B) - - EFI IPv4 Protocol. - The EFI IPv4 Protocol provides basic network IPv4 packet I/O services, - which includes support foR a subset of the Internet Control Message - Protocol (ICMP) and may include support for the Internet Group Management - Protocol (IGMP). - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in UEFI Specification 2.0. - -**/ - -#ifndef __EFI_IP4_PROTOCOL_H__ -#define __EFI_IP4_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Protocol/ManagedNetwork.h> - -#define EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID \ - { \ - 0xc51711e7, 0xb4bf, 0x404a, {0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } \ - } - -#define EFI_IP4_PROTOCOL_GUID \ - { \ - 0x41d94cd2, 0x35b6, 0x455a, {0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } \ - } - -typedef struct _EFI_IP4_PROTOCOL EFI_IP4_PROTOCOL; - -/// -/// EFI_IP4_ADDRESS_PAIR is deprecated in the UEFI 2.4B and should not be used any more. -/// The definition in here is only present to provide backwards compatability. -/// -typedef struct { - EFI_HANDLE InstanceHandle; - EFI_IPv4_ADDRESS Ip4Address; - EFI_IPv4_ADDRESS SubnetMask; -} EFI_IP4_ADDRESS_PAIR; - -/// -/// EFI_IP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more. -/// The definition in here is only present to provide backwards compatability. -/// -typedef struct { - EFI_HANDLE DriverHandle; - UINT32 AddressCount; - EFI_IP4_ADDRESS_PAIR AddressPairs[1]; -} EFI_IP4_VARIABLE_DATA; - -typedef struct { - /// - /// The default IPv4 protocol packets to send and receive. Ignored - /// when AcceptPromiscuous is TRUE. - /// - UINT8 DefaultProtocol; - /// - /// Set to TRUE to receive all IPv4 packets that get through the receive filters. - /// Set to FALSE to receive only the DefaultProtocol IPv4 - /// packets that get through the receive filters. - /// - BOOLEAN AcceptAnyProtocol; - /// - /// Set to TRUE to receive ICMP error report packets. Ignored when - /// AcceptPromiscuous or AcceptAnyProtocol is TRUE. - /// - BOOLEAN AcceptIcmpErrors; - /// - /// Set to TRUE to receive broadcast IPv4 packets. Ignored when - /// AcceptPromiscuous is TRUE. - /// Set to FALSE to stop receiving broadcast IPv4 packets. - /// - BOOLEAN AcceptBroadcast; - /// - /// Set to TRUE to receive all IPv4 packets that are sent to any - /// hardware address or any protocol address. - /// Set to FALSE to stop receiving all promiscuous IPv4 packets - /// - BOOLEAN AcceptPromiscuous; - /// - /// Set to TRUE to use the default IPv4 address and default routing table. - /// - BOOLEAN UseDefaultAddress; - /// - /// The station IPv4 address that will be assigned to this EFI IPv4Protocol instance. - /// - EFI_IPv4_ADDRESS StationAddress; - /// - /// The subnet address mask that is associated with the station address. - /// - EFI_IPv4_ADDRESS SubnetMask; - /// - /// TypeOfService field in transmitted IPv4 packets. - /// - UINT8 TypeOfService; - /// - /// TimeToLive field in transmitted IPv4 packets. - /// - UINT8 TimeToLive; - /// - /// State of the DoNotFragment bit in transmitted IPv4 packets. - /// - BOOLEAN DoNotFragment; - /// - /// Set to TRUE to send and receive unformatted packets. The other - /// IPv4 receive filters are still applied. Fragmentation is disabled for RawData mode. - /// - BOOLEAN RawData; - /// - /// The timer timeout value (number of microseconds) for the - /// receive timeout event to be associated with each assembled - /// packet. Zero means do not drop assembled packets. - /// - UINT32 ReceiveTimeout; - /// - /// The timer timeout value (number of microseconds) for the - /// transmit timeout event to be associated with each outgoing - /// packet. Zero means do not drop outgoing packets. - /// - UINT32 TransmitTimeout; -} EFI_IP4_CONFIG_DATA; - - -typedef struct { - EFI_IPv4_ADDRESS SubnetAddress; - EFI_IPv4_ADDRESS SubnetMask; - EFI_IPv4_ADDRESS GatewayAddress; -} EFI_IP4_ROUTE_TABLE; - -typedef struct { - UINT8 Type; - UINT8 Code; -} EFI_IP4_ICMP_TYPE; - -typedef struct { - /// - /// Set to TRUE after this EFI IPv4 Protocol instance has been successfully configured. - /// - BOOLEAN IsStarted; - /// - /// The maximum packet size, in bytes, of the packet which the upper layer driver could feed. - /// - UINT32 MaxPacketSize; - /// - /// Current configuration settings. - /// - EFI_IP4_CONFIG_DATA ConfigData; - /// - /// Set to TRUE when the EFI IPv4 Protocol instance has a station address and subnet mask. - /// - BOOLEAN IsConfigured; - /// - /// Number of joined multicast groups. - /// - UINT32 GroupCount; - /// - /// List of joined multicast group addresses. - /// - EFI_IPv4_ADDRESS *GroupTable; - /// - /// Number of entries in the routing table. - /// - UINT32 RouteCount; - /// - /// Routing table entries. - /// - EFI_IP4_ROUTE_TABLE *RouteTable; - /// - /// Number of entries in the supported ICMP types list. - /// - UINT32 IcmpTypeCount; - /// - /// Array of ICMP types and codes that are supported by this EFI IPv4 Protocol driver - /// - EFI_IP4_ICMP_TYPE *IcmpTypeList; -} EFI_IP4_MODE_DATA; - -#pragma pack(1) - -typedef struct { - UINT8 HeaderLength:4; - UINT8 Version:4; - UINT8 TypeOfService; - UINT16 TotalLength; - UINT16 Identification; - UINT16 Fragmentation; - UINT8 TimeToLive; - UINT8 Protocol; - UINT16 Checksum; - EFI_IPv4_ADDRESS SourceAddress; - EFI_IPv4_ADDRESS DestinationAddress; -} EFI_IP4_HEADER; -#pragma pack() - - -typedef struct { - UINT32 FragmentLength; - VOID *FragmentBuffer; -} EFI_IP4_FRAGMENT_DATA; - - -typedef struct { - EFI_TIME TimeStamp; - EFI_EVENT RecycleSignal; - UINT32 HeaderLength; - EFI_IP4_HEADER *Header; - UINT32 OptionsLength; - VOID *Options; - UINT32 DataLength; - UINT32 FragmentCount; - EFI_IP4_FRAGMENT_DATA FragmentTable[1]; -} EFI_IP4_RECEIVE_DATA; - - -typedef struct { - EFI_IPv4_ADDRESS SourceAddress; - EFI_IPv4_ADDRESS GatewayAddress; - UINT8 Protocol; - UINT8 TypeOfService; - UINT8 TimeToLive; - BOOLEAN DoNotFragment; -} EFI_IP4_OVERRIDE_DATA; - -typedef struct { - EFI_IPv4_ADDRESS DestinationAddress; - EFI_IP4_OVERRIDE_DATA *OverrideData; //OPTIONAL - UINT32 OptionsLength; //OPTIONAL - VOID *OptionsBuffer; //OPTIONAL - UINT32 TotalDataLength; - UINT32 FragmentCount; - EFI_IP4_FRAGMENT_DATA FragmentTable[1]; -} EFI_IP4_TRANSMIT_DATA; - -typedef struct { - /// - /// This Event will be signaled after the Status field is updated - /// by the EFI IPv4 Protocol driver. The type of Event must be - /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of - /// Event must be lower than or equal to TPL_CALLBACK. - /// - EFI_EVENT Event; - /// - /// The status that is returned to the caller at the end of the operation - /// to indicate whether this operation completed successfully. - /// - EFI_STATUS Status; - union { - /// - /// When this token is used for receiving, RxData is a pointer to the EFI_IP4_RECEIVE_DATA. - /// - EFI_IP4_RECEIVE_DATA *RxData; - /// - /// When this token is used for transmitting, TxData is a pointer to the EFI_IP4_TRANSMIT_DATA. - /// - EFI_IP4_TRANSMIT_DATA *TxData; - } Packet; -} EFI_IP4_COMPLETION_TOKEN; - -/** - Gets the current operational settings for this instance of the EFI IPv4 Protocol driver. - - The GetModeData() function returns the current operational mode data for this - driver instance. The data fields in EFI_IP4_MODE_DATA are read only. This - function is used optionally to retrieve the operational mode data of underlying - networks or drivers. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - @param Ip4ModeData The pointer to the EFI IPv4 Protocol mode data structure. - @param MnpConfigData The pointer to the managed network configuration data structure. - @param SnpModeData The pointer to the simple network mode data structure. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_GET_MODE_DATA)( - IN CONST EFI_IP4_PROTOCOL *This, - OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL, - OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, - OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL - ); - -/** - Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance. - - The Configure() function is used to set, change, or reset the operational - parameters and filter settings for this EFI IPv4 Protocol instance. Until these - parameters have been set, no network traffic can be sent or received by this - instance. Once the parameters have been reset (by calling this function with - IpConfigData set to NULL), no more traffic can be sent or received until these - parameters have been set again. Each EFI IPv4 Protocol instance can be started - and stopped independently of each other by enabling or disabling their receive - filter settings with the Configure() function. - - When IpConfigData.UseDefaultAddress is set to FALSE, the new station address will - be appended as an alias address into the addresses list in the EFI IPv4 Protocol - driver. While set to TRUE, Configure() will trigger the EFI_IP4_CONFIG_PROTOCOL - to retrieve the default IPv4 address if it is not available yet. Clients could - frequently call GetModeData() to check the status to ensure that the default IPv4 - address is ready. - - If operational parameters are reset or changed, any pending transmit and receive - requests will be cancelled. Their completion token status will be set to EFI_ABORTED - and their events will be signaled. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - @param IpConfigData The pointer to the EFI IPv4 Protocol configuration data structure. - - @retval EFI_SUCCESS The driver instance was successfully opened. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - This is NULL. - IpConfigData.StationAddress is not a unicast IPv4 address. - IpConfigData.SubnetMask is not a valid IPv4 subnet - @retval EFI_UNSUPPORTED One or more of the following conditions is TRUE: - A configuration protocol (DHCP, BOOTP, RARP, etc.) could - not be located when clients choose to use the default IPv4 - address. This EFI IPv4 Protocol implementation does not - support this requested filter or timeout setting. - @retval EFI_OUT_OF_RESOURCES The EFI IPv4 Protocol driver instance data could not be allocated. - @retval EFI_ALREADY_STARTED The interface is already open and must be stopped before the - IPv4 address or subnet mask can be changed. The interface must - also be stopped when switching to/from raw packet mode. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI IPv4 - Protocol driver instance is not opened. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_CONFIGURE)( - IN EFI_IP4_PROTOCOL *This, - IN EFI_IP4_CONFIG_DATA *IpConfigData OPTIONAL - ); - -/** - Joins and leaves multicast groups. - - The Groups() function is used to join and leave multicast group sessions. Joining - a group will enable reception of matching multicast packets. Leaving a group will - disable the multicast packet reception. - - If JoinFlag is FALSE and GroupAddress is NULL, all joined groups will be left. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - @param JoinFlag Set to TRUE to join the multicast group session and FALSE to leave. - @param GroupAddress The pointer to the IPv4 multicast address. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER One or more of the following is TRUE: - - This is NULL. - - JoinFlag is TRUE and GroupAddress is NULL. - - GroupAddress is not NULL and *GroupAddress is - not a multicast IPv4 address. - @retval EFI_NOT_STARTED This instance has not been started. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_OUT_OF_RESOURCES System resources could not be allocated. - @retval EFI_UNSUPPORTED This EFI IPv4 Protocol implementation does not support multicast groups. - @retval EFI_ALREADY_STARTED The group address is already in the group table (when - JoinFlag is TRUE). - @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is FALSE). - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_GROUPS)( - IN EFI_IP4_PROTOCOL *This, - IN BOOLEAN JoinFlag, - IN EFI_IPv4_ADDRESS *GroupAddress OPTIONAL - ); - -/** - Adds and deletes routing table entries. - - The Routes() function adds a route to or deletes a route from the routing table. - - Routes are determined by comparing the SubnetAddress with the destination IPv4 - address arithmetically AND-ed with the SubnetMask. The gateway address must be - on the same subnet as the configured station address. - - The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0. - The default route matches all destination IPv4 addresses that do not match any - other routes. - - A GatewayAddress that is zero is a nonroute. Packets are sent to the destination - IP address if it can be found in the ARP cache or on the local subnet. One automatic - nonroute entry will be inserted into the routing table for outgoing packets that - are addressed to a local subnet (gateway address of 0.0.0.0). - - Each EFI IPv4 Protocol instance has its own independent routing table. Those EFI - IPv4 Protocol instances that use the default IPv4 address will also have copies - of the routing table that was provided by the EFI_IP4_CONFIG_PROTOCOL, and these - copies will be updated whenever the EIF IPv4 Protocol driver reconfigures its - instances. As a result, client modification to the routing table will be lost. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - @param DeleteRoute Set to TRUE to delete this route from the routing table. Set to - FALSE to add this route to the routing table. SubnetAddress - and SubnetMask are used as the key to each route entry. - @param SubnetAddress The address of the subnet that needs to be routed. - @param SubnetMask The subnet mask of SubnetAddress. - @param GatewayAddress The unicast gateway IPv4 address for this route. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_NOT_STARTED The driver instance has not been started. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - SubnetAddress is NULL. - - SubnetMask is NULL. - - GatewayAddress is NULL. - - *SubnetAddress is not a valid subnet address. - - *SubnetMask is not a valid subnet mask. - - *GatewayAddress is not a valid unicast IPv4 address. - @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table. - @retval EFI_NOT_FOUND This route is not in the routing table (when DeleteRoute is TRUE). - @retval EFI_ACCESS_DENIED The route is already defined in the routing table (when - DeleteRoute is FALSE). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_ROUTES)( - IN EFI_IP4_PROTOCOL *This, - IN BOOLEAN DeleteRoute, - IN EFI_IPv4_ADDRESS *SubnetAddress, - IN EFI_IPv4_ADDRESS *SubnetMask, - IN EFI_IPv4_ADDRESS *GatewayAddress - ); - -/** - Places outgoing data packets into the transmit queue. - - The Transmit() function places a sending request in the transmit queue of this - EFI IPv4 Protocol instance. Whenever the packet in the token is sent out or some - errors occur, the event in the token will be signaled and the status is updated. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - @param Token The pointer to the transmit token. - - @retval EFI_SUCCESS The data has been queued for transmission. - @retval EFI_NOT_STARTED This instance has not been started. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more pameters are invalid. - @retval EFI_ACCESS_DENIED The transmit completion token with the same Token.Event - was already in the transmit queue. - @retval EFI_NOT_READY The completion token could not be queued because the transmit - queue is full. - @retval EFI_NOT_FOUND Not route is found to destination address. - @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data. - @retval EFI_BUFFER_TOO_SMALL Token.Packet.TxData.TotalDataLength is too - short to transmit. - @retval EFI_BAD_BUFFER_SIZE The length of the IPv4 header + option length + total data length is - greater than MTU (or greater than the maximum packet size if - Token.Packet.TxData.OverrideData. - DoNotFragment is TRUE.) - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_TRANSMIT)( - IN EFI_IP4_PROTOCOL *This, - IN EFI_IP4_COMPLETION_TOKEN *Token - ); - -/** - Places a receiving request into the receiving queue. - - The Receive() function places a completion token into the receive packet queue. - This function is always asynchronous. - - The Token.Event field in the completion token must be filled in by the caller - and cannot be NULL. When the receive operation completes, the EFI IPv4 Protocol - driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event - is signaled. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - @param Token The pointer to a token that is associated with the receive data descriptor. - - @retval EFI_SUCCESS The receive completion token was cached. - @retval EFI_NOT_STARTED This EFI IPv4 Protocol instance has not been started. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, RARP, etc.) - is not finished yet. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - Token is NULL. - - Token.Event is NULL. - @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system - resources (usually memory). - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - The EFI IPv4 Protocol instance has been reset to startup defaults. - @retval EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already - in the receive queue. - @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full. - @retval EFI_ICMP_ERROR An ICMP error packet was received. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_RECEIVE)( - IN EFI_IP4_PROTOCOL *This, - IN EFI_IP4_COMPLETION_TOKEN *Token - ); - -/** - Abort an asynchronous transmit or receive request. - - The Cancel() function is used to abort a pending transmit or receive request. - If the token is in the transmit or receive request queues, after calling this - function, Token->Status will be set to EFI_ABORTED and then Token->Event will - be signaled. If the token is not in one of the queues, which usually means the - asynchronous operation has completed, this function will not signal the token - and EFI_NOT_FOUND is returned. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - @param Token The pointer to a token that has been issued by - EFI_IP4_PROTOCOL.Transmit() or - EFI_IP4_PROTOCOL.Receive(). If NULL, all pending - tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is - defined in EFI_IP4_PROTOCOL.Transmit(). - - @retval EFI_SUCCESS The asynchronous I/O request was aborted and - Token->Event was signaled. When Token is NULL, all - pending requests were aborted and their events were signaled. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_STARTED This instance has not been started. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was - not found in the transmit or receive queue. It has either completed - or was not issued by Transmit() and Receive(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_CANCEL)( - IN EFI_IP4_PROTOCOL *This, - IN EFI_IP4_COMPLETION_TOKEN *Token OPTIONAL - ); - -/** - Polls for incoming data packets and processes outgoing data packets. - - The Poll() function polls for incoming data packets and processes outgoing data - packets. Network drivers and applications can call the EFI_IP4_PROTOCOL.Poll() - function to increase the rate that data packets are moved between the communications - device and the transmit and receive queues. - - In some systems the periodic timer event may not poll the underlying communications - device fast enough to transmit and/or receive all data packets without missing - incoming packets or dropping outgoing packets. Drivers and applications that are - experiencing packet loss should try calling the EFI_IP4_PROTOCOL.Poll() function - more often. - - @param This The pointer to the EFI_IP4_PROTOCOL instance. - - @retval EFI_SUCCESS Incoming or outgoing data was processed. - @retval EFI_NOT_STARTED This EFI IPv4 Protocol instance has not been started. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_NOT_READY No incoming or outgoing data is processed. - @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. - Consider increasing the polling rate. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_POLL)( - IN EFI_IP4_PROTOCOL *This - ); - -/// -/// The EFI IPv4 Protocol implements a simple packet-oriented interface that can be -/// used by drivers, daemons, and applications to transmit and receive network packets. -/// -struct _EFI_IP4_PROTOCOL { - EFI_IP4_GET_MODE_DATA GetModeData; - EFI_IP4_CONFIGURE Configure; - EFI_IP4_GROUPS Groups; - EFI_IP4_ROUTES Routes; - EFI_IP4_TRANSMIT Transmit; - EFI_IP4_RECEIVE Receive; - EFI_IP4_CANCEL Cancel; - EFI_IP4_POLL Poll; -}; - -extern EFI_GUID gEfiIp4ServiceBindingProtocolGuid; -extern EFI_GUID gEfiIp4ProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Ip4Config.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Ip4Config.h deleted file mode 100644 index 227ae0399..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Ip4Config.h +++ /dev/null @@ -1,184 +0,0 @@ -/** @file - This file provides a definition of the EFI IPv4 Configuration - Protocol. - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in UEFI Specification 2.0. - -**/ -#ifndef __EFI_IP4CONFIG_PROTOCOL_H__ -#define __EFI_IP4CONFIG_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Protocol/Ip4.h> - -#define EFI_IP4_CONFIG_PROTOCOL_GUID \ - { \ - 0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \ - } - -typedef struct _EFI_IP4_CONFIG_PROTOCOL EFI_IP4_CONFIG_PROTOCOL; - -#define IP4_CONFIG_VARIABLE_ATTRIBUTES \ - (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS) - -/// -/// EFI_IP4_IPCONFIG_DATA contains the minimum IPv4 configuration data -/// that is needed to start basic network communication. The StationAddress -/// and SubnetMask must be a valid unicast IP address and subnet mask. -/// If RouteTableSize is not zero, then RouteTable contains a properly -/// formatted routing table for the StationAddress/SubnetMask, with the -/// last entry in the table being the default route. -/// -typedef struct { - /// - /// Default station IP address, stored in network byte order. - /// - EFI_IPv4_ADDRESS StationAddress; - /// - /// Default subnet mask, stored in network byte order. - /// - EFI_IPv4_ADDRESS SubnetMask; - /// - /// Number of entries in the following RouteTable. May be zero. - /// - UINT32 RouteTableSize; - /// - /// Default routing table data (stored in network byte order). - /// Ignored if RouteTableSize is zero. - /// - EFI_IP4_ROUTE_TABLE *RouteTable; -} EFI_IP4_IPCONFIG_DATA; - - -/** - Starts running the configuration policy for the EFI IPv4 Protocol driver. - - The Start() function is called to determine and to begin the platform - configuration policy by the EFI IPv4 Protocol driver. This determination may - be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol - driver configuration policy. It may be as involved as loading some defaults - from nonvolatile storage, downloading dynamic data from a DHCP server, and - checking permissions with a site policy server. - Starting the configuration policy is just the beginning. It may finish almost - instantly or it may take several minutes before it fails to retrieve configuration - information from one or more servers. Once the policy is started, drivers - should use the DoneEvent parameter to determine when the configuration policy - has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to - determine if the configuration succeeded or failed. - Until the configuration completes successfully, EFI IPv4 Protocol driver instances - that are attempting to use default configurations must return EFI_NO_MAPPING. - Once the configuration is complete, the EFI IPv4 Configuration Protocol driver - signals DoneEvent. The configuration may need to be updated in the future. - Note that in this case the EFI IPv4 Configuration Protocol driver must signal - ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default - configurations must return EFI_NO_MAPPING until the configuration policy has - been rerun. - - @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance. - @param DoneEvent Event that will be signaled when the EFI IPv4 - Protocol driver configuration policy completes - execution. This event must be of type EVT_NOTIFY_SIGNAL. - @param ReconfigEvent Event that will be signaled when the EFI IPv4 - Protocol driver configuration needs to be updated. - This event must be of type EVT_NOTIFY_SIGNAL. - - @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol - driver is now running. - @retval EFI_INVALID_PARAMETER One or more of the following parameters is NULL: - This - DoneEvent - ReconfigEvent - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_ALREADY_STARTED The configuration policy for the EFI IPv4 Protocol - driver was already started. - @retval EFI_DEVICE_ERROR An unexpected system error or network error occurred. - @retval EFI_UNSUPPORTED This interface does not support the EFI IPv4 Protocol - driver configuration. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_CONFIG_START)( - IN EFI_IP4_CONFIG_PROTOCOL *This, - IN EFI_EVENT DoneEvent, - IN EFI_EVENT ReconfigEvent - ); - -/** - Stops running the configuration policy for the EFI IPv4 Protocol driver. - - The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver. - All configuration data will be lost after calling Stop(). - - @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance. - - @retval EFI_SUCCESS The configuration policy for the EFI IPv4 Protocol - driver has been stopped. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol - driver was not started. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_CONFIG_STOP)( - IN EFI_IP4_CONFIG_PROTOCOL *This - ); - -/** - Returns the default configuration data (if any) for the EFI IPv4 Protocol driver. - - The GetData() function returns the current configuration data for the EFI IPv4 - Protocol driver after the configuration policy has completed. - - @param This The pointer to the EFI_IP4_CONFIG_PROTOCOL instance. - @param IpConfigDataSize On input, the size of the IpConfigData buffer. - On output, the count of bytes that were written - into the IpConfigData buffer. - @param IpConfigData The pointer to the EFI IPv4 Configuration Protocol - driver configuration data structure. - Type EFI_IP4_IPCONFIG_DATA is defined in - "Related Definitions" below. - - @retval EFI_SUCCESS The EFI IPv4 Protocol driver configuration has been returned. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_STARTED The configuration policy for the EFI IPv4 Protocol - driver is not running. - @retval EFI_NOT_READY EFI IPv4 Protocol driver configuration is still running. - @retval EFI_ABORTED EFI IPv4 Protocol driver configuration could not complete. - @retval EFI_BUFFER_TOO_SMALL *IpConfigDataSize is smaller than the configuration - data buffer or IpConfigData is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IP4_CONFIG_GET_DATA)( - IN EFI_IP4_CONFIG_PROTOCOL *This, - IN OUT UINTN *IpConfigDataSize, - OUT EFI_IP4_IPCONFIG_DATA *IpConfigData OPTIONAL - ); - -/// -/// The EFI_IP4_CONFIG_PROTOCOL driver performs platform-dependent and policy-dependent -/// configurations for the EFI IPv4 Protocol driver. -/// -struct _EFI_IP4_CONFIG_PROTOCOL { - EFI_IP4_CONFIG_START Start; - EFI_IP4_CONFIG_STOP Stop; - EFI_IP4_CONFIG_GET_DATA GetData; -}; - -extern EFI_GUID gEfiIp4ConfigProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadFile.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadFile.h deleted file mode 100644 index 99387e89f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadFile.h +++ /dev/null @@ -1,90 +0,0 @@ -/** @file - Load File protocol as defined in the UEFI 2.0 specification. - - The load file protocol exists to supports the addition of new boot devices, - and to support booting from devices that do not map well to file system. - Network boot is done via a LoadFile protocol. - - UEFI 2.0 can boot from any device that produces a LoadFile protocol. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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_LOAD_FILE_PROTOCOL_H__ -#define __EFI_LOAD_FILE_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_LOAD_FILE_PROTOCOL_GUID \ - { \ - 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ - } - -/// -/// Protocol Guid defined by EFI1.1. -/// -#define LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL_GUID - -typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL; - -/// -/// Backward-compatible with EFI1.1 -/// -typedef EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_INTERFACE; - -/** - Causes the driver to load a specified file. - - @param This Protocol instance pointer. - @param FilePath The device specific path of the file to load. - @param BootPolicy If TRUE, indicates that the request originates from the - boot manager is attempting to load FilePath as a boot - selection. If FALSE, then FilePath must match as exact file - to be loaded. - @param BufferSize On input the size of Buffer in bytes. On output with a return - code of EFI_SUCCESS, the amount of data transferred to - Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, - the size of Buffer required to retrieve the requested file. - @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL, - then the size of the requested file is returned in - BufferSize. - - @retval EFI_SUCCESS The file was loaded. - @retval EFI_UNSUPPORTED The device does not support the provided BootPolicy - @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or - BufferSize is NULL. - @retval EFI_NO_MEDIA No medium was present to load the file. - @retval EFI_DEVICE_ERROR The file was not loaded due to a device error. - @retval EFI_NO_RESPONSE The remote system did not respond. - @retval EFI_NOT_FOUND The file was not found. - @retval EFI_ABORTED The file load process was manually cancelled. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LOAD_FILE)( - IN EFI_LOAD_FILE_PROTOCOL *This, - IN EFI_DEVICE_PATH_PROTOCOL *FilePath, - IN BOOLEAN BootPolicy, - IN OUT UINTN *BufferSize, - IN VOID *Buffer OPTIONAL - ); - -/// -/// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices. -/// -struct _EFI_LOAD_FILE_PROTOCOL { - EFI_LOAD_FILE LoadFile; -}; - -extern EFI_GUID gEfiLoadFileProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadFile2.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadFile2.h deleted file mode 100644 index 6cb26fff9..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadFile2.h +++ /dev/null @@ -1,87 +0,0 @@ -/** @file - Load File protocol as defined in the UEFI 2.0 specification. - - Load file protocol exists to supports the addition of new boot devices, - and to support booting from devices that do not map well to file system. - Network boot is done via a LoadFile protocol. - - UEFI 2.0 can boot from any device that produces a LoadFile protocol. - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> - 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_LOAD_FILE2_PROTOCOL_H__ -#define __EFI_LOAD_FILE2_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_LOAD_FILE2_PROTOCOL_GUID \ - { \ - 0x4006c0c1, 0xfcb3, 0x403e, {0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \ - } - -/// -/// Protocol Guid defined by UEFI2.1. -/// -#define LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL_GUID - -typedef struct _EFI_LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL; - - -/** - Causes the driver to load a specified file. - - @param This Protocol instance pointer. - @param FilePath The device specific path of the file to load. - @param BootPolicy Should always be FALSE. - @param BufferSize On input the size of Buffer in bytes. On output with a return - code of EFI_SUCCESS, the amount of data transferred to - Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, - the size of Buffer required to retrieve the requested file. - @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL, - then no the size of the requested file is returned in - BufferSize. - - @retval EFI_SUCCESS The file was loaded. - @retval EFI_UNSUPPORTED BootPolicy is TRUE. - @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or - BufferSize is NULL. - @retval EFI_NO_MEDIA No medium was present to load the file. - @retval EFI_DEVICE_ERROR The file was not loaded due to a device error. - @retval EFI_NO_RESPONSE The remote system did not respond. - @retval EFI_NOT_FOUND The file was not found - @retval EFI_ABORTED The file load process was manually canceled. - @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current - directory entry. BufferSize has been updated with - the size needed to complete the request. - - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_LOAD_FILE2)( - IN EFI_LOAD_FILE2_PROTOCOL *This, - IN EFI_DEVICE_PATH_PROTOCOL *FilePath, - IN BOOLEAN BootPolicy, - IN OUT UINTN *BufferSize, - IN VOID *Buffer OPTIONAL - ); - -/// -/// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices. -/// -struct _EFI_LOAD_FILE2_PROTOCOL { - EFI_LOAD_FILE2 LoadFile; -}; - -extern EFI_GUID gEfiLoadFile2ProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadedImage.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadedImage.h deleted file mode 100755 index cbe4103c4..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/LoadedImage.h +++ /dev/null @@ -1,90 +0,0 @@ -/** @file - UEFI 2.0 Loaded image protocol definition. - - Every EFI driver and application is passed an image handle when it is loaded. - This image handle will contain a Loaded Image Protocol. - - Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> - 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 __LOADED_IMAGE_PROTOCOL_H__ -#define __LOADED_IMAGE_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ - { \ - 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ - } - -#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ - { \ - 0xbc62157e, 0x3e33, 0x4fec, {0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } \ - } - -/// -/// Protocol GUID defined in EFI1.1. -/// -#define LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE_PROTOCOL_GUID - -/// -/// EFI_SYSTEM_TABLE & EFI_IMAGE_UNLOAD are defined in EfiApi.h -/// -#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000 - -/// -/// Revision defined in EFI1.1. -/// -#define EFI_LOADED_IMAGE_INFORMATION_REVISION EFI_LOADED_IMAGE_PROTOCOL_REVISION - -/// -/// Can be used on any image handle to obtain information about the loaded image. -/// -typedef struct { - UINT32 Revision; ///< Defines the revision of the EFI_LOADED_IMAGE_PROTOCOL structure. - ///< All future revisions will be backward compatible to the current revision. - EFI_HANDLE ParentHandle; ///< Parent image's image handle. NULL if the image is loaded directly from - ///< the firmware's boot manager. - EFI_SYSTEM_TABLE *SystemTable; ///< the image's EFI system table pointer. - - // - // Source location of image - // - EFI_HANDLE DeviceHandle; ///< The device handle that the EFI Image was loaded from. - EFI_DEVICE_PATH_PROTOCOL *FilePath; ///< A pointer to the file path portion specific to DeviceHandle - ///< that the EFI Image was loaded from. - VOID *Reserved; ///< Reserved. DO NOT USE. - - // - // Images load options - // - UINT32 LoadOptionsSize;///< The size in bytes of LoadOptions. - VOID *LoadOptions; ///< A pointer to the image's binary load options. - - // - // Location of where image was loaded - // - VOID *ImageBase; ///< The base address at which the image was loaded. - UINT64 ImageSize; ///< The size in bytes of the loaded image. - EFI_MEMORY_TYPE ImageCodeType; ///< The memory type that the code sections were loaded as. - EFI_MEMORY_TYPE ImageDataType; ///< The memory type that the data sections were loaded as. - EFI_IMAGE_UNLOAD Unload; -} EFI_LOADED_IMAGE_PROTOCOL; - -// -// For backward-compatible with EFI1.1. -// -typedef EFI_LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE; - -extern EFI_GUID gEfiLoadedImageProtocolGuid; -extern EFI_GUID gEfiLoadedImageDevicePathProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ManagedNetwork.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ManagedNetwork.h deleted file mode 100644 index 2bd092269..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/ManagedNetwork.h +++ /dev/null @@ -1,374 +0,0 @@ -/** @file - EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0. - EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in UEFI Specification 2.0 - -**/ - -#ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__ -#define __EFI_MANAGED_NETWORK_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Protocol/SimpleNetwork.h> - -#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \ - { \ - 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \ - } - -#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \ - { \ - 0x7ab33a91, 0xace5, 0x4326, { 0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16 } \ - } - -typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL; - -typedef struct { - /// - /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed - /// from the MNP receive queue will be dropped if its receive timeout expires. - /// - UINT32 ReceivedQueueTimeoutValue; - /// - /// Timeout value for a UEFI one-shot timer event. A packet that has not been removed - /// from the MNP transmit queue will be dropped if its receive timeout expires. - /// - UINT32 TransmitQueueTimeoutValue; - /// - /// Ethernet type II 16-bit protocol type in host byte order. Valid - /// values are zero and 1,500 to 65,535. - /// - UINT16 ProtocolTypeFilter; - /// - /// Set to TRUE to receive packets that are sent to the network - /// device MAC address. The startup default value is FALSE. - /// - BOOLEAN EnableUnicastReceive; - /// - /// Set to TRUE to receive packets that are sent to any of the - /// active multicast groups. The startup default value is FALSE. - /// - BOOLEAN EnableMulticastReceive; - /// - /// Set to TRUE to receive packets that are sent to the network - /// device broadcast address. The startup default value is FALSE. - /// - BOOLEAN EnableBroadcastReceive; - /// - /// Set to TRUE to receive packets that are sent to any MAC address. - /// The startup default value is FALSE. - /// - BOOLEAN EnablePromiscuousReceive; - /// - /// Set to TRUE to drop queued packets when the configuration - /// is changed. The startup default value is FALSE. - /// - BOOLEAN FlushQueuesOnReset; - /// - /// Set to TRUE to timestamp all packets when they are received - /// by the MNP. Note that timestamps may be unsupported in some - /// MNP implementations. The startup default value is FALSE. - /// - BOOLEAN EnableReceiveTimestamps; - /// - /// Set to TRUE to disable background polling in this MNP - /// instance. Note that background polling may not be supported in - /// all MNP implementations. The startup default value is FALSE, - /// unless background polling is not supported. - /// - BOOLEAN DisableBackgroundPolling; -} EFI_MANAGED_NETWORK_CONFIG_DATA; - -typedef struct { - EFI_TIME Timestamp; - EFI_EVENT RecycleEvent; - UINT32 PacketLength; - UINT32 HeaderLength; - UINT32 AddressLength; - UINT32 DataLength; - BOOLEAN BroadcastFlag; - BOOLEAN MulticastFlag; - BOOLEAN PromiscuousFlag; - UINT16 ProtocolType; - VOID *DestinationAddress; - VOID *SourceAddress; - VOID *MediaHeader; - VOID *PacketData; -} EFI_MANAGED_NETWORK_RECEIVE_DATA; - -typedef struct { - UINT32 FragmentLength; - VOID *FragmentBuffer; -} EFI_MANAGED_NETWORK_FRAGMENT_DATA; - -typedef struct { - EFI_MAC_ADDRESS *DestinationAddress; //OPTIONAL - EFI_MAC_ADDRESS *SourceAddress; //OPTIONAL - UINT16 ProtocolType; //OPTIONAL - UINT32 DataLength; - UINT16 HeaderLength; //OPTIONAL - UINT16 FragmentCount; - EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1]; -} EFI_MANAGED_NETWORK_TRANSMIT_DATA; - - -typedef struct { - /// - /// This Event will be signaled after the Status field is updated - /// by the MNP. The type of Event must be - /// EFI_NOTIFY_SIGNAL. The Task Priority Level (TPL) of - /// Event must be lower than or equal to TPL_CALLBACK. - /// - EFI_EVENT Event; - /// - /// The status that is returned to the caller at the end of the operation - /// to indicate whether this operation completed successfully. - /// - EFI_STATUS Status; - union { - /// - /// When this token is used for receiving, RxData is a pointer to the EFI_MANAGED_NETWORK_RECEIVE_DATA. - /// - EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData; - /// - /// When this token is used for transmitting, TxData is a pointer to the EFI_MANAGED_NETWORK_TRANSMIT_DATA. - /// - EFI_MANAGED_NETWORK_TRANSMIT_DATA *TxData; - } Packet; -} EFI_MANAGED_NETWORK_COMPLETION_TOKEN; - -/** - Returns the operational parameters for the current MNP child driver. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - @param MnpConfigData The pointer to storage for MNP operational parameters. - @param SnpModeData The pointer to storage for SNP operational parameters. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation. - @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. The default - values are returned in MnpConfigData if it is not NULL. - @retval Other The mode data could not be read. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This, - OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, - OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL - ); - -/** - Sets or clears the operational parameters for the MNP child driver. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - @param MnpConfigData The pointer to configuration data that will be assigned to the MNP - child driver instance. If NULL, the MNP child driver instance is - reset to startup defaults and all pending transmit and receive - requests are flushed. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory) could not be - allocated. - @retval EFI_UNSUPPORTED The requested feature is unsupported in this [MNP] - implementation. - @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. - @retval Other The MNP child driver instance has been reset to startup defaults. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This, - IN EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL - ); - -/** - Translates an IP multicast address to a hardware (MAC) multicast address. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - @param Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address. - Set to FALSE if IpAddress is an IPv4 multicast address. - @param IpAddress The pointer to the multicast IP address (in network byte order) to convert. - @param MacAddress The pointer to the resulting multicast MAC address. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE: - - This is NULL. - - IpAddress is NULL. - - *IpAddress is not a valid multicast IP address. - - MacAddress is NULL. - @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. - @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation. - @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. - @retval Other The address could not be converted. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This, - IN BOOLEAN Ipv6Flag, - IN EFI_IP_ADDRESS *IpAddress, - OUT EFI_MAC_ADDRESS *MacAddress - ); - -/** - Enables and disables receive filters for multicast address. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - @param JoinFlag Set to TRUE to join this multicast group. - Set to FALSE to leave this multicast group. - @param MacAddress The pointer to the multicast MAC group (address) to join or leave. - - @retval EFI_SUCCESS The requested operation completed successfully. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - JoinFlag is TRUE and MacAddress is NULL. - - *MacAddress is not a valid multicast MAC address. - @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. - @retval EFI_ALREADY_STARTED The supplied multicast group is already joined. - @retval EFI_NOT_FOUND The supplied multicast group is not joined. - @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. - @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP implementation. - @retval Other The requested operation could not be completed. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_GROUPS)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This, - IN BOOLEAN JoinFlag, - IN EFI_MAC_ADDRESS *MacAddress OPTIONAL - ); - -/** - Places asynchronous outgoing data packets into the transmit queue. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - @param Token The pointer to a token associated with the transmit data descriptor. - - @retval EFI_SUCCESS The transmit completion token was cached. - @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_ACCESS_DENIED The transmit completion token is already in the transmit queue. - @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources - (usually memory). - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_NOT_READY The transmit request could not be queued because the transmit queue is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This, - IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token - ); - -/** - Places an asynchronous receiving request into the receiving queue. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - @param Token The pointer to a token associated with the receive data descriptor. - - @retval EFI_SUCCESS The receive completion token was cached. - @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - Token is NULL. - - Token.Event is NULL. - @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a lack of system resources - (usually memory). - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_ACCESS_DENIED The receive completion token was already in the receive queue. - @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This, - IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token - ); - - -/** - Aborts an asynchronous transmit or receive request. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - @param Token The pointer to a token that has been issued by - EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or - EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If - NULL, all pending tokens are aborted. - - @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event - was signaled. When Token is NULL, all pending requests were - aborted and their events were signaled. - @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was - not found in the transmit or receive queue. It has either completed - or was not issued by Transmit() and Receive(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_CANCEL)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This, - IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token OPTIONAL - ); - -/** - Polls for incoming data packets and processes outgoing data packets. - - @param This The pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. - - @retval EFI_SUCCESS Incoming or outgoing data was processed. - @retval EFI_NOT_STARTED This MNP child driver instance has not been configured. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider increasing - the polling rate. - @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. - Consider increasing the polling rate. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MANAGED_NETWORK_POLL)( - IN EFI_MANAGED_NETWORK_PROTOCOL *This - ); - -/// -/// The MNP is used by network applications (and drivers) to -/// perform raw (unformatted) asynchronous network packet I/O. -/// -struct _EFI_MANAGED_NETWORK_PROTOCOL { - EFI_MANAGED_NETWORK_GET_MODE_DATA GetModeData; - EFI_MANAGED_NETWORK_CONFIGURE Configure; - EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC McastIpToMac; - EFI_MANAGED_NETWORK_GROUPS Groups; - EFI_MANAGED_NETWORK_TRANSMIT Transmit; - EFI_MANAGED_NETWORK_RECEIVE Receive; - EFI_MANAGED_NETWORK_CANCEL Cancel; - EFI_MANAGED_NETWORK_POLL Poll; -}; - -extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid; -extern EFI_GUID gEfiManagedNetworkProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Mtftp4.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Mtftp4.h deleted file mode 100644 index 0e961cfd4..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Mtftp4.h +++ /dev/null @@ -1,595 +0,0 @@ -/** @file - EFI Multicast Trivial File Tranfer Protocol Definition - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in UEFI Specification 2.0 - -**/ - -#ifndef __EFI_MTFTP4_PROTOCOL_H__ -#define __EFI_MTFTP4_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \ - { \ - 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \ - } - -#define EFI_MTFTP4_PROTOCOL_GUID \ - { \ - 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b } \ - } - -typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL; -typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN; - -// -//MTFTP4 packet opcode definition -// -#define EFI_MTFTP4_OPCODE_RRQ 1 -#define EFI_MTFTP4_OPCODE_WRQ 2 -#define EFI_MTFTP4_OPCODE_DATA 3 -#define EFI_MTFTP4_OPCODE_ACK 4 -#define EFI_MTFTP4_OPCODE_ERROR 5 -#define EFI_MTFTP4_OPCODE_OACK 6 -#define EFI_MTFTP4_OPCODE_DIR 7 -#define EFI_MTFTP4_OPCODE_DATA8 8 -#define EFI_MTFTP4_OPCODE_ACK8 9 - -// -// MTFTP4 error code definition -// -#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED 0 -#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND 1 -#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION 2 -#define EFI_MTFTP4_ERRORCODE_DISK_FULL 3 -#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION 4 -#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID 5 -#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS 6 -#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER 7 -#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED 8 - -// -// MTFTP4 pacekt definitions -// -#pragma pack(1) - -typedef struct { - UINT16 OpCode; - UINT8 Filename[1]; -} EFI_MTFTP4_REQ_HEADER; - -typedef struct { - UINT16 OpCode; - UINT8 Data[1]; -} EFI_MTFTP4_OACK_HEADER; - -typedef struct { - UINT16 OpCode; - UINT16 Block; - UINT8 Data[1]; -} EFI_MTFTP4_DATA_HEADER; - -typedef struct { - UINT16 OpCode; - UINT16 Block[1]; -} EFI_MTFTP4_ACK_HEADER; - -typedef struct { - UINT16 OpCode; - UINT64 Block; - UINT8 Data[1]; -} EFI_MTFTP4_DATA8_HEADER; - -typedef struct { - UINT16 OpCode; - UINT64 Block[1]; -} EFI_MTFTP4_ACK8_HEADER; - -typedef struct { - UINT16 OpCode; - UINT16 ErrorCode; - UINT8 ErrorMessage[1]; -} EFI_MTFTP4_ERROR_HEADER; - -typedef union { - /// - /// Type of packets as defined by the MTFTPv4 packet opcodes. - /// - UINT16 OpCode; - /// - /// Read request packet header. - /// - EFI_MTFTP4_REQ_HEADER Rrq; - /// - /// Write request packet header. - /// - EFI_MTFTP4_REQ_HEADER Wrq; - /// - /// Option acknowledge packet header. - /// - EFI_MTFTP4_OACK_HEADER Oack; - /// - /// Data packet header. - /// - EFI_MTFTP4_DATA_HEADER Data; - /// - /// Acknowledgement packet header. - /// - EFI_MTFTP4_ACK_HEADER Ack; - /// - /// Data packet header with big block number. - /// - EFI_MTFTP4_DATA8_HEADER Data8; - /// - /// Acknowledgement header with big block num. - /// - EFI_MTFTP4_ACK8_HEADER Ack8; - /// - /// Error packet header. - /// - EFI_MTFTP4_ERROR_HEADER Error; -} EFI_MTFTP4_PACKET; - -#pragma pack() - -/// -/// MTFTP4 option definition. -/// -typedef struct { - UINT8 *OptionStr; - UINT8 *ValueStr; -} EFI_MTFTP4_OPTION; - - -typedef struct { - BOOLEAN UseDefaultSetting; - EFI_IPv4_ADDRESS StationIp; - EFI_IPv4_ADDRESS SubnetMask; - UINT16 LocalPort; - EFI_IPv4_ADDRESS GatewayIp; - EFI_IPv4_ADDRESS ServerIp; - UINT16 InitialServerPort; - UINT16 TryCount; - UINT16 TimeoutValue; -} EFI_MTFTP4_CONFIG_DATA; - - -typedef struct { - EFI_MTFTP4_CONFIG_DATA ConfigData; - UINT8 SupportedOptionCount; - UINT8 **SupportedOptoins; - UINT8 UnsupportedOptionCount; - UINT8 **UnsupportedOptoins; -} EFI_MTFTP4_MODE_DATA; - - -typedef struct { - EFI_IPv4_ADDRESS GatewayIp; - EFI_IPv4_ADDRESS ServerIp; - UINT16 ServerPort; - UINT16 TryCount; - UINT16 TimeoutValue; -} EFI_MTFTP4_OVERRIDE_DATA; - -// -// Protocol interfaces definition -// - -/** - A callback function that is provided by the caller to intercept - the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the - EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept - EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to - EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory(). - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param Token The token that the caller provided in the - EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() - or ReadDirectory() function. - @param PacketLen Indicates the length of the packet. - @param Packet The pointer to an MTFTPv4 packet. - - @retval EFI_SUCCESS The operation was successful. - @retval Others Aborts the transfer process. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_CHECK_PACKET)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_TOKEN *Token, - IN UINT16 PacketLen, - IN EFI_MTFTP4_PACKET *Paket - ); - -/** - Timeout callback funtion. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param Token The token that is provided in the - EFI_MTFTP4_PROTOCOL.ReadFile() or - EFI_MTFTP4_PROTOCOL.WriteFile() or - EFI_MTFTP4_PROTOCOL.ReadDirectory() functions - by the caller. - - @retval EFI_SUCCESS The operation was successful. - @retval Others Aborts download process. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_TOKEN *Token - ); - -/** - A callback function that the caller provides to feed data to the - EFI_MTFTP4_PROTOCOL.WriteFile() function. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param Token The token provided in the - EFI_MTFTP4_PROTOCOL.WriteFile() by the caller. - @param Length Indicates the length of the raw data wanted on input, and the - length the data available on output. - @param Buffer The pointer to the buffer where the data is stored. - - @retval EFI_SUCCESS The operation was successful. - @retval Others Aborts session. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_PACKET_NEEDED)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_TOKEN *Token, - IN OUT UINT16 *Length, - OUT VOID **Buffer - ); - - -/** - Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param ModeData The pointer to storage for the EFI MTFTPv4 Protocol driver mode data. - - @retval EFI_SUCCESS The configuration data was successfully returned. - @retval EFI_OUT_OF_RESOURCES The required mode data could not be allocated. - @retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)( - IN EFI_MTFTP4_PROTOCOL *This, - OUT EFI_MTFTP4_MODE_DATA *ModeData - ); - - -/** - Initializes, changes, or resets the default operational setting for this - EFI MTFTPv4 Protocol driver instance. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param MtftpConfigData The pointer to the configuration data structure. - - @retval EFI_SUCCESS The EFI MTFTPv4 Protocol driver was configured successfully. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_ACCESS_DENIED The EFI configuration could not be changed at this time because - there is one MTFTP background operation in progress. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) has not finished yet. - @retval EFI_UNSUPPORTED A configuration protocol (DHCP, BOOTP, RARP, etc.) could not - be located when clients choose to use the default address - settings. - @retval EFI_OUT_OF_RESOURCES The EFI MTFTPv4 Protocol driver instance data could not be - allocated. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The EFI - MTFTPv4 Protocol driver instance is not configured. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_CONFIGURE)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_CONFIG_DATA *MtftpConfigData OPTIONAL - ); - - -/** - Gets information about a file from an MTFTPv4 server. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param OverrideData Data that is used to override the existing parameters. If NULL, - the default parameters that were set in the - EFI_MTFTP4_PROTOCOL.Configure() function are used. - @param Filename The pointer to null-terminated ASCII file name string. - @param ModeStr The pointer to null-terminated ASCII mode string. If NULL, "octet" will be used. - @param OptionCount Number of option/value string pairs in OptionList. - @param OptionList The pointer to array of option/value string pairs. Ignored if - OptionCount is zero. - @param PacketLength The number of bytes in the returned packet. - @param Packet The pointer to the received packet. This buffer must be freed by - the caller. - - @retval EFI_SUCCESS An MTFTPv4 OACK packet was received and is in the Packet. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - Filename is NULL. - - OptionCount is not zero and OptionList is NULL. - - One or more options in OptionList have wrong format. - - PacketLength is NULL. - - One or more IPv4 addresses in OverrideData are not valid - unicast IPv4 addresses if OverrideData is not NULL. - @retval EFI_UNSUPPORTED One or more options in the OptionList are in the - unsupported list of structure EFI_MTFTP4_MODE_DATA. - @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) has not finished yet. - @retval EFI_ACCESS_DENIED The previous operation has not completed yet. - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received and is in the Packet. - @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received and the Packet is set to NULL. - @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received and the Packet is set to NULL. - @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received and the Packet is set to NULL. - @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received and the Packet is set to NULL. - @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received and is in the Buffer. - @retval EFI_PROTOCOL_ERROR An unexpected MTFTPv4 packet was received and is in the Packet. - @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server. - @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred. - @retval EFI_NO_MEDIA There was a media error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_GET_INFO)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_OVERRIDE_DATA *OverrideData OPTIONAL, - IN UINT8 *Filename, - IN UINT8 *ModeStr OPTIONAL, - IN UINT8 OptionCount, - IN EFI_MTFTP4_OPTION *OptionList, - OUT UINT32 *PacketLength, - OUT EFI_MTFTP4_PACKET **Packet OPTIONAL - ); - -/** - Parses the options in an MTFTPv4 OACK packet. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param PacketLen Length of the OACK packet to be parsed. - @param Packet The pointer to the OACK packet to be parsed. - @param OptionCount The pointer to the number of options in following OptionList. - @param OptionList The pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot - Service FreePool() to release the OptionList if the options - in this OptionList are not needed any more. - - @retval EFI_SUCCESS The OACK packet was valid and the OptionCount and - OptionList parameters have been updated. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - PacketLen is 0. - - Packet is NULL or Packet is not a valid MTFTPv4 packet. - - OptionCount is NULL. - @retval EFI_NOT_FOUND No options were found in the OACK packet. - @retval EFI_OUT_OF_RESOURCES Storage for the OptionList array cannot be allocated. - @retval EFI_PROTOCOL_ERROR One or more of the option fields is invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS)( - IN EFI_MTFTP4_PROTOCOL *This, - IN UINT32 PacketLen, - IN EFI_MTFTP4_PACKET *Packet, - OUT UINT32 *OptionCount, - OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL - ); - - -/** - Downloads a file from an MTFTPv4 server. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param Token The pointer to the token structure to provide the parameters that are - used in this operation. - - @retval EFI_SUCCESS The data file has been transferred successfully. - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_BUFFER_TOO_SMALL BufferSize is not zero but not large enough to hold the - downloaded data in downloading process. - @retval EFI_ABORTED Current operation is aborted by user. - @retval EFI_NETWORK_UNREACHABLE An ICMP network unreachable error packet was received. - @retval EFI_HOST_UNREACHABLE An ICMP host unreachable error packet was received. - @retval EFI_PROTOCOL_UNREACHABLE An ICMP protocol unreachable error packet was received. - @retval EFI_PORT_UNREACHABLE An ICMP port unreachable error packet was received. - @retval EFI_ICMP_ERROR Some other ICMP ERROR packet was received. - @retval EFI_TIMEOUT No responses were received from the MTFTPv4 server. - @retval EFI_TFTP_ERROR An MTFTPv4 ERROR packet was received. - @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred. - @retval EFI_NO_MEDIA There was a media error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_READ_FILE)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_TOKEN *Token - ); - - - -/** - Sends a file to an MTFTPv4 server. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param Token The pointer to the token structure to provide the parameters that are - used in this operation. - - @retval EFI_SUCCESS The upload session has started. - @retval EFI_UNSUPPORTED The operation is not supported by this implementation. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in - the unsupported list of structure EFI_MTFTP4_MODE_DATA. - @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session. - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_ACCESS_DENIED The previous operation has not completed yet. - @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_WRITE_FILE)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_TOKEN *Token - ); - - -/** - Downloads a data file "directory" from an MTFTPv4 server. May be unsupported in some EFI - implementations. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - @param Token The pointer to the token structure to provide the parameters that are - used in this operation. - - @retval EFI_SUCCESS The MTFTPv4 related file "directory" has been downloaded. - @retval EFI_UNSUPPORTED The operation is not supported by this implementation. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_UNSUPPORTED One or more options in the Token.OptionList are in - the unsupported list of structure EFI_MTFTP4_MODE_DATA. - @retval EFI_NOT_STARTED The EFI MTFTPv4 Protocol driver has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_ALREADY_STARTED This Token is already being used in another MTFTPv4 session. - @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. - @retval EFI_ACCESS_DENIED The previous operation has not completed yet. - @retval EFI_DEVICE_ERROR An unexpected network error or system error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_READ_DIRECTORY)( - IN EFI_MTFTP4_PROTOCOL *This, - IN EFI_MTFTP4_TOKEN *Token - ); - -/** - Polls for incoming data packets and processes outgoing data packets. - - @param This The pointer to the EFI_MTFTP4_PROTOCOL instance. - - @retval EFI_SUCCESS Incoming or outgoing data was processed. - @retval EFI_NOT_STARTED This EFI MTFTPv4 Protocol instance has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. - Consider increasing the polling rate. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_MTFTP4_POLL)( - IN EFI_MTFTP4_PROTOCOL *This - ); - -/// -/// The EFI_MTFTP4_PROTOCOL is designed to be used by UEFI drivers and applications -/// to transmit and receive data files. The EFI MTFTPv4 Protocol driver uses -/// the underlying EFI UDPv4 Protocol driver and EFI IPv4 Protocol driver. -/// -struct _EFI_MTFTP4_PROTOCOL { - EFI_MTFTP4_GET_MODE_DATA GetModeData; - EFI_MTFTP4_CONFIGURE Configure; - EFI_MTFTP4_GET_INFO GetInfo; - EFI_MTFTP4_PARSE_OPTIONS ParseOptions; - EFI_MTFTP4_READ_FILE ReadFile; - EFI_MTFTP4_WRITE_FILE WriteFile; - EFI_MTFTP4_READ_DIRECTORY ReadDirectory; - EFI_MTFTP4_POLL Poll; -}; - -struct _EFI_MTFTP4_TOKEN { - /// - /// The status that is returned to the caller at the end of the operation - /// to indicate whether this operation completed successfully. - /// - EFI_STATUS Status; - /// - /// The event that will be signaled when the operation completes. If - /// set to NULL, the corresponding function will wait until the read or - /// write operation finishes. The type of Event must be - /// EVT_NOTIFY_SIGNAL. The Task Priority Level (TPL) of - /// Event must be lower than or equal to TPL_CALLBACK. - /// - EFI_EVENT Event; - /// - /// If not NULL, the data that will be used to override the existing configure data. - /// - EFI_MTFTP4_OVERRIDE_DATA *OverrideData; - /// - /// The pointer to the null-terminated ASCII file name string. - /// - UINT8 *Filename; - /// - /// The pointer to the null-terminated ASCII mode string. If NULL, "octet" is used. - /// - UINT8 *ModeStr; - /// - /// Number of option/value string pairs. - /// - UINT32 OptionCount; - /// - /// The pointer to an array of option/value string pairs. Ignored if OptionCount is zero. - /// - EFI_MTFTP4_OPTION *OptionList; - /// - /// The size of the data buffer. - /// - UINT64 BufferSize; - /// - /// The pointer to the data buffer. Data that is downloaded from the - /// MTFTPv4 server is stored here. Data that is uploaded to the - /// MTFTPv4 server is read from here. Ignored if BufferSize is zero. - /// - VOID *Buffer; - /// - /// The pointer to the context that will be used by CheckPacket, - /// TimeoutCallback and PacketNeeded. - /// - VOID *Context; - /// - /// The pointer to the callback function to check the contents of the received packet. - /// - EFI_MTFTP4_CHECK_PACKET CheckPacket; - /// - /// The pointer to the function to be called when a timeout occurs. - /// - EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback; - /// - /// The pointer to the function to provide the needed packet contents. - /// - EFI_MTFTP4_PACKET_NEEDED PacketNeeded; -}; - -extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid; -extern EFI_GUID gEfiMtftp4ProtocolGuid; - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/NetworkInterfaceIdentifier.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/NetworkInterfaceIdentifier.h deleted file mode 100644 index 5adedd8e9..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/NetworkInterfaceIdentifier.h +++ /dev/null @@ -1,120 +0,0 @@ -/** @file - EFI Network Interface Identifier Protocol. - -Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in EFI Specification 1.10. - -**/ - -#ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__ -#define __EFI_NETWORK_INTERFACE_IDENTIFER_H__ - -FILE_LICENCE ( BSD3 ); - -// -// GUID retired from UEFI Specification 2.1b -// -#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID \ - { \ - 0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 } \ - } - -// -// GUID intruduced in UEFI Specification 2.1b -// -#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID_31 \ - { \ - 0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 } \ - } - -// -// Revision defined in UEFI Specification 2.4 -// -#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION 0x00020000 - - -/// -/// 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; - -/// -/// 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; ///< The 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; ///< The 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; ///< The 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. - UINT16 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 | IFcntExt <<8 ) fields in the !PXE structure. - -}; - -/// -///******************************************************* -/// EFI_NETWORK_INTERFACE_TYPE -///******************************************************* -/// -typedef enum { - EfiNetworkInterfaceUndi = 1 -} EFI_NETWORK_INTERFACE_TYPE; - -/// -/// Forward reference for pure ANSI compatability. -/// -typedef struct undiconfig_table UNDI_CONFIG_TABLE; - -/// -/// The format of the configuration table for UNDI -/// -struct undiconfig_table { - UINT32 NumberOfInterfaces; ///< The number of NIC devices - ///< that this UNDI controls. - UINT32 reserved; - UNDI_CONFIG_TABLE *nextlink; ///< A pointer to the next UNDI - ///< configuration table. - /// - /// The length of this array is given in the NumberOfInterfaces field. - /// - struct { - VOID *NII_InterfacePointer; ///< Pointer to the NII interface structure. - VOID *DevicePathPointer; ///< Pointer to the device path for this NIC. - } NII_entry[1]; -}; - -extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid; -extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PciIo.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PciIo.h deleted file mode 100644 index 97f65e1f8..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PciIo.h +++ /dev/null @@ -1,560 +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 - 2010, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -/// -/// 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; - -/// -/// ******************************************************* -/// EFI_PCI_IO_PROTOCOL_WIDTH -/// ******************************************************* -/// -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 writes 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 0x40000 ///< 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 { - /// - /// A read operation from system memory by a bus master. - /// - EfiPciIoOperationBusMasterRead, - /// - /// A write operation from system memory by a bus master. - /// - EfiPciIoOperationBusMasterWrite, - /// - /// Provides both read and write access to system memory by both the processor and a - /// bus master. The buffer is coherent from both the processor's and the bus master's point of view. - /// - EfiPciIoOperationBusMasterCommonBuffer, - EfiPciIoOperationMaximum -} EFI_PCI_IO_PROTOCOL_OPERATION; - -/// -/// ******************************************************* -/// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION -/// ******************************************************* -/// -typedef enum { - /// - /// Retrieve the PCI controller's current attributes, and return them in Result. - /// - EfiPciIoAttributeOperationGet, - /// - /// Set the PCI controller's current attributes to Attributes. - /// - EfiPciIoAttributeOperationSet, - /// - /// Enable the attributes specified by the bits that are set in Attributes for this PCI controller. - /// - EfiPciIoAttributeOperationEnable, - /// - /// Disable the attributes specified by the bits that are set in Attributes for this PCI controller. - /// - EfiPciIoAttributeOperationDisable, - /// - /// Retrieve the PCI controller's supported attributes, and return them in Result. - /// - EfiPciIoAttributeOperationSupported, - EfiPciIoAttributeOperationMaximum -} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; - -/** - Reads from the memory space of a PCI controller. Returns either when 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 { - /// - /// Read PCI controller registers in the PCI memory or I/O space. - /// - EFI_PCI_IO_PROTOCOL_IO_MEM Read; - /// - /// Write PCI controller registers in the PCI memory or I/O space. - /// - 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 { - /// - /// Read PCI controller registers in PCI configuration space. - /// - EFI_PCI_IO_PROTOCOL_CONFIG Read; - /// - /// Write PCI controller registers in PCI configuration space. - /// - 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-specific 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 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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PciRootBridgeIo.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PciRootBridgeIo.h deleted file mode 100644 index b9c80f589..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PciRootBridgeIo.h +++ /dev/null @@ -1,444 +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 - 2011, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Library/BaseLib.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; - -/// -/// ******************************************************* -/// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH -/// ******************************************************* -/// -typedef enum { - EfiPciWidthUint8, - EfiPciWidthUint16, - EfiPciWidthUint32, - EfiPciWidthUint64, - EfiPciWidthFifoUint8, - EfiPciWidthFifoUint16, - EfiPciWidthFifoUint32, - EfiPciWidthFifoUint64, - EfiPciWidthFillUint8, - EfiPciWidthFillUint16, - EfiPciWidthFillUint32, - EfiPciWidthFillUint64, - EfiPciWidthMaximum -} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH; - -/// -/// ******************************************************* -/// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION -/// ******************************************************* -/// -typedef enum { - /// - /// A read operation from system memory by a bus master that is not capable of producing - /// PCI dual address cycles. - /// - EfiPciOperationBusMasterRead, - /// - /// A write operation from system memory by a bus master that is not capable of producing - /// PCI dual address cycles. - /// - EfiPciOperationBusMasterWrite, - /// - /// Provides both read and write access to system memory by both the processor and a bus - /// master that is not capable of producing PCI dual address cycles. - /// - EfiPciOperationBusMasterCommonBuffer, - /// - /// A read operation from system memory by a bus master that is capable of producing PCI - /// dual address cycles. - /// - EfiPciOperationBusMasterRead64, - /// - /// A write operation to system memory by a bus master that is capable of producing PCI - /// dual address cycles. - /// - EfiPciOperationBusMasterWrite64, - /// - /// Provides both read and write access to system memory by both the processor and a bus - /// master that is capable of producing PCI dual address cycles. - /// - 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_ISA_IO_16 0x10000 -#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 -#define EFI_PCI_ATTRIBUTE_VGA_IO_16 0x40000 - -#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)) < 256 ? ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) (reg), 32)))) - -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 { - /// - /// Read PCI controller registers in the PCI root bridge memory space. - /// - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read; - /// - /// Write PCI controller registers in the PCI root bridge memory space. - /// - 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-specific 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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PxeBaseCode.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PxeBaseCode.h deleted file mode 100644 index 26447987d..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/PxeBaseCode.h +++ /dev/null @@ -1,936 +0,0 @@ -/** @file - EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible - devices for network access and network booting. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in EFI Specification 1.10. - -**/ -#ifndef __PXE_BASE_CODE_PROTOCOL_H__ -#define __PXE_BASE_CODE_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -/// -/// PXE Base Code protocol. -/// -#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \ - { \ - 0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ - } - -typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL; - -/// -/// Protocol defined in EFI1.1. -/// -typedef EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE; - -/// -/// Default IP TTL and ToS. -/// -#define DEFAULT_TTL 16 -#define DEFAULT_ToS 0 - -/// -/// ICMP error format. -/// -typedef struct { - UINT8 Type; - UINT8 Code; - UINT16 Checksum; - union { - UINT32 reserved; - UINT32 Mtu; - UINT32 Pointer; - struct { - UINT16 Identifier; - UINT16 Sequence; - } Echo; - } u; - UINT8 Data[494]; -} EFI_PXE_BASE_CODE_ICMP_ERROR; - -/// -/// TFTP error format. -/// -typedef struct { - UINT8 ErrorCode; - CHAR8 ErrorString[127]; -} EFI_PXE_BASE_CODE_TFTP_ERROR; - -/// -/// IP Receive Filter definitions. -/// -#define EFI_PXE_BASE_CODE_MAX_IPCNT 8 - -/// -/// IP Receive Filter structure. -/// -typedef struct { - UINT8 Filters; - UINT8 IpCnt; - UINT16 reserved; - EFI_IP_ADDRESS IpList[EFI_PXE_BASE_CODE_MAX_IPCNT]; -} EFI_PXE_BASE_CODE_IP_FILTER; - -#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP 0x0001 -#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST 0x0002 -#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004 -#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008 - -/// -/// ARP cache entries. -/// -typedef struct { - EFI_IP_ADDRESS IpAddr; - EFI_MAC_ADDRESS MacAddr; -} EFI_PXE_BASE_CODE_ARP_ENTRY; - -/// -/// ARP route table entries. -/// -typedef struct { - EFI_IP_ADDRESS IpAddr; - EFI_IP_ADDRESS SubnetMask; - EFI_IP_ADDRESS GwAddr; -} EFI_PXE_BASE_CODE_ROUTE_ENTRY; - -// -// UDP definitions -// -typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT; - -#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001 -#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002 -#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP 0x0004 -#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008 -#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010 -#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020 - -// -// Discover() definitions -// -#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM 2 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI 3 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO 4 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD 5 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM 6 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG 7 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW 8 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 9 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 10 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 11 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 12 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL 13 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15 -#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16 -// -// 17 through 32767 are reserved -// 32768 through 65279 are for vendor use -// 65280 through 65534 are reserved -// -#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535 - -#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF -#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000 - -// -// PXE Tag definition that identifies the processor -// and programming environment of the client system. -// These identifiers are defined by IETF: -// http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml -// -#if defined (MDE_CPU_IA32) -#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0006 -#elif defined (MDE_CPU_IPF) -#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0002 -#elif defined (MDE_CPU_X64) -#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x0007 -#elif defined (MDE_CPU_ARM) -#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000A -#elif defined (MDE_CPU_AARCH64) -#define EFI_PXE_CLIENT_SYSTEM_ARCHITECTURE 0x000B -#endif - - -/// -/// Discover() server list structure. -/// -typedef struct { - UINT16 Type; - BOOLEAN AcceptAnyResponse; - UINT8 Reserved; - EFI_IP_ADDRESS IpAddr; -} EFI_PXE_BASE_CODE_SRVLIST; - -/// -/// Discover() information override structure. -/// -typedef struct { - BOOLEAN UseMCast; - BOOLEAN UseBCast; - BOOLEAN UseUCast; - BOOLEAN MustUseList; - EFI_IP_ADDRESS ServerMCastIp; - UINT16 IpCnt; - EFI_PXE_BASE_CODE_SRVLIST SrvList[1]; -} EFI_PXE_BASE_CODE_DISCOVER_INFO; - -/// -/// TFTP opcode definitions. -/// -typedef enum { - EFI_PXE_BASE_CODE_TFTP_FIRST, - EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE, - EFI_PXE_BASE_CODE_TFTP_READ_FILE, - EFI_PXE_BASE_CODE_TFTP_WRITE_FILE, - EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY, - EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE, - EFI_PXE_BASE_CODE_MTFTP_READ_FILE, - EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY, - EFI_PXE_BASE_CODE_MTFTP_LAST -} EFI_PXE_BASE_CODE_TFTP_OPCODE; - -/// -/// MTFTP information. This information is required -/// to start or join a multicast TFTP session. It is also required to -/// perform the "get file size" and "read directory" operations of MTFTP. -/// -typedef struct { - EFI_IP_ADDRESS MCastIp; - EFI_PXE_BASE_CODE_UDP_PORT CPort; - EFI_PXE_BASE_CODE_UDP_PORT SPort; - UINT16 ListenTimeout; - UINT16 TransmitTimeout; -} EFI_PXE_BASE_CODE_MTFTP_INFO; - -/// -/// DHCPV4 Packet structure. -/// -typedef struct { - UINT8 BootpOpcode; - UINT8 BootpHwType; - UINT8 BootpHwAddrLen; - UINT8 BootpGateHops; - UINT32 BootpIdent; - UINT16 BootpSeconds; - UINT16 BootpFlags; - UINT8 BootpCiAddr[4]; - UINT8 BootpYiAddr[4]; - UINT8 BootpSiAddr[4]; - UINT8 BootpGiAddr[4]; - UINT8 BootpHwAddr[16]; - UINT8 BootpSrvName[64]; - UINT8 BootpBootFile[128]; - UINT32 DhcpMagik; - UINT8 DhcpOptions[56]; -} EFI_PXE_BASE_CODE_DHCPV4_PACKET; - -/// -/// DHCPV6 Packet structure. -/// -typedef struct { - UINT32 MessageType:8; - UINT32 TransactionId:24; - UINT8 DhcpOptions[1024]; -} EFI_PXE_BASE_CODE_DHCPV6_PACKET; - -/// -/// Packet structure. -/// -typedef union { - UINT8 Raw[1472]; - EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4; - EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6; -} EFI_PXE_BASE_CODE_PACKET; - -// -// PXE Base Code Mode structure -// -#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8 -#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8 - -/// -/// EFI_PXE_BASE_CODE_MODE. -/// The data values in this structure are read-only and -/// are updated by the code that produces the -/// EFI_PXE_BASE_CODE_PROTOCOL functions. -/// -typedef struct { - BOOLEAN Started; - BOOLEAN Ipv6Available; - BOOLEAN Ipv6Supported; - BOOLEAN UsingIpv6; - BOOLEAN BisSupported; - BOOLEAN BisDetected; - BOOLEAN AutoArp; - BOOLEAN SendGUID; - BOOLEAN DhcpDiscoverValid; - BOOLEAN DhcpAckReceived; - BOOLEAN ProxyOfferReceived; - BOOLEAN PxeDiscoverValid; - BOOLEAN PxeReplyReceived; - BOOLEAN PxeBisReplyReceived; - BOOLEAN IcmpErrorReceived; - BOOLEAN TftpErrorReceived; - BOOLEAN MakeCallbacks; - UINT8 TTL; - UINT8 ToS; - EFI_IP_ADDRESS StationIp; - EFI_IP_ADDRESS SubnetMask; - EFI_PXE_BASE_CODE_PACKET DhcpDiscover; - EFI_PXE_BASE_CODE_PACKET DhcpAck; - EFI_PXE_BASE_CODE_PACKET ProxyOffer; - EFI_PXE_BASE_CODE_PACKET PxeDiscover; - EFI_PXE_BASE_CODE_PACKET PxeReply; - EFI_PXE_BASE_CODE_PACKET PxeBisReply; - EFI_PXE_BASE_CODE_IP_FILTER IpFilter; - UINT32 ArpCacheEntries; - EFI_PXE_BASE_CODE_ARP_ENTRY ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES]; - UINT32 RouteTableEntries; - EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES]; - EFI_PXE_BASE_CODE_ICMP_ERROR IcmpError; - EFI_PXE_BASE_CODE_TFTP_ERROR TftpError; -} EFI_PXE_BASE_CODE_MODE; - -// -// PXE Base Code Interface Function definitions -// - -/** - Enables the use of the PXE Base Code Protocol functions. - - This function enables the use of the PXE Base Code Protocol functions. If the - Started field of the EFI_PXE_BASE_CODE_MODE structure is already TRUE, then - EFI_ALREADY_STARTED will be returned. If UseIpv6 is TRUE, then IPv6 formatted - addresses will be used in this session. If UseIpv6 is FALSE, then IPv4 formatted - addresses will be used in this session. If UseIpv6 is TRUE, and the Ipv6Supported - field of the EFI_PXE_BASE_CODE_MODE structure is FALSE, then EFI_UNSUPPORTED will - be returned. If there is not enough memory or other resources to start the PXE - Base Code Protocol, then EFI_OUT_OF_RESOURCES will be returned. Otherwise, the - PXE Base Code Protocol will be started, and all of the fields of the EFI_PXE_BASE_CODE_MODE - structure will be initialized as follows: - StartedSet to TRUE. - Ipv6SupportedUnchanged. - Ipv6AvailableUnchanged. - UsingIpv6Set to UseIpv6. - BisSupportedUnchanged. - BisDetectedUnchanged. - AutoArpSet to TRUE. - SendGUIDSet to FALSE. - TTLSet to DEFAULT_TTL. - ToSSet to DEFAULT_ToS. - DhcpCompletedSet to FALSE. - ProxyOfferReceivedSet to FALSE. - StationIpSet to an address of all zeros. - SubnetMaskSet to a subnet mask of all zeros. - DhcpDiscoverZero-filled. - DhcpAckZero-filled. - ProxyOfferZero-filled. - PxeDiscoverValidSet to FALSE. - PxeDiscoverZero-filled. - PxeReplyValidSet to FALSE. - PxeReplyZero-filled. - PxeBisReplyValidSet to FALSE. - PxeBisReplyZero-filled. - IpFilterSet the Filters field to 0 and the IpCnt field to 0. - ArpCacheEntriesSet to 0. - ArpCacheZero-filled. - RouteTableEntriesSet to 0. - RouteTableZero-filled. - IcmpErrorReceivedSet to FALSE. - IcmpErrorZero-filled. - TftpErroReceivedSet to FALSE. - TftpErrorZero-filled. - MakeCallbacksSet to TRUE if the PXE Base Code Callback Protocol is available. - Set to FALSE if the PXE Base Code Callback Protocol is not available. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param UseIpv6 Specifies the type of IP addresses that are to be used during the session - that is being started. Set to TRUE for IPv6 addresses, and FALSE for - IPv4 addresses. - - @retval EFI_SUCCESS The PXE Base Code Protocol was started. - @retval EFI_DEVICE_ERROR The network device encountered an error during this oper - @retval EFI_UNSUPPORTED UseIpv6 is TRUE, but the Ipv6Supported field of the - EFI_PXE_BASE_CODE_MODE structure is FALSE. - @retval EFI_ALREADY_STARTED The PXE Base Code Protocol is already in the started state. - @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid - EFI_PXE_BASE_CODE_PROTOCOL structure. - @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory or other resources to start the - PXE Base Code Protocol. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_START)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN BOOLEAN UseIpv6 - ); - -/** - Disables the use of the PXE Base Code Protocol functions. - - This function stops all activity on the network device. All the resources allocated - in Start() are released, the Started field of the EFI_PXE_BASE_CODE_MODE structure is - set to FALSE and EFI_SUCCESS is returned. If the Started field of the EFI_PXE_BASE_CODE_MODE - structure is already FALSE, then EFI_NOT_STARTED will be returned. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - - @retval EFI_SUCCESS The PXE Base Code Protocol was stopped. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is already in the stopped state. - @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid - EFI_PXE_BASE_CODE_PROTOCOL structure. - @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_STOP)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This - ); - -/** - Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6 - S.A.R.R (solicit / advertise / request / reply) sequence. - - This function attempts to complete the DHCP sequence. If this sequence is completed, - then EFI_SUCCESS is returned, and the DhcpCompleted, ProxyOfferReceived, StationIp, - SubnetMask, DhcpDiscover, DhcpAck, and ProxyOffer fields of the EFI_PXE_BASE_CODE_MODE - structure are filled in. - If SortOffers is TRUE, then the cached DHCP offer packets will be sorted before - they are tried. If SortOffers is FALSE, then the cached DHCP offer packets will - be tried in the order in which they are received. Please see the Preboot Execution - Environment (PXE) Specification for additional details on the implementation of DHCP. - This function can take at least 31 seconds to timeout and return control to the - caller. If the DHCP sequence does not complete, then EFI_TIMEOUT will be returned. - If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, - then the DHCP sequence will be stopped and EFI_ABORTED will be returned. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param SortOffers TRUE if the offers received should be sorted. Set to FALSE to try the - offers in the order that they are received. - - @retval EFI_SUCCESS Valid DHCP has completed. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid - EFI_PXE_BASE_CODE_PROTOCOL structure. - @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. - @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete the DHCP Protocol. - @retval EFI_ABORTED The callback function aborted the DHCP Protocol. - @retval EFI_TIMEOUT The DHCP Protocol timed out. - @retval EFI_ICMP_ERROR An ICMP error packet was received during the DHCP session. - @retval EFI_NO_RESPONSE Valid PXE offer was not received. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_DHCP)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN BOOLEAN SortOffers - ); - -/** - Attempts to complete the PXE Boot Server and/or boot image discovery sequence. - - This function attempts to complete the PXE Boot Server and/or boot image discovery - sequence. If this sequence is completed, then EFI_SUCCESS is returned, and the - PxeDiscoverValid, PxeDiscover, PxeReplyReceived, and PxeReply fields of the - EFI_PXE_BASE_CODE_MODE structure are filled in. If UseBis is TRUE, then the - PxeBisReplyReceived and PxeBisReply fields of the EFI_PXE_BASE_CODE_MODE structure - will also be filled in. If UseBis is FALSE, then PxeBisReplyValid will be set to FALSE. - In the structure referenced by parameter Info, the PXE Boot Server list, SrvList[], - has two uses: It is the Boot Server IP address list used for unicast discovery - (if the UseUCast field is TRUE), and it is the list used for Boot Server verification - (if the MustUseList field is TRUE). Also, if the MustUseList field in that structure - is TRUE and the AcceptAnyResponse field in the SrvList[] array is TRUE, any Boot - Server reply of that type will be accepted. If the AcceptAnyResponse field is - FALSE, only responses from Boot Servers with matching IP addresses will be accepted. - This function can take at least 10 seconds to timeout and return control to the - caller. If the Discovery sequence does not complete, then EFI_TIMEOUT will be - returned. Please see the Preboot Execution Environment (PXE) Specification for - additional details on the implementation of the Discovery sequence. - If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, - then the Discovery sequence is stopped and EFI_ABORTED will be returned. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param Type The type of bootstrap to perform. - @param Layer The pointer to the boot server layer number to discover, which must be - PXE_BOOT_LAYER_INITIAL when a new server type is being - discovered. - @param UseBis TRUE if Boot Integrity Services are to be used. FALSE otherwise. - @param Info The pointer to a data structure that contains additional information on the - type of discovery operation that is to be performed. - - @retval EFI_SUCCESS The Discovery sequence has been completed. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. - @retval EFI_OUT_OF_RESOURCES Could not allocate enough memory to complete Discovery. - @retval EFI_ABORTED The callback function aborted the Discovery sequence. - @retval EFI_TIMEOUT The Discovery sequence timed out. - @retval EFI_ICMP_ERROR An ICMP error packet was received during the PXE discovery - session. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_DISCOVER)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN UINT16 Type, - IN UINT16 *Layer, - IN BOOLEAN UseBis, - IN EFI_PXE_BASE_CODE_DISCOVER_INFO *Info OPTIONAL - ); - -/** - Used to perform TFTP and MTFTP services. - - This function is used to perform TFTP and MTFTP services. This includes the - TFTP operations to get the size of a file, read a directory, read a file, and - write a file. It also includes the MTFTP operations to get the size of a file, - read a directory, and read a file. The type of operation is specified by Operation. - If the callback function that is invoked during the TFTP/MTFTP operation does - not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will - be returned. - For read operations, the return data will be placed in the buffer specified by - BufferPtr. If BufferSize is too small to contain the entire downloaded file, - then EFI_BUFFER_TOO_SMALL will be returned and BufferSize will be set to zero - or the size of the requested file (the size of the requested file is only returned - if the TFTP server supports TFTP options). If BufferSize is large enough for the - read operation, then BufferSize will be set to the size of the downloaded file, - and EFI_SUCCESS will be returned. Applications using the PxeBc.Mtftp() services - should use the get-file-size operations to determine the size of the downloaded - file prior to using the read-file operations--especially when downloading large - (greater than 64 MB) files--instead of making two calls to the read-file operation. - Following this recommendation will save time if the file is larger than expected - and the TFTP server does not support TFTP option extensions. Without TFTP option - extension support, the client has to download the entire file, counting and discarding - the received packets, to determine the file size. - For write operations, the data to be sent is in the buffer specified by BufferPtr. - BufferSize specifies the number of bytes to send. If the write operation completes - successfully, then EFI_SUCCESS will be returned. - For TFTP "get file size" operations, the size of the requested file or directory - is returned in BufferSize, and EFI_SUCCESS will be returned. If the TFTP server - does not support options, the file will be downloaded into a bit bucket and the - length of the downloaded file will be returned. For MTFTP "get file size" operations, - if the MTFTP server does not support the "get file size" option, EFI_UNSUPPORTED - will be returned. - This function can take up to 10 seconds to timeout and return control to the caller. - If the TFTP sequence does not complete, EFI_TIMEOUT will be returned. - If the Callback Protocol does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, - then the TFTP sequence is stopped and EFI_ABORTED will be returned. - The format of the data returned from a TFTP read directory operation is a null-terminated - filename followed by a null-terminated information string, of the form - "size year-month-day hour:minute:second" (i.e. %d %d-%d-%d %d:%d:%f - note that - the seconds field can be a decimal number), where the date and time are UTC. For - an MTFTP read directory command, there is additionally a null-terminated multicast - IP address preceding the filename of the form %d.%d.%d.%d for IP v4. The final - entry is itself null-terminated, so that the final information string is terminated - with two null octets. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param Operation The type of operation to perform. - @param BufferPtr A pointer to the data buffer. - @param Overwrite Only used on write file operations. TRUE if a file on a remote server can - be overwritten. - @param BufferSize For get-file-size operations, *BufferSize returns the size of the - requested file. - @param BlockSize The requested block size to be used during a TFTP transfer. - @param ServerIp The TFTP / MTFTP server IP address. - @param Filename A Null-terminated ASCII string that specifies a directory name or a file - name. - @param Info The pointer to the MTFTP information. - @param DontUseBuffer Set to FALSE for normal TFTP and MTFTP read file operation. - - @retval EFI_SUCCESS The TFTP/MTFTP operation was completed. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. - @retval EFI_BUFFER_TOO_SMALL The buffer is not large enough to complete the read operation. - @retval EFI_ABORTED The callback function aborted the TFTP/MTFTP operation. - @retval EFI_TIMEOUT The TFTP/MTFTP operation timed out. - @retval EFI_ICMP_ERROR An ICMP error packet was received during the MTFTP session. - @retval EFI_TFTP_ERROR A TFTP error packet was received during the MTFTP session. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_MTFTP)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation, - IN OUT VOID *BufferPtr OPTIONAL, - IN BOOLEAN Overwrite, - IN OUT UINT64 *BufferSize, - IN UINTN *BlockSize OPTIONAL, - IN EFI_IP_ADDRESS *ServerIp, - IN UINT8 *Filename OPTIONAL, - IN EFI_PXE_BASE_CODE_MTFTP_INFO *Info OPTIONAL, - IN BOOLEAN DontUseBuffer - ); - -/** - Writes a UDP packet to the network interface. - - This function writes a UDP packet specified by the (optional HeaderPtr and) - BufferPtr parameters to the network interface. The UDP header is automatically - built by this routine. It uses the parameters OpFlags, DestIp, DestPort, GatewayIp, - SrcIp, and SrcPort to build this header. If the packet is successfully built and - transmitted through the network interface, then EFI_SUCCESS will be returned. - If a timeout occurs during the transmission of the packet, then EFI_TIMEOUT will - be returned. If an ICMP error occurs during the transmission of the packet, then - the IcmpErrorReceived field is set to TRUE, the IcmpError field is filled in and - EFI_ICMP_ERROR will be returned. If the Callback Protocol does not return - EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED will be returned. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param OpFlags The UDP operation flags. - @param DestIp The destination IP address. - @param DestPort The destination UDP port number. - @param GatewayIp The gateway IP address. - @param SrcIp The source IP address. - @param SrcPort The source UDP port number. - @param HeaderSize An optional field which may be set to the length of a header at - HeaderPtr to be prefixed to the data at BufferPtr. - @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the - data at BufferPtr. - @param BufferSize A pointer to the size of the data at BufferPtr. - @param BufferPtr A pointer to the data to be written. - - @retval EFI_SUCCESS The UDP Write operation was completed. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_BAD_BUFFER_SIZE The buffer is too long to be transmitted. - @retval EFI_ABORTED The callback function aborted the UDP Write operation. - @retval EFI_TIMEOUT The UDP Write operation timed out. - @retval EFI_ICMP_ERROR An ICMP error packet was received during the UDP write session. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN UINT16 OpFlags, - IN EFI_IP_ADDRESS *DestIp, - IN EFI_PXE_BASE_CODE_UDP_PORT *DestPort, - IN EFI_IP_ADDRESS *GatewayIp, OPTIONAL - IN EFI_IP_ADDRESS *SrcIp, OPTIONAL - IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL - IN UINTN *HeaderSize, OPTIONAL - IN VOID *HeaderPtr, OPTIONAL - IN UINTN *BufferSize, - IN VOID *BufferPtr - ); - -/** - Reads a UDP packet from the network interface. - - This function reads a UDP packet from a network interface. The data contents - are returned in (the optional HeaderPtr and) BufferPtr, and the size of the - buffer received is returned in BufferSize. If the input BufferSize is smaller - than the UDP packet received (less optional HeaderSize), it will be set to the - required size, and EFI_BUFFER_TOO_SMALL will be returned. In this case, the - contents of BufferPtr are undefined, and the packet is lost. If a UDP packet is - successfully received, then EFI_SUCCESS will be returned, and the information - from the UDP header will be returned in DestIp, DestPort, SrcIp, and SrcPort if - they are not NULL. - Depending on the values of OpFlags and the DestIp, DestPort, SrcIp, and SrcPort - input values, different types of UDP packet receive filtering will be performed. - The following tables summarize these receive filter operations. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param OpFlags The UDP operation flags. - @param DestIp The destination IP address. - @param DestPort The destination UDP port number. - @param SrcIp The source IP address. - @param SrcPort The source UDP port number. - @param HeaderSize An optional field which may be set to the length of a header at - HeaderPtr to be prefixed to the data at BufferPtr. - @param HeaderPtr If HeaderSize is not NULL, a pointer to a header to be prefixed to the - data at BufferPtr. - @param BufferSize A pointer to the size of the data at BufferPtr. - @param BufferPtr A pointer to the data to be read. - - @retval EFI_SUCCESS The UDP Read operation was completed. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. - @retval EFI_BUFFER_TOO_SMALL The packet is larger than Buffer can hold. - @retval EFI_ABORTED The callback function aborted the UDP Read operation. - @retval EFI_TIMEOUT The UDP Read operation timed out. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_UDP_READ)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN UINT16 OpFlags, - IN OUT EFI_IP_ADDRESS *DestIp, OPTIONAL - IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort, OPTIONAL - IN OUT EFI_IP_ADDRESS *SrcIp, OPTIONAL - IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort, OPTIONAL - IN UINTN *HeaderSize, OPTIONAL - IN VOID *HeaderPtr, OPTIONAL - IN OUT UINTN *BufferSize, - IN VOID *BufferPtr - ); - -/** - Updates the IP receive filters of a network device and enables software filtering. - - The NewFilter field is used to modify the network device's current IP receive - filter settings and to enable a software filter. This function updates the IpFilter - field of the EFI_PXE_BASE_CODE_MODE structure with the contents of NewIpFilter. - The software filter is used when the USE_FILTER in OpFlags is set to UdpRead(). - The current hardware filter remains in effect no matter what the settings of OpFlags - are, so that the meaning of ANY_DEST_IP set in OpFlags to UdpRead() is from those - packets whose reception is enabled in hardware - physical NIC address (unicast), - broadcast address, logical address or addresses (multicast), or all (promiscuous). - UdpRead() does not modify the IP filter settings. - Dhcp(), Discover(), and Mtftp() set the IP filter, and return with the IP receive - filter list emptied and the filter set to EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP. - If an application or driver wishes to preserve the IP receive filter settings, - it will have to preserve the IP receive filter settings before these calls, and - use SetIpFilter() to restore them after the calls. If incompatible filtering is - requested (for example, PROMISCUOUS with anything else), or if the device does not - support a requested filter setting and it cannot be accommodated in software - (for example, PROMISCUOUS not supported), EFI_INVALID_PARAMETER will be returned. - The IPlist field is used to enable IPs other than the StationIP. They may be - multicast or unicast. If IPcnt is set as well as EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP, - then both the StationIP and the IPs from the IPlist will be used. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param NewFilter The pointer to the new set of IP receive filters. - - @retval EFI_SUCCESS The IP receive filter settings were updated. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN EFI_PXE_BASE_CODE_IP_FILTER *NewFilter - ); - -/** - Uses the ARP protocol to resolve a MAC address. - - This function uses the ARP protocol to resolve a MAC address. The UsingIpv6 field - of the EFI_PXE_BASE_CODE_MODE structure is used to determine if IPv4 or IPv6 - addresses are being used. The IP address specified by IpAddr is used to resolve - a MAC address. If the ARP protocol succeeds in resolving the specified address, - then the ArpCacheEntries and ArpCache fields of the EFI_PXE_BASE_CODE_MODE structure - are updated, and EFI_SUCCESS is returned. If MacAddr is not NULL, the resolved - MAC address is placed there as well. - If the PXE Base Code protocol is in the stopped state, then EFI_NOT_STARTED is - returned. If the ARP protocol encounters a timeout condition while attempting - to resolve an address, then EFI_TIMEOUT is returned. If the Callback Protocol - does not return EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE, then EFI_ABORTED is - returned. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param IpAddr The pointer to the IP address that is used to resolve a MAC address. - @param MacAddr If not NULL, a pointer to the MAC address that was resolved with the - ARP protocol. - - @retval EFI_SUCCESS The IP or MAC address was resolved. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_DEVICE_ERROR The network device encountered an error during this operation. - @retval EFI_ABORTED The callback function aborted the ARP Protocol. - @retval EFI_TIMEOUT The ARP Protocol encountered a timeout condition. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_ARP)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN EFI_IP_ADDRESS *IpAddr, - IN EFI_MAC_ADDRESS *MacAddr OPTIONAL - ); - -/** - Updates the parameters that affect the operation of the PXE Base Code Protocol. - - This function sets parameters that affect the operation of the PXE Base Code Protocol. - The parameter specified by NewAutoArp is used to control the generation of ARP - protocol packets. If NewAutoArp is TRUE, then ARP Protocol packets will be generated - as required by the PXE Base Code Protocol. If NewAutoArp is FALSE, then no ARP - Protocol packets will be generated. In this case, the only mappings that are - available are those stored in the ArpCache of the EFI_PXE_BASE_CODE_MODE structure. - If there are not enough mappings in the ArpCache to perform a PXE Base Code Protocol - service, then the service will fail. This function updates the AutoArp field of - the EFI_PXE_BASE_CODE_MODE structure to NewAutoArp. - The SetParameters() call must be invoked after a Callback Protocol is installed - to enable the use of callbacks. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param NewAutoArp If not NULL, a pointer to a value that specifies whether to replace the - current value of AutoARP. - @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the - current value of SendGUID. - @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL, - the "time to live" field of the IP header. - @param NewToS If not NULL, a pointer to be used in place of the current value of ToS, - the "type of service" field of the IP header. - @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the - current value of the MakeCallback field of the Mode structure. - - @retval EFI_SUCCESS The new parameters values were updated. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN BOOLEAN *NewAutoArp, OPTIONAL - IN BOOLEAN *NewSendGUID, OPTIONAL - IN UINT8 *NewTTL, OPTIONAL - IN UINT8 *NewToS, OPTIONAL - IN BOOLEAN *NewMakeCallback OPTIONAL - ); - -/** - Updates the station IP address and/or subnet mask values of a network device. - - This function updates the station IP address and/or subnet mask values of a network - device. - The NewStationIp field is used to modify the network device's current IP address. - If NewStationIP is NULL, then the current IP address will not be modified. Otherwise, - this function updates the StationIp field of the EFI_PXE_BASE_CODE_MODE structure - with NewStationIp. - The NewSubnetMask field is used to modify the network device's current subnet - mask. If NewSubnetMask is NULL, then the current subnet mask will not be modified. - Otherwise, this function updates the SubnetMask field of the EFI_PXE_BASE_CODE_MODE - structure with NewSubnetMask. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param NewStationIp The pointer to the new IP address to be used by the network device. - @param NewSubnetMask The pointer to the new subnet mask to be used by the network device. - - @retval EFI_SUCCESS The new station IP address and/or subnet mask were updated. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - IN EFI_IP_ADDRESS *NewStationIp, OPTIONAL - IN EFI_IP_ADDRESS *NewSubnetMask OPTIONAL - ); - -/** - Updates the contents of the cached DHCP and Discover packets. - - The pointers to the new packets are used to update the contents of the cached - packets in the EFI_PXE_BASE_CODE_MODE structure. - - @param This The pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance. - @param NewDhcpDiscoverValid The pointer to a value that will replace the current - DhcpDiscoverValid field. - @param NewDhcpAckReceived The pointer to a value that will replace the current - DhcpAckReceived field. - @param NewProxyOfferReceived The pointer to a value that will replace the current - ProxyOfferReceived field. - @param NewPxeDiscoverValid The pointer to a value that will replace the current - ProxyOfferReceived field. - @param NewPxeReplyReceived The pointer to a value that will replace the current - PxeReplyReceived field. - @param NewPxeBisReplyReceived The pointer to a value that will replace the current - PxeBisReplyReceived field. - @param NewDhcpDiscover The pointer to the new cached DHCP Discover packet contents. - @param NewDhcpAck The pointer to the new cached DHCP Ack packet contents. - @param NewProxyOffer The pointer to the new cached Proxy Offer packet contents. - @param NewPxeDiscover The pointer to the new cached PXE Discover packet contents. - @param NewPxeReply The pointer to the new cached PXE Reply packet contents. - @param NewPxeBisReply The pointer to the new cached PXE BIS Reply packet contents. - - @retval EFI_SUCCESS The cached packet contents were updated. - @retval EFI_NOT_STARTED The PXE Base Code Protocol is in the stopped state. - @retval EFI_INVALID_PARAMETER This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS)( - IN EFI_PXE_BASE_CODE_PROTOCOL *This, - BOOLEAN *NewDhcpDiscoverValid, OPTIONAL - BOOLEAN *NewDhcpAckReceived, OPTIONAL - BOOLEAN *NewProxyOfferReceived, OPTIONAL - BOOLEAN *NewPxeDiscoverValid, OPTIONAL - BOOLEAN *NewPxeReplyReceived, OPTIONAL - BOOLEAN *NewPxeBisReplyReceived, OPTIONAL - IN EFI_PXE_BASE_CODE_PACKET *NewDhcpDiscover, OPTIONAL - IN EFI_PXE_BASE_CODE_PACKET *NewDhcpAck, OPTIONAL - IN EFI_PXE_BASE_CODE_PACKET *NewProxyOffer, OPTIONAL - IN EFI_PXE_BASE_CODE_PACKET *NewPxeDiscover, OPTIONAL - IN EFI_PXE_BASE_CODE_PACKET *NewPxeReply, OPTIONAL - IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL - ); - -// -// PXE Base Code Protocol structure -// -#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION 0x00010000 - -// -// Revision defined in EFI1.1 -// -#define EFI_PXE_BASE_CODE_INTERFACE_REVISION EFI_PXE_BASE_CODE_PROTOCOL_REVISION - -/// -/// The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices. -/// An EFI_PXE_BASE_CODE_PROTOCOL will be layered on top of an -/// EFI_MANAGED_NETWORK_PROTOCOL protocol in order to perform packet level transactions. -/// The EFI_PXE_BASE_CODE_PROTOCOL handle also supports the -/// EFI_LOAD_FILE_PROTOCOL protocol. This provides a clean way to obtain control from the -/// boot manager if the boot path is from the remote device. -/// -struct _EFI_PXE_BASE_CODE_PROTOCOL { - /// - /// The revision of the EFI_PXE_BASE_CODE_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_PXE_BASE_CODE_START Start; - EFI_PXE_BASE_CODE_STOP Stop; - EFI_PXE_BASE_CODE_DHCP Dhcp; - EFI_PXE_BASE_CODE_DISCOVER Discover; - EFI_PXE_BASE_CODE_MTFTP Mtftp; - EFI_PXE_BASE_CODE_UDP_WRITE UdpWrite; - EFI_PXE_BASE_CODE_UDP_READ UdpRead; - EFI_PXE_BASE_CODE_SET_IP_FILTER SetIpFilter; - EFI_PXE_BASE_CODE_ARP Arp; - EFI_PXE_BASE_CODE_SET_PARAMETERS SetParameters; - EFI_PXE_BASE_CODE_SET_STATION_IP SetStationIp; - EFI_PXE_BASE_CODE_SET_PACKETS SetPackets; - /// - /// The pointer to the EFI_PXE_BASE_CODE_MODE data for this device. - /// - EFI_PXE_BASE_CODE_MODE *Mode; -}; - -extern EFI_GUID gEfiPxeBaseCodeProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Rng.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Rng.h deleted file mode 100644 index f04efbb03..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Rng.h +++ /dev/null @@ -1,158 +0,0 @@ -/** @file - EFI_RNG_PROTOCOL as defined in UEFI 2.4. - The UEFI Random Number Generator Protocol is used to provide random bits for use - in applications, or entropy for seeding other random number generators. - -Copyright (c) 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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_RNG_PROTOCOL_H__ -#define __EFI_RNG_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -/// -/// Global ID for the Random Number Generator Protocol -/// -#define EFI_RNG_PROTOCOL_GUID \ - { \ - 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44 } \ - } - -typedef struct _EFI_RNG_PROTOCOL EFI_RNG_PROTOCOL; - -/// -/// A selection of EFI_RNG_PROTOCOL algorithms. -/// The algorithms listed are optional, not meant to be exhaustive and be argmented by -/// vendors or other industry standards. -/// - -typedef EFI_GUID EFI_RNG_ALGORITHM; - -/// -/// The algorithms corresponds to SP800-90 as defined in -/// NIST SP 800-90, "Recommendation for Random Number Generation Using Deterministic Random -/// Bit Generators", March 2007. -/// -#define EFI_RNG_ALGORITHM_SP800_90_HASH_256_GUID \ - { \ - 0xa7af67cb, 0x603b, 0x4d42, {0xba, 0x21, 0x70, 0xbf, 0xb6, 0x29, 0x3f, 0x96 } \ - } -#define EFI_RNG_ALGORITHM_SP800_90_HMAC_256_GUID \ - { \ - 0xc5149b43, 0xae85, 0x4f53, {0x99, 0x82, 0xb9, 0x43, 0x35, 0xd3, 0xa9, 0xe7 } \ - } -#define EFI_RNG_ALGORITHM_SP800_90_CTR_256_GUID \ - { \ - 0x44f0de6e, 0x4d8c, 0x4045, {0xa8, 0xc7, 0x4d, 0xd1, 0x68, 0x85, 0x6b, 0x9e } \ - } -/// -/// The algorithms correspond to X9.31 as defined in -/// NIST, "Recommended Random Number Generator Based on ANSI X9.31 Appendix A.2.4 Using -/// the 3-Key Triple DES and AES Algorithm", January 2005. -/// -#define EFI_RNG_ALGORITHM_X9_31_3DES_GUID \ - { \ - 0x63c4785a, 0xca34, 0x4012, {0xa3, 0xc8, 0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46 } \ - } -#define EFI_RNG_ALGORITHM_X9_31_AES_GUID \ - { \ - 0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9 } \ - } -/// -/// The "raw" algorithm, when supported, is intended to provide entropy directly from -/// the source, without it going through some deterministic random bit generator. -/// -#define EFI_RNG_ALGORITHM_RAW \ - { \ - 0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 } \ - } - -/** - Returns information about the random number generation implementation. - - @param[in] This A pointer to the EFI_RNG_PROTOCOL instance. - @param[in,out] RNGAlgorithmListSize On input, the size in bytes of RNGAlgorithmList. - On output with a return code of EFI_SUCCESS, the size - in bytes of the data returned in RNGAlgorithmList. On output - with a return code of EFI_BUFFER_TOO_SMALL, - the size of RNGAlgorithmList required to obtain the list. - @param[out] RNGAlgorithmList A caller-allocated memory buffer filled by the driver - with one EFI_RNG_ALGORITHM element for each supported - RNG algorithm. The list must not change across multiple - calls to the same driver. The first algorithm in the list - is the default algorithm for the driver. - - @retval EFI_SUCCESS The RNG algorithm list was returned successfully. - @retval EFI_UNSUPPORTED The services is not supported by this driver. - @retval EFI_DEVICE_ERROR The list of algorithms could not be retrieved due to a - hardware or firmware error. - @retval EFI_INVALID_PARAMETER One or more of the parameters are incorrect. - @retval EFI_BUFFER_TOO_SMALL The buffer RNGAlgorithmList is too small to hold the result. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_RNG_GET_INFO) ( - IN EFI_RNG_PROTOCOL *This, - IN OUT UINTN *RNGAlgorithmListSize, - OUT EFI_RNG_ALGORITHM *RNGAlgorithmList - ); - -/** - Produces and returns an RNG value using either the default or specified RNG algorithm. - - @param[in] This A pointer to the EFI_RNG_PROTOCOL instance. - @param[in] RNGAlgorithm A pointer to the EFI_RNG_ALGORITHM that identifies the RNG - algorithm to use. May be NULL in which case the function will - use its default RNG algorithm. - @param[in] RNGValueLength The length in bytes of the memory buffer pointed to by - RNGValue. The driver shall return exactly this numbers of bytes. - @param[out] RNGValue A caller-allocated memory buffer filled by the driver with the - resulting RNG value. - - @retval EFI_SUCCESS The RNG value was returned successfully. - @retval EFI_UNSUPPORTED The algorithm specified by RNGAlgorithm is not supported by - this driver. - @retval EFI_DEVICE_ERROR An RNG value could not be retrieved due to a hardware or - firmware error. - @retval EFI_NOT_READY There is not enough random data available to satisfy the length - requested by RNGValueLength. - @retval EFI_INVALID_PARAMETER RNGValue is NULL or RNGValueLength is zero. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_RNG_GET_RNG) ( - IN EFI_RNG_PROTOCOL *This, - IN EFI_RNG_ALGORITHM *RNGAlgorithm, OPTIONAL - IN UINTN RNGValueLength, - OUT UINT8 *RNGValue - ); - -/// -/// The Random Number Generator (RNG) protocol provides random bits for use in -/// applications, or entropy for seeding other random number generators. -/// -struct _EFI_RNG_PROTOCOL { - EFI_RNG_GET_INFO GetInfo; - EFI_RNG_GET_RNG GetRNG; -}; - -extern EFI_GUID gEfiRngProtocolGuid; -extern EFI_GUID gEfiRngAlgorithmSp80090Hash256Guid; -extern EFI_GUID gEfiRngAlgorithmSp80090Hmac256Guid; -extern EFI_GUID gEfiRngAlgorithmSp80090Ctr256Guid; -extern EFI_GUID gEfiRngAlgorithmX9313DesGuid; -extern EFI_GUID gEfiRngAlgorithmX931AesGuid; -extern EFI_GUID gEfiRngAlgorithmRaw; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleFileSystem.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleFileSystem.h deleted file mode 100644 index b6bacfd9c..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleFileSystem.h +++ /dev/null @@ -1,564 +0,0 @@ -/** @file - SimpleFileSystem protocol as defined in the UEFI 2.0 specification. - - The SimpleFileSystem protocol is the programmatic access to the FAT (12,16,32) - file system specified in UEFI 2.0. It can also be used to abstract a file - system other than FAT. - - UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem. - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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_FILE_SYSTEM_H__ -#define __SIMPLE_FILE_SYSTEM_H__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - { \ - 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL; - -typedef struct _EFI_FILE_PROTOCOL EFI_FILE_PROTOCOL; -typedef struct _EFI_FILE_PROTOCOL *EFI_FILE_HANDLE; - -/// -/// Protocol GUID name defined in EFI1.1. -/// -#define SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID - -/// -/// Protocol name defined in EFI1.1. -/// -typedef EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_FILE_IO_INTERFACE; -typedef EFI_FILE_PROTOCOL EFI_FILE; - -/** - Open the root directory on a volume. - - @param This A pointer to the volume to open the root directory. - @param Root A pointer to the location to return the opened file handle for the - root directory. - - @retval EFI_SUCCESS The device was opened. - @retval EFI_UNSUPPORTED This volume does not support the requested file system type. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_ACCESS_DENIED The service denied access to the file. - @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources. - @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no - longer supported. Any existing file handles for this volume are - no longer valid. To access the files on the new medium, the - volume must be reopened with OpenVolume(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME)( - IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, - OUT EFI_FILE_PROTOCOL **Root - ); - -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000 - -/// -/// Revision defined in EFI1.1 -/// -#define EFI_FILE_IO_INTERFACE_REVISION EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION - -struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL { - /// - /// The version of the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. The version - /// specified by this specification is 0x00010000. All future revisions - /// must be backwards compatible. - /// - UINT64 Revision; - EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume; -}; - -/** - Opens a new file relative to the source file's location. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to the source location. This would typically be an open - handle to a directory. - @param NewHandle A pointer to the location to return the opened handle for the new - file. - @param FileName The Null-terminated string of the name of the file to be opened. - The file name may contain the following path modifiers: "\", ".", - and "..". - @param OpenMode The mode to open the file. The only valid combinations that the - file may be opened with are: Read, Read/Write, or Create/Read/Write. - @param Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the - attribute bits for the newly created file. - - @retval EFI_SUCCESS The file was opened. - @retval EFI_NOT_FOUND The specified file could not be found on the device. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no - longer supported. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write - when the media is write-protected. - @retval EFI_ACCESS_DENIED The service denied access to the file. - @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. - @retval EFI_VOLUME_FULL The volume is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_OPEN)( - IN EFI_FILE_PROTOCOL *This, - OUT EFI_FILE_PROTOCOL **NewHandle, - IN CHAR16 *FileName, - IN UINT64 OpenMode, - IN UINT64 Attributes - ); - -// -// Open modes -// -#define EFI_FILE_MODE_READ 0x0000000000000001ULL -#define EFI_FILE_MODE_WRITE 0x0000000000000002ULL -#define EFI_FILE_MODE_CREATE 0x8000000000000000ULL - -// -// File attributes -// -#define EFI_FILE_READ_ONLY 0x0000000000000001ULL -#define EFI_FILE_HIDDEN 0x0000000000000002ULL -#define EFI_FILE_SYSTEM 0x0000000000000004ULL -#define EFI_FILE_RESERVED 0x0000000000000008ULL -#define EFI_FILE_DIRECTORY 0x0000000000000010ULL -#define EFI_FILE_ARCHIVE 0x0000000000000020ULL -#define EFI_FILE_VALID_ATTR 0x0000000000000037ULL - -/** - Closes a specified file handle. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to close. - - @retval EFI_SUCCESS The file was closed. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_CLOSE)( - IN EFI_FILE_PROTOCOL *This - ); - -/** - Close and delete the file handle. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the - handle to the file to delete. - - @retval EFI_SUCCESS The file was closed and deleted, and the handle was closed. - @retval EFI_WARN_DELETE_FAILURE The handle was closed, but the file was not deleted. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_DELETE)( - IN EFI_FILE_PROTOCOL *This - ); - -/** - Reads data from a file. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to read data from. - @param BufferSize On input, the size of the Buffer. On output, the amount of data - returned in Buffer. In both cases, the size is measured in bytes. - @param Buffer The buffer into which the data is read. - - @retval EFI_SUCCESS Data was read. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file. - @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory - entry. BufferSize has been updated with the size - needed to complete the request. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_READ)( - IN EFI_FILE_PROTOCOL *This, - IN OUT UINTN *BufferSize, - OUT VOID *Buffer - ); - -/** - Writes data to a file. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to write data to. - @param BufferSize On input, the size of the Buffer. On output, the amount of data - actually written. In both cases, the size is measured in bytes. - @param Buffer The buffer of data to write. - - @retval EFI_SUCCESS Data was written. - @retval EFI_UNSUPPORTED Writes to open directory files are not supported. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_WRITE_PROTECTED The file or medium is write-protected. - @retval EFI_ACCESS_DENIED The file was opened read only. - @retval EFI_VOLUME_FULL The volume is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_WRITE)( - IN EFI_FILE_PROTOCOL *This, - IN OUT UINTN *BufferSize, - IN VOID *Buffer - ); - -/** - Sets a file's current position. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the - file handle to set the requested position on. - @param Position The byte position from the start of the file to set. - - @retval EFI_SUCCESS The position was set. - @retval EFI_UNSUPPORTED The seek request for nonzero is not valid on open - directories. - @retval EFI_DEVICE_ERROR An attempt was made to set the position of a deleted file. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_SET_POSITION)( - IN EFI_FILE_PROTOCOL *This, - IN UINT64 Position - ); - -/** - Returns a file's current position. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to get the current position on. - @param Position The address to return the file's current position value. - - @retval EFI_SUCCESS The position was returned. - @retval EFI_UNSUPPORTED The request is not valid on open directories. - @retval EFI_DEVICE_ERROR An attempt was made to get the position from a deleted file. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_GET_POSITION)( - IN EFI_FILE_PROTOCOL *This, - OUT UINT64 *Position - ); - -/** - Returns information about a file. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle the requested information is for. - @param InformationType The type identifier for the information being requested. - @param BufferSize On input, the size of Buffer. On output, the amount of data - returned in Buffer. In both cases, the size is measured in bytes. - @param Buffer A pointer to the data buffer to return. The buffer's type is - indicated by InformationType. - - @retval EFI_SUCCESS The information was returned. - @retval EFI_UNSUPPORTED The InformationType is not known. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry. - BufferSize has been updated with the size needed to complete - the request. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_GET_INFO)( - IN EFI_FILE_PROTOCOL *This, - IN EFI_GUID *InformationType, - IN OUT UINTN *BufferSize, - OUT VOID *Buffer - ); - -/** - Sets information about a file. - - @param File A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle the information is for. - @param InformationType The type identifier for the information being set. - @param BufferSize The size, in bytes, of Buffer. - @param Buffer A pointer to the data buffer to write. The buffer's type is - indicated by InformationType. - - @retval EFI_SUCCESS The information was set. - @retval EFI_UNSUPPORTED The InformationType is not known. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_INFO_ID and the media is - read-only. - @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_PROTOCOL_SYSTEM_INFO_ID - and the media is read only. - @retval EFI_WRITE_PROTECTED InformationType is EFI_FILE_SYSTEM_VOLUME_LABEL_ID - and the media is read-only. - @retval EFI_ACCESS_DENIED An attempt is made to change the name of a file to a - file that is already present. - @retval EFI_ACCESS_DENIED An attempt is being made to change the EFI_FILE_DIRECTORY - Attribute. - @retval EFI_ACCESS_DENIED An attempt is being made to change the size of a directory. - @retval EFI_ACCESS_DENIED InformationType is EFI_FILE_INFO_ID and the file was opened - read-only and an attempt is being made to modify a field - other than Attribute. - @retval EFI_VOLUME_FULL The volume is full. - @retval EFI_BAD_BUFFER_SIZE BufferSize is smaller than the size of the type indicated - by InformationType. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_SET_INFO)( - IN EFI_FILE_PROTOCOL *This, - IN EFI_GUID *InformationType, - IN UINTN BufferSize, - IN VOID *Buffer - ); - -/** - Flushes all modified data associated with a file to a device. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to flush. - - @retval EFI_SUCCESS The data was flushed. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_WRITE_PROTECTED The file or medium is write-protected. - @retval EFI_ACCESS_DENIED The file was opened read-only. - @retval EFI_VOLUME_FULL The volume is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_FLUSH)( - IN EFI_FILE_PROTOCOL *This - ); - -typedef struct { - // - // If Event is NULL, then blocking I/O is performed. - // If Event is not NULL and non-blocking I/O is supported, then non-blocking I/O is performed, - // and Event will be signaled when the read request is completed. - // The caller must be prepared to handle the case where the callback associated with Event - // occurs before the original asynchronous I/O request call returns. - // - EFI_EVENT Event; - - // - // Defines whether or not the signaled event encountered an error. - // - EFI_STATUS Status; - - // - // For OpenEx(): Not Used, ignored. - // For ReadEx(): On input, the size of the Buffer. On output, the amount of data returned in Buffer. - // In both cases, the size is measured in bytes. - // For WriteEx(): On input, the size of the Buffer. On output, the amount of data actually written. - // In both cases, the size is measured in bytes. - // For FlushEx(): Not used, ignored. - // - UINTN BufferSize; - - // - // For OpenEx(): Not Used, ignored. - // For ReadEx(): The buffer into which the data is read. - // For WriteEx(): The buffer of data to write. - // For FlushEx(): Not Used, ignored. - // - VOID *Buffer; -} EFI_FILE_IO_TOKEN; - -/** - Opens a new file relative to the source directory's location. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to the source location. - @param NewHandle A pointer to the location to return the opened handle for the new - file. - @param FileName The Null-terminated string of the name of the file to be opened. - The file name may contain the following path modifiers: "\", ".", - and "..". - @param OpenMode The mode to open the file. The only valid combinations that the - file may be opened with are: Read, Read/Write, or Create/Read/Write. - @param Attributes Only valid for EFI_FILE_MODE_CREATE, in which case these are the - attribute bits for the newly created file. - @param Token A pointer to the token associated with the transaction. - - @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully. - If Event is not NULL (asynchronous I/O): The request was successfully - queued for processing. - @retval EFI_NOT_FOUND The specified file could not be found on the device. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no - longer supported. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_WRITE_PROTECTED An attempt was made to create a file, or open a file for write - when the media is write-protected. - @retval EFI_ACCESS_DENIED The service denied access to the file. - @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open the file. - @retval EFI_VOLUME_FULL The volume is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_OPEN_EX)( - IN EFI_FILE_PROTOCOL *This, - OUT EFI_FILE_PROTOCOL **NewHandle, - IN CHAR16 *FileName, - IN UINT64 OpenMode, - IN UINT64 Attributes, - IN OUT EFI_FILE_IO_TOKEN *Token - ); - - -/** - Reads data from a file. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to read data from. - @param Token A pointer to the token associated with the transaction. - - @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully. - If Event is not NULL (asynchronous I/O): The request was successfully - queued for processing. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_DEVICE_ERROR An attempt was made to read from a deleted file. - @retval EFI_DEVICE_ERROR On entry, the current file position is beyond the end of the file. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_READ_EX) ( - IN EFI_FILE_PROTOCOL *This, - IN OUT EFI_FILE_IO_TOKEN *Token -); - - -/** - Writes data to a file. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file handle to write data to. - @param Token A pointer to the token associated with the transaction. - - @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully. - If Event is not NULL (asynchronous I/O): The request was successfully - queued for processing. - @retval EFI_UNSUPPORTED Writes to open directory files are not supported. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_DEVICE_ERROR An attempt was made to write to a deleted file. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_WRITE_PROTECTED The file or medium is write-protected. - @retval EFI_ACCESS_DENIED The file was opened read only. - @retval EFI_VOLUME_FULL The volume is full. - @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_WRITE_EX) ( - IN EFI_FILE_PROTOCOL *This, - IN OUT EFI_FILE_IO_TOKEN *Token -); - -/** - Flushes all modified data associated with a file to a device. - - @param This A pointer to the EFI_FILE_PROTOCOL instance that is the file - handle to flush. - @param Token A pointer to the token associated with the transaction. - - @retval EFI_SUCCESS If Event is NULL (blocking I/O): The data was read successfully. - If Event is not NULL (asynchronous I/O): The request was successfully - queued for processing. - @retval EFI_NO_MEDIA The device has no medium. - @retval EFI_DEVICE_ERROR The device reported an error. - @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted. - @retval EFI_WRITE_PROTECTED The file or medium is write-protected. - @retval EFI_ACCESS_DENIED The file was opened read-only. - @retval EFI_VOLUME_FULL The volume is full. - @retval EFI_OUT_OF_RESOURCES Unable to queue the request due to lack of resources. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_FILE_FLUSH_EX) ( - IN EFI_FILE_PROTOCOL *This, - IN OUT EFI_FILE_IO_TOKEN *Token - ); - -#define EFI_FILE_PROTOCOL_REVISION 0x00010000 -#define EFI_FILE_PROTOCOL_REVISION2 0x00020000 -#define EFI_FILE_PROTOCOL_LATEST_REVISION EFI_FILE_PROTOCOL_REVISION2 - -// -// Revision defined in EFI1.1. -// -#define EFI_FILE_REVISION EFI_FILE_PROTOCOL_REVISION - -/// -/// The EFI_FILE_PROTOCOL provides file IO access to supported file systems. -/// An EFI_FILE_PROTOCOL provides access to a file's or directory's contents, -/// and is also a reference to a location in the directory tree of the file system -/// in which the file resides. With any given file handle, other files may be opened -/// relative to this file's location, yielding new file handles. -/// -struct _EFI_FILE_PROTOCOL { - /// - /// The version of the EFI_FILE_PROTOCOL interface. The version specified - /// by this specification is EFI_FILE_PROTOCOL_LATEST_REVISION. - /// Future versions are required to be backward compatible to version 1.0. - /// - UINT64 Revision; - EFI_FILE_OPEN Open; - EFI_FILE_CLOSE Close; - EFI_FILE_DELETE Delete; - EFI_FILE_READ Read; - EFI_FILE_WRITE Write; - EFI_FILE_GET_POSITION GetPosition; - EFI_FILE_SET_POSITION SetPosition; - EFI_FILE_GET_INFO GetInfo; - EFI_FILE_SET_INFO SetInfo; - EFI_FILE_FLUSH Flush; - EFI_FILE_OPEN_EX OpenEx; - EFI_FILE_READ_EX ReadEx; - EFI_FILE_WRITE_EX WriteEx; - EFI_FILE_FLUSH_EX FlushEx; -}; - - -extern EFI_GUID gEfiSimpleFileSystemProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleNetwork.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleNetwork.h deleted file mode 100644 index 2b521a9de..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleNetwork.h +++ /dev/null @@ -1,664 +0,0 @@ -/** @file - The EFI_SIMPLE_NETWORK_PROTOCOL provides services to initialize a network interface, - transmit packets, receive packets, and close a network interface. - - Basic network device abstraction. - - Rx - Received - Tx - Transmit - MCast - MultiCast - ... - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in EFI Specification 1.10. - -**/ - -#ifndef __SIMPLE_NETWORK_H__ -#define __SIMPLE_NETWORK_H__ - -FILE_LICENCE ( BSD3 ); - -#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; - -/// -/// The state of the network interface. -/// When an EFI_SIMPLE_NETWORK_PROTOCOL driver initializes a -/// network interface, the network interface is left in the EfiSimpleNetworkStopped state. -/// -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 { - /// - /// Reports the current state of the network interface. - /// - UINT32 State; - /// - /// The size, in bytes, of the network interface's HW address. - /// - UINT32 HwAddressSize; - /// - /// The size, in bytes, of the network interface's media header. - /// - UINT32 MediaHeaderSize; - /// - /// The maximum size, in bytes, of the packets supported by the network interface. - /// - UINT32 MaxPacketSize; - /// - /// The size, in bytes, of the NVRAM device attached to the network interface. - /// - UINT32 NvRamSize; - /// - /// The size that must be used for all NVRAM reads and writes. The - /// start address for NVRAM read and write operations and the total - /// length of those operations, must be a multiple of this value. The - /// legal values for this field are 0, 1, 2, 4, and 8. - /// - UINT32 NvRamAccessSize; - /// - /// The multicast receive filter settings supported by the network interface. - /// - UINT32 ReceiveFilterMask; - /// - /// The current multicast receive filter settings. - /// - UINT32 ReceiveFilterSetting; - /// - /// The maximum number of multicast address receive filters supported by the driver. - /// - UINT32 MaxMCastFilterCount; - /// - /// The current number of multicast address receive filters. - /// - UINT32 MCastFilterCount; - /// - /// Array containing the addresses of the current multicast address receive filters. - /// - EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT]; - /// - /// The current HW MAC address for the network interface. - /// - EFI_MAC_ADDRESS CurrentAddress; - /// - /// The current HW MAC address for broadcast packets. - /// - EFI_MAC_ADDRESS BroadcastAddress; - /// - /// The permanent HW MAC address for the network interface. - /// - EFI_MAC_ADDRESS PermanentAddress; - /// - /// The interface type of the network interface. - /// - UINT8 IfType; - /// - /// TRUE if the HW MAC address can be changed. - /// - BOOLEAN MacAddressChangeable; - /// - /// TRUE if the network interface can transmit more than one packet at a time. - /// - BOOLEAN MultipleTxSupported; - /// - /// TRUE if the presence of media can be determined; otherwise FALSE. - /// - BOOLEAN MediaPresentSupported; - /// - /// TRUE if media are connected to the network interface; otherwise FALSE. - /// - 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 The 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 The 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 The 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 The protocol instance pointer. - @param Reset Flag used to reset the station address to the network interfaces - permanent address. - @param New The 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 The 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 The 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 The 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 The 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 DestAddr 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 The 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 DestAddr 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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextIn.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextIn.h deleted file mode 100644 index 571ecaf30..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextIn.h +++ /dev/null @@ -1,136 +0,0 @@ -/** @file - Simple Text Input protocol from the UEFI 2.0 specification. - - Abstraction of a very simple input device like a keyboard or serial - terminal. - - Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ - { \ - 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ - } - -typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL; - -/// -/// Protocol GUID name defined in EFI1.1. -/// -#define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID - -/// -/// Protocol name in EFI1.1 for backward-compatible. -/// -typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE; - -/// -/// The keystroke information for the key that was pressed. -/// -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_ESC 0x0017 - -/** - Reset the input device and optionally 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 existence of a keystroke via WaitForEvent () call. - - @param This Protocol instance pointer. - @param Key A pointer to a buffer that is filled in with the keystroke - information for the key that was pressed. - - @retval EFI_SUCCESS The keystroke information was returned. - @retval EFI_NOT_READY There was no keystroke data available. - @retval EFI_DEVICE_ERROR The keystroke 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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextInEx.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextInEx.h deleted file mode 100644 index 9a9f5ab59..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextInEx.h +++ /dev/null @@ -1,327 +0,0 @@ -/** @file - Simple Text Input Ex protocol from the UEFI 2.0 specification. - - This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL - which exposes much more state and modifier information from the input device, - also allows one to register a notification for a particular keystroke. - - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR> - 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_EX_H__ -#define __SIMPLE_TEXT_IN_EX_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Protocol/SimpleTextIn.h> - -#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ - {0xdd9e7534, 0x7762, 0x4698, { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } } - - -typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; - -/** - The Reset() function resets the input device hardware. As part - of initialization process, the firmware/device will make a quick - but reasonable attempt to verify that the device is functioning. - If the ExtendedVerification flag is TRUE the firmware may take - an extended amount of time to verify the device is operating on - reset. Otherwise the reset operation is to occur as quickly as - possible. The hardware verification process is not defined by - this specification and is left up to the platform firmware or - driver to implement. - - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. - - @param ExtendedVerification Indicates that the driver may - perform a more exhaustive - verification operation of the - device during reset. - - - @retval EFI_SUCCESS The device was reset. - - @retval EFI_DEVICE_ERROR The device is not functioning - correctly and could not be reset. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INPUT_RESET_EX)( - IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - IN BOOLEAN ExtendedVerification -); - - -/// -/// EFI_KEY_TOGGLE_STATE. The toggle states are defined. -/// They are: EFI_TOGGLE_STATE_VALID, EFI_SCROLL_LOCK_ACTIVE -/// EFI_NUM_LOCK_ACTIVE, EFI_CAPS_LOCK_ACTIVE -/// -typedef UINT8 EFI_KEY_TOGGLE_STATE; - -typedef struct _EFI_KEY_STATE { - /// - /// Reflects the currently pressed shift - /// modifiers for the input device. The - /// returned value is valid only if the high - /// order bit has been set. - /// - UINT32 KeyShiftState; - /// - /// Reflects the current internal state of - /// various toggled attributes. The returned - /// value is valid only if the high order - /// bit has been set. - /// - EFI_KEY_TOGGLE_STATE KeyToggleState; -} EFI_KEY_STATE; - -typedef struct { - /// - /// The EFI scan code and Unicode value returned from the input device. - /// - EFI_INPUT_KEY Key; - /// - /// The current state of various toggled attributes as well as input modifier values. - /// - EFI_KEY_STATE KeyState; -} EFI_KEY_DATA; - -// -// Any Shift or Toggle State that is valid should have -// high order bit set. -// -// Shift state -// -#define EFI_SHIFT_STATE_VALID 0x80000000 -#define EFI_RIGHT_SHIFT_PRESSED 0x00000001 -#define EFI_LEFT_SHIFT_PRESSED 0x00000002 -#define EFI_RIGHT_CONTROL_PRESSED 0x00000004 -#define EFI_LEFT_CONTROL_PRESSED 0x00000008 -#define EFI_RIGHT_ALT_PRESSED 0x00000010 -#define EFI_LEFT_ALT_PRESSED 0x00000020 -#define EFI_RIGHT_LOGO_PRESSED 0x00000040 -#define EFI_LEFT_LOGO_PRESSED 0x00000080 -#define EFI_MENU_KEY_PRESSED 0x00000100 -#define EFI_SYS_REQ_PRESSED 0x00000200 - -// -// Toggle state -// -#define EFI_TOGGLE_STATE_VALID 0x80 -#define EFI_KEY_STATE_EXPOSED 0x40 -#define EFI_SCROLL_LOCK_ACTIVE 0x01 -#define EFI_NUM_LOCK_ACTIVE 0x02 -#define EFI_CAPS_LOCK_ACTIVE 0x04 - -// -// EFI Scan codes -// -#define SCAN_F11 0x0015 -#define SCAN_F12 0x0016 -#define SCAN_PAUSE 0x0048 -#define SCAN_F13 0x0068 -#define SCAN_F14 0x0069 -#define SCAN_F15 0x006A -#define SCAN_F16 0x006B -#define SCAN_F17 0x006C -#define SCAN_F18 0x006D -#define SCAN_F19 0x006E -#define SCAN_F20 0x006F -#define SCAN_F21 0x0070 -#define SCAN_F22 0x0071 -#define SCAN_F23 0x0072 -#define SCAN_F24 0x0073 -#define SCAN_MUTE 0x007F -#define SCAN_VOLUME_UP 0x0080 -#define SCAN_VOLUME_DOWN 0x0081 -#define SCAN_BRIGHTNESS_UP 0x0100 -#define SCAN_BRIGHTNESS_DOWN 0x0101 -#define SCAN_SUSPEND 0x0102 -#define SCAN_HIBERNATE 0x0103 -#define SCAN_TOGGLE_DISPLAY 0x0104 -#define SCAN_RECOVERY 0x0105 -#define SCAN_EJECT 0x0106 - -/** - The function reads the next keystroke from the input device. If - there is no pending keystroke the function returns - EFI_NOT_READY. If there is a pending keystroke, then - KeyData.Key.ScanCode is the EFI scan code defined in Error! - Reference source not found. The KeyData.Key.UnicodeChar is the - actual printable character or is zero if the key does not - represent a printable character (control key, function key, - etc.). The KeyData.KeyState is shift state for the character - reflected in KeyData.Key.UnicodeChar or KeyData.Key.ScanCode . - When interpreting the data from this function, it should be - noted that if a class of printable characters that are - normally adjusted by shift modifiers (e.g. Shift Key + "f" - key) would be presented solely as a KeyData.Key.UnicodeChar - without the associated shift state. So in the previous example - of a Shift Key + "f" key being pressed, the only pertinent - data returned would be KeyData.Key.UnicodeChar with the value - of "F". This of course would not typically be the case for - non-printable characters such as the pressing of the Right - Shift Key + F10 key since the corresponding returned data - would be reflected both in the KeyData.KeyState.KeyShiftState - and KeyData.Key.ScanCode values. UEFI drivers which implement - the EFI_SIMPLE_TEXT_INPUT_EX protocol are required to return - KeyData.Key and KeyData.KeyState values. These drivers must - always return the most current state of - KeyData.KeyState.KeyShiftState and - KeyData.KeyState.KeyToggleState. It should also be noted that - certain input devices may not be able to produce shift or toggle - state information, and in those cases the high order bit in the - respective Toggle and Shift state fields should not be active. - - - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. - - @param KeyData A pointer to a buffer that is filled in with - the keystroke state data for the key that was - pressed. - - - @retval EFI_SUCCESS The keystroke information was - returned. - - @retval EFI_NOT_READY There was no keystroke data available. - EFI_DEVICE_ERROR The keystroke - information was not returned due to - hardware errors. - - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_INPUT_READ_KEY_EX)( - IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - OUT EFI_KEY_DATA *KeyData -); - -/** - The SetState() function allows the input device hardware to - have state settings adjusted. - - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. - - @param KeyToggleState Pointer to the EFI_KEY_TOGGLE_STATE to - set the state for the input device. - - - @retval EFI_SUCCESS The device state was set appropriately. - - @retval EFI_DEVICE_ERROR The device is not functioning - correctly and could not have the - setting adjusted. - - @retval EFI_UNSUPPORTED The device does not support the - ability to have its state set. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_SET_STATE)( - IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - IN EFI_KEY_TOGGLE_STATE *KeyToggleState -); - -/// -/// The function will be called when the key sequence is typed specified by KeyData. -/// -typedef -EFI_STATUS -(EFIAPI *EFI_KEY_NOTIFY_FUNCTION)( - IN EFI_KEY_DATA *KeyData -); - -/** - The RegisterKeystrokeNotify() function registers a function - which will be called when a specified keystroke will occur. - - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. - - @param KeyData A pointer to a buffer that is filled in with - the keystroke information for the key that was - pressed. - - @param KeyNotificationFunction Points to the function to be - called when the key sequence - is typed specified by KeyData. - - - @param NotifyHandle Points to the unique handle assigned to - the registered notification. - - @retval EFI_SUCCESS The device state was set - appropriately. - - @retval EFI_OUT_OF_RESOURCES Unable to allocate necessary - data structures. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY)( - IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - IN EFI_KEY_DATA *KeyData, - IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, - OUT VOID **NotifyHandle -); - -/** - The UnregisterKeystrokeNotify() function removes the - notification which was previously registered. - - @param This A pointer to the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL instance. - - @param NotificationHandle The handle of the notification - function being unregistered. - - @retval EFI_SUCCESS The device state was set appropriately. - - @retval EFI_INVALID_PARAMETER The NotificationHandle is - invalid. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY)( - IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, - IN VOID *NotificationHandle -); - - -/// -/// The EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL is used on the ConsoleIn -/// device. It is an extension to the Simple Text Input protocol -/// which allows a variety of extended shift state information to be -/// returned. -/// -struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL{ - EFI_INPUT_RESET_EX Reset; - EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; - /// - /// Event to use with WaitForEvent() to wait for a key to be available. - /// - EFI_EVENT WaitForKeyEx; - EFI_SET_STATE SetState; - EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; - EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; -}; - - -extern EFI_GUID gEfiSimpleTextInputExProtocolGuid; - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextOut.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextOut.h deleted file mode 100644 index a79cf431c..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/SimpleTextOut.h +++ /dev/null @@ -1,406 +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 aggregation - of multiple physical devices. - -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#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, -// Bit 7 signifies 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, such as serial or LAN consoles. -// -#define EFI_WIDE_ATTRIBUTE 0x80 - -/** - Reset the text output device hardware and optionaly run diagnostics - - @param This The 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 string to the output device. - - @param This The protocol instance pointer. - @param String The NULL-terminated string to be displayed on the output - device(s). All output devices must also support the Unicode - drawing character codes 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 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 string can be output to the - target device. - - @param This The protocol instance pointer. - @param String The NULL-terminated 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 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 The 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 The 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 The 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 The 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 The 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 The 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. -**/ -typedef struct { - /// - /// The number of modes supported by QueryMode () and SetMode (). - /// - INT32 MaxMode; - - // - // current settings - // - - /// - /// The text mode of the output device(s). - /// - INT32 Mode; - /// - /// The current character output attribute. - /// - INT32 Attribute; - /// - /// The cursor's column. - /// - INT32 CursorColumn; - /// - /// The cursor's row. - /// - INT32 CursorRow; - /// - /// The cursor is currently visbile or not. - /// - 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/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/TcgService.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/TcgService.h deleted file mode 100644 index 1068448f0..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/TcgService.h +++ /dev/null @@ -1,209 +0,0 @@ -/** @file - TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final - See http://trustedcomputinggroup.org for the latest specification - -Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 _TCG_SERVICE_PROTOCOL_H_ -#define _TCG_SERVICE_PROTOCOL_H_ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/IndustryStandard/UefiTcgPlatform.h> - -#define EFI_TCG_PROTOCOL_GUID \ - {0xf541796d, 0xa62e, 0x4954, { 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd } } - -typedef struct _EFI_TCG_PROTOCOL EFI_TCG_PROTOCOL; - -typedef struct { - UINT8 Major; - UINT8 Minor; - UINT8 RevMajor; - UINT8 RevMinor; -} TCG_VERSION; - -typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY { - UINT8 Size; /// Size of this structure. - TCG_VERSION StructureVersion; - TCG_VERSION ProtocolSpecVersion; - UINT8 HashAlgorithmBitmap; /// Hash algorithms . - /// This protocol is capable of : 01=SHA-1. - BOOLEAN TPMPresentFlag; /// 00h = TPM not present. - BOOLEAN TPMDeactivatedFlag; /// 01h = TPM currently deactivated. -} TCG_EFI_BOOT_SERVICE_CAPABILITY; - -typedef UINT32 TCG_ALGORITHM_ID; - -/// -/// Note: -/// Status codes returned for functions of EFI_TCG_PROTOCOL do not exactly match -/// those defined in the TCG EFI Protocol 1.20 Final Specification. -/// - -/** - This service provides EFI protocol capability information, state information - about the TPM, and Event Log state information. - - @param This Indicates the calling context - @param ProtocolCapability The callee allocates memory for a TCG_BOOT_SERVICE_CAPABILITY - structure and fills in the fields with the EFI protocol - capability information and the current TPM state information. - @param TCGFeatureFlags This is a pointer to the feature flags. No feature - flags are currently defined so this parameter - MUST be set to 0. However, in the future, - feature flags may be defined that, for example, - enable hash algorithm agility. - @param EventLogLocation This is a pointer to the address of the event log in memory. - @param EventLogLastEntry If the Event Log contains more than one entry, - this is a pointer to the address of the start of - the last entry in the event log in memory. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER ProtocolCapability does not match TCG capability. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCG_STATUS_CHECK)( - IN EFI_TCG_PROTOCOL *This, - OUT TCG_EFI_BOOT_SERVICE_CAPABILITY - *ProtocolCapability, - OUT UINT32 *TCGFeatureFlags, - OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, - OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry - ); - -/** - This service abstracts the capability to do a hash operation on a data buffer. - - @param This Indicates the calling context. - @param HashData The pointer to the data buffer to be hashed. - @param HashDataLen The length of the data buffer to be hashed. - @param AlgorithmId Identification of the Algorithm to use for the hashing operation. - @param HashedDataLen Resultant length of the hashed data. - @param HashedDataResult Resultant buffer of the hashed data. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER HashDataLen is NULL. - @retval EFI_INVALID_PARAMETER HashDataLenResult is NULL. - @retval EFI_OUT_OF_RESOURCES Cannot allocate buffer of size *HashedDataLen. - @retval EFI_UNSUPPORTED AlgorithmId not supported. - @retval EFI_BUFFER_TOO_SMALL *HashedDataLen < sizeof (TCG_DIGEST). -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCG_HASH_ALL)( - IN EFI_TCG_PROTOCOL *This, - IN UINT8 *HashData, - IN UINT64 HashDataLen, - IN TCG_ALGORITHM_ID AlgorithmId, - IN OUT UINT64 *HashedDataLen, - IN OUT UINT8 **HashedDataResult - ); - -/** - This service abstracts the capability to add an entry to the Event Log. - - @param This Indicates the calling context - @param TCGLogData The pointer to the start of the data buffer containing - the TCG_PCR_EVENT data structure. All fields in - this structure are properly filled by the caller. - @param EventNumber The event number of the event just logged. - @param Flags Indicates additional flags. Only one flag has been - defined at this time, which is 0x01 and means the - extend operation should not be performed. All - other bits are reserved. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_OUT_OF_RESOURCES Insufficient memory in the event log to complete this action. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCG_LOG_EVENT)( - IN EFI_TCG_PROTOCOL *This, - IN TCG_PCR_EVENT *TCGLogData, - IN OUT UINT32 *EventNumber, - IN UINT32 Flags - ); - -/** - This service is a proxy for commands to the TPM. - - @param This Indicates the calling context. - @param TpmInputParameterBlockSize Size of the TPM input parameter block. - @param TpmInputParameterBlock The pointer to the TPM input parameter block. - @param TpmOutputParameterBlockSize Size of the TPM output parameter block. - @param TpmOutputParameterBlock The pointer to the TPM output parameter block. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_INVALID_PARAMETER Invalid ordinal. - @retval EFI_UNSUPPORTED Current Task Priority Level >= EFI_TPL_CALLBACK. - @retval EFI_TIMEOUT The TIS timed-out. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM)( - IN EFI_TCG_PROTOCOL *This, - IN UINT32 TpmInputParameterBlockSize, - IN UINT8 *TpmInputParameterBlock, - IN UINT32 TpmOutputParameterBlockSize, - IN UINT8 *TpmOutputParameterBlock - ); - -/** - This service abstracts the capability to do a hash operation on a data buffer, extend a specific TPM PCR with the hash result, and add an entry to the Event Log - - @param This Indicates the calling context - @param HashData The physical address of the start of the data buffer - to be hashed, extended, and logged. - @param HashDataLen The length, in bytes, of the buffer referenced by HashData - @param AlgorithmId Identification of the Algorithm to use for the hashing operation - @param TCGLogData The physical address of the start of the data - buffer containing the TCG_PCR_EVENT data structure. - @param EventNumber The event number of the event just logged. - @param EventLogLastEntry The physical address of the first byte of the entry - just placed in the Event Log. If the Event Log was - empty when this function was called then this physical - address will be the same as the physical address of - the start of the Event Log. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_UNSUPPORTED AlgorithmId != TPM_ALG_SHA. - @retval EFI_UNSUPPORTED Current TPL >= EFI_TPL_CALLBACK. - @retval EFI_DEVICE_ERROR The command was unsuccessful. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT)( - IN EFI_TCG_PROTOCOL *This, - IN EFI_PHYSICAL_ADDRESS HashData, - IN UINT64 HashDataLen, - IN TCG_ALGORITHM_ID AlgorithmId, - IN OUT TCG_PCR_EVENT *TCGLogData, - IN OUT UINT32 *EventNumber, - OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry - ); - -/// -/// The EFI_TCG Protocol abstracts TCG activity. -/// -struct _EFI_TCG_PROTOCOL { - EFI_TCG_STATUS_CHECK StatusCheck; - EFI_TCG_HASH_ALL HashAll; - EFI_TCG_LOG_EVENT LogEvent; - EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm; - EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent; -}; - -extern EFI_GUID gEfiTcgProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Tcp4.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Tcp4.h deleted file mode 100644 index 1771bc55f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Tcp4.h +++ /dev/null @@ -1,579 +0,0 @@ -/** @file - EFI TCPv4(Transmission Control Protocol version 4) Protocol Definition - The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create - and destroy child of the driver to communicate with other host using TCP protocol. - The EFI TCPv4 Protocol provides services to send and receive data stream. - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in UEFI Specification 2.0. - -**/ - -#ifndef __EFI_TCP4_PROTOCOL_H__ -#define __EFI_TCP4_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Protocol/Ip4.h> - -#define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \ - { \ - 0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \ - } - -#define EFI_TCP4_PROTOCOL_GUID \ - { \ - 0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \ - } - -typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL; - -/// -/// EFI_TCP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more. -/// The definition in here is only present to provide backwards compatability. -/// -typedef struct { - EFI_HANDLE InstanceHandle; - EFI_IPv4_ADDRESS LocalAddress; - UINT16 LocalPort; - EFI_IPv4_ADDRESS RemoteAddress; - UINT16 RemotePort; -} EFI_TCP4_SERVICE_POINT; - -/// -/// EFI_TCP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more. -/// The definition in here is only present to provide backwards compatability. -/// -typedef struct { - EFI_HANDLE DriverHandle; - UINT32 ServiceCount; - EFI_TCP4_SERVICE_POINT Services[1]; -} EFI_TCP4_VARIABLE_DATA; - -typedef struct { - BOOLEAN UseDefaultAddress; - EFI_IPv4_ADDRESS StationAddress; - EFI_IPv4_ADDRESS SubnetMask; - UINT16 StationPort; - EFI_IPv4_ADDRESS RemoteAddress; - UINT16 RemotePort; - BOOLEAN ActiveFlag; -} EFI_TCP4_ACCESS_POINT; - -typedef struct { - UINT32 ReceiveBufferSize; - UINT32 SendBufferSize; - UINT32 MaxSynBackLog; - UINT32 ConnectionTimeout; - UINT32 DataRetries; - UINT32 FinTimeout; - UINT32 TimeWaitTimeout; - UINT32 KeepAliveProbes; - UINT32 KeepAliveTime; - UINT32 KeepAliveInterval; - BOOLEAN EnableNagle; - BOOLEAN EnableTimeStamp; - BOOLEAN EnableWindowScaling; - BOOLEAN EnableSelectiveAck; - BOOLEAN EnablePathMtuDiscovery; -} EFI_TCP4_OPTION; - -typedef struct { - // - // I/O parameters - // - UINT8 TypeOfService; - UINT8 TimeToLive; - - // - // Access Point - // - EFI_TCP4_ACCESS_POINT AccessPoint; - - // - // TCP Control Options - // - EFI_TCP4_OPTION *ControlOption; -} EFI_TCP4_CONFIG_DATA; - -/// -/// TCP4 connnection state -/// -typedef enum { - Tcp4StateClosed = 0, - Tcp4StateListen = 1, - Tcp4StateSynSent = 2, - Tcp4StateSynReceived = 3, - Tcp4StateEstablished = 4, - Tcp4StateFinWait1 = 5, - Tcp4StateFinWait2 = 6, - Tcp4StateClosing = 7, - Tcp4StateTimeWait = 8, - Tcp4StateCloseWait = 9, - Tcp4StateLastAck = 10 -} EFI_TCP4_CONNECTION_STATE; - -typedef struct { - EFI_EVENT Event; - EFI_STATUS Status; -} EFI_TCP4_COMPLETION_TOKEN; - -typedef struct { - /// - /// The Status in the CompletionToken will be set to one of - /// the following values if the active open succeeds or an unexpected - /// error happens: - /// EFI_SUCCESS: The active open succeeds and the instance's - /// state is Tcp4StateEstablished. - /// EFI_CONNECTION_RESET: The connect fails because the connection is reset - /// either by instance itself or the communication peer. - /// EFI_CONNECTION_REFUSED: The connect fails because this connection is initiated with - /// an active open and the connection is refused. - /// EFI_ABORTED: The active open is aborted. - /// EFI_TIMEOUT: The connection establishment timer expires and - /// no more specific information is available. - /// EFI_NETWORK_UNREACHABLE: The active open fails because - /// an ICMP network unreachable error is received. - /// EFI_HOST_UNREACHABLE: The active open fails because an - /// ICMP host unreachable error is received. - /// EFI_PROTOCOL_UNREACHABLE: The active open fails - /// because an ICMP protocol unreachable error is received. - /// EFI_PORT_UNREACHABLE: The connection establishment - /// timer times out and an ICMP port unreachable error is received. - /// EFI_ICMP_ERROR: The connection establishment timer timeout and some other ICMP - /// error is received. - /// EFI_DEVICE_ERROR: An unexpected system or network error occurred. - /// EFI_NO_MEDIA: There was a media error. - /// - EFI_TCP4_COMPLETION_TOKEN CompletionToken; -} EFI_TCP4_CONNECTION_TOKEN; - -typedef struct { - EFI_TCP4_COMPLETION_TOKEN CompletionToken; - EFI_HANDLE NewChildHandle; -} EFI_TCP4_LISTEN_TOKEN; - -typedef struct { - UINT32 FragmentLength; - VOID *FragmentBuffer; -} EFI_TCP4_FRAGMENT_DATA; - -typedef struct { - BOOLEAN UrgentFlag; - UINT32 DataLength; - UINT32 FragmentCount; - EFI_TCP4_FRAGMENT_DATA FragmentTable[1]; -} EFI_TCP4_RECEIVE_DATA; - -typedef struct { - BOOLEAN Push; - BOOLEAN Urgent; - UINT32 DataLength; - UINT32 FragmentCount; - EFI_TCP4_FRAGMENT_DATA FragmentTable[1]; -} EFI_TCP4_TRANSMIT_DATA; - -typedef struct { - /// - /// When transmission finishes or meets any unexpected error it will - /// be set to one of the following values: - /// EFI_SUCCESS: The receiving or transmission operation - /// completes successfully. - /// EFI_CONNECTION_FIN: The receiving operation fails because the communication peer - /// has closed the connection and there is no more data in the - /// receive buffer of the instance. - /// EFI_CONNECTION_RESET: The receiving or transmission operation fails - /// because this connection is reset either by instance - /// itself or the communication peer. - /// EFI_ABORTED: The receiving or transmission is aborted. - /// EFI_TIMEOUT: The transmission timer expires and no more - /// specific information is available. - /// EFI_NETWORK_UNREACHABLE: The transmission fails - /// because an ICMP network unreachable error is received. - /// EFI_HOST_UNREACHABLE: The transmission fails because an - /// ICMP host unreachable error is received. - /// EFI_PROTOCOL_UNREACHABLE: The transmission fails - /// because an ICMP protocol unreachable error is received. - /// EFI_PORT_UNREACHABLE: The transmission fails and an - /// ICMP port unreachable error is received. - /// EFI_ICMP_ERROR: The transmission fails and some other - /// ICMP error is received. - /// EFI_DEVICE_ERROR: An unexpected system or network error occurs. - /// EFI_NO_MEDIA: There was a media error. - /// - EFI_TCP4_COMPLETION_TOKEN CompletionToken; - union { - /// - /// When this token is used for receiving, RxData is a pointer to EFI_TCP4_RECEIVE_DATA. - /// - EFI_TCP4_RECEIVE_DATA *RxData; - /// - /// When this token is used for transmitting, TxData is a pointer to EFI_TCP4_TRANSMIT_DATA. - /// - EFI_TCP4_TRANSMIT_DATA *TxData; - } Packet; -} EFI_TCP4_IO_TOKEN; - -typedef struct { - EFI_TCP4_COMPLETION_TOKEN CompletionToken; - BOOLEAN AbortOnClose; -} EFI_TCP4_CLOSE_TOKEN; - -// -// Interface definition for TCP4 protocol -// - -/** - Get the current operational status. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param Tcp4State The pointer to the buffer to receive the current TCP state. - @param Tcp4ConfigData The pointer to the buffer to receive the current TCP configuration. - @param Ip4ModeData The pointer to the buffer to receive the current IPv4 configuration - data used by the TCPv4 instance. - @param MnpConfigData The pointer to the buffer to receive the current MNP configuration - data used indirectly by the TCPv4 instance. - @param SnpModeData The pointer to the buffer to receive the current SNP configuration - data used indirectly by the TCPv4 instance. - - @retval EFI_SUCCESS The mode data was read. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_STARTED No configuration data is available because this instance hasn't - been started. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_GET_MODE_DATA)( - IN EFI_TCP4_PROTOCOL *This, - OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL, - OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL, - OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL, - OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, - OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL - ); - -/** - Initialize or brutally reset the operational parameters for this EFI TCPv4 instance. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param Tcp4ConfigData The pointer to the configure data to configure the instance. - - @retval EFI_SUCCESS The operational settings are set, changed, or reset - successfully. - @retval EFI_INVALID_PARAMETER Some parameter is invalid. - @retval EFI_NO_MAPPING When using a default address, configuration (through - DHCP, BOOTP, RARP, etc.) is not finished yet. - @retval EFI_ACCESS_DENIED Configuring TCP instance when it is configured without - calling Configure() with NULL to reset it. - @retval EFI_DEVICE_ERROR An unexpected network or system error occurred. - @retval EFI_UNSUPPORTED One or more of the control options are not supported in - the implementation. - @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resources when - executing Configure(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_CONFIGURE)( - IN EFI_TCP4_PROTOCOL *This, - IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL - ); - - -/** - Add or delete a route entry to the route table - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param DeleteRoute Set it to TRUE to delete this route from the routing table. Set it to - FALSE to add this route to the routing table. - DestinationAddress and SubnetMask are used as the - keywords to search route entry. - @param SubnetAddress The destination network. - @param SubnetMask The subnet mask of the destination network. - @param GatewayAddress The gateway address for this route. It must be on the same - subnet with the station address unless a direct route is specified. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_NOT_STARTED The EFI TCPv4 Protocol instance has not been configured. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - SubnetAddress is NULL. - - SubnetMask is NULL. - - GatewayAddress is NULL. - - *SubnetAddress is not NULL a valid subnet address. - - *SubnetMask is not a valid subnet mask. - - *GatewayAddress is not a valid unicast IP address or it - is not in the same subnet. - @retval EFI_OUT_OF_RESOURCES Could not allocate enough resources to add the entry to the - routing table. - @retval EFI_NOT_FOUND This route is not in the routing table. - @retval EFI_ACCESS_DENIED The route is already defined in the routing table. - @retval EFI_UNSUPPORTED The TCP driver does not support this operation. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_ROUTES)( - IN EFI_TCP4_PROTOCOL *This, - IN BOOLEAN DeleteRoute, - IN EFI_IPv4_ADDRESS *SubnetAddress, - IN EFI_IPv4_ADDRESS *SubnetMask, - IN EFI_IPv4_ADDRESS *GatewayAddress - ); - -/** - Initiate a nonblocking TCP connection request for an active TCP instance. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param ConnectionToken The pointer to the connection token to return when the TCP three - way handshake finishes. - - @retval EFI_SUCCESS The connection request is successfully initiated and the state - of this TCPv4 instance has been changed to Tcp4StateSynSent. - @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured. - @retval EFI_ACCESS_DENIED One or more of the following conditions are TRUE: - - This instance is not configured as an active one. - - This instance is not in Tcp4StateClosed state. - @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: - - This is NULL. - - ConnectionToken is NULL. - - ConnectionToken->CompletionToken.Event is NULL. - @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to initiate the activ eopen. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_CONNECT)( - IN EFI_TCP4_PROTOCOL *This, - IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken - ); - - -/** - Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param ListenToken The pointer to the listen token to return when operation finishes. - - @retval EFI_SUCCESS The listen token has been queued successfully. - @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured. - @retval EFI_ACCESS_DENIED One or more of the following are TRUE: - - This instance is not a passive instance. - - This instance is not in Tcp4StateListen state. - - The same listen token has already existed in the listen - token queue of this TCP instance. - @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: - - This is NULL. - - ListenToken is NULL. - - ListentToken->CompletionToken.Event is NULL. - @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation. - @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_ACCEPT)( - IN EFI_TCP4_PROTOCOL *This, - IN EFI_TCP4_LISTEN_TOKEN *ListenToken - ); - -/** - Queues outgoing data into the transmit queue. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param Token The pointer to the completion token to queue to the transmit queue. - - @retval EFI_SUCCESS The data has been queued for transmission. - @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: - - This is NULL. - - Token is NULL. - - Token->CompletionToken.Event is NULL. - - Token->Packet.TxData is NULL L. - - Token->Packet.FragmentCount is zero. - - Token->Packet.DataLength is not equal to the sum of fragment lengths. - @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE: - - A transmit completion token with the same Token->CompletionToken.Event - was already in the transmission queue. - - The current instance is in Tcp4StateClosed state. - - The current instance is a passive one and it is in - Tcp4StateListen state. - - User has called Close() to disconnect this connection. - @retval EFI_NOT_READY The completion token could not be queued because the - transmit queue is full. - @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data because of resource - shortage. - @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_TRANSMIT)( - IN EFI_TCP4_PROTOCOL *This, - IN EFI_TCP4_IO_TOKEN *Token - ); - - -/** - Places an asynchronous receive request into the receiving queue. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param Token The pointer to a token that is associated with the receive data - descriptor. - - @retval EFI_SUCCESS The receive completion token was cached. - @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP, - etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - Token is NULL. - - Token->CompletionToken.Event is NULL. - - Token->Packet.RxData is NULL. - - Token->Packet.RxData->DataLength is 0. - - The Token->Packet.RxData->DataLength is not - the sum of all FragmentBuffer length in FragmentTable. - @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of - system resources (usually memory). - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_ACCESS_DENIED One or more of the following conditions is TRUE: - - A receive completion token with the same Token- - >CompletionToken.Event was already in the receive - queue. - - The current instance is in Tcp4StateClosed state. - - The current instance is a passive one and it is in - Tcp4StateListen state. - - User has called Close() to disconnect this connection. - @retval EFI_CONNECTION_FIN The communication peer has closed the connection and there is - no any buffered data in the receive buffer of this instance. - @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_RECEIVE)( - IN EFI_TCP4_PROTOCOL *This, - IN EFI_TCP4_IO_TOKEN *Token - ); - -/** - Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a - nonblocking operation. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param CloseToken The pointer to the close token to return when operation finishes. - - @retval EFI_SUCCESS The Close() is called successfully. - @retval EFI_NOT_STARTED This EFI TCPv4 Protocol instance has not been configured. - @retval EFI_ACCESS_DENIED One or more of the following are TRUE: - - Configure() has been called with - TcpConfigData set to NULL and this function has - not returned. - - Previous Close() call on this instance has not - finished. - @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: - - This is NULL. - - CloseToken is NULL. - - CloseToken->CompletionToken.Event is NULL. - @retval EFI_OUT_OF_RESOURCES Could not allocate enough resource to finish the operation. - @retval EFI_DEVICE_ERROR Any unexpected and not belonged to above category error. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_CLOSE)( - IN EFI_TCP4_PROTOCOL *This, - IN EFI_TCP4_CLOSE_TOKEN *CloseToken - ); - -/** - Abort an asynchronous connection, listen, transmission or receive request. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - @param Token The pointer to a token that has been issued by - EFI_TCP4_PROTOCOL.Connect(), - EFI_TCP4_PROTOCOL.Accept(), - EFI_TCP4_PROTOCOL.Transmit() or - EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending - tokens issued by above four functions will be aborted. Type - EFI_TCP4_COMPLETION_TOKEN is defined in - EFI_TCP4_PROTOCOL.Connect(). - - @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event - is signaled. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_STARTED This instance hasn't been configured. - @retval EFI_NO_MAPPING When using the default address, configuration - (DHCP, BOOTP,RARP, etc.) hasn't finished yet. - @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the - transmission or receive queue. It has either - completed or wasn't issued by Transmit() and Receive(). - @retval EFI_UNSUPPORTED The implementation does not support this function. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_CANCEL)( - IN EFI_TCP4_PROTOCOL *This, - IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL - ); - - -/** - Poll to receive incoming data and transmit outgoing segments. - - @param This The pointer to the EFI_TCP4_PROTOCOL instance. - - @retval EFI_SUCCESS Incoming or outgoing data was processed. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_NOT_READY No incoming or outgoing data is processed. - @retval EFI_TIMEOUT Data was dropped out of the transmission or receive queue. - Consider increasing the polling rate. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_TCP4_POLL)( - IN EFI_TCP4_PROTOCOL *This - ); - -/// -/// The EFI_TCP4_PROTOCOL defines the EFI TCPv4 Protocol child to be used by -/// any network drivers or applications to send or receive data stream. -/// It can either listen on a specified port as a service or actively connected -/// to remote peer as a client. Each instance has its own independent settings, -/// such as the routing table. -/// -struct _EFI_TCP4_PROTOCOL { - EFI_TCP4_GET_MODE_DATA GetModeData; - EFI_TCP4_CONFIGURE Configure; - EFI_TCP4_ROUTES Routes; - EFI_TCP4_CONNECT Connect; - EFI_TCP4_ACCEPT Accept; - EFI_TCP4_TRANSMIT Transmit; - EFI_TCP4_RECEIVE Receive; - EFI_TCP4_CLOSE Close; - EFI_TCP4_CANCEL Cancel; - EFI_TCP4_POLL Poll; -}; - -extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid; -extern EFI_GUID gEfiTcp4ProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Udp4.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Udp4.h deleted file mode 100644 index 3c61db8c2..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/Udp4.h +++ /dev/null @@ -1,447 +0,0 @@ -/** @file - UDP4 Service Binding Protocol as defined in UEFI specification. - - The EFI UDPv4 Protocol provides simple packet-oriented services - to transmit and receive UDP packets. - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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: - This Protocol is introduced in UEFI Specification 2.0. - -**/ - -#ifndef __EFI_UDP4_PROTOCOL_H__ -#define __EFI_UDP4_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Protocol/Ip4.h> -// -//GUID definitions -// -#define EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID \ - { \ - 0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } \ - } - -#define EFI_UDP4_PROTOCOL_GUID \ - { \ - 0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \ - } - -typedef struct _EFI_UDP4_PROTOCOL EFI_UDP4_PROTOCOL; - -/// -/// EFI_UDP4_SERVICE_POINT is deprecated in the UEFI 2.4B and should not be used any more. -/// The definition in here is only present to provide backwards compatability. -/// -typedef struct { - EFI_HANDLE InstanceHandle; - EFI_IPv4_ADDRESS LocalAddress; - UINT16 LocalPort; - EFI_IPv4_ADDRESS RemoteAddress; - UINT16 RemotePort; -} EFI_UDP4_SERVICE_POINT; - -/// -/// EFI_UDP4_VARIABLE_DATA is deprecated in the UEFI 2.4B and should not be used any more. -/// The definition in here is only present to provide backwards compatability. -/// -typedef struct { - EFI_HANDLE DriverHandle; - UINT32 ServiceCount; - EFI_UDP4_SERVICE_POINT Services[1]; -} EFI_UDP4_VARIABLE_DATA; - -typedef struct { - UINT32 FragmentLength; - VOID *FragmentBuffer; -} EFI_UDP4_FRAGMENT_DATA; - -typedef struct { - EFI_IPv4_ADDRESS SourceAddress; - UINT16 SourcePort; - EFI_IPv4_ADDRESS DestinationAddress; - UINT16 DestinationPort; -} EFI_UDP4_SESSION_DATA; -typedef struct { - // - // Receiving Filters - // - BOOLEAN AcceptBroadcast; - BOOLEAN AcceptPromiscuous; - BOOLEAN AcceptAnyPort; - BOOLEAN AllowDuplicatePort; - // - // I/O parameters - // - UINT8 TypeOfService; - UINT8 TimeToLive; - BOOLEAN DoNotFragment; - UINT32 ReceiveTimeout; - UINT32 TransmitTimeout; - // - // Access Point - // - BOOLEAN UseDefaultAddress; - EFI_IPv4_ADDRESS StationAddress; - EFI_IPv4_ADDRESS SubnetMask; - UINT16 StationPort; - EFI_IPv4_ADDRESS RemoteAddress; - UINT16 RemotePort; -} EFI_UDP4_CONFIG_DATA; - -typedef struct { - EFI_UDP4_SESSION_DATA *UdpSessionData; //OPTIONAL - EFI_IPv4_ADDRESS *GatewayAddress; //OPTIONAL - UINT32 DataLength; - UINT32 FragmentCount; - EFI_UDP4_FRAGMENT_DATA FragmentTable[1]; -} EFI_UDP4_TRANSMIT_DATA; - -typedef struct { - EFI_TIME TimeStamp; - EFI_EVENT RecycleSignal; - EFI_UDP4_SESSION_DATA UdpSession; - UINT32 DataLength; - UINT32 FragmentCount; - EFI_UDP4_FRAGMENT_DATA FragmentTable[1]; -} EFI_UDP4_RECEIVE_DATA; - - -typedef struct { - EFI_EVENT Event; - EFI_STATUS Status; - union { - EFI_UDP4_RECEIVE_DATA *RxData; - EFI_UDP4_TRANSMIT_DATA *TxData; - } Packet; -} EFI_UDP4_COMPLETION_TOKEN; - -/** - Reads the current operational settings. - - The GetModeData() function copies the current operational settings of this EFI - UDPv4 Protocol instance into user-supplied buffers. This function is used - optionally to retrieve the operational mode data of underlying networks or - drivers. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - @param Udp4ConfigData The pointer to the buffer to receive the current configuration data. - @param Ip4ModeData The pointer to the EFI IPv4 Protocol mode data structure. - @param MnpConfigData The pointer to the managed network configuration data structure. - @param SnpModeData The pointer to the simple network mode data structure. - - @retval EFI_SUCCESS The mode data was read. - @retval EFI_NOT_STARTED When Udp4ConfigData is queried, no configuration data is - available because this instance has not been started. - @retval EFI_INVALID_PARAMETER This is NULL. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_GET_MODE_DATA)( - IN EFI_UDP4_PROTOCOL *This, - OUT EFI_UDP4_CONFIG_DATA *Udp4ConfigData OPTIONAL, - OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL, - OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, - OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL - ); - - -/** - Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv4 - Protocol. - - The Configure() function is used to do the following: - * Initialize and start this instance of the EFI UDPv4 Protocol. - * Change the filtering rules and operational parameters. - * Reset this instance of the EFI UDPv4 Protocol. - Until these parameters are initialized, no network traffic can be sent or - received by this instance. This instance can be also reset by calling Configure() - with UdpConfigData set to NULL. Once reset, the receiving queue and transmitting - queue are flushed and no traffic is allowed through this instance. - With different parameters in UdpConfigData, Configure() can be used to bind - this instance to specified port. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - @param Udp4ConfigData The pointer to the buffer to receive the current configuration data. - - @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_INVALID_PARAMETER UdpConfigData.StationAddress is not a valid unicast IPv4 address. - @retval EFI_INVALID_PARAMETER UdpConfigData.SubnetMask is not a valid IPv4 address mask. The subnet - mask must be contiguous. - @retval EFI_INVALID_PARAMETER UdpConfigData.RemoteAddress is not a valid unicast IPv4 address if it - is not zero. - @retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured - and must be stopped/reset before it can be reconfigured. - @retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE - and UdpConfigData.StationPort is already used by - other instance. - @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this - EFI UDPv4 Protocol instance. - @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance - was not opened. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_CONFIGURE)( - IN EFI_UDP4_PROTOCOL *This, - IN EFI_UDP4_CONFIG_DATA *UdpConfigData OPTIONAL - ); - -/** - Joins and leaves multicast groups. - - The Groups() function is used to enable and disable the multicast group - filtering. If the JoinFlag is FALSE and the MulticastAddress is NULL, then all - currently joined groups are left. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - @param JoinFlag Set to TRUE to join a multicast group. Set to FALSE to leave one - or all multicast groups. - @param MulticastAddress The pointer to multicast group address to join or leave. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE: - - This is NULL. - - JoinFlag is TRUE and MulticastAddress is NULL. - - JoinFlag is TRUE and *MulticastAddress is not - a valid multicast address. - @retval EFI_ALREADY_STARTED The group address is already in the group table (when - JoinFlag is TRUE). - @retval EFI_NOT_FOUND The group address is not in the group table (when JoinFlag is - FALSE). - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_GROUPS)( - IN EFI_UDP4_PROTOCOL *This, - IN BOOLEAN JoinFlag, - IN EFI_IPv4_ADDRESS *MulticastAddress OPTIONAL - ); - -/** - Adds and deletes routing table entries. - - The Routes() function adds a route to or deletes a route from the routing table. - Routes are determined by comparing the SubnetAddress with the destination IP - address and arithmetically AND-ing it with the SubnetMask. The gateway address - must be on the same subnet as the configured station address. - The default route is added with SubnetAddress and SubnetMask both set to 0.0.0.0. - The default route matches all destination IP addresses that do not match any - other routes. - A zero GatewayAddress is a nonroute. Packets are sent to the destination IP - address if it can be found in the Address Resolution Protocol (ARP) cache or - on the local subnet. One automatic nonroute entry will be inserted into the - routing table for outgoing packets that are addressed to a local subnet - (gateway address of 0.0.0.0). - Each instance of the EFI UDPv4 Protocol has its own independent routing table. - Instances of the EFI UDPv4 Protocol that use the default IP address will also - have copies of the routing table provided by the EFI_IP4_CONFIG_PROTOCOL. These - copies will be updated automatically whenever the IP driver reconfigures its - instances; as a result, the previous modification to these copies will be lost. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - @param DeleteRoute Set to TRUE to delete this route from the routing table. - Set to FALSE to add this route to the routing table. - @param SubnetAddress The destination network address that needs to be routed. - @param SubnetMask The subnet mask of SubnetAddress. - @param GatewayAddress The gateway IP address for this route. - - @retval EFI_SUCCESS The operation completed successfully. - @retval EFI_NOT_STARTED The EFI UDPv4 Protocol instance has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table. - @retval EFI_NOT_FOUND This route is not in the routing table. - @retval EFI_ACCESS_DENIED The route is already defined in the routing table. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_ROUTES)( - IN EFI_UDP4_PROTOCOL *This, - IN BOOLEAN DeleteRoute, - IN EFI_IPv4_ADDRESS *SubnetAddress, - IN EFI_IPv4_ADDRESS *SubnetMask, - IN EFI_IPv4_ADDRESS *GatewayAddress - ); - -/** - Polls for incoming data packets and processes outgoing data packets. - - The Poll() function can be used by network drivers and applications to increase - the rate that data packets are moved between the communications device and the - transmit and receive queues. - In some systems, the periodic timer event in the managed network driver may not - poll the underlying communications device fast enough to transmit and/or receive - all data packets without missing incoming packets or dropping outgoing packets. - Drivers and applications that are experiencing packet loss should try calling - the Poll() function more often. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - - @retval EFI_SUCCESS Incoming or outgoing data was processed. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive queue. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_POLL)( - IN EFI_UDP4_PROTOCOL *This - ); - -/** - Places an asynchronous receive request into the receiving queue. - - The Receive() function places a completion token into the receive packet queue. - This function is always asynchronous. - The caller must fill in the Token.Event field in the completion token, and this - field cannot be NULL. When the receive operation completes, the EFI UDPv4 Protocol - driver updates the Token.Status and Token.Packet.RxData fields and the Token.Event - is signaled. Providing a proper notification function and context for the event - will enable the user to receive the notification and receiving status. That - notification function is guaranteed to not be re-entered. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - @param Token The pointer to a token that is associated with the receive data - descriptor. - - @retval EFI_SUCCESS The receive completion token was cached. - @retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, RARP, etc.) - is not finished yet. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_INVALID_PARAMETER Token is NULL. - @retval EFI_INVALID_PARAMETER Token.Event is NULL. - @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of system - resources (usually memory). - @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. - @retval EFI_ACCESS_DENIED A receive completion token with the same Token.Event was already in - the receive queue. - @retval EFI_NOT_READY The receive request could not be queued because the receive queue is full. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_RECEIVE)( - IN EFI_UDP4_PROTOCOL *This, - IN EFI_UDP4_COMPLETION_TOKEN *Token - ); - -/** - Queues outgoing data packets into the transmit queue. - - The Transmit() function places a sending request to this instance of the EFI - UDPv4 Protocol, alongside the transmit data that was filled by the user. Whenever - the packet in the token is sent out or some errors occur, the Token.Event will - be signaled and Token.Status is updated. Providing a proper notification function - and context for the event will enable the user to receive the notification and - transmitting status. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - @param Token The pointer to the completion token that will be placed into the - transmit queue. - - @retval EFI_SUCCESS The data has been queued for transmission. - @retval EFI_NOT_STARTED This EFI UDPv4 Protocol instance has not been started. - @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_INVALID_PARAMETER One or more parameters are invalid. - @retval EFI_ACCESS_DENIED The transmit completion token with the same - Token.Event was already in the transmit queue. - @retval EFI_NOT_READY The completion token could not be queued because the - transmit queue is full. - @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data. - @retval EFI_NOT_FOUND There is no route to the destination network or address. - @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP packet - size. Or the length of the IP header + UDP header + data - length is greater than MTU if DoNotFragment is TRUE. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_TRANSMIT)( - IN EFI_UDP4_PROTOCOL *This, - IN EFI_UDP4_COMPLETION_TOKEN *Token - ); - -/** - Aborts an asynchronous transmit or receive request. - - The Cancel() function is used to abort a pending transmit or receive request. - If the token is in the transmit or receive request queues, after calling this - function, Token.Status will be set to EFI_ABORTED and then Token.Event will be - signaled. If the token is not in one of the queues, which usually means that - the asynchronous operation has completed, this function will not signal the - token and EFI_NOT_FOUND is returned. - - @param This The pointer to the EFI_UDP4_PROTOCOL instance. - @param Token The pointer to a token that has been issued by - EFI_UDP4_PROTOCOL.Transmit() or - EFI_UDP4_PROTOCOL.Receive().If NULL, all pending - tokens are aborted. - - @retval EFI_SUCCESS The asynchronous I/O request was aborted and Token.Event - was signaled. When Token is NULL, all pending requests are - aborted and their events are signaled. - @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_STARTED This instance has not been started. - @retval EFI_NO_MAPPING When using the default address, configuration (DHCP, BOOTP, - RARP, etc.) is not finished yet. - @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O request was - not found in the transmit or receive queue. It has either completed - or was not issued by Transmit() and Receive(). - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_UDP4_CANCEL)( - IN EFI_UDP4_PROTOCOL *This, - IN EFI_UDP4_COMPLETION_TOKEN *Token OPTIONAL - ); - -/// -/// The EFI_UDP4_PROTOCOL defines an EFI UDPv4 Protocol session that can be used -/// by any network drivers, applications, or daemons to transmit or receive UDP packets. -/// This protocol instance can either be bound to a specified port as a service or -/// connected to some remote peer as an active client. Each instance has its own settings, -/// such as the routing table and group table, which are independent from each other. -/// -struct _EFI_UDP4_PROTOCOL { - EFI_UDP4_GET_MODE_DATA GetModeData; - EFI_UDP4_CONFIGURE Configure; - EFI_UDP4_GROUPS Groups; - EFI_UDP4_ROUTES Routes; - EFI_UDP4_TRANSMIT Transmit; - EFI_UDP4_RECEIVE Receive; - EFI_UDP4_CANCEL Cancel; - EFI_UDP4_POLL Poll; -}; - -extern EFI_GUID gEfiUdp4ServiceBindingProtocolGuid; -extern EFI_GUID gEfiUdp4ProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/VlanConfig.h b/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/VlanConfig.h deleted file mode 100644 index 928faded2..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Protocol/VlanConfig.h +++ /dev/null @@ -1,145 +0,0 @@ -/** @file - EFI VLAN Config protocol is to provide manageability interface for VLAN configuration. - - Copyright (c) 2009, Intel Corporation. All rights reserved.<BR> - 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: - This Protocol is introduced in UEFI Specification 2.2 - -**/ - -#ifndef __EFI_VLANCONFIG_PROTOCOL_H__ -#define __EFI_VLANCONFIG_PROTOCOL_H__ - -FILE_LICENCE ( BSD3 ); - - -#define EFI_VLAN_CONFIG_PROTOCOL_GUID \ - { \ - 0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74 } \ - } - -typedef struct _EFI_VLAN_CONFIG_PROTOCOL EFI_VLAN_CONFIG_PROTOCOL; - - -/// -/// EFI_VLAN_FIND_DATA -/// -typedef struct { - UINT16 VlanId; ///< Vlan Identifier. - UINT8 Priority; ///< Priority of this VLAN. -} EFI_VLAN_FIND_DATA; - - -/** - Create a VLAN device or modify the configuration parameter of an - already-configured VLAN. - - The Set() function is used to create a new VLAN device or change the VLAN - configuration parameters. If the VlanId hasn't been configured in the - physical Ethernet device, a new VLAN device will be created. If a VLAN with - this VlanId is already configured, then related configuration will be updated - as the input parameters. - - If VlanId is zero, the VLAN device will send and receive untagged frames. - Otherwise, the VLAN device will send and receive VLAN-tagged frames containing the VlanId. - If VlanId is out of scope of (0-4094), EFI_INVALID_PARAMETER is returned. - If Priority is out of the scope of (0-7), then EFI_INVALID_PARAMETER is returned. - If there is not enough system memory to perform the registration, then - EFI_OUT_OF_RESOURCES is returned. - - @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL. - @param[in] VlanId A unique identifier (1-4094) of the VLAN which is being created - or modified, or zero (0). - @param[in] Priority 3 bit priority in VLAN header. Priority 0 is default value. If - VlanId is zero (0), Priority is ignored. - - @retval EFI_SUCCESS The VLAN is successfully configured. - @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE: - - This is NULL. - - VlanId is an invalid VLAN Identifier. - - Priority is invalid. - @retval EFI_OUT_OF_RESOURCES There is not enough system memory to perform the registration. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_VLAN_CONFIG_SET)( - IN EFI_VLAN_CONFIG_PROTOCOL *This, - IN UINT16 VlanId, - IN UINT8 Priority - ); - -/** - Find configuration information for specified VLAN or all configured VLANs. - - The Find() function is used to find the configuration information for matching - VLAN and allocate a buffer into which those entries are copied. - - @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL. - @param[in] VlanId Pointer to VLAN identifier. Set to NULL to find all - configured VLANs. - @param[out] NumberOfVlan The number of VLANs which is found by the specified criteria. - @param[out] Entries The buffer which receive the VLAN configuration. - - @retval EFI_SUCCESS The VLAN is successfully found. - @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE: - - This is NULL. - - Specified VlanId is invalid. - @retval EFI_NOT_FOUND No matching VLAN is found. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_VLAN_CONFIG_FIND)( - IN EFI_VLAN_CONFIG_PROTOCOL *This, - IN UINT16 *VlanId OPTIONAL, - OUT UINT16 *NumberOfVlan, - OUT EFI_VLAN_FIND_DATA **Entries - ); - -/** - Remove the configured VLAN device. - - The Remove() function is used to remove the specified VLAN device. - If the VlanId is out of the scope of (0-4094), EFI_INVALID_PARAMETER is returned. - If specified VLAN hasn't been previously configured, EFI_NOT_FOUND is returned. - - @param[in] This Points to the EFI_VLAN_CONFIG_PROTOCOL. - @param[in] VlanId Identifier (0-4094) of the VLAN to be removed. - - @retval EFI_SUCCESS The VLAN is successfully removed. - @retval EFI_INVALID_PARAMETER One or more of following conditions is TRUE: - - This is NULL. - - VlanId is an invalid parameter. - @retval EFI_NOT_FOUND The to-be-removed VLAN does not exist. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_VLAN_CONFIG_REMOVE)( - IN EFI_VLAN_CONFIG_PROTOCOL *This, - IN UINT16 VlanId - ); - -/// -/// EFI_VLAN_CONFIG_PROTOCOL -/// provide manageability interface for VLAN setting. The intended -/// VLAN tagging implementation is IEEE802.1Q. -/// -struct _EFI_VLAN_CONFIG_PROTOCOL { - EFI_VLAN_CONFIG_SET Set; - EFI_VLAN_CONFIG_FIND Find; - EFI_VLAN_CONFIG_REMOVE Remove; -}; - -extern EFI_GUID gEfiVlanConfigProtocolGuid; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi.h b/qemu/roms/ipxe/src/include/ipxe/efi/Uefi.h deleted file mode 100644 index a5a25a9c4..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi.h +++ /dev/null @@ -1,29 +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 - 2010, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Uefi/UefiBaseType.h> -#include <ipxe/efi/Uefi/UefiSpec.h> - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiBaseType.h b/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiBaseType.h deleted file mode 100644 index 371dae649..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiBaseType.h +++ /dev/null @@ -1,303 +0,0 @@ -/** @file - Defines data types and constants introduced in UEFI. - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR> - -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Base.h> - -// -// Basic 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; - -/// -/// 64-bit physical memory address. -/// -typedef UINT64 EFI_PHYSICAL_ADDRESS; - -/// -/// 64-bit virtual memory address. -/// -typedef UINT64 EFI_VIRTUAL_ADDRESS; - -/// -/// EFI Time Abstraction: -/// Year: 1900 - 9999 -/// 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_COMPROMISED_DATA RETURN_COMPROMISED_DATA - -#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 EFI_WARN_STALE_DATA RETURN_WARN_STALE_DATA -///@} - -/// -/// Define macro to encode the status code. -/// -#define EFIERR(_a) ENCODE_ERROR(_a) - -#define EFI_ERROR(A) RETURN_ERROR(A) - -/// -/// ICMP error definitions -///@{ -#define EFI_NETWORK_UNREACHABLE EFIERR(100) -#define EFI_HOST_UNREACHABLE EFIERR(101) -#define EFI_PROTOCOL_UNREACHABLE EFIERR(102) -#define EFI_PORT_UNREACHABLE EFIERR(103) -///@} - -/// -/// Tcp connection status definitions -///@{ -#define EFI_CONNECTION_FIN EFIERR(104) -#define EFI_CONNECTION_RESET EFIERR(105) -#define EFI_CONNECTION_REFUSED EFIERR(106) -///@} - -// -// The EFI memory allocation functions work in units of EFI_PAGEs that are -// 4KB. 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 SIZE_4KB -#define EFI_PAGE_MASK 0xFFF -#define EFI_PAGE_SHIFT 12 - -/** - Macro that converts a size, in bytes, to a number of EFI_PAGESs. - - @param Size A size in bytes. This parameter is assumed to be type UINTN. - Passing in a parameter that is larger than UINTN may produce - unexpected results. - - @return The number of EFI_PAGESs associated with the number of bytes specified - by Size. - -**/ -#define EFI_SIZE_TO_PAGES(Size) (((Size) >> EFI_PAGE_SHIFT) + (((Size) & EFI_PAGE_MASK) ? 1 : 0)) - -/** - Macro that converts a number of EFI_PAGEs to a size in bytes. - - @param Pages The number of EFI_PAGES. This parameter is assumed to be - type UINTN. Passing in a parameter that is larger than - UINTN may produce unexpected results. - - @return The number of bytes associated with the number of EFI_PAGEs specified - by Pages. - -**/ -#define EFI_PAGES_TO_SIZE(Pages) ((Pages) << EFI_PAGE_SHIFT) - -/// -/// PE32+ Machine type for IA32 UEFI images. -/// -#define EFI_IMAGE_MACHINE_IA32 0x014C - -/// -/// PE32+ Machine type for IA64 UEFI images. -/// -#define EFI_IMAGE_MACHINE_IA64 0x0200 - -/// -/// PE32+ Machine type for EBC UEFI images. -/// -#define EFI_IMAGE_MACHINE_EBC 0x0EBC - -/// -/// PE32+ Machine type for X64 UEFI images. -/// -#define EFI_IMAGE_MACHINE_X64 0x8664 - -/// -/// PE32+ Machine type for ARM mixed ARM and Thumb/Thumb2 images. -/// -#define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED 0x01C2 - -/// -/// PE32+ Machine type for AARCH64 A64 images. -/// -#define EFI_IMAGE_MACHINE_AARCH64 0xAA64 - - -#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) - -#elif defined (MDE_CPU_IPF) - -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ - (((Machine) == EFI_IMAGE_MACHINE_IA64) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) - -#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) - -#elif defined (MDE_CPU_ARM) - -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ - (((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED) - -#elif defined (MDE_CPU_AARCH64) - -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \ - (((Machine) == EFI_IMAGE_MACHINE_AARCH64) || ((Machine) == EFI_IMAGE_MACHINE_EBC)) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) - -#elif defined (MDE_CPU_EBC) - -/// -/// This is just to make sure you can cross compile with the EBC compiler. -/// It does not make sense to have a PE loader coded in EBC. -/// -#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC) - -#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE) - -#else -#error Unknown Processor Type -#endif - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiGpt.h b/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiGpt.h deleted file mode 100644 index 19acf55d4..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiGpt.h +++ /dev/null @@ -1,143 +0,0 @@ -/** @file - EFI Guid Partition Table Format Definition. - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -/// -/// 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 SIGNATURE_64 ('E','F','I',' ','P','A','R','T') - -#pragma pack(1) - -/// -/// GPT Partition Table Header. -/// -typedef struct { - /// - /// The table header for the GPT partition Table. - /// This header contains EFI_PTAB_HEADER_ID. - /// - EFI_TABLE_HEADER Header; - /// - /// The LBA that contains this data structure. - /// - EFI_LBA MyLBA; - /// - /// LBA address of the alternate GUID Partition Table Header. - /// - EFI_LBA AlternateLBA; - /// - /// The first usable logical block that may be used - /// by a partition described by a GUID Partition Entry. - /// - EFI_LBA FirstUsableLBA; - /// - /// The last usable logical block that may be used - /// by a partition described by a GUID Partition Entry. - /// - EFI_LBA LastUsableLBA; - /// - /// GUID that can be used to uniquely identify the disk. - /// - EFI_GUID DiskGUID; - /// - /// The starting LBA of the GUID Partition Entry array. - /// - EFI_LBA PartitionEntryLBA; - /// - /// The number of Partition Entries in the GUID Partition Entry array. - /// - UINT32 NumberOfPartitionEntries; - /// - /// The size, in bytes, of each the GUID Partition - /// Entry structures in the GUID Partition Entry - /// array. This field shall be set to a value of 128 x 2^n where n is - /// an integer greater than or equal to zero (e.g., 128, 256, 512, etc.). - /// - UINT32 SizeOfPartitionEntry; - /// - /// The CRC32 of the GUID Partition Entry array. - /// Starts at PartitionEntryLBA and is - /// computed over a byte length of - /// NumberOfPartitionEntries * SizeOfPartitionEntry. - /// - UINT32 PartitionEntryArrayCRC32; -} EFI_PARTITION_TABLE_HEADER; - -/// -/// GPT Partition Entry. -/// -typedef struct { - /// - /// Unique ID that defines the purpose and type of this Partition. A value of - /// zero defines that this partition entry is not being used. - /// - EFI_GUID PartitionTypeGUID; - /// - /// GUID that is unique for every partition entry. Every partition ever - /// created will have a unique GUID. - /// This GUID must be assigned when the GUID Partition Entry is created. - /// - EFI_GUID UniquePartitionGUID; - /// - /// Starting LBA of the partition defined by this entry - /// - EFI_LBA StartingLBA; - /// - /// Ending LBA of the partition defined by this entry. - /// - EFI_LBA EndingLBA; - /// - /// Attribute bits, all bits reserved by UEFI - /// Bit 0: If this bit is set, the partition is required for the platform to function. The owner/creator of the - /// partition indicates that deletion or modification of the contents can result in loss of platform - /// features or failure for the platform to boot or operate. The system cannot function normally if - /// this partition is removed, and it should be considered part of the hardware of the system. - /// Actions such as running diagnostics, system recovery, or even OS install or boot, could - /// potentially stop working if this partition is removed. Unless OS software or firmware - /// recognizes this partition, it should never be removed or modified as the UEFI firmware or - /// platform hardware may become non-functional. - /// Bit 1: If this bit is set, then firmware must not produce an EFI_BLOCK_IO_PROTOCOL device for - /// this partition. By not producing an EFI_BLOCK_IO_PROTOCOL partition, file system - /// mappings will not be created for this partition in UEFI. - /// Bit 2: This bit is set aside to let systems with traditional PC-AT BIOS firmware implementations - /// inform certain limited, special-purpose software running on these systems that a GPT - /// partition may be bootable. The UEFI boot manager must ignore this bit when selecting - /// a UEFI-compliant application, e.g., an OS loader. - /// Bits 3-47: Undefined and must be zero. Reserved for expansion by future versions of the UEFI - /// specification. - /// Bits 48-63: Reserved for GUID specific use. The use of these bits will vary depending on the - /// PartitionTypeGUID. Only the owner of the PartitionTypeGUID is allowed - /// to modify these bits. They must be preserved if Bits 0-47 are modified.. - /// - UINT64 Attributes; - /// - /// Null-terminated name of the partition. - /// - CHAR16 PartitionName[36]; -} EFI_PARTITION_ENTRY; - -#pragma pack() -#endif - - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h b/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h deleted file mode 100644 index 19121dea7..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h +++ /dev/null @@ -1,2108 +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 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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 UEFI 2.1 and 2.2. - -**/ - -#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__ -#define __UEFI_INTERNAL_FORMREPRESENTATION_H__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Guid/HiiFormMapMethodGuid.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_ANIMATION_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_ANIMATIONS 0x0A -#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 -// - -/// -/// 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 -///@} - -/// -/// The EFI_NARROW_GLYPH has a preferred dimension (w x h) of 8 x 19 pixels. -/// -typedef struct { - /// - /// The Unicode representation of the glyph. The term weight is the - /// technical term for a character code. - /// - CHAR16 UnicodeWeight; - /// - /// The data element containing the glyph definitions. - /// - UINT8 Attributes; - /// - /// The column major glyph representation of the character. Bits - /// with values of one indicate that the corresponding pixel is to be - /// on when normally displayed; those with zero are off. - /// - UINT8 GlyphCol1[EFI_GLYPH_HEIGHT]; -} EFI_NARROW_GLYPH; - -/// -/// The EFI_WIDE_GLYPH has a preferred dimension (w x h) of 16 x 19 pixels, which is large enough -/// to accommodate logographic characters. -/// -typedef struct { - /// - /// The Unicode representation of the glyph. The term weight is the - /// technical term for a character code. - /// - CHAR16 UnicodeWeight; - /// - /// The data element containing the glyph definitions. - /// - UINT8 Attributes; - /// - /// The column major glyph representation of the character. Bits - /// with values of one indicate that the corresponding pixel is to be - /// on when normally displayed; those with zero are off. - /// - UINT8 GlyphCol1[EFI_GLYPH_HEIGHT]; - /// - /// The column major glyph representation of the character. Bits - /// with values of one indicate that the corresponding pixel is to be - /// on when normally displayed; those with zero are off. - /// - UINT8 GlyphCol2[EFI_GLYPH_HEIGHT]; - /// - /// Ensures that sizeof (EFI_WIDE_GLYPH) is twice the - /// sizeof (EFI_NARROW_GLYPH). The contents of Pad must - /// be zero. - /// - 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, -/// 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_HDR { - EFI_HII_PACKAGE_HEADER Header; - // EFI_DEVICE_PATH_PROTOCOL DevicePath[]; -} EFI_HII_DEVICE_PATH_PACKAGE_HDR; - -// -// 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 "x-UEFI" -#define UEFI_CONFIG_LANG_2 "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 Form package is used to carry form-based encoding data. -/// -typedef struct _EFI_HII_FORM_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - // EFI_IFR_OP_HEADER OpCodeHeader; - // More op-codes follow -} EFI_HII_FORM_PACKAGE_HDR; - -typedef struct { - UINT8 Hour; - UINT8 Minute; - UINT8 Second; -} EFI_HII_TIME; - -typedef struct { - UINT16 Year; - UINT8 Month; - UINT8 Day; -} EFI_HII_DATE; - -typedef struct { - EFI_QUESTION_ID QuestionId; - EFI_FORM_ID FormId; - EFI_GUID FormSetGuid; - EFI_STRING_ID DevicePath; -} EFI_HII_REF; - -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_STRING, EFI_IFR_TYPE_ACTION - EFI_HII_REF ref; ///< EFI_IFR_TYPE_REF - // UINT8 buffer[]; ///< EFI_IFR_TYPE_BUFFER -} 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_VAL_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_ANIMATION_OP 0x1F -#define EFI_IFR_TO_LOWER_OP 0x20 -#define EFI_IFR_TO_UPPER_OP 0x21 -#define EFI_IFR_MAP_OP 0x22 -#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_GET_OP 0x2B -#define EFI_IFR_SET_OP 0x2C -#define EFI_IFR_READ_OP 0x2D -#define EFI_IFR_WRITE_OP 0x2E -#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_FORM_MAP_OP 0x5D -#define EFI_IFR_CATENATE_OP 0x5E -#define EFI_IFR_GUID_OP 0x5F -#define EFI_IFR_SECURITY_OP 0x60 -#define EFI_IFR_MODAL_TAG_OP 0x61 -#define EFI_IFR_REFRESH_ID_OP 0x62 -#define EFI_IFR_WARNING_IF_OP 0x63 - -// -// 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; - UINT16 Size; - UINT8 Name[1]; -} 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; - UINT8 Flags; - // EFI_GUID ClassGuid[]; -} 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_MODAL_TAG { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_MODAL_TAG; - -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_DEFAULT_2 { - EFI_IFR_OP_HEADER Header; - UINT16 DefaultId; - UINT8 Type; -} EFI_IFR_DEFAULT_2; - -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_REF5 { - EFI_IFR_OP_HEADER Header; - EFI_IFR_QUESTION_HEADER Question; -} EFI_IFR_REF5; - -typedef struct _EFI_IFR_RESET_BUTTON { - EFI_IFR_OP_HEADER Header; - EFI_IFR_STATEMENT_HEADER Statement; - 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_WARNING_IF { - EFI_IFR_OP_HEADER Header; - EFI_STRING_ID Warning; - UINT8 TimeOut; -} EFI_IFR_WARNING_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_TYPE_UNDEFINED 0x09 -#define EFI_IFR_TYPE_ACTION 0x0A -#define EFI_IFR_TYPE_BUFFER 0x0B -#define EFI_IFR_TYPE_REF 0x0C - -#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_REFRESH_ID { - EFI_IFR_OP_HEADER Header; - EFI_GUID RefreshEventGroupId; -} EFI_IFR_REFRESH_ID; - -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_VAL_LIST { - EFI_IFR_OP_HEADER Header; - EFI_QUESTION_ID QuestionId; - UINT16 ListLength; - UINT16 ValueList[1]; -} EFI_IFR_EQ_ID_VAL_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; - -typedef struct _EFI_IFR_SECURITY { - /// - /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP. - /// - EFI_IFR_OP_HEADER Header; - /// - /// Security permission level. - /// - EFI_GUID Permissions; -} EFI_IFR_SECURITY; - -typedef struct _EFI_IFR_FORM_MAP_METHOD { - /// - /// The string identifier which provides the human-readable name of - /// the configuration method for this standards map form. - /// - EFI_STRING_ID MethodTitle; - /// - /// Identifier which uniquely specifies the configuration methods - /// associated with this standards map form. - /// - EFI_GUID MethodIdentifier; -} EFI_IFR_FORM_MAP_METHOD; - -typedef struct _EFI_IFR_FORM_MAP { - /// - /// The sequence that defines the type of opcode as well as the length - /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP. - /// - EFI_IFR_OP_HEADER Header; - /// - /// The unique identifier for this particular form. - /// - EFI_FORM_ID FormId; - /// - /// One or more configuration method's name and unique identifier. - /// - // EFI_IFR_FORM_MAP_METHOD Methods[]; -} EFI_IFR_FORM_MAP; - -typedef struct _EFI_IFR_SET { - /// - /// The sequence that defines the type of opcode as well as the length - /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP. - /// - EFI_IFR_OP_HEADER Header; - /// - /// Specifies the identifier of a previously declared variable store to - /// use when storing the question's value. - /// - EFI_VARSTORE_ID VarStoreId; - union { - /// - /// A 16-bit Buffer Storage offset. - /// - EFI_STRING_ID VarName; - /// - /// A Name Value or EFI Variable name (VarName). - /// - UINT16 VarOffset; - } VarStoreInfo; - /// - /// Specifies the type used for storage. - /// - UINT8 VarStoreType; -} EFI_IFR_SET; - -typedef struct _EFI_IFR_GET { - /// - /// The sequence that defines the type of opcode as well as the length - /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP. - /// - EFI_IFR_OP_HEADER Header; - /// - /// Specifies the identifier of a previously declared variable store to - /// use when retrieving the value. - /// - EFI_VARSTORE_ID VarStoreId; - union { - /// - /// A 16-bit Buffer Storage offset. - /// - EFI_STRING_ID VarName; - /// - /// A Name Value or EFI Variable name (VarName). - /// - UINT16 VarOffset; - } VarStoreInfo; - /// - /// Specifies the type used for storage. - /// - UINT8 VarStoreType; -} EFI_IFR_GET; - -typedef struct _EFI_IFR_READ { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_READ; - -typedef struct _EFI_IFR_WRITE { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_WRITE; - -typedef struct _EFI_IFR_MAP { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_MAP; -// -// Definitions for Keyboard Package -// Releated definitions are in Section of EFI_HII_DATABASE_PROTOCOL -// - -/// -/// Each enumeration values maps a physical key on a keyboard. -/// -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 { - /// - /// Used to describe a physical key on a keyboard. - /// - EFI_KEY Key; - /// - /// Unicode character code for the Key. - /// - CHAR16 Unicode; - /// - /// Unicode character code for the key with the shift key being held down. - /// - CHAR16 ShiftedUnicode; - /// - /// Unicode character code for the key with the Alt-GR being held down. - /// - CHAR16 AltGrUnicode; - /// - /// Unicode character code for the key with the Alt-GR and shift keys being held down. - /// - CHAR16 ShiftedAltGrUnicode; - /// - /// Modifier keys are defined to allow for special functionality that is not necessarily - /// accomplished by a printable character. Many of these modifier keys are flags to toggle - /// certain state bits on and off inside of a keyboard driver. - /// - 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 an "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 - -/// -/// Animation IFR opcode -/// -typedef struct _EFI_IFR_ANIMATION { - /// - /// Standard opcode header, where Header.OpCode is - /// EFI_IFR_ANIMATION_OP. - /// - EFI_IFR_OP_HEADER Header; - /// - /// Animation identifier in the HII database. - /// - EFI_ANIMATION_ID Id; -} EFI_IFR_ANIMATION; - -/// -/// HII animation package header. -/// -typedef struct _EFI_HII_ANIMATION_PACKAGE_HDR { - /// - /// Standard package header, where Header.Type = EFI_HII_PACKAGE_ANIMATIONS. - /// - EFI_HII_PACKAGE_HEADER Header; - /// - /// Offset, relative to this header, of the animation information. If - /// this is zero, then there are no animation sequences in the package. - /// - UINT32 AnimationInfoOffset; -} EFI_HII_ANIMATION_PACKAGE_HDR; - -/// -/// Animation information is encoded as a series of blocks, -/// with each block prefixed by a single byte header EFI_HII_ANIMATION_BLOCK. -/// -typedef struct _EFI_HII_ANIMATION_BLOCK { - UINT8 BlockType; - //UINT8 BlockBody[]; -} EFI_HII_ANIMATION_BLOCK; - -/// -/// Animation block types. -/// -#define EFI_HII_AIBT_END 0x00 -#define EFI_HII_AIBT_OVERLAY_IMAGES 0x10 -#define EFI_HII_AIBT_CLEAR_IMAGES 0x11 -#define EFI_HII_AIBT_RESTORE_SCRN 0x12 -#define EFI_HII_AIBT_OVERLAY_IMAGES_LOOP 0x18 -#define EFI_HII_AIBT_CLEAR_IMAGES_LOOP 0x19 -#define EFI_HII_AIBT_RESTORE_SCRN_LOOP 0x1A -#define EFI_HII_AIBT_DUPLICATE 0x20 -#define EFI_HII_AIBT_SKIP2 0x21 -#define EFI_HII_AIBT_SKIP1 0x22 -#define EFI_HII_AIBT_EXT1 0x30 -#define EFI_HII_AIBT_EXT2 0x31 -#define EFI_HII_AIBT_EXT4 0x32 - -/// -/// Extended block headers used for variable sized animation records -/// which need an explicit length. -/// - -typedef struct _EFI_HII_AIBT_EXT1_BLOCK { - /// - /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT1. - /// - EFI_HII_ANIMATION_BLOCK Header; - /// - /// The block type. - /// - UINT8 BlockType2; - /// - /// Size of the animation block, in bytes, including the animation block header. - /// - UINT8 Length; -} EFI_HII_AIBT_EXT1_BLOCK; - -typedef struct _EFI_HII_AIBT_EXT2_BLOCK { - /// - /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT2. - /// - EFI_HII_ANIMATION_BLOCK Header; - /// - /// The block type - /// - UINT8 BlockType2; - /// - /// Size of the animation block, in bytes, including the animation block header. - /// - UINT16 Length; -} EFI_HII_AIBT_EXT2_BLOCK; - -typedef struct _EFI_HII_AIBT_EXT4_BLOCK { - /// - /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT4. - /// - EFI_HII_ANIMATION_BLOCK Header; - /// - /// The block type - /// - UINT8 BlockType2; - /// - /// Size of the animation block, in bytes, including the animation block header. - /// - UINT32 Length; -} EFI_HII_AIBT_EXT4_BLOCK; - -typedef struct _EFI_HII_ANIMATION_CELL { - /// - /// The X offset from the upper left hand corner of the logical - /// window to position the indexed image. - /// - UINT16 OffsetX; - /// - /// The Y offset from the upper left hand corner of the logical - /// window to position the indexed image. - /// - UINT16 OffsetY; - /// - /// The image to display at the specified offset from the upper left - /// hand corner of the logical window. - /// - EFI_IMAGE_ID ImageId; - /// - /// The number of milliseconds to delay after displaying the indexed - /// image and before continuing on to the next linked image. If value - /// is zero, no delay. - /// - UINT16 Delay; -} EFI_HII_ANIMATION_CELL; - -/// -/// An animation block to describe an animation sequence that does not cycle, and -/// where one image is simply displayed over the previous image. -/// -typedef struct _EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK { - /// - /// This is image that is to be reference by the image protocols, if the - /// animation function is not supported or disabled. This image can - /// be one particular image from the animation sequence (if any one - /// of the animation frames has a complete image) or an alternate - /// image that can be displayed alone. If the value is zero, no image - /// is displayed. - /// - EFI_IMAGE_ID DftImageId; - /// - /// The overall width of the set of images (logical window width). - /// - UINT16 Width; - /// - /// The overall height of the set of images (logical window height). - /// - UINT16 Height; - /// - /// The number of EFI_HII_ANIMATION_CELL contained in the - /// animation sequence. - /// - UINT16 CellCount; - /// - /// An array of CellCount animation cells. - /// - EFI_HII_ANIMATION_CELL AnimationCell[1]; -} EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK; - -/// -/// An animation block to describe an animation sequence that does not cycle, -/// and where the logical window is cleared to the specified color before -/// the next image is displayed. -/// -typedef struct _EFI_HII_AIBT_CLEAR_IMAGES_BLOCK { - /// - /// This is image that is to be reference by the image protocols, if the - /// animation function is not supported or disabled. This image can - /// be one particular image from the animation sequence (if any one - /// of the animation frames has a complete image) or an alternate - /// image that can be displayed alone. If the value is zero, no image - /// is displayed. - /// - EFI_IMAGE_ID DftImageId; - /// - /// The overall width of the set of images (logical window width). - /// - UINT16 Width; - /// - /// The overall height of the set of images (logical window height). - /// - UINT16 Height; - /// - /// The number of EFI_HII_ANIMATION_CELL contained in the - /// animation sequence. - /// - UINT16 CellCount; - /// - /// The color to clear the logical window to before displaying the - /// indexed image. - /// - EFI_HII_RGB_PIXEL BackgndColor; - /// - /// An array of CellCount animation cells. - /// - EFI_HII_ANIMATION_CELL AnimationCell[1]; -} EFI_HII_AIBT_CLEAR_IMAGES_BLOCK; - -/// -/// An animation block to describe an animation sequence that does not cycle, -/// and where the screen is restored to the original state before the next -/// image is displayed. -/// -typedef struct _EFI_HII_AIBT_RESTORE_SCRN_BLOCK { - /// - /// This is image that is to be reference by the image protocols, if the - /// animation function is not supported or disabled. This image can - /// be one particular image from the animation sequence (if any one - /// of the animation frames has a complete image) or an alternate - /// image that can be displayed alone. If the value is zero, no image - /// is displayed. - /// - EFI_IMAGE_ID DftImageId; - /// - /// The overall width of the set of images (logical window width). - /// - UINT16 Width; - /// - /// The overall height of the set of images (logical window height). - /// - UINT16 Height; - /// - /// The number of EFI_HII_ANIMATION_CELL contained in the - /// animation sequence. - /// - UINT16 CellCount; - /// - /// An array of CellCount animation cells. - /// - EFI_HII_ANIMATION_CELL AnimationCell[1]; -} EFI_HII_AIBT_RESTORE_SCRN_BLOCK; - -/// -/// An animation block to describe an animation sequence that continuously cycles, -/// and where one image is simply displayed over the previous image. -/// -typedef EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK EFI_HII_AIBT_OVERLAY_IMAGES_LOOP_BLOCK; - -/// -/// An animation block to describe an animation sequence that continuously cycles, -/// and where the logical window is cleared to the specified color before -/// the next image is displayed. -/// -typedef EFI_HII_AIBT_CLEAR_IMAGES_BLOCK EFI_HII_AIBT_CLEAR_IMAGES_LOOP_BLOCK; - -/// -/// An animation block to describe an animation sequence that continuously cycles, -/// and where the screen is restored to the original state before -/// the next image is displayed. -/// -typedef EFI_HII_AIBT_RESTORE_SCRN_BLOCK EFI_HII_AIBT_RESTORE_SCRN_LOOP_BLOCK; - -/// -/// Assigns a new character value to a previously defined animation sequence. -/// -typedef struct _EFI_HII_AIBT_DUPLICATE_BLOCK { - /// - /// The previously defined animation ID with the exact same - /// animation information. - /// - EFI_ANIMATION_ID AnimationId; -} EFI_HII_AIBT_DUPLICATE_BLOCK; - -/// -/// Skips animation IDs. -/// -typedef struct _EFI_HII_AIBT_SKIP1_BLOCK { - /// - /// The unsigned 8-bit value to add to AnimationIdCurrent. - /// - UINT8 SkipCount; -} EFI_HII_AIBT_SKIP1_BLOCK; - -/// -/// Skips animation IDs. -/// -typedef struct _EFI_HII_AIBT_SKIP2_BLOCK { - /// - /// The unsigned 16-bit value to add to AnimationIdCurrent. - /// - UINT16 SkipCount; -} EFI_HII_AIBT_SKIP2_BLOCK; - -#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/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiMultiPhase.h b/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiMultiPhase.h deleted file mode 100644 index 678f3ebd6..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiMultiPhase.h +++ /dev/null @@ -1,195 +0,0 @@ -/** @file - This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases. - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Guid/WinCertificate.h> -/// -/// Enumeration of memory types introduced in UEFI. -/// -typedef enum { - /// - /// Not used. - /// - EfiReservedMemoryType, - /// - /// The code portions of a loaded application. - /// (Note that UEFI OS loaders are UEFI applications.) - /// - EfiLoaderCode, - /// - /// The data portions of a loaded application and the default data allocation - /// type used by an application to allocate pool memory. - /// - EfiLoaderData, - /// - /// The code portions of a loaded Boot Services Driver. - /// - EfiBootServicesCode, - /// - /// The data portions of a loaded Boot Serves Driver, and the default data - /// allocation type used by a Boot Services Driver to allocate pool memory. - /// - EfiBootServicesData, - /// - /// The code portions of a loaded Runtime Services Driver. - /// - EfiRuntimeServicesCode, - /// - /// The data portions of a loaded Runtime Services Driver and the default - /// data allocation type used by a Runtime Services Driver to allocate pool memory. - /// - EfiRuntimeServicesData, - /// - /// Free (unallocated) memory. - /// - EfiConventionalMemory, - /// - /// Memory in which errors have been detected. - /// - EfiUnusableMemory, - /// - /// Memory that holds the ACPI tables. - /// - EfiACPIReclaimMemory, - /// - /// Address space reserved for use by the firmware. - /// - EfiACPIMemoryNVS, - /// - /// Used by system firmware to request that a memory-mapped IO region - /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services. - /// - EfiMemoryMappedIO, - /// - /// System memory-mapped IO region that is used to translate memory - /// cycles to IO cycles by the processor. - /// - EfiMemoryMappedIOPortSpace, - /// - /// Address space reserved by the firmware for code that is part of the processor. - /// - EfiPalCode, - EfiMaxMemoryType -} EFI_MEMORY_TYPE; - -/// -/// Data structure that precedes all of the standard EFI table types. -/// -typedef struct { - /// - /// A 64-bit signature that identifies the type of table that follows. - /// Unique signatures have been generated for the EFI System Table, - /// the EFI Boot Services Table, and the EFI Runtime Services Table. - /// - UINT64 Signature; - /// - /// The revision of the EFI Specification to which this table - /// conforms. The upper 16 bits of this field contain the major - /// revision value, and the lower 16 bits contain the minor revision - /// value. The minor revision values are limited to the range of 00..99. - /// - UINT32 Revision; - /// - /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER. - /// - UINT32 HeaderSize; - /// - /// The 32-bit CRC for the entire table. This value is computed by - /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes. - /// - UINT32 CRC32; - /// - /// Reserved field that must be set to 0. - /// - 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 -/// -/// This attribute is identified by the mnemonic 'HR' -/// elsewhere in this specification. -/// -#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008 -/// -/// Attributes of Authenticated Variable -/// -#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010 -#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020 -#define EFI_VARIABLE_APPEND_WRITE 0x00000040 - - -/// -/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType -/// WIN_CERTIFICATE_UEFI_GUID and the CertType -/// EFI_CERT_TYPE_RSA2048_SHA256_GUID. 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; - -/// -/// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is -/// set, then the Data buffer shall begin with an instance of a complete (and serialized) -/// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new -/// variable value and DataSize shall reflect the combined size of the descriptor and the new -/// variable value. The authentication descriptor is not part of the variable data and is not -/// returned by subsequent calls to GetVariable(). -/// -typedef struct { - /// - /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and - /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT. - /// - EFI_TIME TimeStamp; - /// - /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted. - /// - WIN_CERTIFICATE_UEFI_GUID AuthInfo; - } EFI_VARIABLE_AUTHENTICATION_2; - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiPxe.h b/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiPxe.h deleted file mode 100644 index 5c0b2038f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiPxe.h +++ /dev/null @@ -1,1774 +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 - 2013, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#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 - -/// -/// Return current media status. -/// -#define PXE_OPFLAGS_GET_MEDIA_STATUS 0x0004 - -/// -/// 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 - -#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_MASK 0x0002 -#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_NOT_SUPPORTED 0x0000 -#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED 0x0002 - -/// -/// 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 - -/// -/// This flag is set if there is no media detected. -/// -#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA 0x0040 - -/// -/// 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 lower byte. - PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER. - PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER. - PXE_UINT8 IFcntExt; ///< physical connector count upper byte. - PXE_UINT8 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 lower byte. - PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER. - PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER. - PXE_UINT8 IFcntExt; ///< physical connector count upper byte. - PXE_UINT8 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/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiSpec.h b/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiSpec.h deleted file mode 100644 index 422b2f30e..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/Uefi/UefiSpec.h +++ /dev/null @@ -1,2146 +0,0 @@ -/** @file - Include file that supports UEFI. - - This include file must contain things defined in the UEFI 2.4 specification. - If a code construct is defined in the UEFI 2.4 specification it must be included - by this include file. - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> -This program and the accompanying materials are licensed and made available under -the terms and conditions of the BSD License that 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__ - -FILE_LICENCE ( BSD3 ); - -#include <ipxe/efi/Uefi/UefiMultiPhase.h> - -#include <ipxe/efi/Protocol/DevicePath.h> -#include <ipxe/efi/Protocol/SimpleTextIn.h> -#include <ipxe/efi/Protocol/SimpleTextInEx.h> -#include <ipxe/efi/Protocol/SimpleTextOut.h> - -/// -/// Enumeration of EFI memory allocation types. -/// -typedef enum { - /// - /// Allocate any available range of pages that satisfies the request. - /// - AllocateAnyPages, - /// - /// Allocate any available range of pages whose uppermost address is less than - /// or equal to a specified maximum address. - /// - AllocateMaxAddress, - /// - /// Allocate pages at a specified address. - /// - AllocateAddress, - /// - /// Maximum enumeration value that may be used for bounds checking. - /// - 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 an EFI memory descriptor. -/// -typedef struct { - /// - /// Type of the memory region. See EFI_MEMORY_TYPE. - /// - UINT32 Type; - /// - /// Physical address of the first byte of the memory region. Must aligned - /// on a 4 KB boundary. - /// - EFI_PHYSICAL_ADDRESS PhysicalStart; - /// - /// Virtual address of the first byte of the memory region. Must aligned - /// on a 4 KB boundary. - /// - EFI_VIRTUAL_ADDRESS VirtualStart; - /// - /// Number of 4KB pages in the memory region. - /// - UINT64 NumberOfPages; - /// - /// Attributes of the memory region that describe the bit mask of capabilities - /// for that memory region, and not necessarily the current settings for that - /// memory region. - /// - UINT64 Attribute; -} EFI_MEMORY_DESCRIPTOR; - -/** - 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 The 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 - 3) Memory is NULL. - 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 or Buffer is NULL. - -**/ -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 The 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 NULL. - @retval EFI_NOT_FOUND 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances - present in the system. - 2) No drivers were connected to ControllerHandle. - @retval EFI_SECURITY_VIOLATION - The user has no permission to start UEFI device drivers on the device path - associated with the ControllerHandle or specified by the RemainingDevicePath. -**/ -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 NULL. - 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 - -/** - 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 The 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 The pointer to the event's notification function, if any. - @param NotifyContext The pointer to the notification function's context; corresponds to parameter - Context in the notification function. - @param Event The 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 The pointer to the event's notification function, if any. - @param NotifyContext The pointer to the notification function's context; corresponds to parameter - Context in the notification function. - @param EventGroup The 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 The 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 { - /// - /// An event's timer settings is to be cancelled and not trigger time is to be set/ - /// - TimerCancel, - /// - /// An event is to be signaled periodically at a specified interval from the current time. - /// - TimerPeriodic, - /// - /// An event is to be signaled once at a specified interval from the current time. - /// - 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 The 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 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 - 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 string that is the name of the vendor's variable. - Each VariableName is unique for each VendorGuid. VariableName must - contain 1 or more characters. If VariableName is an empty string, - then EFI_INVALID_PARAMETER is returned. - @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. Unless the EFI_VARIABLE_APPEND_WRITE, - EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or - EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero - causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is - set, then a SetVariable() call with a DataSize of zero will not cause any change to - the variable value (the timestamp associated with the variable may be updated however - even if no new data value is provided,see the description of the - EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not - be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated). - @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, name, and GUID was supplied, or the - DataSize exceeds the maximum allowed. - @retval EFI_INVALID_PARAMETER VariableName is an empty 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 written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS - or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo - does NOT pass the validation check carried out by the firmware. - - @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 { - /// - /// Provides the reporting resolution of the real-time clock device in - /// counts per second. For a normal PC-AT CMOS RTC device, this - /// value would be 1 Hz, or 1, to indicate that the device only reports - /// the time to the resolution of 1 second. - /// - UINT32 Resolution; - /// - /// Provides the timekeeping accuracy of the real-time clock in an - /// error rate of 1E-6 parts per million. For a clock with an accuracy - /// of 50 parts per million, the value in this field would be - /// 50,000,000. - /// - UINT32 Accuracy; - /// - /// A TRUE indicates that a time set operation clears the device's - /// time below the Resolution reporting level. A FALSE - /// indicates that the state below the Resolution level of the - /// device is not cleared when the time is set. Normal PC-AT CMOS - /// RTC devices set this value to FALSE. - /// - 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 - ); - -/** - 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 The 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. - @retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the - image from being loaded. NULL is returned in *ImageHandle. - @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a - valid EFI_LOADED_IMAGE_PROTOCOL. However, the current - platform policy specifies that the image should not be started. -**/ -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 The pointer to the size, in bytes, of ExitData. - @param ExitData The pointer to a pointer to a data buffer that includes a Null-terminated - 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. - @retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started. - @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. This parameter is passed to the - image on entry. - @param ExitStatus The image's exit code. - @param ExitDataSize The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS. - @param ExitData The pointer to a data buffer that includes a Null-terminated string, - optionally followed by additional binary data. The string is a - description that the caller may use to further indicate the reason - for the image's exit. ExitData is only valid if ExitStatus - is something other than EFI_SUCCESS. The ExitData buffer - must be allocated by calling AllocatePool(). - - @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. - -**/ -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 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 watchdog 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 { - /// - /// Used to induce a system-wide reset. This sets all circuitry within the - /// system to its initial state. This type of reset is asynchronous to system - /// operation and operates withgout regard to cycle boundaries. EfiColdReset - /// is tantamount to a system power cycle. - /// - EfiResetCold, - /// - /// Used to induce a system-wide initialization. The processors are set to their - /// initial state, and pending cycles are not corrupted. If the system does - /// not support this reset type, then an EfiResetCold must be performed. - /// - EfiResetWarm, - /// - /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3 - /// state. If the system does not support this reset type, then when the system - /// is rebooted, it should exhibit the EfiResetCold attributes. - /// - EfiResetShutdown, - /// - /// Used to induce a system-wide reset. The exact type of the reset is defined by - /// the EFI_GUID that follows the Null-terminated Unicode string passed into - /// ResetData. If the platform does not recognize the EFI_GUID in ResetData the - /// platform must pick a supported reset type to perform. The platform may - /// optionally log the parameters from any non-normal reset that occurs. - /// - EfiResetPlatformSpecific -} 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 - 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 VOID *ResetData OPTIONAL - ); - -/** - Returns a monotonically increasing count for the platform. - - @param Count The 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 The 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 The pointer to the destination buffer of the memory copy. - @param Source The 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 The 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 - ); - -/// -/// Enumeration of EFI Interface Types -/// -typedef enum { - /// - /// Indicates that the supplied protocol interface is supplied in native form. - /// - 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 pointer to a handle to install the new protocol interfaces on, - or a pointer to 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. - @retval EFI_INVALID_PARAMETER Handle is NULL. - @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle. - -**/ -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 NULL. - @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 NULL. - @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 NULL. - @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 NULL. - 2) AgentHandle is NULL. - 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 - ); - -/// -/// EFI Oprn Protocol Information Entry -/// -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 - ); - -/// -/// Enumeration of EFI Locate Search Types -/// -typedef enum { - /// - /// Retrieve all the handles in the handle database. - /// - AllHandles, - /// - /// Retrieve the next handle fron a RegisterProtocolNotify() event. - /// - ByRegisterNotify, - /// - /// Retrieve the set of handles from the handle database that support a - /// specified protocol. - /// - 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 NULL. - @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 - ); - -/// -/// EFI Capsule Block Descriptor -/// -typedef struct { - /// - /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer. - /// - UINT64 Length; - union { - /// - /// Physical address of the data block. This member of the union is - /// used if Length is not equal to zero. - /// - EFI_PHYSICAL_ADDRESS DataBlock; - /// - /// Physical address of another block of - /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This - /// member of the union is used if Length is equal to zero. If - /// ContinuationPointer is zero this entry represents the end of the list. - /// - EFI_PHYSICAL_ADDRESS ContinuationPointer; - } Union; -} EFI_CAPSULE_BLOCK_DESCRIPTOR; - -/// -/// EFI Capsule Header. -/// -typedef struct { - /// - /// A GUID that defines the contents of a capsule. - /// - EFI_GUID CapsuleGuid; - /// - /// The size of the capsule header. This may be larger than the size of - /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply - /// extended header entries - /// - UINT32 HeaderSize; - /// - /// Bit-mapped list describing the capsule attributes. The Flag values - /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values - /// of 0x10000 - 0xFFFFFFFF are defined by this specification - /// - UINT32 Flags; - /// - /// Size in bytes of the capsule. - /// - 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 { - /// - /// the size of the array of capsules. - /// - UINT32 CapsuleArrayNumber; - /// - /// Point to an array of capsules that contain the same CapsuleGuid value. - /// - VOID* CapsulePtr[1]; -} EFI_CAPSULE_TABLE; - -#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000 -#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000 -#define CAPSULE_FLAGS_INITIATE_RESET 0x00040000 - -/** - 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_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were - set in the capsule header. - @retval EFI_INVALID_PARAMETER CapsuleCount is 0. - @retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error. - @retval EFI_UNSUPPORTED The capsule type is not supported on this platform. - @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has been previously called this error indicates the capsule - is compatible with this platform but is not capable of being submitted or processed - in runtime. The caller may resubmit the capsule prior to ExitBootServices(). - @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates - the capsule is compatible with this platform but there are insufficient resources to process. - -**/ -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 When ExitBootServices() has been previously called this error indicates the capsule - is compatible with this platform but is not capable of being submitted or processed - in runtime. The caller may resubmit the capsule prior to ExitBootServices(). - @retval EFI_OUT_OF_RESOURCES When ExitBootServices() has not been previously called then this error indicates - the capsule is compatible with this platform but there are insufficient resources to process. - -**/ -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 - ); - -// -// Firmware should stop at a firmware user interface on next boot -// -#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001 -#define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION 0x0000000000000002 -#define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004 -#define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x0000000000000008 -#define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x0000000000000010 - -// -// EFI Runtime Services Table -// -#define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' ','S','Y','S','T') -#define EFI_2_40_SYSTEM_TABLE_REVISION ((2 << 16) | (40)) -#define EFI_2_31_SYSTEM_TABLE_REVISION ((2 << 16) | (31)) -#define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30)) -#define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20)) -#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_SYSTEM_TABLE_REVISION EFI_2_40_SYSTEM_TABLE_REVISION -#define EFI_SPECIFICATION_VERSION EFI_SYSTEM_TABLE_REVISION - -#define EFI_RUNTIME_SERVICES_SIGNATURE SIGNATURE_64 ('R','U','N','T','S','E','R','V') -#define EFI_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_VERSION - -/// -/// 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 SIGNATURE_64 ('B','O','O','T','S','E','R','V') -#define EFI_BOOT_SERVICES_REVISION EFI_SPECIFICATION_VERSION - -/// -/// 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 -/// -typedef struct { - /// - /// The table header for the EFI System Table. - /// - EFI_TABLE_HEADER Hdr; - /// - /// A pointer to a null terminated 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. This handle must support - /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. - /// - EFI_HANDLE ConsoleInHandle; - /// - /// A pointer to the EFI_SIMPLE_TEXT_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 EFI_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. - /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL. - /// - EFI_HANDLE StandardErrorHandle; - /// - /// A pointer to the EFI_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_SYSTEM_TABLE; - -/** - 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 Others An unexpected error occurred. -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_IMAGE_ENTRY_POINT)( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ); - -// -// 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 - -/// -/// EFI Boot Key Data -/// -typedef union { - struct { - /// - /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0. - /// - UINT32 Revision : 8; - /// - /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0). - /// - UINT32 ShiftPressed : 1; - /// - /// Either the left or right Control keys must be pressed (1) or must not be pressed (0). - /// - UINT32 ControlPressed : 1; - /// - /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0). - /// - UINT32 AltPressed : 1; - /// - /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0). - /// - UINT32 LogoPressed : 1; - /// - /// The Menu key must be pressed (1) or must not be pressed (0). - /// - UINT32 MenuPressed : 1; - /// - /// The SysReq key must be pressed (1) or must not be pressed (0). - /// - UINT32 SysReqPressed : 1; - UINT32 Reserved : 16; - /// - /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If - /// zero, then only the shift state is considered. If more than one, then the boot option will - /// only be launched if all of the specified keys are pressed with the same shift state. - /// - UINT32 InputKeyCount : 2; - } Options; - UINT32 PackedValue; -} EFI_BOOT_KEY_DATA; - -/// -/// EFI Key Option. -/// -#pragma pack(1) -typedef struct { - /// - /// Specifies options about how the key will be processed. - /// - EFI_BOOT_KEY_DATA KeyData; - /// - /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to - /// which BootOption refers. If the CRC-32s do not match this value, then this key - /// option is ignored. - /// - UINT32 BootOptionCrc; - /// - /// The Boot#### option which will be invoked if this key is pressed and the boot option - /// is active (LOAD_OPTION_ACTIVE is set). - /// - UINT16 BootOption; - /// - /// The key codes to compare against those returned by the - /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols. - /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions. - /// - //EFI_INPUT_KEY Keys[]; -} EFI_KEY_OPTION; -#pragma pack() - -// -// 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" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI" -#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.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) -#elif defined (MDE_CPU_ARM) - #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_ARM -#elif defined (MDE_CPU_AARCH64) - #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 -#else - #error Unknown Processor Type -#endif - -#include <ipxe/efi/Uefi/UefiPxe.h> -#include <ipxe/efi/Uefi/UefiGpt.h> -#include <ipxe/efi/Uefi/UefiInternalFormRepresentation.h> - -#endif diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/X64/ProcessorBind.h b/qemu/roms/ipxe/src/include/ipxe/efi/X64/ProcessorBind.h deleted file mode 100644 index 4f21bb8de..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/X64/ProcessorBind.h +++ /dev/null @@ -1,300 +0,0 @@ -/** @file - Processor or Compiler specific defines and types x64 (Intel 64, AMD64). - - Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> - 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__ - -FILE_LICENCE ( BSD3 ); - -/// -/// Define the processor type so other code can make processor based choices -/// -#define MDE_CPU_X64 - -// -// Make sure we are using the correct packing rules per EFI specification -// -#if !defined(__GNUC__) -#pragma pack() -#endif - - -#if defined(__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 ) - -// -// Disable ICC's remark #593: "Variable" was set but never used. -// This is legal ANSI C code so we disable the remark that is turned on with /W4 -// -#pragma warning ( disable : 593 ) - -#endif - - -#if defined(_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) source file. For precompiled header only. -// -#pragma warning ( disable : 4206 ) - -#endif - - -#if defined(_MSC_EXTENSIONS) - // - // use Microsoft C complier dependent integer width types - // - - /// - /// 8-byte unsigned value - /// - typedef unsigned __int64 UINT64; - /// - /// 8-byte signed value - /// - typedef __int64 INT64; - /// - /// 4-byte unsigned value - /// - typedef unsigned __int32 UINT32; - /// - /// 4-byte signed value - /// - typedef __int32 INT32; - /// - /// 2-byte unsigned value - /// - typedef unsigned short UINT16; - /// - /// 2-byte Character. Unless otherwise specified all strings are stored in the - /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards. - /// - typedef unsigned short CHAR16; - /// - /// 2-byte signed value - /// - typedef short INT16; - /// - /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other - /// values are undefined. - /// - typedef unsigned char BOOLEAN; - /// - /// 1-byte unsigned value - /// - typedef unsigned char UINT8; - /// - /// 1-byte Character - /// - typedef char CHAR8; - /// - /// 1-byte signed value - /// - typedef signed char INT8; -#else - /// - /// 8-byte unsigned value - /// - typedef unsigned long long UINT64; - /// - /// 8-byte signed value - /// - typedef long long INT64; - /// - /// 4-byte unsigned value - /// - typedef unsigned int UINT32; - /// - /// 4-byte signed value - /// - typedef int INT32; - /// - /// 2-byte unsigned value - /// - typedef unsigned short UINT16; - /// - /// 2-byte Character. Unless otherwise specified all strings are stored in the - /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards. - /// - typedef unsigned short CHAR16; - /// - /// 2-byte signed value - /// - typedef short INT16; - /// - /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other - /// values are undefined. - /// - typedef unsigned char BOOLEAN; - /// - /// 1-byte unsigned value - /// - typedef unsigned char UINT8; - /// - /// 1-byte Character - /// - typedef char CHAR8; - /// - /// 1-byte signed value - /// - typedef signed char INT8; -#endif - -/// -/// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions, -/// 8 bytes on supported 64-bit processor instructions) -/// -typedef UINT64 UINTN; -/// -/// Signed value of native width. (4 bytes on supported 32-bit processor instructions, -/// 8 bytes on supported 64-bit processor instructions) -/// -typedef INT64 INTN; - - -// -// Processor specific defines -// - -/// -/// A value of native width with the highest bit set. -/// -#define MAX_BIT 0x8000000000000000ULL -/// -/// A value of native width with the two highest bits set. -/// -#define MAX_2_BITS 0xC000000000000000ULL - -/// -/// Maximum legal x64 address -/// -#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL - -/// -/// Maximum legal x64 INTN and UINTN values. -/// -#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL) -#define MAX_UINTN ((UINTN)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 their member functions with EFIAPI. -// -#ifdef EFIAPI - /// - /// If EFIAPI is already defined, then we use that definition. - /// -#elif defined(_MSC_EXTENSIONS) - /// - /// Microsoft* compiler specific method for EFIAPI calling convension - /// - #define EFIAPI __cdecl -#elif defined(__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 -#else - /// - /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI - /// is the standard. - /// - #define EFIAPI -#endif - -#if defined(__GNUC__) - /// - /// For GNU assembly code, .global or .globl can declare global symbols. - /// Define this macro to unify the usage. - /// - #define ASM_GLOBAL .globl -#endif - -/** - Return the pointer to the first instruction of a function given a function pointer. - On x64 CPU architectures, these two pointer values are the same, - so the implementation of this macro is very simple. - - @param FunctionPointer A pointer to a function. - - @return The pointer to the first instruction of a function given a function pointer. - -**/ -#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer) - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ -#endif - -#endif - diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi.h deleted file mode 100644 index ab52dd9e0..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi.h +++ /dev/null @@ -1,248 +0,0 @@ -#ifndef _IPXE_EFI_H -#define _IPXE_EFI_H - -/** @file - * - * EFI API - * - * The intention is to include near-verbatim copies of the EFI headers - * required by iPXE. 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 iPXE tree. It will - * also tidy up the file by removing carriage return characters and - * trailing whitespace. - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -/* EFI headers rudely redefine NULL */ -#undef NULL - -/* EFI headers expect ICC to define __GNUC__ */ -#if defined ( __ICC ) && ! defined ( __GNUC__ ) -#define __GNUC__ 1 -#endif - -/* EFI headers think your compiler uses the MS ABI by default on X64 */ -#if __x86_64__ -#define EFIAPI __attribute__((ms_abi)) -#endif - -/* EFI headers assume regparm(0) on i386, but that is not the case for iPXE */ -#if __i386__ -#define EFIAPI __attribute__((cdecl,regparm(0))) -#endif - -/* EFI headers define EFI_HANDLE as a void pointer, which renders type - * checking somewhat useless. Work around this bizarre sabotage - * attempt by redefining EFI_HANDLE as a pointer to an anonymous - * structure. - */ -#define EFI_HANDLE STUPID_EFI_HANDLE -#include <ipxe/efi/Uefi/UefiBaseType.h> -#undef EFI_HANDLE -typedef struct {} *EFI_HANDLE; - -/* Include the top-level EFI header files */ -#include <ipxe/efi/Uefi.h> -#include <ipxe/efi/PiDxe.h> -#include <ipxe/efi/Protocol/LoadedImage.h> - -/* Reset any trailing #pragma pack directives */ -#pragma pack(1) -#pragma pack() - -#include <ipxe/tables.h> -#include <ipxe/uuid.h> - -/** An EFI protocol used by iPXE */ -struct efi_protocol { - /** GUID */ - EFI_GUID guid; - /** Variable containing pointer to protocol structure */ - void **protocol; - /** Protocol is required */ - int required; -}; - -/** EFI protocol table */ -#define EFI_PROTOCOLS __table ( struct efi_protocol, "efi_protocols" ) - -/** Declare an EFI protocol used by iPXE */ -#define __efi_protocol __table_entry ( EFI_PROTOCOLS, 01 ) - -/** Declare an EFI protocol to be required by iPXE - * - * @v _protocol EFI protocol name - * @v _ptr Pointer to protocol instance - */ -#define EFI_REQUIRE_PROTOCOL( _protocol, _ptr ) \ - struct efi_protocol __ ## _protocol __efi_protocol = { \ - .guid = _protocol ## _GUID, \ - .protocol = ( ( void ** ) ( void * ) \ - ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \ - (_ptr) : (_ptr) ) ), \ - .required = 1, \ - } - -/** Declare an EFI protocol to be requested by iPXE - * - * @v _protocol EFI protocol name - * @v _ptr Pointer to protocol instance - */ -#define EFI_REQUEST_PROTOCOL( _protocol, _ptr ) \ - struct efi_protocol __ ## _protocol __efi_protocol = { \ - .guid = _protocol ## _GUID, \ - .protocol = ( ( void ** ) ( void * ) \ - ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \ - (_ptr) : (_ptr) ) ), \ - .required = 0, \ - } - -/** An EFI configuration table used by iPXE */ -struct efi_config_table { - /** GUID */ - EFI_GUID guid; - /** 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 iPXE */ -#define __efi_config_table __table_entry ( EFI_CONFIG_TABLES, 01 ) - -/** Declare an EFI configuration table to be used by iPXE - * - * @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 = { \ - .guid = _table ## _GUID, \ - .table = ( ( void ** ) ( void * ) (_ptr) ), \ - .required = (_required), \ - } - -/** - * Convert an iPXE status code to an EFI status code - * - * @v rc iPXE status code - * @ret efirc EFI status code - */ -#define EFIRC( rc ) ERRNO_TO_PLATFORM ( -(rc) ) - -/** - * Convert an EFI status code to an iPXE status code - * - * @v efirc EFI status code - * @ret rc iPXE status code (before negation) - */ -#define EEFI( efirc ) EPLATFORM ( EINFO_EPLATFORM, efirc ) - -extern EFI_GUID efi_arp_protocol_guid; -extern EFI_GUID efi_arp_service_binding_protocol_guid; -extern EFI_GUID efi_block_io_protocol_guid; -extern EFI_GUID efi_bus_specific_driver_override_protocol_guid; -extern EFI_GUID efi_component_name_protocol_guid; -extern EFI_GUID efi_component_name2_protocol_guid; -extern EFI_GUID efi_device_path_protocol_guid; -extern EFI_GUID efi_dhcp4_protocol_guid; -extern EFI_GUID efi_dhcp4_service_binding_protocol_guid; -extern EFI_GUID efi_disk_io_protocol_guid; -extern EFI_GUID efi_driver_binding_protocol_guid; -extern EFI_GUID efi_graphics_output_protocol_guid; -extern EFI_GUID efi_hii_config_access_protocol_guid; -extern EFI_GUID efi_ip4_protocol_guid; -extern EFI_GUID efi_ip4_config_protocol_guid; -extern EFI_GUID efi_ip4_service_binding_protocol_guid; -extern EFI_GUID efi_load_file_protocol_guid; -extern EFI_GUID efi_load_file2_protocol_guid; -extern EFI_GUID efi_loaded_image_protocol_guid; -extern EFI_GUID efi_loaded_image_device_path_protocol_guid; -extern EFI_GUID efi_managed_network_protocol_guid; -extern EFI_GUID efi_managed_network_service_binding_protocol_guid; -extern EFI_GUID efi_mtftp4_protocol_guid; -extern EFI_GUID efi_mtftp4_service_binding_protocol_guid; -extern EFI_GUID efi_nii_protocol_guid; -extern EFI_GUID efi_nii31_protocol_guid; -extern EFI_GUID efi_pci_io_protocol_guid; -extern EFI_GUID efi_pci_root_bridge_io_protocol_guid; -extern EFI_GUID efi_pxe_base_code_protocol_guid; -extern EFI_GUID efi_simple_file_system_protocol_guid; -extern EFI_GUID efi_simple_network_protocol_guid; -extern EFI_GUID efi_tcg_protocol_guid; -extern EFI_GUID efi_tcp4_protocol_guid; -extern EFI_GUID efi_tcp4_service_binding_protocol_guid; -extern EFI_GUID efi_udp4_protocol_guid; -extern EFI_GUID efi_udp4_service_binding_protocol_guid; -extern EFI_GUID efi_vlan_config_protocol_guid; - -extern EFI_HANDLE efi_image_handle; -extern EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image; -extern EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path; -extern EFI_SYSTEM_TABLE *efi_systab; - -extern const char * efi_guid_ntoa ( EFI_GUID *guid ); -extern const char * efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL *path ); -extern const char * efi_handle_name ( EFI_HANDLE handle ); - -extern void dbg_efi_openers ( EFI_HANDLE handle, EFI_GUID *protocol ); -extern void dbg_efi_protocols ( EFI_HANDLE handle ); - -#define DBG_EFI_OPENERS_IF( level, handle, protocol ) do { \ - if ( DBG_ ## level ) { \ - dbg_efi_openers ( handle, protocol ); \ - } \ - } while ( 0 ) - -#define DBG_EFI_PROTOCOLS_IF( level, handle ) do { \ - if ( DBG_ ## level ) { \ - dbg_efi_protocols ( handle ); \ - } \ - } while ( 0 ) - -#define DBGC_EFI_OPENERS_IF( level, id, ... ) do { \ - DBG_AC_IF ( level, id ); \ - DBG_EFI_OPENERS_IF ( level, __VA_ARGS__ ); \ - DBG_DC_IF ( level ); \ - } while ( 0 ) - -#define DBGC_EFI_PROTOCOLS_IF( level, id, ... ) do { \ - DBG_AC_IF ( level, id ); \ - DBG_EFI_PROTOCOLS_IF ( level, __VA_ARGS__ ); \ - DBG_DC_IF ( level ); \ - } while ( 0 ) - -#define DBGC_EFI_OPENERS( ... ) \ - DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ ) -#define DBGC_EFI_PROTOCOLS( ... ) \ - DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ ) - -#define DBGC2_EFI_OPENERS( ... ) \ - DBGC_EFI_OPENERS_IF ( EXTRA, ##__VA_ARGS__ ) -#define DBGC2_EFI_PROTOCOLS( ... ) \ - DBGC_EFI_PROTOCOLS_IF ( EXTRA, ##__VA_ARGS__ ) - -#define DBGCP_EFI_OPENERS( ... ) \ - DBGC_EFI_OPENERS_IF ( PROFILE, ##__VA_ARGS__ ) -#define DBGCP_EFI_PROTOCOLS( ... ) \ - DBGC_EFI_PROTOCOLS_IF ( PROFILE, ##__VA_ARGS__ ) - -extern EFI_STATUS efi_init ( EFI_HANDLE image_handle, - EFI_SYSTEM_TABLE *systab ); - -#endif /* _IPXE_EFI_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_autoboot.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_autoboot.h deleted file mode 100644 index 1d5ddc8c3..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_autoboot.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _IPXE_EFI_AUTOBOOT_H -#define _IPXE_EFI_AUTOBOOT_H - -/** @file - * - * EFI autoboot device - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -extern void efi_set_autoboot ( void ); - -#endif /* _IPXE_EFI_AUTOBOOT_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_download.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_download.h deleted file mode 100644 index 740fcadf5..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_download.h +++ /dev/null @@ -1,157 +0,0 @@ -#ifndef _IPXE_DOWNLOAD_H -#define _IPXE_DOWNLOAD_H - -/* - * Copyright (C) 2010 VMware, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -FILE_LICENCE ( GPL2_OR_LATER ); - -/** @file - * - * iPXE Download Protocol - * - * EFI applications started by iPXE may use this interface to download files. - */ - -typedef struct _IPXE_DOWNLOAD_PROTOCOL IPXE_DOWNLOAD_PROTOCOL; - -/** Token to represent a currently downloading file */ -typedef VOID *IPXE_DOWNLOAD_FILE; - -/** - * Callback function that is invoked when data arrives for a particular file. - * - * Not all protocols will deliver data in order. Clients should not rely on the - * order of data delivery matching the order in the file. - * - * Some protocols are capable of determining the file size near the beginning - * of data transfer. To allow the client to allocate memory more efficiently, - * iPXE may give a hint about the file size by calling the Data callback with - * a zero BufferLength and the file size in FileOffset. Clients should be - * prepared to deal with more or less data than the hint actually arriving. - * - * @v Context Context provided to the Start function - * @v Buffer New data - * @v BufferLength Length of new data in bytes - * @v FileOffset Offset of new data in the file - * @ret Status EFI_SUCCESS to continue the download, - * or any error code to abort. - */ -typedef -EFI_STATUS -(EFIAPI *IPXE_DOWNLOAD_DATA_CALLBACK)( - IN VOID *Context, - IN VOID *Buffer, - IN UINTN BufferLength, - IN UINTN FileOffset - ); - -/** - * Callback function that is invoked when the file is finished downloading, or - * when a connection unexpectedly closes or times out. - * - * The finish callback is also called when a download is aborted by the Abort - * function (below). - * - * @v Context Context provided to the Start function - * @v Status Reason for termination: EFI_SUCCESS when the entire - * file was transferred successfully, or an error - * otherwise - */ -typedef -void -(EFIAPI *IPXE_DOWNLOAD_FINISH_CALLBACK)( - IN VOID *Context, - IN EFI_STATUS Status - ); - -/** - * Start downloading a file, and register callback functions to handle the - * download. - * - * @v This iPXE Download Protocol instance - * @v Url URL to download from - * @v DataCallback Callback that will be invoked when data arrives - * @v FinishCallback Callback that will be invoked when the download ends - * @v Context Context passed to the Data and Finish callbacks - * @v File Token that can be used to abort the download - * @ret Status EFI status code - */ -typedef -EFI_STATUS -(EFIAPI *IPXE_DOWNLOAD_START)( - IN IPXE_DOWNLOAD_PROTOCOL *This, - IN CHAR8 *Url, - IN IPXE_DOWNLOAD_DATA_CALLBACK DataCallback, - IN IPXE_DOWNLOAD_FINISH_CALLBACK FinishCallback, - IN VOID *Context, - OUT IPXE_DOWNLOAD_FILE *File - ); - -/** - * Forcibly abort downloading a file that is currently in progress. - * - * It is not safe to call this function after the Finish callback has executed. - * - * @v This iPXE Download Protocol instance - * @v File Token obtained from Start - * @v Status Reason for aborting the download - * @ret Status EFI status code - */ -typedef -EFI_STATUS -(EFIAPI *IPXE_DOWNLOAD_ABORT)( - IN IPXE_DOWNLOAD_PROTOCOL *This, - IN IPXE_DOWNLOAD_FILE File, - IN EFI_STATUS Status - ); - -/** - * Poll for more data from iPXE. This function will invoke the registered - * callbacks if data is available or if downloads complete. - * - * @v This iPXE Download Protocol instance - * @ret Status EFI status code - */ -typedef -EFI_STATUS -(EFIAPI *IPXE_DOWNLOAD_POLL)( - IN IPXE_DOWNLOAD_PROTOCOL *This - ); - -/** - * The iPXE Download Protocol. - * - * iPXE will attach a iPXE Download Protocol to the DeviceHandle in the Loaded - * Image Protocol of all child EFI applications. - */ -struct _IPXE_DOWNLOAD_PROTOCOL { - IPXE_DOWNLOAD_START Start; - IPXE_DOWNLOAD_ABORT Abort; - IPXE_DOWNLOAD_POLL Poll; -}; - -#define IPXE_DOWNLOAD_PROTOCOL_GUID \ - { \ - 0x3eaeaebd, 0xdecf, 0x493b, { 0x9b, 0xd1, 0xcd, 0xb2, 0xde, 0xca, 0xe7, 0x19 } \ - } - -extern int efi_download_install ( EFI_HANDLE handle ); -extern void efi_download_uninstall ( EFI_HANDLE handle ); - -#endif /* _IPXE_DOWNLOAD_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_driver.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_driver.h deleted file mode 100644 index f497df3e3..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_driver.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef _IPXE_EFI_DRIVER_H -#define _IPXE_EFI_DRIVER_H - -/** @file - * - * EFI driver interface - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <ipxe/device.h> -#include <ipxe/tables.h> -#include <ipxe/efi/efi.h> -#include <ipxe/efi/Protocol/DevicePath.h> - -/** An EFI device */ -struct efi_device { - /** Generic device */ - struct device dev; - /** EFI device handle */ - EFI_HANDLE device; - /** Driver for this device */ - struct efi_driver *driver; - /** Driver-private data */ - void *priv; -}; - -/** An EFI driver */ -struct efi_driver { - /** Name */ - const char *name; - /** - * Check if driver supports device - * - * @v device EFI device handle - * @ret rc Return status code - */ - int ( * supported ) ( EFI_HANDLE device ); - /** - * Attach driver to device - * - * @v efidev EFI device - * @ret rc Return status code - */ - int ( * start ) ( struct efi_device *efidev ); - /** - * Detach driver from device - * - * @v efidev EFI device - */ - void ( * stop ) ( struct efi_device *efidev ); -}; - -/** EFI driver table */ -#define EFI_DRIVERS __table ( struct efi_driver, "efi_drivers" ) - -/** Declare an EFI driver */ -#define __efi_driver( order ) __table_entry ( EFI_DRIVERS, order ) - -#define EFI_DRIVER_EARLY 01 /**< Early drivers */ -#define EFI_DRIVER_NORMAL 02 /**< Normal drivers */ -#define EFI_DRIVER_LATE 03 /**< Late drivers */ - -/** - * Set EFI driver-private data - * - * @v efidev EFI device - * @v priv Private data - */ -static inline void efidev_set_drvdata ( struct efi_device *efidev, - void *priv ) { - efidev->priv = priv; -} - -/** - * Get EFI driver-private data - * - * @v efidev EFI device - * @ret priv Private data - */ -static inline void * efidev_get_drvdata ( struct efi_device *efidev ) { - return efidev->priv; -} - -extern struct efi_device * efidev_parent ( struct device *dev ); -extern int efi_driver_install ( void ); -extern void efi_driver_uninstall ( void ); -extern int efi_driver_connect_all ( void ); -extern void efi_driver_disconnect_all ( void ); -extern void efi_driver_reconnect_all ( void ); - -#endif /* _IPXE_EFI_DRIVER_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_entropy.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_entropy.h deleted file mode 100644 index 39a667355..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_entropy.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _IPXE_EFI_ENTROPY_H -#define _IPXE_EFI_ENTROPY_H - -/** @file - * - * EFI entropy source - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <stdint.h> - -#ifdef ENTROPY_EFI -#define ENTROPY_PREFIX_efi -#else -#define ENTROPY_PREFIX_efi __efi_ -#endif - -/** - * min-entropy per sample - * - * @ret min_entropy min-entropy of each sample - */ -static inline __always_inline double -ENTROPY_INLINE ( efi, min_entropy_per_sample ) ( void ) { - - /* We use essentially the same mechanism as for the BIOS - * RTC-based entropy source, and so assume the same - * min-entropy per sample. - */ - return 1.3; -} - -#endif /* _IPXE_EFI_ENTROPY_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_file.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_file.h deleted file mode 100644 index e4db0305a..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_file.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _IPXE_EFI_FILE_H -#define _IPXE_EFI_FILE_H - -/** @file - * - * EFI file protocols - * - */ - -extern int efi_file_install ( EFI_HANDLE handle ); -extern void efi_file_uninstall ( EFI_HANDLE handle ); - -#endif /* _IPXE_EFI_FILE_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_hii.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_hii.h deleted file mode 100644 index bbec31194..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_hii.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef _IPXE_EFI_HII_H -#define _IPXE_EFI_HII_H - -/** @file - * - * EFI human interface infrastructure - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <string.h> -#include <ipxe/efi/Uefi/UefiInternalFormRepresentation.h> -#include <ipxe/efi/Guid/MdeModuleHii.h> - -/** GUID indicating formset compliance for IBM Unified Configuration Manager */ -#define EFI_HII_IBM_UCM_COMPLIANT_FORMSET_GUID \ - { 0x5c8e9746, 0xa5f7, 0x4593, \ - { 0xaf, 0x1f, 0x66, 0xa8, 0x2a, 0xa1, 0x9c, 0xb1 } } - -/** An EFI IFR builder */ -struct efi_ifr_builder { - /** IFR opcodes */ - EFI_IFR_OP_HEADER *ops; - /** Length of IFR opcodes */ - size_t ops_len; - /** Strings */ - EFI_HII_STRING_BLOCK *strings; - /** Length of strings */ - size_t strings_len; - /** Current string identifier */ - unsigned int string_id; - /** Current variable store identifier */ - unsigned int varstore_id; - /** Current form identifier */ - unsigned int form_id; - /** An allocation has failed */ - int failed; -}; - -/** - * Initialise IFR builder - * - * @v ifr IFR builder - * - * The caller must eventually call efi_ifr_free() to free the dynamic - * storage associated with the IFR builder. - */ -static inline void efi_ifr_init ( struct efi_ifr_builder *ifr ) { - memset ( ifr, 0, sizeof ( *ifr ) ); -} - -extern unsigned int efi_ifr_string ( struct efi_ifr_builder *ifr, - const char *fmt, ... ); -extern void efi_ifr_end_op ( struct efi_ifr_builder *ifr ); -extern void efi_ifr_false_op ( struct efi_ifr_builder *ifr ); -extern unsigned int efi_ifr_form_op ( struct efi_ifr_builder *ifr, - unsigned int title_id ); -extern void efi_ifr_form_set_op ( struct efi_ifr_builder *ifr, - const EFI_GUID *guid, - unsigned int title_id, unsigned int help_id, - ... ); -void efi_ifr_get_op ( struct efi_ifr_builder *ifr, unsigned int varstore_id, - unsigned int varstore_info, unsigned int varstore_type ); -extern void efi_ifr_guid_class_op ( struct efi_ifr_builder *ifr, - unsigned int class ); -extern void efi_ifr_guid_subclass_op ( struct efi_ifr_builder *ifr, - unsigned int subclass ); -extern void efi_ifr_numeric_op ( struct efi_ifr_builder *ifr, - unsigned int prompt_id, - unsigned int help_id, unsigned int question_id, - unsigned int varstore_id, - unsigned int varstore_info, - unsigned int vflags, unsigned long min_value, - unsigned long max_value, unsigned int step, - unsigned int flags ); -extern void efi_ifr_string_op ( struct efi_ifr_builder *ifr, - unsigned int prompt_id, unsigned int help_id, - unsigned int question_id, - unsigned int varstore_id, - unsigned int varstore_info, unsigned int vflags, - unsigned int min_size, unsigned int max_size, - unsigned int flags ); -extern void efi_ifr_suppress_if_op ( struct efi_ifr_builder *ifr ); -extern void efi_ifr_text_op ( struct efi_ifr_builder *ifr, - unsigned int prompt_id, unsigned int help_id, - unsigned int text_id ); -extern void efi_ifr_true_op ( struct efi_ifr_builder *ifr ); -extern unsigned int -efi_ifr_varstore_name_value_op ( struct efi_ifr_builder *ifr, - const EFI_GUID *guid ); -extern void efi_ifr_free ( struct efi_ifr_builder *ifr ); -extern EFI_HII_PACKAGE_LIST_HEADER * -efi_ifr_package ( struct efi_ifr_builder *ifr, const EFI_GUID *guid, - const char *language, unsigned int language_id ); - -#endif /* _IPXE_EFI_HII_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci.h deleted file mode 100644 index 6dd945f05..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _IPXE_EFI_PCI_H -#define _IPXE_EFI_PCI_H - -/** @file - * - * EFI driver interface - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <ipxe/pci.h> -#include <ipxe/efi/efi.h> -#include <ipxe/efi/Protocol/PciIo.h> - -/* PciRootBridgeIo.h uses LShiftU64(), which isn't defined anywhere else */ -static inline EFIAPI uint64_t LShiftU64 ( UINT64 value, UINTN shift ) { - return ( value << shift ); -} - -extern int efipci_open ( EFI_HANDLE device, UINT32 attributes, - struct pci_device *pci ); -extern void efipci_close ( EFI_HANDLE device ); -extern int efipci_info ( EFI_HANDLE device, struct pci_device *pci ); - -#endif /* _IPXE_EFI_PCI_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci_api.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci_api.h deleted file mode 100644 index 887d5ee14..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_pci_api.h +++ /dev/null @@ -1,151 +0,0 @@ -#ifndef _IPXE_EFI_PCI_API_H -#define _IPXE_EFI_PCI_API_H - -/** @file - * - * iPXE PCI I/O API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#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 number of PCI buses within system - * - * @ret num_bus Number of buses - */ -static inline __always_inline int -PCIAPI_INLINE ( efi, pci_num_bus ) ( void ) { - /* EFI does not want us to scan the PCI bus ourselves */ - return 0; -} - -/** - * 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 ) { - *value = 0xff; - 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 ) { - *value = 0xffff; - 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 ) { - *value = 0xffffffffUL; - 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 /* _IPXE_EFI_PCI_API_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_reboot.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_reboot.h deleted file mode 100644 index 249cae8c5..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_reboot.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _IPXE_EFI_REBOOT_H -#define _IPXE_EFI_REBOOT_H - -/** @file - * - * iPXE reboot API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#ifdef REBOOT_EFI -#define REBOOT_PREFIX_efi -#else -#define REBOOT_PREFIX_efi __efi_ -#endif - -#endif /* _IPXE_EFI_REBOOT_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_smbios.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_smbios.h deleted file mode 100644 index d890d5460..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_smbios.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _IPXE_EFI_SMBIOS_H -#define _IPXE_EFI_SMBIOS_H - -/** @file - * - * iPXE SMBIOS API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#ifdef SMBIOS_EFI -#define SMBIOS_PREFIX_efi -#else -#define SMBIOS_PREFIX_efi __efi_ -#endif - -#endif /* _IPXE_EFI_SMBIOS_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_snp.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_snp.h deleted file mode 100644 index 1e5c66626..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_snp.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef _IPXE_EFI_SNP_H -#define _IPXE_EFI_SNP_H - -/** @file - * - * iPXE EFI SNP interface - * - */ - -#include <ipxe/list.h> -#include <ipxe/netdevice.h> -#include <ipxe/efi/efi.h> -#include <ipxe/efi/Protocol/SimpleNetwork.h> -#include <ipxe/efi/Protocol/NetworkInterfaceIdentifier.h> -#include <ipxe/efi/Protocol/ComponentName2.h> -#include <ipxe/efi/Protocol/DevicePath.h> -#include <ipxe/efi/Protocol/HiiConfigAccess.h> -#include <ipxe/efi/Protocol/HiiDatabase.h> -#include <ipxe/efi/Protocol/LoadFile.h> - -/** SNP transmit completion ring size */ -#define EFI_SNP_NUM_TX 32 - -/** An SNP device */ -struct efi_snp_device { - /** List of SNP devices */ - struct list_head list; - /** The underlying iPXE network device */ - struct net_device *netdev; - /** The underlying EFI device */ - struct efi_device *efidev; - /** EFI device handle */ - EFI_HANDLE handle; - /** The SNP structure itself */ - EFI_SIMPLE_NETWORK_PROTOCOL snp; - /** The SNP "mode" (parameters) */ - EFI_SIMPLE_NETWORK_MODE mode; - /** Started flag */ - int started; - /** Pending interrupt status */ - unsigned int interrupts; - /** Transmit completion ring */ - VOID *tx[EFI_SNP_NUM_TX]; - /** Transmit completion ring producer counter */ - unsigned int tx_prod; - /** Transmit completion ring consumer counter */ - unsigned int tx_cons; - /** Receive queue */ - struct list_head rx; - /** The network interface identifier */ - EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL nii; - /** Component name protocol */ - EFI_COMPONENT_NAME2_PROTOCOL name2; - /** Load file protocol handle */ - EFI_LOAD_FILE_PROTOCOL load_file; - /** HII configuration access protocol */ - EFI_HII_CONFIG_ACCESS_PROTOCOL hii; - /** HII package list */ - EFI_HII_PACKAGE_LIST_HEADER *package_list; - /** HII handle */ - EFI_HII_HANDLE hii_handle; - /** Device name */ - wchar_t name[ sizeof ( ( ( struct net_device * ) NULL )->name ) ]; - /** Driver name */ - wchar_t driver_name[16]; - /** Controller name */ - wchar_t controller_name[64]; - /** The device path */ - EFI_DEVICE_PATH_PROTOCOL *path; -}; - -extern int efi_snp_hii_install ( struct efi_snp_device *snpdev ); -extern void efi_snp_hii_uninstall ( struct efi_snp_device *snpdev ); -extern struct efi_snp_device * find_snpdev ( EFI_HANDLE handle ); -extern struct efi_snp_device * last_opened_snpdev ( void ); -extern void efi_snp_set_claimed ( int claimed ); - -/** - * Claim network devices for use by iPXE - * - */ -static inline void efi_snp_claim ( void ) { - efi_snp_set_claimed ( 1 ); -} - -/** - * Release network devices for use via SNP - * - */ -static inline void efi_snp_release ( void ) { - efi_snp_set_claimed ( 0 ); -} - -#endif /* _IPXE_EFI_SNP_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_strings.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_strings.h deleted file mode 100644 index 2f241537e..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_strings.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _IPXE_EFI_STRINGS_H -#define _IPXE_EFI_STRINGS_H - -/** @file - * - * EFI strings - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <stddef.h> -#include <stdint.h> -#include <stdarg.h> - -extern int efi_vsnprintf ( wchar_t *wbuf, size_t wsize, const char *fmt, - va_list args ); -extern int efi_snprintf ( wchar_t *wbuf, size_t wsize, const char *fmt, ... ); -extern int efi_vssnprintf ( wchar_t *wbuf, ssize_t swsize, const char *fmt, - va_list args ); -extern int efi_ssnprintf ( wchar_t *wbuf, ssize_t swsize, - const char *fmt, ... ); - -#endif /* _IPXE_EFI_STRINGS_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_time.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_time.h deleted file mode 100644 index 099994b57..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_time.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _IPXE_EFI_TIME_H -#define _IPXE_EFI_TIME_H - -/** @file - * - * EFI time source - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <stdint.h> - -#ifdef TIME_EFI -#define TIME_PREFIX_efi -#else -#define TIME_PREFIX_efi __efi_ -#endif - -#endif /* _IPXE_EFI_TIME_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_timer.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_timer.h deleted file mode 100644 index c03765393..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_timer.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _IPXE_EFI_TIMER_H -#define _IPXE_EFI_TIMER_H - -/** @file - * - * iPXE timer API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#ifdef TIMER_EFI -#define TIMER_PREFIX_efi -#else -#define TIMER_PREFIX_efi __efi_ -#endif - -#endif /* _IPXE_EFI_TIMER_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_uaccess.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_uaccess.h deleted file mode 100644 index 3cc750405..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_uaccess.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef _IPXE_EFI_UACCESS_H -#define _IPXE_EFI_UACCESS_H - -/** @file - * - * iPXE 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_OR_UBDL ); - -#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 off_t -UACCESS_INLINE ( efi, userptr_sub ) ( userptr_t userptr, - userptr_t subtrahend ) { - return trivial_userptr_sub ( userptr, subtrahend ); -} - -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 int -UACCESS_INLINE ( efi, memcmp_user ) ( userptr_t first, off_t first_off, - userptr_t second, off_t second_off, - size_t len ) { - return trivial_memcmp_user ( first, first_off, second, second_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 /* _IPXE_EFI_UACCESS_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_umalloc.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_umalloc.h deleted file mode 100644 index 4eb2a5f9b..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_umalloc.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _IPXE_EFI_UMALLOC_H -#define _IPXE_EFI_UMALLOC_H - -/** @file - * - * iPXE user memory allocation API for EFI - * - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#ifdef UMALLOC_EFI -#define UMALLOC_PREFIX_efi -#else -#define UMALLOC_PREFIX_efi __efi_ -#endif - -#endif /* _IPXE_EFI_UMALLOC_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_utils.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_utils.h deleted file mode 100644 index 57268daf7..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_utils.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _IPXE_EFI_UTILS_H -#define _IPXE_EFI_UTILS_H - -/** @file - * - * EFI utilities - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <ipxe/efi/efi.h> -#include <ipxe/efi/Protocol/DevicePath.h> - -struct device; - -extern EFI_DEVICE_PATH_PROTOCOL * -efi_devpath_end ( EFI_DEVICE_PATH_PROTOCOL *path ); -extern int efi_locate_device ( EFI_HANDLE device, EFI_GUID *protocol, - EFI_HANDLE *parent ); -extern int efi_child_add ( EFI_HANDLE parent, EFI_HANDLE child ); -extern void efi_child_del ( EFI_HANDLE parent, EFI_HANDLE child ); -extern void efi_device_info ( EFI_HANDLE device, const char *prefix, - struct device *dev ); - -#endif /* _IPXE_EFI_UTILS_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_watchdog.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_watchdog.h deleted file mode 100644 index 4a56b9a29..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_watchdog.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _IPXE_EFI_WATCHDOG_H -#define _IPXE_EFI_WATCHDOG_H - -/** @file - * - * EFI watchdog holdoff timer - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -extern struct retry_timer efi_watchdog; - -/** - * Start EFI watchdog holdoff timer - * - */ -static inline void efi_watchdog_start ( void ) { - - start_timer_nodelay ( &efi_watchdog ); -} - -/** - * Stop EFI watchdog holdoff timer - * - */ -static inline void efi_watchdog_stop ( void ) { - - stop_timer ( &efi_watchdog ); -} - -#endif /* _IPXE_EFI_WATCHDOG_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/efi_wrap.h b/qemu/roms/ipxe/src/include/ipxe/efi/efi_wrap.h deleted file mode 100644 index d8ed1a5cc..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/efi_wrap.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _IPXE_EFI_WRAP_H -#define _IPXE_EFI_WRAP_H - -/** @file - * - * EFI driver interface - */ - -FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); - -#include <ipxe/efi/efi.h> - -extern void efi_wrap ( EFI_HANDLE handle ); - -#endif /* _IPXE_EFI_WRAP_H */ diff --git a/qemu/roms/ipxe/src/include/ipxe/efi/import.pl b/qemu/roms/ipxe/src/include/ipxe/efi/import.pl deleted file mode 100755 index f5a3f546f..000000000 --- a/qemu/roms/ipxe/src/include/ipxe/efi/import.pl +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/perl -w - -=head1 NAME - -import.pl - -=head1 SYNOPSIS - -import.pl [options] /path/to/edk2/edk2 - -Options: - - -h,--help Display brief help message - -v,--verbose Increase verbosity - -q,--quiet Decrease verbosity - -=cut - -use File::Spec::Functions qw ( :ALL ); -use File::Find; -use File::Path; -use Getopt::Long; -use Pod::Usage; -use FindBin; -use strict; -use warnings; - -my $verbosity = 0; - -sub try_import_file { - my $ipxedir = shift; - my $edktop = shift; - my $edkdirs = shift; - my $filename = shift; - - # Skip everything except headers - return unless $filename =~ /\.h$/; - - # Skip files that are iPXE native headers - my $outfile = catfile ( $ipxedir, $filename ); - if ( -s $outfile ) { - open my $outfh, "<$outfile" or die "Could not open $outfile: $!\n"; - my $line = <$outfh>; - close $outfh; - chomp $line; - return if $line =~ /^\#ifndef\s+_IPXE_\S+_H$/; - } - - # Search for importable header - foreach my $edkdir ( @$edkdirs ) { - my $infile = catfile ( $edktop, $edkdir, $filename ); - if ( -e $infile ) { - # We have found a matching source file - import it - print "$filename <- ".catfile ( $edkdir, $filename )."\n" - if $verbosity >= 1; - 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 = (); - my $licence; - my $maybe_guard; - my $guard; - 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 <ipxe\/efi\/$1>/ ) { - push @dependencies, $1; - } - # Check for BSD licence statement - if ( /^\s*THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE/ ) { - die "Licence detected after header guard\n" if $guard; - $licence = "BSD3"; - } - # Write out line - print $outfh "$_\n"; - # Apply FILE_LICENCE() immediately after include guard - if ( defined $maybe_guard && ! defined $guard ) { - if ( /^\#define\s+_?_${maybe_guard}_?_$/ ) { - $guard = $maybe_guard; - print $outfh "\nFILE_LICENCE ( $licence );\n" if $licence; - } - undef $maybe_guard; - } - if ( /^#ifndef\s+_?_(\S+)_?_/ ) { - $maybe_guard = $1; - } - } - close $outfh; - close $infh; - # Warn if no licence was detected - warn "Cannot detect licence in $infile\n" unless $licence; - warn "Cannot detect header guard in $infile\n" unless $guard; - # Recurse to handle any included files that we don't already have - foreach my $dependency ( @dependencies ) { - if ( ! -e catfile ( $ipxedir, $dependency ) ) { - print "...following dependency on $dependency\n" if $verbosity >= 1; - try_import_file ( $ipxedir, $edktop, $edkdirs, $dependency ); - } - } - return; - } - } - die "$filename has no equivalent in $edktop\n"; -} - -# Parse command-line options -Getopt::Long::Configure ( 'bundling', 'auto_abbrev' ); -GetOptions ( - 'verbose|v+' => sub { $verbosity++; }, - 'quiet|q+' => sub { $verbosity--; }, - 'help|h' => sub { pod2usage ( 1 ); }, -) or die "Could not parse command-line options\n"; -pod2usage ( 1 ) unless @ARGV == 1; -my $edktop = shift; - -# Identify edk import directories -my $edkdirs = [ "MdePkg/Include", "IntelFrameworkPkg/Include", - "MdeModulePkg/Include", "EdkCompatibilityPkg/Foundation" ]; -foreach my $edkdir ( @$edkdirs ) { - die "Directory \"$edktop\" does not appear to contain the EFI EDK2 " - ."(missing \"$edkdir\")\n" unless -d catdir ( $edktop, $edkdir ); -} - -# Identify iPXE EFI includes directory -my $ipxedir = $FindBin::Bin; -die "Directory \"$ipxedir\" does not appear to contain the iPXE EFI includes\n" - unless -e catfile ( $ipxedir, "../../../include/ipxe/efi" ); - -if ( $verbosity >= 1 ) { - print "Importing EFI headers into $ipxedir\nfrom "; - print join ( "\n and ", map { catdir ( $edktop, $_ ) } @$edkdirs )."\n"; -} - -# Import headers -find ( { wanted => sub { - try_import_file ( $ipxedir, $edktop, $edkdirs, abs2rel ( $_, $ipxedir ) ); -}, no_chdir => 1 }, $ipxedir ); |