Initial import.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
bbahnsen
2006-04-21 22:54:32 +00:00
commit 878ddf1fc3
2651 changed files with 624620 additions and 0 deletions

28
MdePkg/Include/Base.h Normal file
View File

@@ -0,0 +1,28 @@
/** @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, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __BASE_H__
#define __BASE_H__
#include <Common/BaseTypes.h>
#include <Common/EfiImage.h>
#endif

View File

@@ -0,0 +1,206 @@
/** @file
Processor or Compiler specific defines for all supported processors.
This file is stand alone self consistent set of definitions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: BaseTypes.h
**/
#ifndef __BASE_TYPES_H__
#define __BASE_TYPES_H__
//
// Include processor specific binding
//
#include <ProcessorBind.h>
#define MEMORY_FENCE() MemoryFence ()
#define BREAKPOINT() CpuBreakpoint ()
#define DEADLOOP() CpuDeadLoop ()
typedef struct {
UINT32 Data1;
UINT16 Data2;
UINT16 Data3;
UINT8 Data4[8];
} GUID;
//
// Modifiers to absract standard types to aid in debug of problems
//
#define CONST const
#define STATIC static
#define VOID void
//
// Modifiers for Data Types used to self document code.
// This concept is borrowed for UEFI specification.
//
#ifndef IN
//
// Some other envirnments use this construct, so #ifndef to prevent
// mulitple definition.
//
#define IN
#define OUT
#define OPTIONAL
#endif
//
// Constants. They may exist in other build structures, so #ifndef them.
//
#ifndef TRUE
//
// BugBug: UEFI specification claims 1 and 0. We are concerned about the
// complier portability so we did it this way.
//
#define TRUE ((BOOLEAN)(1==1))
#endif
#ifndef FALSE
#define FALSE ((BOOLEAN)(0==1))
#endif
#ifndef NULL
#define NULL ((VOID *) 0)
#endif
//
// Support for variable length argument lists using the ANSI standard.
//
// Since we are using the ANSI standard we used the standard nameing and
// did not folow the coding convention
//
// VA_LIST - typedef for argument list.
// VA_START (VA_LIST Marker, argument before the ...) - Init Marker for use.
// VA_END (VA_LIST Marker) - Clear Marker
// VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argumnet from
// the ... list. You must know the size and pass it in this macro.
//
// example:
//
// UINTN
// ExampleVarArg (
// IN UINTN NumberOfArgs,
// ...
// )
// {
// VA_LIST Marker;
// UINTN Index;
// UINTN Result;
//
// //
// // Initialize the Marker
// //
// VA_START (Marker, NumberOfArgs);
// for (Index = 0, Result = 0; Index < NumberOfArgs; Index++) {
// //
// // The ... list is a series of UINTN values, so average them up.
// //
// Result += VA_ARG (Marker, UINTN);
// }
//
// VA_END (Marker);
// return Result
// }
//
#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
//
// Also support coding convention rules for var arg macros
//
#ifndef VA_START
typedef CHAR8 *VA_LIST;
#define VA_START(ap, v) (ap = (VA_LIST) & (v) + _INT_SIZE_OF (v))
#define VA_ARG(ap, t) (*(t *) ((ap += _INT_SIZE_OF (t)) - _INT_SIZE_OF (t)))
#define VA_END(ap) (ap = (VA_LIST) 0)
#endif
///
/// CONTAINING_RECORD - returns a pointer to the structure
/// from one of it's elements.
///
#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
///
/// ALIGN_POINTER - aligns a pointer to the lowest boundry
///
#define ALIGN_POINTER(p, s) ((VOID *) ((p) + (((s) - ((UINTN) (p))) & ((s) - 1))))
///
/// ALIGN_VARIABLE - aligns a variable up to the next natural boundry for int size of a processor
///
#define ALIGN_VARIABLE(Value, Adjustment) \
Adjustment = 0U; \
if ((UINTN) (Value) % sizeof (UINTN)) { \
(Adjustment) = (UINTN)(sizeof (UINTN) - ((UINTN) (Value) % sizeof (UINTN))); \
} \
(Value) = (UINTN)((UINTN) (Value) + (UINTN) (Adjustment))
//
// EFI Error Codes common to all execution phases
//
typedef INTN RETURN_STATUS;
///
/// Set the upper bit to indicate EFI Error.
///
#define ENCODE_ERROR(a) (MAX_BIT | (a))
#define ENCODE_WARNING(a) (a)
#define RETURN_ERROR(a) ((a) < 0)
#define RETURN_SUCCESS 0
#define RETURN_LOAD_ERROR ENCODE_ERROR (1)
#define RETURN_INVALID_PARAMETER ENCODE_ERROR (2)
#define RETURN_UNSUPPORTED ENCODE_ERROR (3)
#define RETURN_BAD_BUFFER_SIZE ENCODE_ERROR (4)
#define RETURN_BUFFER_TOO_SMALL ENCODE_ERROR (5)
#define RETURN_NOT_READY ENCODE_ERROR (6)
#define RETURN_DEVICE_ERROR ENCODE_ERROR (7)
#define RETURN_WRITE_PROTECTED ENCODE_ERROR (8)
#define RETURN_OUT_OF_RESOURCES ENCODE_ERROR (9)
#define RETURN_VOLUME_CORRUPTED ENCODE_ERROR (10)
#define RETURN_VOLUME_FULL ENCODE_ERROR (11)
#define RETURN_NO_MEDIA ENCODE_ERROR (12)
#define RETURN_MEDIA_CHANGED ENCODE_ERROR (13)
#define RETURN_NOT_FOUND ENCODE_ERROR (14)
#define RETURN_ACCESS_DENIED ENCODE_ERROR (15)
#define RETURN_NO_RESPONSE ENCODE_ERROR (16)
#define RETURN_NO_MAPPING ENCODE_ERROR (17)
#define RETURN_TIMEOUT ENCODE_ERROR (18)
#define RETURN_NOT_STARTED ENCODE_ERROR (19)
#define RETURN_ALREADY_STARTED ENCODE_ERROR (20)
#define RETURN_ABORTED ENCODE_ERROR (21)
#define RETURN_ICMP_ERROR ENCODE_ERROR (22)
#define RETURN_TFTP_ERROR ENCODE_ERROR (23)
#define RETURN_PROTOCOL_ERROR ENCODE_ERROR (24)
#define RETURN_INCOMPATIBLE_VERSION ENCODE_ERROR (25)
#define RETURN_SECURITY_VIOLATION ENCODE_ERROR (26)
#define RETURN_CRC_ERROR ENCODE_ERROR (27)
#define RETURN_END_OF_MEDIA ENCODE_ERROR (28)
#define RETURN_END_OF_FILE ENCODE_ERROR (31)
#define RETURN_WARN_UNKNOWN_GLYPH ENCODE_WARNING (1)
#define RETURN_WARN_DELETE_FAILURE ENCODE_WARNING (2)
#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3)
#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)
typedef UINT64 PHYSICAL_ADDRESS;
#endif

View File

@@ -0,0 +1,37 @@
/** @file
This includes for the Boot mode information.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: BootMode.h
@par Revision Reference:
These definitions are from PeiCis 0.91 spec.
**/
#ifndef __EFI_BOOT_MODE_H__
#define __EFI_BOOT_MODE_H__
#define BOOT_WITH_FULL_CONFIGURATION 0x00
#define BOOT_WITH_MINIMAL_CONFIGURATION 0x01
#define BOOT_ASSUMING_NO_CONFIGURATION_CHANGES 0x02
#define BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS 0x03
#define BOOT_WITH_DEFAULT_SETTINGS 0x04
#define BOOT_ON_S4_RESUME 0x05
#define BOOT_ON_S5_RESUME 0x06
#define BOOT_ON_S2_RESUME 0x10
#define BOOT_ON_S3_RESUME 0x11
#define BOOT_ON_FLASH_UPDATE 0x12
#define BOOT_IN_RECOVERY_MODE 0x20
#define BOOT_IN_RECOVERY_MODE_MASK 0x40
#define BOOT_SPECIAL_MASK 0x80
#endif

View File

@@ -0,0 +1,198 @@
/** @file
This file declares the related BootScript definitions and some SMBus definitions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: BootScript.h
@par Revision Reference:
These definitions are defined in BootScript Spec 0.91 and SmBus PPI spec 0.9.
**/
#ifndef _EFI_SCRIPT_H_
#define _EFI_SCRIPT_H_
#define EFI_ACPI_S3_RESUME_SCRIPT_TABLE 0x00
//
// 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_TABLE_OPCODE 0xAA
#define EFI_BOOT_SCRIPT_TERMINATE_OPCODE 0xFF
//
// EFI Boot Script Width
//
typedef enum {
EfiBootScriptWidthUint8,
EfiBootScriptWidthUint16,
EfiBootScriptWidthUint32,
EfiBootScriptWidthUint64,
EfiBootScriptWidthFifoUint8,
EfiBootScriptWidthFifoUint16,
EfiBootScriptWidthFifoUint32,
EfiBootScriptWidthFifoUint64,
EfiBootScriptWidthFillUint8,
EfiBootScriptWidthFillUint16,
EfiBootScriptWidthFillUint32,
EfiBootScriptWidthFillUint64,
EfiBootScriptWidthMaximum
} EFI_BOOT_SCRIPT_WIDTH;
//
// EFI Smbus Device Address, Smbus Device Command, Smbus Operation
//
typedef struct {
UINTN SmbusDeviceAddress : 7;
} EFI_SMBUS_DEVICE_ADDRESS;
typedef UINTN EFI_SMBUS_DEVICE_COMMAND;
typedef enum _EFI_SMBUS_OPERATION
{
EfiSmbusQuickRead,
EfiSmbusQuickWrite,
EfiSmbusReceiveByte,
EfiSmbusSendByte,
EfiSmbusReadByte,
EfiSmbusWriteByte,
EfiSmbusReadWord,
EfiSmbusWriteWord,
EfiSmbusReadBlock,
EfiSmbusWriteBlock,
EfiSmbusProcessCall,
EfiSmbusBWBRProcessCall
} EFI_SMBUS_OPERATION;
//
// Boot Script Opcode Header Structure Definitions
//
typedef struct {
UINT16 OpCode;
UINT8 Length;
} EFI_BOOT_SCRIPT_GENERIC_HEADER;
typedef struct {
UINT16 OpCode;
UINT8 Length;
UINT16 Version;
UINT32 TableLength;
UINT16 Reserved[2];
} EFI_BOOT_SCRIPT_TABLE_HEADER;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_BOOT_SCRIPT_WIDTH Width;
} EFI_BOOT_SCRIPT_COMMON_HEADER;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_BOOT_SCRIPT_WIDTH Width;
UINTN Count;
UINT64 Address;
} EFI_BOOT_SCRIPT_IO_WRITE;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_BOOT_SCRIPT_WIDTH Width;
UINT64 Address;
} EFI_BOOT_SCRIPT_IO_READ_WRITE;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_BOOT_SCRIPT_WIDTH Width;
UINTN Count;
UINT64 Address;
} EFI_BOOT_SCRIPT_MEM_WRITE;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_BOOT_SCRIPT_WIDTH Width;
UINT64 Address;
} EFI_BOOT_SCRIPT_MEM_READ_WRITE;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_BOOT_SCRIPT_WIDTH Width;
UINTN Count;
UINT64 Address;
} EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_BOOT_SCRIPT_WIDTH Width;
UINT64 Address;
} EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_SMBUS_DEVICE_ADDRESS SlaveAddress;
EFI_SMBUS_DEVICE_COMMAND Command;
EFI_SMBUS_OPERATION Operation;
BOOLEAN PecCheck;
UINTN DataSize;
} EFI_BOOT_SCRIPT_SMBUS_EXECUTE;
typedef struct {
UINT16 OpCode;
UINT8 Length;
UINTN Duration;
} EFI_BOOT_SCRIPT_STALL;
typedef struct {
UINT16 OpCode;
UINT8 Length;
EFI_PHYSICAL_ADDRESS EntryPoint;
} EFI_BOOT_SCRIPT_DISPATCH;
typedef struct {
UINT16 OpCode;
UINT8 Length;
} EFI_BOOT_SCRIPT_TERMINATE;
typedef union {
EFI_BOOT_SCRIPT_GENERIC_HEADER *Header;
EFI_BOOT_SCRIPT_TABLE_HEADER *TableInfo;
EFI_BOOT_SCRIPT_IO_WRITE *IoWrite;
EFI_BOOT_SCRIPT_IO_READ_WRITE *IoReadWrite;
EFI_BOOT_SCRIPT_MEM_WRITE *MemWrite;
EFI_BOOT_SCRIPT_MEM_READ_WRITE *MemReadWrite;
EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE *PciWrite;
EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE *PciReadWrite;
EFI_BOOT_SCRIPT_SMBUS_EXECUTE *SmbusExecute;
EFI_BOOT_SCRIPT_STALL *Stall;
EFI_BOOT_SCRIPT_DISPATCH *Dispatch;
EFI_BOOT_SCRIPT_TERMINATE *Terminate;
EFI_BOOT_SCRIPT_COMMON_HEADER *CommonHeader;
UINT8 *Raw;
} BOOT_SCRIPT_POINTERS;
#endif

View File

@@ -0,0 +1,67 @@
/** @file
Defines for the EFI Capsule functionality.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Capsule.h
@par Revision Reference:
These definitions are from Capsule Spec Version 0.9.
**/
#ifndef _EFI_CAPSULE_H_
#define _EFI_CAPSULE_H_
//
// Bits in the flags field of the capsule header
//
#define EFI_CAPSULE_HEADER_FLAG_SETUP 0x00000001 // supports setup changes
#define CAPSULE_BLOCK_DESCRIPTOR_SIGNATURE EFI_SIGNATURE_32 ('C', 'B', 'D', 'S')
//
// An array of these describe the blocks that make up a capsule for
// a capsule update.
//
typedef struct {
UINT64 Length; // length of the data block
EFI_PHYSICAL_ADDRESS Data; // physical address of the data block
UINT32 Signature; // CBDS
UINT32 CheckSum; // to sum this structure to 0
} EFI_CAPSULE_BLOCK_DESCRIPTOR;
typedef struct {
EFI_GUID OemGuid;
UINT32 HeaderSize;
//
// UINT8 OemHdrData[];
//
} EFI_CAPSULE_OEM_HEADER;
typedef struct {
EFI_GUID CapsuleGuid;
UINT32 HeaderSize;
UINT32 Flags;
UINT32 CapsuleImageSize;
UINT32 SequenceNumber;
EFI_GUID InstanceId;
UINT32 OffsetToSplitInformation;
UINT32 OffsetToCapsuleBody;
UINT32 OffsetToOemDefinedHeader;
UINT32 OffsetToAuthorInformation;
UINT32 OffsetToRevisionInformation;
UINT32 OffsetToShortDescription;
UINT32 OffsetToLongDescription;
UINT32 OffsetToApplicableDevices;
} EFI_CAPSULE_HEADER;
#endif // #ifndef _EFI_CAPSULE_H_

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
/** @file
This module contains data specific to dependency expressions
and local function prototypes.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Dependency.h
**/
#ifndef __DEPENDENCY_H__
#define __DEPENDENCY_H__
/// EFI_DEP_BEFORE - If present, this must be the first and only opcode
#define EFI_DEP_BEFORE 0x00
/// EFI_DEP_AFTER - If present, this must be the first and only opcode
#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
/// EFI_DEP_SOR - If present, this must be the first opcode
#define EFI_DEP_SOR 0x09
///
/// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression
/// to save time. A EFI_DEP_PUSH is evauated one an
/// replaced with EFI_DEP_REPLACE_TRUE
///
#define EFI_DEP_REPLACE_TRUE 0xff
///
/// Define the initial size of the dependency expression evaluation stack
///
#define DEPEX_STACK_SIZE_INCREMENT 0x1000
#endif

View File

@@ -0,0 +1,698 @@
/** @file
EFI image format for PE32+. Please note some data structures are different
for IA-32 and Itanium-based images, look for UINTN and the #ifdef EFI_IA64
@bug Fix text - doc as defined in MSFT EFI specification.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: EfiImage.h
**/
#ifndef __EFI_IMAGE_H__
#define __EFI_IMAGE_H__
//
// PE32+ Subsystem type for EFI images
//
#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10
#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
//
// BugBug: Need to get a real answer for this problem. This is not in the
// PE specification.
//
// A SAL runtime driver does not get fixed up when a transition to
// virtual mode is made. In all other cases it should be treated
// like a EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER image
//
#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
//
// PE32+ Machine type for EFI images
//
#define IMAGE_FILE_MACHINE_I386 0x014c
#define IMAGE_FILE_MACHINE_IA64 0x0200
#define IMAGE_FILE_MACHINE_EBC 0x0EBC
#define IMAGE_FILE_MACHINE_X64 0x8664
//
// Support old names for backward compatible
//
#define EFI_IMAGE_MACHINE_IA32 IMAGE_FILE_MACHINE_I386
#define EFI_IMAGE_MACHINE_IA64 IMAGE_FILE_MACHINE_IA64
#define EFI_IMAGE_MACHINE_IPF IMAGE_FILE_MACHINE_IA64
#define EFI_IMAGE_MACHINE_EBC IMAGE_FILE_MACHINE_EBC
#define EFI_IMAGE_MACHINE_X64 IMAGE_FILE_MACHINE_X64
#define EFI_IMAGE_DOS_SIGNATURE 0x5A4D // MZ
#define EFI_IMAGE_OS2_SIGNATURE 0x454E // NE
#define EFI_IMAGE_OS2_SIGNATURE_LE 0x454C // LE
#define EFI_IMAGE_NT_SIGNATURE 0x00004550 // PE00
#define EFI_IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
///
/// 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;
///
/// File header format.
///
typedef struct {
UINT16 Machine;
UINT16 NumberOfSections;
UINT32 TimeDateStamp;
UINT32 PointerToSymbolTable;
UINT32 NumberOfSymbols;
UINT16 SizeOfOptionalHeader;
UINT16 Characteristics;
} EFI_IMAGE_FILE_HEADER;
#define EFI_IMAGE_SIZEOF_FILE_HEADER 20
#define EFI_IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
#define EFI_IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
#define EFI_IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
#define EFI_IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
#define EFI_IMAGE_FILE_SYSTEM 0x1000 // System File.
#define EFI_IMAGE_FILE_DLL 0x2000 // File is a DLL.
#define EFI_IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
#define EFI_IMAGE_FILE_MACHINE_UNKNOWN 0
#define EFI_IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
#define EFI_IMAGE_FILE_MACHINE_R3000 0x162 // MIPS* little-endian, 0540 big-endian
#define EFI_IMAGE_FILE_MACHINE_R4000 0x166 // MIPS* little-endian
#define EFI_IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP*
#define EFI_IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM* PowerPC Little-Endian
#define EFI_IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
//
// * Other names and brands may be claimed as the property of others.
//
///
/// Directory format.
///
typedef struct {
UINT32 VirtualAddress;
UINT32 Size;
} EFI_IMAGE_DATA_DIRECTORY;
#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16
typedef struct {
UINT16 Magic;
UINT8 MajorLinkerVersion;
UINT8 MinorLinkerVersion;
UINT32 SizeOfCode;
UINT32 SizeOfInitializedData;
UINT32 SizeOfUninitializedData;
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
UINT32 BaseOfData;
UINT32 BaseOfBss;
UINT32 GprMask;
UINT32 CprMask[4];
UINT32 GpValue;
} EFI_IMAGE_ROM_OPTIONAL_HEADER;
#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
#define EFI_IMAGE_SIZEOF_ROM_OPTIONAL_HEADER sizeof (EFI_IMAGE_ROM_OPTIONAL_HEADER)
typedef struct {
EFI_IMAGE_FILE_HEADER FileHeader;
EFI_IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
} EFI_IMAGE_ROM_HEADERS;
///
/// @attention
/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
/// are for use ONLY by tools. All proper EFI code MUST use
/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
///
#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
typedef struct {
//
// Standard fields.
//
UINT16 Magic;
UINT8 MajorLinkerVersion;
UINT8 MinorLinkerVersion;
UINT32 SizeOfCode;
UINT32 SizeOfInitializedData;
UINT32 SizeOfUninitializedData;
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
UINT32 BaseOfData;
//
// NT additional fields.
//
UINT32 ImageBase;
UINT32 SectionAlignment;
UINT32 FileAlignment;
UINT16 MajorOperatingSystemVersion;
UINT16 MinorOperatingSystemVersion;
UINT16 MajorImageVersion;
UINT16 MinorImageVersion;
UINT16 MajorSubsystemVersion;
UINT16 MinorSubsystemVersion;
UINT32 Win32VersionValue;
UINT32 SizeOfImage;
UINT32 SizeOfHeaders;
UINT32 CheckSum;
UINT16 Subsystem;
UINT16 DllCharacteristics;
UINT32 SizeOfStackReserve;
UINT32 SizeOfStackCommit;
UINT32 SizeOfHeapReserve;
UINT32 SizeOfHeapCommit;
UINT32 LoaderFlags;
UINT32 NumberOfRvaAndSizes;
EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
} EFI_IMAGE_OPTIONAL_HEADER32;
///
/// @attention
/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64
/// are for use ONLY by tools. All proper EFI code MUST use
/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!
///
#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
typedef struct {
//
// Standard fields.
//
UINT16 Magic;
UINT8 MajorLinkerVersion;
UINT8 MinorLinkerVersion;
UINT32 SizeOfCode;
UINT32 SizeOfInitializedData;
UINT32 SizeOfUninitializedData;
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
//
// NT additional fields.
//
UINT64 ImageBase;
UINT32 SectionAlignment;
UINT32 FileAlignment;
UINT16 MajorOperatingSystemVersion;
UINT16 MinorOperatingSystemVersion;
UINT16 MajorImageVersion;
UINT16 MinorImageVersion;
UINT16 MajorSubsystemVersion;
UINT16 MinorSubsystemVersion;
UINT32 Win32VersionValue;
UINT32 SizeOfImage;
UINT32 SizeOfHeaders;
UINT32 CheckSum;
UINT16 Subsystem;
UINT16 DllCharacteristics;
UINT64 SizeOfStackReserve;
UINT64 SizeOfStackCommit;
UINT64 SizeOfHeapReserve;
UINT64 SizeOfHeapCommit;
UINT32 LoaderFlags;
UINT32 NumberOfRvaAndSizes;
EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];
} EFI_IMAGE_OPTIONAL_HEADER64;
///
/// @attention
/// EFI_IMAGE_NT_HEADERS32 and EFI_IMAGE_HEADERS64 are for use ONLY
/// by tools. All proper EFI code MUST use EFI_IMAGE_NT_HEADERS ONLY!!!
///
typedef struct {
UINT32 Signature;
EFI_IMAGE_FILE_HEADER FileHeader;
EFI_IMAGE_OPTIONAL_HEADER32 OptionalHeader;
} EFI_IMAGE_NT_HEADERS32;
#define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32)
typedef struct {
UINT32 Signature;
EFI_IMAGE_FILE_HEADER FileHeader;
EFI_IMAGE_OPTIONAL_HEADER64 OptionalHeader;
} EFI_IMAGE_NT_HEADERS64;
#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64)
//
// Processor specific definition of EFI_IMAGE_OPTIONAL_HEADER so the
// type name EFI_IMAGE_OPTIONAL_HEADER is appropriate to the build. Same for
// EFI_IMAGE_NT_HEADERS. These definitions MUST be used by ALL EFI code.
//
#if defined (MDE_CPU_IA32)
typedef EFI_IMAGE_OPTIONAL_HEADER32 EFI_IMAGE_OPTIONAL_HEADER;
typedef EFI_IMAGE_NT_HEADERS32 EFI_IMAGE_NT_HEADERS;
#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
(((Machine) == EFI_IMAGE_MACHINE_IA32) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
#elif defined (MDE_CPU_IPF)
typedef EFI_IMAGE_OPTIONAL_HEADER64 EFI_IMAGE_OPTIONAL_HEADER;
typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
(((Machine) == EFI_IMAGE_MACHINE_IPF) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
#elif defined (MDE_CPU_X64)
typedef EFI_IMAGE_OPTIONAL_HEADER64 EFI_IMAGE_OPTIONAL_HEADER;
typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
(((Machine) == EFI_IMAGE_MACHINE_X64) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
#elif defined (MDE_CPU_EBC)
//
// This is just to make sure you can cross compile with the EBC compiiler.
// It does not make sense to have a PE loader coded in EBC. You need to
// understand the basic
//
typedef EFI_IMAGE_OPTIONAL_HEADER64 EFI_IMAGE_OPTIONAL_HEADER;
typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC)
#else
#error Unknown Processor Type
#endif
#define EFI_IMAGE_FIRST_SECTION(ntheader) \
( \
(EFI_IMAGE_SECTION_HEADER *) \
( \
(UINT32) ntheader + \
FIELD_OFFSET (EFI_IMAGE_NT_HEADERS, OptionalHeader) + \
((EFI_IMAGE_NT_HEADERS *) (ntheader))->FileHeader.SizeOfOptionalHeader \
) \
)
//
// 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
//
// 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
//
// Section header format.
//
#define EFI_IMAGE_SIZEOF_SHORT_NAME 8
typedef struct {
UINT8 Name[EFI_IMAGE_SIZEOF_SHORT_NAME];
union {
UINT32 PhysicalAddress;
UINT32 VirtualSize;
} Misc;
UINT32 VirtualAddress;
UINT32 SizeOfRawData;
UINT32 PointerToRawData;
UINT32 PointerToRelocations;
UINT32 PointerToLinenumbers;
UINT16 NumberOfRelocations;
UINT16 NumberOfLinenumbers;
UINT32 Characteristics;
} EFI_IMAGE_SECTION_HEADER;
#define EFI_IMAGE_SIZEOF_SECTION_HEADER 40
#define EFI_IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
#define EFI_IMAGE_SCN_CNT_CODE 0x00000020
#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
#define EFI_IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
#define EFI_IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information.
#define EFI_IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image.
#define EFI_IMAGE_SCN_LNK_COMDAT 0x00001000
#define EFI_IMAGE_SCN_ALIGN_1BYTES 0x00100000
#define EFI_IMAGE_SCN_ALIGN_2BYTES 0x00200000
#define EFI_IMAGE_SCN_ALIGN_4BYTES 0x00300000
#define EFI_IMAGE_SCN_ALIGN_8BYTES 0x00400000
#define EFI_IMAGE_SCN_ALIGN_16BYTES 0x00500000
#define EFI_IMAGE_SCN_ALIGN_32BYTES 0x00600000
#define EFI_IMAGE_SCN_ALIGN_64BYTES 0x00700000
#define EFI_IMAGE_SCN_MEM_DISCARDABLE 0x02000000
#define EFI_IMAGE_SCN_MEM_NOT_CACHED 0x04000000
#define EFI_IMAGE_SCN_MEM_NOT_PAGED 0x08000000
#define EFI_IMAGE_SCN_MEM_SHARED 0x10000000
#define EFI_IMAGE_SCN_MEM_EXECUTE 0x20000000
#define EFI_IMAGE_SCN_MEM_READ 0x40000000
#define EFI_IMAGE_SCN_MEM_WRITE 0x80000000
///
/// Symbol format.
///
#define EFI_IMAGE_SIZEOF_SYMBOL 18
//
// Section values.
//
// 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.
//
// Type (fundamental) values.
//
#define EFI_IMAGE_SYM_TYPE_NULL 0 // no type.
#define EFI_IMAGE_SYM_TYPE_VOID 1 //
#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
//
// 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
#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;
#define EFI_IMAGE_SIZEOF_RELOCATION 10
//
// I386 relocation types.
//
#define EFI_IMAGE_REL_I386_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
#define EFI_IMAGE_REL_I386_DIR16 01 // Direct 16-bit reference to the symbols virtual address
#define EFI_IMAGE_REL_I386_REL16 02 // PC-relative 16-bit reference to the symbols virtual address
#define EFI_IMAGE_REL_I386_DIR32 06 // Direct 32-bit reference to the symbols virtual address
#define EFI_IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit reference to the symbols virtual address, base not included
#define EFI_IMAGE_REL_I386_SEG12 011 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
#define EFI_IMAGE_REL_I386_SECTION 012
#define EFI_IMAGE_REL_I386_SECREL 013
#define EFI_IMAGE_REL_I386_REL32 024 // PC-relative 32-bit reference to the symbols virtual address
///
/// Based relocation format.
///
typedef struct {
UINT32 VirtualAddress;
UINT32 SizeOfBlock;
} EFI_IMAGE_BASE_RELOCATION;
#define EFI_IMAGE_SIZEOF_BASE_RELOCATION 8
//
// Based relocation types.
//
#define EFI_IMAGE_REL_BASED_ABSOLUTE 0
#define EFI_IMAGE_REL_BASED_HIGH 1
#define EFI_IMAGE_REL_BASED_LOW 2
#define EFI_IMAGE_REL_BASED_HIGHLOW 3
#define EFI_IMAGE_REL_BASED_HIGHADJ 4
#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR 5
#define EFI_IMAGE_REL_BASED_IA64_IMM64 9
#define 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;
#define EFI_IMAGE_SIZEOF_LINENUMBER 6
//
// Archive format.
//
#define EFI_IMAGE_ARCHIVE_START_SIZE 8
#define EFI_IMAGE_ARCHIVE_START "!<arch>\n"
#define EFI_IMAGE_ARCHIVE_END "`\n"
#define EFI_IMAGE_ARCHIVE_PAD "\n"
#define EFI_IMAGE_ARCHIVE_LINKER_MEMBER "/ "
#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
typedef struct {
UINT8 Name[16]; // File member name - `/' terminated.
UINT8 Date[12]; // File member date - decimal.
UINT8 UserID[6]; // File member user id - decimal.
UINT8 GroupID[6]; // File member group id - decimal.
UINT8 Mode[8]; // File member mode - octal.
UINT8 Size[10]; // File member size - decimal.
UINT8 EndHeader[2]; // String to end header.
} EFI_IMAGE_ARCHIVE_MEMBER_HEADER;
#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
//
// DLL support.
//
///
/// DLL Export Format
///
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;
///
/// DLL support.
/// Import Format
///
typedef struct {
UINT16 Hint;
UINT8 Name[1];
} EFI_IMAGE_IMPORT_BY_NAME;
typedef struct {
union {
UINT32 Function;
UINT32 Ordinal;
EFI_IMAGE_IMPORT_BY_NAME *AddressOfData;
} u1;
} EFI_IMAGE_THUNK_DATA;
#define EFI_IMAGE_ORDINAL_FLAG 0x80000000
#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)
#define EFI_IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
typedef struct {
UINT32 Characteristics;
UINT32 TimeDateStamp;
UINT32 ForwarderChain;
UINT32 Name;
EFI_IMAGE_THUNK_DATA *FirstThunk;
} EFI_IMAGE_IMPORT_DESCRIPTOR;
///
/// Debug Format
///
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2
typedef struct {
UINT32 Characteristics;
UINT32 TimeDateStamp;
UINT16 MajorVersion;
UINT16 MinorVersion;
UINT32 Type;
UINT32 SizeOfData;
UINT32 RVA;
UINT32 FileOffset;
} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
#define CODEVIEW_SIGNATURE_NB10 0x3031424E // "NB10"
typedef struct {
UINT32 Signature; // "NB10"
UINT32 Unknown;
UINT32 Unknown2;
UINT32 Unknown3;
//
// Filename of .PDB goes here
//
} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
#define CODEVIEW_SIGNATURE_RSDS 0x53445352 // "RSDS"
typedef struct {
UINT32 Signature; // "RSDS"
UINT32 Unknown;
UINT32 Unknown2;
UINT32 Unknown3;
UINT32 Unknown4;
UINT32 Unknown5;
//
// Filename of .PDB goes here
//
} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
///
/// Header format for TE images
///
typedef struct {
UINT16 Signature; // signature for TE format = "VZ"
UINT16 Machine; // from the original file header
UINT8 NumberOfSections; // from the original file header
UINT8 Subsystem; // from original optional header
UINT16 StrippedSize; // how many bytes we removed from the header
UINT32 AddressOfEntryPoint; // offset to entry point -- from original optional header
UINT32 BaseOfCode; // from original image -- required for ITP debug
UINT64 ImageBase; // from original file header
EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]; // only base relocation and debug directory
} EFI_TE_IMAGE_HEADER;
#define EFI_TE_IMAGE_HEADER_SIGNATURE 0x5A56 // "VZ"
//
// Data directory indexes in our TE image header
//
#define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC 0
#define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG 1
#endif

View File

@@ -0,0 +1,98 @@
/** @file
This file defines the data structures that comprise the FFS file system.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: FirmwareFileSystem.h
@par Revision Reference:
These definitions are from Firmware File System Spec 0.9.
**/
#ifndef __EFI_FFS_FILE_SYSTEM_H__
#define __EFI_FFS_FILE_SYSTEM_H__
///
/// FFS specific file types
///
#define EFI_FV_FILETYPE_FFS_PAD 0xF0
//
// FFS File Attributes
//
#define FFS_ATTRIB_TAIL_PRESENT 0x01
#define FFS_ATTRIB_RECOVERY 0x02
#define FFS_ATTRIB_HEADER_EXTENSION 0x04
#define FFS_ATTRIB_DATA_ALIGNMENT 0x38
#define FFS_ATTRIB_CHECKSUM 0x40
///
/// FFS_FIXED_CHECKSUM is the default checksum value used when the
/// FFS_ATTRIB_CHECKSUM attribute bit is clear
/// note this is NOT an architecturally defined value, but is in this file for
/// implementation convenience
///
#define FFS_FIXED_CHECKSUM 0x5A
//
// File state definitions
//
#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
#define EFI_FILE_ALL_STATE_BITS (EFI_FILE_HEADER_CONSTRUCTION | \
EFI_FILE_HEADER_VALID | \
EFI_FILE_DATA_VALID | \
EFI_FILE_MARKED_FOR_UPDATE | \
EFI_FILE_DELETED | \
EFI_FILE_HEADER_INVALID \
)
#define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \
( \
(BOOLEAN) ( \
(FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \
) \
)
typedef UINT16 EFI_FFS_FILE_TAIL;
///
/// FFS file integrity check structure
///
typedef union {
struct {
UINT8 Header;
UINT8 File;
} Checksum;
UINT16 TailReference;
} EFI_FFS_INTEGRITY_CHECK;
//
// FFS file header definition
//
typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
typedef UINT8 EFI_FFS_FILE_STATE;
typedef struct {
EFI_GUID Name;
EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
EFI_FV_FILETYPE Type;
EFI_FFS_FILE_ATTRIBUTES Attributes;
UINT8 Size[3];
EFI_FFS_FILE_STATE State;
} EFI_FFS_FILE_HEADER;
#endif

View File

@@ -0,0 +1,109 @@
/** @file
Defines data structure that is the volume header found at the beginning of
all firmware volumes that are either memory mapped, or have an
associated FirmwareVolumeBlock protocol.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: FirmwareVolumeHeader.h
@par Revision Reference:
These definitions are from Firmware Volume Block Spec 0.9.
**/
#ifndef __EFI_FIRMWARE_VOLUME_HEADER_H__
#define __EFI_FIRMWARE_VOLUME_HEADER_H__
//
// Firmware Volume Block Attributes definition
//
typedef UINT32 EFI_FVB_ATTRIBUTES;
//
// Firmware Volume Block Attributes bit definitions
//
#define EFI_FVB_READ_DISABLED_CAP 0x00000001
#define EFI_FVB_READ_ENABLED_CAP 0x00000002
#define EFI_FVB_READ_STATUS 0x00000004
#define EFI_FVB_WRITE_DISABLED_CAP 0x00000008
#define EFI_FVB_WRITE_ENABLED_CAP 0x00000010
#define EFI_FVB_WRITE_STATUS 0x00000020
#define EFI_FVB_LOCK_CAP 0x00000040
#define EFI_FVB_LOCK_STATUS 0x00000080
#define EFI_FVB_STICKY_WRITE 0x00000200
#define EFI_FVB_MEMORY_MAPPED 0x00000400
#define EFI_FVB_ERASE_POLARITY 0x00000800
#define EFI_FVB_ALIGNMENT_CAP 0x00008000
#define EFI_FVB_ALIGNMENT_2 0x00010000
#define EFI_FVB_ALIGNMENT_4 0x00020000
#define EFI_FVB_ALIGNMENT_8 0x00040000
#define EFI_FVB_ALIGNMENT_16 0x00080000
#define EFI_FVB_ALIGNMENT_32 0x00100000
#define EFI_FVB_ALIGNMENT_64 0x00200000
#define EFI_FVB_ALIGNMENT_128 0x00400000
#define EFI_FVB_ALIGNMENT_256 0x00800000
#define EFI_FVB_ALIGNMENT_512 0x01000000
#define EFI_FVB_ALIGNMENT_1K 0x02000000
#define EFI_FVB_ALIGNMENT_2K 0x04000000
#define EFI_FVB_ALIGNMENT_4K 0x08000000
#define EFI_FVB_ALIGNMENT_8K 0x10000000
#define EFI_FVB_ALIGNMENT_16K 0x20000000
#define EFI_FVB_ALIGNMENT_32K 0x40000000
#define EFI_FVB_ALIGNMENT_64K 0x80000000
#define EFI_FVB_CAPABILITIES (EFI_FVB_READ_DISABLED_CAP | \
EFI_FVB_READ_ENABLED_CAP | \
EFI_FVB_WRITE_DISABLED_CAP | \
EFI_FVB_WRITE_ENABLED_CAP | \
EFI_FVB_LOCK_CAP \
)
#define EFI_FVB_STATUS (EFI_FVB_READ_STATUS | EFI_FVB_WRITE_STATUS | EFI_FVB_LOCK_STATUS)
///
/// Firmware Volume Header Revision definition
///
#define EFI_FVH_REVISION 0x01
///
/// Firmware Volume Header Signature definition
///
#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')
///
/// Firmware Volume Header Block Map Entry definition
///
typedef struct {
UINT32 NumBlocks;
UINT32 BlockLength;
} EFI_FV_BLOCK_MAP_ENTRY;
///
/// Firmware Volume Header definition
///
typedef struct {
UINT8 ZeroVector[16];
EFI_GUID FileSystemGuid;
UINT64 FvLength;
UINT32 Signature;
EFI_FVB_ATTRIBUTES Attributes;
UINT16 HeaderLength;
UINT16 Checksum;
UINT8 Reserved[3];
UINT8 Revision;
EFI_FV_BLOCK_MAP_ENTRY FvBlockMap[1];
} EFI_FIRMWARE_VOLUME_HEADER;
#endif

View File

@@ -0,0 +1,277 @@
/** @file
This file defines the data structures that are architecturally defined for file
images loaded via the FirmwareVolume protocol. The Firmware Volume specification
is the basis for these definitions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: FimrwareVolumeImageFormat.h
@par Revision Reference:
These definitions are from Firmware Volume Spec 0.9.
**/
#ifndef __FIRMWARE_VOLUME_IMAGE_FORMAT_H__
#define __FIRMWARE_VOLUME_IMAGE_FORMAT_H__
//
// pack all data structures since this is actually a binary format and we cannot
// allow internal padding in the data structures because of some compilerism..
//
#pragma pack(1)
//
// ////////////////////////////////////////////////////////////////////////////
//
// Architectural file types
//
typedef UINT8 EFI_FV_FILETYPE;
#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
//
// File type 0x0A is reserved and should not be used
//
#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
//
// ////////////////////////////////////////////////////////////////////////////
//
// Section types
//
typedef UINT8 EFI_SECTION_TYPE;
//
// ************************************************************
// The section type EFI_SECTION_ALL is a psuedo type. It is
// used as a wildcard when retrieving sections. The section
// type EFI_SECTION_ALL matches all section types.
// ************************************************************
//
#define EFI_SECTION_ALL 0x00
//
// ************************************************************
// Encapsulation section Type values
// ************************************************************
//
#define EFI_SECTION_COMPRESSION 0x01
#define EFI_SECTION_GUID_DEFINED 0x02
//
// ************************************************************
// Leaf section Type values
// ************************************************************
//
#define EFI_SECTION_FIRST_LEAF_SECTION_TYPE 0x10
#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_LAST_LEAF_SECTION_TYPE 0x1B
#define EFI_SECTION_LAST_SECTION_TYPE 0x1B
//
// ////////////////////////////////////////////////////////////////////////////
//
// Common section header
//
typedef struct {
UINT8 Size[3];
UINT8 Type;
} EFI_COMMON_SECTION_HEADER;
#define SECTION_SIZE(SectionHeaderPtr) \
((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))
//
// ////////////////////////////////////////////////////////////////////////////
//
// Compression section
//
//
// CompressionType values
//
#define EFI_NOT_COMPRESSED 0x00
#define EFI_STANDARD_COMPRESSION 0x01
#define EFI_CUSTOMIZED_COMPRESSION 0x02
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
UINT32 UncompressedLength;
UINT8 CompressionType;
} EFI_COMPRESSION_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// GUID defined section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
EFI_GUID SectionDefinitionGuid;
UINT16 DataOffset;
UINT16 Attributes;
} EFI_GUID_DEFINED_SECTION;
//
// Bit values for Attributes
//
#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
//
// Bit values for AuthenticationStatus
//
#define EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE 0x000001
#define EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED 0x000002
#define EFI_AGGREGATE_AUTH_STATUS_NOT_TESTED 0x000004
#define EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED 0x000008
#define EFI_AGGREGATE_AUTH_STATUS_ALL 0x00000f
#define EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE 0x010000
#define EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED 0x020000
#define EFI_LOCAL_AUTH_STATUS_NOT_TESTED 0x040000
#define EFI_LOCAL_AUTH_STATUS_TEST_FAILED 0x080000
#define EFI_LOCAL_AUTH_STATUS_ALL 0x0f0000
//
// ////////////////////////////////////////////////////////////////////////////
//
// PE32+ section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
} EFI_PE32_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// PIC section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
} EFI_PIC_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// PEIM header section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
} EFI_PEIM_HEADER_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// DEPEX section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
} EFI_DEPEX_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// Version section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
UINT16 BuildNumber;
INT16 VersionString[1];
} EFI_VERSION_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// User interface section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
INT16 FileNameString[1];
} EFI_USER_INTERFACE_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// Code16 section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
} EFI_CODE16_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// Firmware Volume Image section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
} EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// Freeform subtype GUID section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
EFI_GUID SubTypeGuid;
} EFI_FREEFORM_SUBTYPE_GUID_SECTION;
//
// ////////////////////////////////////////////////////////////////////////////
//
// Raw section
//
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
} EFI_RAW_SECTION;
//
// undo the pragma from the beginning...
//
#pragma pack()
typedef union {
EFI_COMMON_SECTION_HEADER *CommonHeader;
EFI_COMPRESSION_SECTION *CompressionSection;
EFI_GUID_DEFINED_SECTION *GuidDefinedSection;
EFI_PE32_SECTION *Pe32Section;
EFI_PIC_SECTION *PicSection;
EFI_PEIM_HEADER_SECTION *PeimHeaderSection;
EFI_DEPEX_SECTION *DependencySection;
EFI_VERSION_SECTION *VersionSection;
EFI_USER_INTERFACE_SECTION *UISection;
EFI_CODE16_SECTION *Code16Section;
EFI_FIRMWARE_VOLUME_IMAGE_SECTION *FVImageSection;
EFI_FREEFORM_SUBTYPE_GUID_SECTION *FreeformSubtypeSection;
EFI_RAW_SECTION *RawSection;
} EFI_FILE_SECTION_POINTER;
#endif

235
MdePkg/Include/Common/Hob.h Normal file
View File

@@ -0,0 +1,235 @@
/** @file
Hand Off Block (HOB) definition.
The HOB is a memory data structure used to hand-off system information from
PEI to DXE (the next phase).
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Hob.h
@par Revision Reference:
These definitions are from Hand Off Block (HOB) Spec Version 0.9.
**/
#ifndef __HOB_H__
#define __HOB_H__
//
// Every Hob must start with this data structure.
//
typedef struct {
UINT16 HobType;
UINT16 HobLength;
UINT32 Reserved;
} EFI_HOB_GENERIC_HEADER;
//
// End of HOB List HOB
//
#define EFI_HOB_TYPE_END_OF_HOB_LIST 0xffff
//
// Handoff Information Table HOB
//
#define EFI_HOB_TYPE_HANDOFF 0x0001
#define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009
typedef UINT32 EFI_BOOT_MODE;
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
UINT32 Version;
EFI_BOOT_MODE BootMode;
EFI_PHYSICAL_ADDRESS EfiMemoryTop;
EFI_PHYSICAL_ADDRESS EfiMemoryBottom;
EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop;
EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom;
EFI_PHYSICAL_ADDRESS EfiEndOfHobList;
} EFI_HOB_HANDOFF_INFO_TABLE;
//
// Memory Descriptor HOB
//
#define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002
typedef struct {
EFI_GUID Name;
EFI_PHYSICAL_ADDRESS MemoryBaseAddress;
UINT64 MemoryLength;
EFI_MEMORY_TYPE MemoryType;
UINT8 Reserved[4];
} EFI_HOB_MEMORY_ALLOCATION_HEADER;
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;
//
// Additional data pertaining to the "Name" Guid memory
// may go here.
//
} EFI_HOB_MEMORY_ALLOCATION;
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;
} EFI_HOB_MEMORY_ALLOCATION_BSP_STORE;
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;
} EFI_HOB_MEMORY_ALLOCATION_STACK;
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader;
EFI_GUID ModuleName;
EFI_PHYSICAL_ADDRESS EntryPoint;
} EFI_HOB_MEMORY_ALLOCATION_MODULE;
#define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003
typedef UINT32 EFI_RESOURCE_TYPE;
#define EFI_RESOURCE_SYSTEM_MEMORY 0
#define EFI_RESOURCE_MEMORY_MAPPED_IO 1
#define EFI_RESOURCE_IO 2
#define EFI_RESOURCE_FIRMWARE_DEVICE 3
#define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 4
#define EFI_RESOURCE_MEMORY_RESERVED 5
#define EFI_RESOURCE_IO_RESERVED 6
#define EFI_RESOURCE_MAX_MEMORY_TYPE 7
typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
#define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001
#define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002
#define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004
#define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008
#define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010
#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020
#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040
#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080
#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100
#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200
#define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400
#define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800
#define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000
#define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000
#define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000
#define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000
#define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000
#define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_GUID Owner;
EFI_RESOURCE_TYPE ResourceType;
EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;
EFI_PHYSICAL_ADDRESS PhysicalStart;
UINT64 ResourceLength;
} EFI_HOB_RESOURCE_DESCRIPTOR;
//
// GUID Extension HOB
// The HobLength is variable as it includes the GUID specific data.
//
#define EFI_HOB_TYPE_GUID_EXTENSION 0x0004
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_GUID Name;
//
// Guid specific data goes here
//
} EFI_HOB_GUID_TYPE;
//
// Firmware Volume HOB
//
#define EFI_HOB_TYPE_FV 0x0005
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_PHYSICAL_ADDRESS BaseAddress;
UINT64 Length;
} EFI_HOB_FIRMWARE_VOLUME;
//
// CPU HOB
//
#define EFI_HOB_TYPE_CPU 0x0006
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
UINT8 SizeOfMemorySpace;
UINT8 SizeOfIoSpace;
UINT8 Reserved[6];
} EFI_HOB_CPU;
//
// PEI Core Memory Pool HOB
// The HobLength is variable as the HOB contains pool allocations by
// the PeiServices AllocatePool function
//
#define EFI_HOB_TYPE_PEI_MEMORY_POOL 0x0007
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
} EFI_HOB_MEMORY_POOL;
//
// Capsule volume HOB -- identical to a firmware volume
//
#define EFI_HOB_TYPE_CV 0x0008
typedef struct {
EFI_HOB_GENERIC_HEADER Header;
EFI_PHYSICAL_ADDRESS BaseAddress;
UINT64 Length;
} EFI_HOB_CAPSULE_VOLUME;
#define EFI_HOB_TYPE_UNUSED 0xFFFE
//
// 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_CPU *Cpu;
EFI_HOB_MEMORY_POOL *Pool;
EFI_HOB_CAPSULE_VOLUME *CapsuleVolume;
UINT8 *Raw;
} EFI_PEI_HOB_POINTERS;
#define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
#define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
#define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
#define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_END_OF_HOB_LIST)
//
// Get the data and data size field of GUID
//
#define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))
#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))
#endif

View File

@@ -0,0 +1,422 @@
/** @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, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: InternalFormRepresentation.h
@par Revision Reference:
These definitions are from Human Interface Infrastructure Spec Version 0.92.
**/
#ifndef __EFI_INTERNAL_FORM_REPRESENTATION_H__
#define __EFI_INTERNAL_FORM_REPRESENTATION_H__
//
// The following types are currently defined:
//
typedef UINT32 RELOFST;
typedef CHAR16 *EFI_STRING;
//
// IFR Op codes
//
#define EFI_IFR_FORM_OP 0x01
#define EFI_IFR_SUBTITLE_OP 0x02
#define EFI_IFR_TEXT_OP 0x03
#define EFI_IFR_GRAPHIC_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 // ONEOF OPTION field
#define EFI_IFR_SUPPRESS_IF_OP 0x0A
#define EFI_IFR_END_FORM_OP 0x0B
#define EFI_IFR_HIDDEN_OP 0x0C
#define EFI_IFR_END_FORM_SET_OP 0x0D
#define EFI_IFR_FORM_SET_OP 0x0E
#define EFI_IFR_REF_OP 0x0F
#define EFI_IFR_END_ONE_OF_OP 0x10
#define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP
#define EFI_IFR_INCONSISTENT_IF_OP 0x11
#define EFI_IFR_EQ_ID_VAL_OP 0x12
#define EFI_IFR_EQ_ID_ID_OP 0x13
#define EFI_IFR_EQ_ID_LIST_OP 0x14
#define EFI_IFR_AND_OP 0x15
#define EFI_IFR_OR_OP 0x16
#define EFI_IFR_NOT_OP 0x17
#define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif
#define EFI_IFR_GRAYOUT_IF_OP 0x19
#define EFI_IFR_DATE_OP 0x1A
#define EFI_IFR_TIME_OP 0x1B
#define EFI_IFR_STRING_OP 0x1C
#define EFI_IFR_LABEL_OP 0x1D
#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E
#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
#define EFI_IFR_BANNER_OP 0x20
#define EFI_IFR_INVENTORY_OP 0x21
#define EFI_IFR_EQ_VAR_VAL_OP 0x22
#define EFI_IFR_ORDERED_LIST_OP 0x23
#define EFI_IFR_VARSTORE_OP 0x24
#define EFI_IFR_VARSTORE_SELECT_OP 0x25
#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
#define EFI_IFR_TRUE_OP 0x27
#define EFI_IFR_FALSE_OP 0x28
#define EFI_IFR_GT_OP 0x29
#define EFI_IFR_GE_OP 0x2A
#define EFI_IFR_OEM_DEFINED_OP 0x2B
#define EFI_IFR_LAST_OPCODE EFI_IFR_OEM_DEFINED_OP
#define EFI_IFR_OEM_OP 0xFE
#define EFI_IFR_NV_ACCESS_COMMAND 0xFF
//
// Define values for the flags fields in some VFR opcodes. These are
// bitmasks.
//
#define EFI_IFR_FLAG_DEFAULT 0x01
#define EFI_IFR_FLAG_MANUFACTURING 0x02
#define EFI_IFR_FLAG_INTERACTIVE 0x04
#define EFI_IFR_FLAG_NV_ACCESS 0x08
#define EFI_IFR_FLAG_RESET_REQUIRED 0x10
#define EFI_IFR_FLAG_LATE_CHECK 0x20
#define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager
#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
#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
#define EFI_FRONT_PAGE_SUBCLASS 0x02
#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
//
// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set
// and the browser since we need to distinguish between compiled NV map data and created data.
// We do not allow new entries to be created in the NV map dynamically however we still need
// to display this information correctly. To dynamically create op-codes and assume that their
// data will be saved, ensure that the NV starting location they refer to is pre-defined in the
// NV map.
//
#define EFI_IFR_FLAG_CREATED 128
#pragma pack(1)
//
// IFR Structure definitions
//
typedef struct {
UINT8 OpCode;
UINT8 Length;
} EFI_IFR_OP_HEADER;
typedef struct {
EFI_IFR_OP_HEADER Header;
EFI_GUID Guid;
STRING_REF FormSetTitle;
STRING_REF Help;
EFI_PHYSICAL_ADDRESS CallbackHandle;
UINT16 Class;
UINT16 SubClass;
UINT16 NvDataSize; // set once, size of the NV data as defined in the script
} EFI_IFR_FORM_SET;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 FormId;
STRING_REF FormTitle;
} EFI_IFR_FORM;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 LabelId;
} EFI_IFR_LABEL;
typedef struct {
EFI_IFR_OP_HEADER Header;
STRING_REF SubTitle;
} EFI_IFR_SUBTITLE;
typedef struct {
EFI_IFR_OP_HEADER Header;
STRING_REF Help;
STRING_REF Text;
STRING_REF TextTwo;
UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
UINT16 Key; // Value to be passed to caller to identify this particular op-code
} EFI_IFR_TEXT;
//
// goto
//
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 FormId;
STRING_REF Prompt;
STRING_REF Help; // The string Token for the context-help
UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
UINT16 Key; // Value to be passed to caller to identify this particular op-code
} EFI_IFR_REF;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_END_FORM;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_END_FORM_SET;
//
// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever
// changes we need to revisit the InitializeTagStructures code
//
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
UINT8 Width; // The Size of the Data being saved
STRING_REF Prompt; // The String Token for the Prompt
STRING_REF Help; // The string Token for the context-help
} EFI_IFR_ONE_OF;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // The offset in NV for storage of the data
UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)
STRING_REF Prompt; // The string token for the prompt
STRING_REF Help; // The string token for the context-help
} EFI_IFR_ORDERED_LIST;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
UINT8 Width; // The Size of the Data being saved
STRING_REF Prompt; // The String Token for the Prompt
STRING_REF Help; // The string Token for the context-help
UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely
UINT16 Key; // Value to be passed to caller to identify this particular op-code
} EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;
typedef struct {
EFI_IFR_OP_HEADER Header;
STRING_REF Option; // The string token describing the option
UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen
UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above
UINT16 Key; // Value to be passed to caller to identify this particular op-code
} EFI_IFR_ONE_OF_OPTION;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
UINT8 Width; // The Size of the Data being saved
STRING_REF Prompt; // The String Token for the Prompt
STRING_REF Help; // The string Token for the context-help
UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
UINT16 Key; // Value to be passed to caller to identify this particular op-code
UINT16 Minimum;
UINT16 Maximum;
UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for
UINT16 Default;
} EFI_IFR_NUMERIC;
//
// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from
// a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space
// will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system
// resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate
// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.
//
typedef struct {
EFI_IFR_NUMERIC Hour;
EFI_IFR_NUMERIC Minute;
EFI_IFR_NUMERIC Second;
} EFI_IFR_TIME;
typedef struct {
EFI_IFR_NUMERIC Year;
EFI_IFR_NUMERIC Month;
EFI_IFR_NUMERIC Day;
} EFI_IFR_DATE;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday
STRING_REF Prompt; // The String Token for the Prompt
STRING_REF Help; // The string Token for the context-help
UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
UINT16 Key; // Value to be passed to caller to identify this particular op-code
UINT8 MinSize; // Minimum allowable sized password
UINT8 MaxSize; // Maximum allowable sized password
UINT16 Encoding;
} EFI_IFR_PASSWORD;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday
STRING_REF Prompt; // The String Token for the Prompt
STRING_REF Help; // The string Token for the context-help
UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
UINT16 Key; // Value to be passed to caller to identify this particular op-code
UINT8 MinSize; // Minimum allowable sized password
UINT8 MaxSize; // Maximum allowable sized password
} EFI_IFR_STRING;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_END_ONE_OF;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 Value;
UINT16 Key;
} EFI_IFR_HIDDEN;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT8 Flags;
} EFI_IFR_SUPPRESS;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT8 Flags;
} EFI_IFR_GRAY_OUT;
typedef struct {
EFI_IFR_OP_HEADER Header;
STRING_REF Popup;
UINT8 Flags;
} EFI_IFR_INCONSISTENT;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // offset into variable storage
UINT8 Width; // size of variable storage
UINT16 Value; // value to compare against
} EFI_IFR_EQ_ID_VAL;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // offset into variable storage
UINT8 Width; // size of variable storage
UINT16 ListLength;
UINT16 ValueList[1];
} EFI_IFR_EQ_ID_LIST;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 QuestionId1; // offset into variable storage for first value to compare
UINT8 Width; // size of variable storage (must be same for both)
UINT16 QuestionId2; // offset into variable storage for second value to compare
} EFI_IFR_EQ_ID_ID;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 VariableId; // offset into variable storage
UINT16 Value; // value to compare against
} EFI_IFR_EQ_VAR_VAL;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_AND;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_OR;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_NOT;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_END_EXPR, EFI_IFR_END_IF;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 FormId;
STRING_REF Prompt;
STRING_REF Help;
UINT8 Flags;
UINT16 Key;
} EFI_IFR_SAVE_DEFAULTS;
typedef struct {
EFI_IFR_OP_HEADER Header;
STRING_REF Help;
STRING_REF Text;
STRING_REF TextTwo; // optional text
} EFI_IFR_INVENTORY;
typedef struct {
EFI_IFR_OP_HEADER Header;
EFI_GUID Guid; // GUID for the variable
UINT16 VarId; // variable store ID, as referenced elsewhere in the form
UINT16 Size; // size of the variable storage
} EFI_IFR_VARSTORE;
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 VarId; // variable store ID, as referenced elsewhere in the form
} EFI_IFR_VARSTORE_SELECT;
//
// Used for the ideqid VFR statement where two variable stores may be referenced in the
// same VFR statement.
// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following
// IFR opcodes use the VarId as defined here.
//
typedef struct {
EFI_IFR_OP_HEADER Header;
UINT16 VarId; // variable store ID, as referenced elsewhere in the form
UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form
} EFI_IFR_VARSTORE_SELECT_PAIR;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_TRUE;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_FALSE;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_GT;
typedef struct {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_GE;
//
// Save defaults and restore defaults have same structure
//
#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
typedef struct {
EFI_IFR_OP_HEADER Header;
STRING_REF Title; // The string token for the banner title
UINT16 LineNumber; // 1-based line number
UINT8 Alignment; // left, center, or right-aligned
} EFI_IFR_BANNER;
#define EFI_IFR_BANNER_ALIGN_LEFT 0
#define EFI_IFR_BANNER_ALIGN_CENTER 1
#define EFI_IFR_BANNER_ALIGN_RIGHT 2
#define EFI_IFR_BANNER_TIMEOUT 0xFF
#pragma pack()
#endif

View File

@@ -0,0 +1,310 @@
/** @file
API between 16-bit Legacy BIOS and EFI
We need to figure out what the 16-bit code is going to use to
represent these data structures. Is a pointer SEG:OFF or 32-bit...
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Legacy16.h
@par Revision Reference:
These definitions are from Compatibility Support Module Spec Version 0.96.
**/
#ifndef LEGACY_16_H_
#define LEGACY_16_H_
#define EFI_TO_LEGACY_MAJOR_VERSION 0x02
#define EFI_TO_LEGACY_MINOR_VERSION 0x00
#pragma pack(1)
//
// EFI Legacy to Legacy16 data
// EFI_COMPATIBILITY16_TABLE has been moved to LegacyBios protocol defn file.
//
typedef struct {
//
// Memory map used to start up Legacy16 code
//
UINT32 BiosLessThan1MB;
UINT32 HiPmmMemory;
UINT32 PmmMemorySizeInBytes;
UINT16 ReverseThunkCallSegment;
UINT16 ReverseThunkCallOffset;
UINT32 NumberE820Entries;
UINT32 OsMemoryAbove1Mb;
UINT32 ThunkStart;
UINT32 ThunkSizeInBytes;
UINT32 LowPmmMemory;
UINT32 LowPmmMemorySizeInBytes;
} EFI_TO_COMPATIBILITY16_INIT_TABLE;
#pragma pack()
//
// Legacy16 Call types
//
typedef enum {
Legacy16InitializeYourself = 0x0000,
Legacy16UpdateBbs = 0x0001,
Legacy16PrepareToBoot = 0x0002,
Legacy16Boot = 0x0003,
Legacy16RetrieveLastBootDevice= 0x0004,
Legacy16DispatchOprom = 0x0005,
Legacy16GetTableAddress = 0x0006,
Legacy16SetKeyboardLeds = 0x0007,
Legacy16InstallPciHandler = 0x0008,
} EFI_COMPATIBILITY_FUNCTIONS;
#define F0000Region 0x01
#define E0000Region 0x02
//
// Legacy16 call prototypes
// Input: AX = EFI_COMPATIBILITY16_FUNCTIONS for all functions.
// Output: AX = Return status for all functions. It follows EFI error
// codes.
//
// Legacy16InitializeYourself
// Description: This is the first call to 16-bit code. It allows the
// 16-bit to perform any internal initialization.
// Input: ES:BX pointer to EFI_TO_LEGACY16_INIT_TABLE
// Output:
// Legacy16UpdateBbs
// Description: The 16-bit code updates the BBS table for non-compliant
// devices.
// Input: ES:BX pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE
// Output:
// Legacy16PrepareToBoot
// Description: This is the last call to 16-bit code where 0xE0000 -0xFFFFF
// is read/write. 16-bit code does any final clean up.
// Input: ES:BX pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE
// Output:
// Legacy16Boot
// Description: Do INT19.
// Input:
// Output:
// Legacy16RetrieveLastBootDevice
// Description: Return the priority number of the device that booted.
// Input:
// Output: BX = priority number of the last attempted boot device.
// Legacy16DispatchOprom
// Description: Pass control to the specified OPROM. Allows the 16-bit
// code to rehook INT 13,18 and/or 19 from non-BBS
// compliant devices.
// Input: ES:DI = Segment:Offset of PnPInstallationCheck
// SI = OPROM segment. Offset assumed to be 3.
// BH = PCI bus number.
// BL = PCI device * 8 | PCI function.
// Output: BX = Number of BBS non-compliant drives detected. Return
// zero for BBS compliant devices.
// Legacy16GetTableAddress
// Description: Allocate an area in the 0xE0000-0xFFFFF region.
// Input: BX = Allocation region.
// 0x0 = Any region
// Bit 0 = 0xF0000 region
// Bit 1 = 0xE0000 region
// Multiple bits can be set.
// CX = Length in bytes requested
// DX = Required address alignment
// Bit mapped. First non-zero bit from right to left is
// alignment.
// Output: DS:BX is assigned region.
// AX = EFI_OUT_OF_RESOURCES if request cannot be granted.
// Legacy16SetKeyboardLeds
// Description: Perform any special action when keyboard LEDS change.
// Other code performs the LED change and updates standard
// BDA locations. This is for non-standard operations.
// Input: CL = LED status. 1 = set.
// Bit 0 = Scroll lock
// Bit 1 = Num lock
// Bit 2 = Caps lock
// Output:
// Legacy16InstallPciHandler
// Description: Provides 16-bit code a hook to establish an interrupt
// handler for any PCI device requiring a PCI interrupt
// but having no OPROM. This is called before interrupt
// is assigned. 8259 will be disabled(even if sharded)
// and PCI Interrupt Line unprogrammed. Other code will
// program 8259 and PCI Interrupt Line.
// Input: ES:BX Pointer to EFI_LEGACY_INSTALL_PCI_HANDLER strcture
// Output:
//
typedef UINT8 SERIAL_MODE;
typedef UINT8 PARALLEL_MODE;
#pragma pack(1)
#define DEVICE_SERIAL_MODE_NORMAL 0x00
#define DEVICE_SERIAL_MODE_IRDA 0x01
#define DEVICE_SERIAL_MODE_ASK_IR 0x02
#define DEVICE_SERIAL_MODE_DUPLEX_HALF 0x00
#define DEVICE_SERIAL_MODE_DUPLEX_FULL 0x10
#define DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY 0x00
#define DEVICE_PARALLEL_MODE_MODE_BIDIRECTIONAL 0x01
#define DEVICE_PARALLEL_MODE_MODE_EPP 0x02
#define DEVICE_PARALLEL_MODE_MODE_ECP 0x03
typedef struct {
UINT16 Address;
UINT8 Irq;
SERIAL_MODE Mode;
} DEVICE_PRODUCER_SERIAL;
typedef struct {
UINT16 Address;
UINT8 Irq;
UINT8 Dma;
PARALLEL_MODE Mode;
} DEVICE_PRODUCER_PARALLEL;
typedef struct {
UINT16 Address;
UINT8 Irq;
UINT8 Dma;
UINT8 NumberOfFloppy;
} DEVICE_PRODUCER_FLOPPY;
typedef struct {
UINT32 A20Kybd : 1;
UINT32 A20Port90 : 1;
UINT32 Reserved : 30;
} LEGACY_DEVICE_FLAGS;
typedef struct {
DEVICE_PRODUCER_SERIAL Serial[4];
DEVICE_PRODUCER_PARALLEL Parallel[3];
DEVICE_PRODUCER_FLOPPY Floppy;
UINT8 MousePresent;
LEGACY_DEVICE_FLAGS Flags;
} DEVICE_PRODUCER_DATA_HEADER;
//
// SMM Table definitions
// SMM table has a header that provides the number of entries. Following
// the header is a variable length amount of data.
//
#define STANDARD_IO 0x00
#define STANDARD_MEMORY 0x01
#define PORT_SIZE_8 0x00
#define PORT_SIZE_16 0x01
#define PORT_SIZE_32 0x02
#define PORT_SIZE_64 0x03
#define DATA_SIZE_8 0x00
#define DATA_SIZE_16 0x01
#define DATA_SIZE_32 0x02
#define DATA_SIZE_64 0x03
typedef struct {
UINT16 Type : 3;
UINT16 PortGranularity : 3;
UINT16 DataGranularity : 3;
UINT16 Reserved : 7;
} SMM_ATTRIBUTES;
#define INT15_D042 0x0000
#define GET_USB_BOOT_INFO 0x0001
#define DMI_PNP_50_57 0x0002
#define STANDARD_OWNER 0x0
#define OEM_OWNER 0x1
typedef struct {
UINT16 Function : 15;
UINT16 Owner : 1;
} SMM_FUNCTION;
typedef struct {
SMM_ATTRIBUTES SmmAttributes;
SMM_FUNCTION SmmFunction;
//
// Data size depends upon SmmAttributes and ranges from 2 bytes to
// 16 bytes
//
// bugbug how to do variable length Data
//
UINT8 SmmPort;
UINT8 SmmData;
} SMM_ENTRY;
typedef struct {
UINT16 NumSmmEntries;
SMM_ENTRY SmmEntry;
} SMM_TABLE;
//
// If MAX_IDE_CONTROLLER changes value 16-bit legacy code needs to change
//
#define MAX_IDE_CONTROLLER 8
typedef struct {
UINT16 MajorVersion;
UINT16 MinorVersion;
UINT32 AcpiTable; // 4 GB range
UINT32 SmbiosTable; // 4 GB range
UINT32 SmbiosTableLength;
//
// Legacy SIO state
//
DEVICE_PRODUCER_DATA_HEADER SioData;
UINT16 DevicePathType;
UINT16 PciIrqMask;
UINT32 NumberE820Entries;
//
// Controller & Drive Identify[2] per controller information
//
HDD_INFO HddInfo[MAX_IDE_CONTROLLER];
UINT32 NumberBbsEntries;
UINT32 BbsTable;
UINT32 SmmTable;
UINT32 OsMemoryAbove1Mb;
UINT32 UnconventionalDeviceTable;
} EFI_TO_COMPATIBILITY16_BOOT_TABLE;
typedef struct {
UINT8 PciBus;
UINT8 PciDeviceFun;
UINT8 PciSegment;
UINT8 PciClass;
UINT8 PciSubclass;
UINT8 PciInterface;
UINT8 PrimaryIrq;
UINT8 PrimaryReserved;
UINT16 PrimaryControl;
UINT16 PrimaryBase;
UINT16 PrimaryBusMaster;
UINT8 SecondaryIrq;
UINT8 SecondaryReserved;
UINT16 SecondaryControl;
UINT16 SecondaryBase;
UINT16 SecondaryBusMaster;
} EFI_LEGACY_INSTALL_PCI_HANDLER;
typedef struct {
UINT16 PnPInstallationCheckSegment;
UINT16 PnPInstallationCheckOffset;
UINT16 OpromSegment;
UINT8 PciBus;
UINT8 PciDeviceFunction;
UINT8 NumberBbsEntries;
VOID *BbsTablePointer;
} EFI_DISPATCH_OPROM_TABLE;
#pragma pack()
#endif

View File

@@ -0,0 +1,84 @@
/** @file
This includes some definitions that will be used in both PEI and DXE phases.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: MultiPhase.h
**/
#ifndef __MULTI_PHASE_H__
#define __MULTI_PHASE_H__
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Needed EFI defines for PEI
//
typedef UINT64 EFI_PHYSICAL_ADDRESS;
typedef enum {
EfiReservedMemoryType,
EfiLoaderCode,
EfiLoaderData,
EfiBootServicesCode,
EfiBootServicesData,
EfiRuntimeServicesCode,
EfiRuntimeServicesData,
EfiConventionalMemory,
EfiUnusableMemory,
EfiACPIReclaimMemory,
EfiACPIMemoryNVS,
EfiMemoryMappedIO,
EfiMemoryMappedIOPortSpace,
EfiPalCode,
EfiMaxMemoryType
} EFI_MEMORY_TYPE;
typedef UINT32 EFI_STATUS_CODE_TYPE;
typedef UINT32 EFI_STATUS_CODE_VALUE;
typedef struct {
UINT16 HeaderSize;
UINT16 Size;
EFI_GUID Type;
} EFI_STATUS_CODE_DATA;
typedef struct {
UINT64 Signature;
UINT32 Revision;
UINT32 HeaderSize;
UINT32 CRC32;
UINT32 Reserved;
} EFI_TABLE_HEADER;
#define EFI_PAGE_SIZE 4096
typedef VOID *EFI_HANDLE;
typedef UINT16 EFI_HII_HANDLE;
typedef UINT16 STRING_REF;
typedef struct {
INT16 Value;
INT16 Exponent;
} EFI_EXP_BASE10_DATA;
//
// Define macros to build data structure signatures from characters.
//
#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
(EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
#include <Protocol/DevicePath.h>
#endif

View File

@@ -0,0 +1,33 @@
/** @file
This file defines the common macro and data structure shared between PCD PEIM and
PCD DXE driver.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Pcd.h
**/
#ifndef _COMMON_PCD_H
#define _COMMON_PCD_H
typedef UINT32 PCD_TOKEN_NUMBER;
typedef UINT8 SKU_ID;
#define PCD_INVALID_TOKEN ((PCD_TOKEN_NUMBER)(-1))
typedef
VOID
(EFIAPI *PCD_PROTOCOL_CALLBACK) (
IN UINT32 CallBackToken,
IN VOID *TokenData,
IN UINTN TokenDataSize
);
#endif

View File

@@ -0,0 +1,91 @@
/** @file
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __PCD_TEMP_H__
#define __PCD_TEMP_H__
#define PCD_INVALID_TOKEN ((UINTN)(-1))
/*
* The following structure will be removed soon after the real
* PCD service PEIM and DXE driver are implmented.
*/
///
/// I have rearranged the data so that the variable length items are at the end of the structure
/// and we have a reasonable change of interpreting the other stuff properly.
///
typedef struct {
UINTN Token;
//
// HII Knowledge - non optimized for now
//
UINT8 HiiData; // If TRUE, use Variable Data
UINT8 SKUEnabled; // If TRUE, there might be various SKU data entries for this Token
UINT8 MaxSKUCount; // Up to 256 entries - limits the search space
UINT8 SKUId; // ID of the SKU
GUID VariableGuid; // Variable GUID
UINT32 DatumSize;
UINT64 Datum;
CHAR16 *VariableName; // Null-terminated Variable Name (remember to calculate size)
// We still need Offset information for the variable
// So naturally we can use DatumSize as the Length Field
// And we can overload the use of Datum for the Offset information
VOID *ExtendedData; // VOID* data of size DatumSize
} EMULATED_PCD_ENTRY;
typedef
VOID
(EFIAPI *PCD_TEMP_CALLBACK) (
IN CONST EFI_GUID *CallBackGuid, OPTIONAL
IN UINTN CallBackToken,
IN VOID *TokenData,
IN UINTN TokenDataSize
);
///
/// Used by the PCD Database - never contained in an FFS file
///
typedef struct {
UINTN Token;
//
// HII Knowledge - non optimized for now
//
UINT8 HiiData; // If TRUE, use Variable Data
UINT8 SKUEnabled; // If TRUE, there might be various SKU data entries for this Token
UINT8 MaxSKUCount; // Up to 256 entries - limits the search space
UINT8 SKUId; // ID of the SKU
GUID VariableGuid; // Variable GUID
UINT32 DatumSize;
UINT64 Datum;
CHAR16 *VariableName; // Null-terminated Variable Name (remember to calculate size)
// We still need Offset information for the variable
// So naturally we can use DatumSize as the Length Field
// And we can overload the use of Datum for the Offset information
VOID *ExtendedData; // VOID* data of size DatumSize
PCD_TEMP_CALLBACK *CallBackList;
UINT32 CallBackEntries;
UINT32 CallBackListSize;
} EMULATED_PCD_ENTRY_EX; // This exists to facilitate PCD Database implementation only
typedef struct {
UINTN Count;
EMULATED_PCD_ENTRY_EX Entry[1]; // This exists to facilitate PCD Database implementation only
} EMULATED_PCD_DATABASE_EX;
#endif

View File

@@ -0,0 +1,912 @@
/** @file
Status Code Definitions, according to Intel Platform Innovation Framework
for EFI Status Codes Specification
The file is divided into sections for ease of use.
<pre>
Section: Contents:
1 General Status Code Definitions
2 Class definitions
3 Computing Unit Subclasses, Progress and Error Codes
4 Peripheral Subclasses, Progress and Error Codes.
5 IO Bus Subclasses, Progress and Error Codes.
6 Software Subclasses, Progress and Error Codes.
7 Debug Codes
</pre>
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: StatusCode.h
@par Revision Reference:
Version 0.92.
**/
#ifndef _EFI_STATUS_CODE_H_
#define _EFI_STATUS_CODE_H_
//
// /////////////////////////////////////////////////////////////////////////////
// Section 1
///////////////////////////////////////////////////////////////////////////////
//
// 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.
//
#define EFI_ERROR_MINOR 0x40000000
#define EFI_ERROR_MAJOR 0x80000000
#define EFI_ERROR_UNRECOVERED 0x90000000
#define EFI_ERROR_UNCONTAINED 0xA0000000
//
// A Status Code Value is made up of the class, subclass, and
// an operation. Classes, subclasses, and operations are defined
// in the following sections.
//
#define EFI_STATUS_CODE_CLASS_MASK 0xFF000000
#define EFI_STATUS_CODE_SUBCLASS_MASK 0x00FF0000
#define EFI_STATUS_CODE_OPERATION_MASK 0x0000FFFF
//
// Data Hub Status Code class record definition
//
typedef struct {
EFI_STATUS_CODE_TYPE CodeType;
EFI_STATUS_CODE_VALUE Value;
UINT32 Instance;
EFI_GUID CallerId;
EFI_STATUS_CODE_DATA Data;
} DATA_HUB_STATUS_CODE_DATA_RECORD;
//
// /////////////////////////////////////////////////////////////////////////////
// Section 2
///////////////////////////////////////////////////////////////////////////////
//
// 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
//
// 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
//
// /////////////////////////////////////////////////////////////////////////////
// Section 3
///////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//
// 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.
//
///////////////////////////////////////////////////////////////////////////////
// Section 4
///////////////////////////////////////////////////////////////////////////////
//
// 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.
//
///////////////////////////////////////////////////////////////////////////////
// Section 5
///////////////////////////////////////////////////////////////////////////////
//
// 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_PC_BUS_ENUM (EFI_SUBCLASS_SPECIFIC | 0x00000000)
#define EFI_IOB_PCI_PC_RES_ALLOC (EFI_SUBCLASS_SPECIFIC | 0x00000001)
#define EFI_IOB_PCI_PC_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.
//
///////////////////////////////////////////////////////////////////////////////
// Section 6
///////////////////////////////////////////////////////////////////////////////
//
// 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)
//
// 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_PEIM_PC_RECOVERY_BEGIN (EFI_SUBCLASS_SPECIFIC | 0x00000000)
#define EFI_SW_PEIM_PC_CAPSULE_LOAD (EFI_SUBCLASS_SPECIFIC | 0x00000001)
#define EFI_SW_PEIM_PC_CAPSULE_START (EFI_SUBCLASS_SPECIFIC | 0x00000001)
#define EFI_SW_PEIM_PC_RECOVERY_USER (EFI_SUBCLASS_SPECIFIC | 0x00000003)
#define EFI_SW_PEIM_PC_RECOVERY_AUTO (EFI_SUBCLASS_SPECIFIC | 0x00000004)
//
// 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)
//
// 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)
#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 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 EFI AL Subclass Progress Code definitions.
//
#define EFI_SW_AL_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
#define EFI_SW_AL_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000001)
//
// Software Class EBC Exception Subclass Progress Code definitions.
//
//
// Software Class IA32 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)
//
// 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)
//
// 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)
//
// 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)
//
// Software Class PEI Module Subclass Error Code definitions.
//
#define EFI_SW_PEIM_EC_NO_RECOVERY_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
#define EFI_SW_PEIM_EC_INVALID_CAPSULE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x00000001)
//
// Software Class DXE Core Subclass Error Code definitions.
//
#define EFI_SW_CSM_LEGACY_ROM_INIT (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)
//
// 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.
//
//
// 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.
//
///////////////////////////////////////////////////////////////////////////////
// Section 7
///////////////////////////////////////////////////////////////////////////////
//
// Debug Code definitions for all classes and subclass
// Only one debug code is defined at this point and should
// be used for anything that gets sent to debug stream.
//
#define EFI_DC_UNSPECIFIED 0x0
#endif

View File

@@ -0,0 +1,336 @@
/** @file
This file defines the data structures to support Status Code Data.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: StatusCodeDataTypeId.h
@par Revision Reference:
These definitions are from Framework of EFI Status Code Spec
Version 0.92.
**/
#ifndef __STATUS_CODE_DATA_TYPE_ID_H__
#define __STATUS_CODE_DATA_TYPE_ID_H__
///
/// The size of string
///
#define EFI_STATUS_CODE_DATA_MAX_STRING_SIZE 150
///
/// This is the max data size including all the headers which can be passed
/// as Status Code data. This data should be multiple of 8 byte
/// to avoid any kind of boundary issue. Also, sum of this data size (inclusive
/// of size of EFI_STATUS_CODE_DATA should not exceed the max record size of
/// data hub
///
#define EFI_STATUS_CODE_DATA_MAX_SIZE 200
#pragma pack(1)
typedef enum {
EfiStringAscii,
EfiStringUnicode,
EfiStringToken
} EFI_STRING_TYPE;
typedef struct {
EFI_HII_HANDLE Handle;
STRING_REF Token;
} EFI_STATUS_CODE_STRING_TOKEN;
typedef union {
CHAR8 *Ascii;
CHAR16 *Unicode;
EFI_STATUS_CODE_STRING_TOKEN Hii;
} EFI_STATUS_CODE_STRING;
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_STRING_TYPE StringType;
EFI_STATUS_CODE_STRING String;
} EFI_STATUS_CODE_STRING_DATA;
#pragma pack()
#pragma pack(1)
typedef struct {
UINT32 ErrorLevel;
//
// 12 * sizeof (UINT64) Var Arg stack
//
// ascii DEBUG () Format string
//
} EFI_DEBUG_INFO;
#pragma pack()
//
// declaration for EFI_EXP_DATA. This may change
//
// typedef UINTN EFI_EXP_DATA;
///
/// Voltage Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_EXP_BASE10_DATA Voltage;
EFI_EXP_BASE10_DATA Threshold;
} EFI_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
///
/// Microcode Update Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT32 Version;
} EFI_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
///
/// Asynchronous Timer Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_EXP_BASE10_DATA TimerLimit;
} EFI_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
///
/// Host Processor Mismatch Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT32 Instance;
UINT16 Attributes;
} EFI_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
//
// EFI_COMPUTING_UNIT_MISMATCH_ATTRIBUTES
// All other attributes are reserved for future use and
// must be initialized to 0.
//
#define EFI_COMPUTING_UNIT_MISMATCH_SPEED 0x0001
#define EFI_COMPUTING_UNIT_MISMATCH_FSB_SPEED 0x0002
#define EFI_COMPUTING_UNIT_MISMATCH_FAMILY 0x0004
#define EFI_COMPUTING_UNIT_MISMATCH_MODEL 0x0008
#define EFI_COMPUTING_UNIT_MISMATCH_STEPPING 0x0010
#define EFI_COMPUTING_UNIT_MISMATCH_CACHE_SIZE 0x0020
#define EFI_COMPUTING_UNIT_MISMATCH_OEM1 0x1000
#define EFI_COMPUTING_UNIT_MISMATCH_OEM2 0x2000
#define EFI_COMPUTING_UNIT_MISMATCH_OEM3 0x4000
#define EFI_COMPUTING_UNIT_MISMATCH_OEM4 0x8000
///
/// Thermal Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_EXP_BASE10_DATA Temperature;
EFI_EXP_BASE10_DATA Threshold;
} EFI_COMPUTING_UNIT_THERMAL_ERROR_DATA;
///
/// Processor Disabled Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT32 Cause;
BOOLEAN SoftwareDisabled;
} EFI_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
typedef enum {
EfiInitCacheDataOnly,
EfiInitCacheInstrOnly,
EfiInitCacheBoth,
EfiInitCacheUnspecified
} EFI_INIT_CACHE_TYPE;
///
/// Embedded cache init extended data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT32 Level;
EFI_INIT_CACHE_TYPE Type;
} EFI_CACHE_INIT_DATA;
//
// Memory Extended Error Data
//
///
/// Memory Error Granularity Definition
///
typedef UINT8 EFI_MEMORY_ERROR_GRANULARITY;
///
/// Memory Error Operation Definition
///
typedef UINT8 EFI_MEMORY_ERROR_OPERATION;
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_MEMORY_ERROR_GRANULARITY Granularity;
EFI_MEMORY_ERROR_OPERATION Operation;
UINTN Syndrome;
EFI_PHYSICAL_ADDRESS Address;
UINTN Resolution;
} EFI_MEMORY_EXTENDED_ERROR_DATA;
//
// Memory Error Granularities
//
#define EFI_MEMORY_ERROR_OTHER 0x01
#define EFI_MEMORY_ERROR_UNKNOWN 0x02
#define EFI_MEMORY_ERROR_DEVICE 0x03
#define EFI_MEMORY_ERROR_PARTITION 0x04
//
// Memory Error Operations
//
#define EFI_MEMORY_OPERATION_OTHER 0x01
#define EFI_MEMORY_OPERATION_UNKNOWN 0x02
#define EFI_MEMORY_OPERATION_READ 0x03
#define EFI_MEMORY_OPERATION_WRITE 0x04
#define EFI_MEMORY_OPERATION_PARTIAL_WRITE 0x05
//
// Define shorthands to describe Group Operations
// Many memory init operations are essentially group
// operations.
/// A shorthand to describe that the operation is performed
/// on multiple devices within the array
///
#define EFI_MULTIPLE_MEMORY_DEVICE_OPERATION 0xfffe
///
/// A shorthand to describe that the operation is performed on all devices within the array
///
#define EFI_ALL_MEMORY_DEVICE_OPERATION 0xffff
///
/// A shorthand to describe that the operation is performed on multiple arrays
///
#define EFI_MULTIPLE_MEMORY_ARRAY_OPERATION 0xfffe
///
/// A shorthand to describe that the operation is performed on all the arrays
///
#define EFI_ALL_MEMORY_ARRAY_OPERATION 0xffff
//
// DIMM number
//
#pragma pack(1)
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT16 Array;
UINT16 Device;
} EFI_STATUS_CODE_DIMM_NUMBER;
#pragma pack()
///
/// Memory Module Mismatch Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_STATUS_CODE_DIMM_NUMBER Instance;
} EFI_MEMORY_MODULE_MISMATCH_ERROR_DATA;
///
/// Memory Range Extended Data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_PHYSICAL_ADDRESS Start;
EFI_PHYSICAL_ADDRESS Length;
} EFI_MEMORY_RANGE_EXTENDED_DATA;
///
/// Device handle Extended Data. Used for many
/// errors and progress codes to point to the device.
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_HANDLE Handle;
} EFI_DEVICE_HANDLE_EXTENDED_DATA;
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT8 *DevicePath;
} EFI_DEVICE_PATH_EXTENDED_DATA;
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_HANDLE ControllerHandle;
EFI_HANDLE DriverBindingHandle;
UINT16 DevicePathSize;
UINT8 *RemainingDevicePath;
} EFI_STATUS_CODE_START_EXTENDED_DATA;
///
/// Resource Allocation Failure Extended Error Data
///
/*
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
UINT32 Bar;
VOID *ReqRes;
VOID *AllocRes;
} EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
*/
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT32 Bar;
UINT16 DevicePathSize;
UINT16 ReqResSize;
UINT16 AllocResSize;
UINT8 *DevicePath;
UINT8 *ReqRes;
UINT8 *AllocRes;
} EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
///
/// Extended Error Data for Assert
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
UINT32 LineNumber;
UINT32 FileNameSize;
EFI_STATUS_CODE_STRING_DATA *FileName;
} EFI_DEBUG_ASSERT_DATA;
///
/// System Context Data EBC/IA32/IPF
///
typedef union {
EFI_SYSTEM_CONTEXT_EBC SystemContextEbc;
EFI_SYSTEM_CONTEXT_IA32 SystemContextIa32;
EFI_SYSTEM_CONTEXT_IPF SystemContextIpf;
} EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT;
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;
} EFI_STATUS_CODE_EXCEP_EXTENDED_DATA;
///
/// Legacy Oprom extended data
///
typedef struct {
EFI_STATUS_CODE_DATA DataHeader;
EFI_HANDLE DeviceHandle;
EFI_PHYSICAL_ADDRESS RomImageBase;
} EFI_LEGACY_OPROM_EXTENDED_DATA;
#endif

View File

@@ -0,0 +1,85 @@
/** @file
This file makes the BaseTypes.h backward compatible with the ones used in the
past for EFI and Tiano development. It's mostly just prepending an EFI_ on the
definitions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: UefiBaseTypes.h
**/
#ifndef __UEFI_BASE_TYPES_H__
#define __UEFI_BASE_TYPES_H__
#include <Common/BaseTypes.h>
typedef UINT64 EFI_LBA;
#define EFIERR(_a) ENCODE_ERROR(_a)
#define EFI_MAX_BIT MAX_BIT
#define EFI_MAX_ADDRESS MAX_ADDRESS
#define EFI_BREAKPOINT() CpuBreakpoint ()
#define EFI_DEADLOOP() CpuDeadLoop ()
#define EFI_ERROR(A) RETURN_ERROR(A)
typedef GUID EFI_GUID;
typedef RETURN_STATUS 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_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
//
// The EFI memory allocation functions work in units of EFI_PAGEs that are
// 4K. This should in no way be confused with the page size of the processor.
// An EFI_PAGE is just the quanta of memory in EFI.
//
#define EFI_PAGE_MASK 0xFFF
#define EFI_PAGE_SHIFT 12
#define EFI_SIZE_TO_PAGES(a) (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0))
#define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT)
#endif

51
MdePkg/Include/Dxe.h Normal file
View File

@@ -0,0 +1,51 @@
/** @file
Root include file for Mde Package DXE modules
DXE modules follow the public Framework specifications and the UEFI
specifiations. The build infrastructure must set
EFI_SPECIFICATION_VERSION before including this file. To support
R9/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To support
R8.5/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010.
EDK_RELEASE_VERSION must be set to a non zero value.
EFI_SPECIFIATION_VERSION and EDK_RELEASE_VERSION are set automatically
by the build infrastructure for every module.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __DXE_H__
#define __DXE_H__
//
// Check to make sure EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION are defined.
//
#if !defined(EFI_SPECIFICATION_VERSION)
#error EFI_SPECIFICATION_VERSION not defined
#elif !defined(EDK_RELEASE_VERSION)
#error EDK_RELEASE_VERSION not defined
#elif (EDK_RELEASE_VERSION == 0)
#error EDK_RELEASE_VERSION can not be zero
#endif
#include <Common/UefiBaseTypes.h>
#include <Dxe/DxeCis.h>
#include <Dxe/SmmCis.h>
#include <Common/DataHubRecords.h>
#include <Guid/DataHubRecords.h>
#include <Protocol/Pcd.h>
#include <Common/PcdTemp.h> //This will be removed when PCD PEIM is completed!
#endif

View File

@@ -0,0 +1,87 @@
/** @file
Boot Device Selection Architectural Protocol as defined in DXE CIS
When the DXE core is done it calls the BDS via this protocol.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Bds.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_BDS_H__
#define __ARCH_PROTOCOL_BDS_H__
//
// Global ID for the BDS Architectural Protocol
//
#define EFI_BDS_ARCH_PROTOCOL_GUID \
{ 0x665E3FF6, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
//
// Declare forward reference for the BDS Architectural Protocol
//
typedef struct _EFI_BDS_ARCH_PROTOCOL EFI_BDS_ARCH_PROTOCOL;
/**
This function uses policy data from the platform to determine what operating
system or system utility should be loaded and invoked. This function call
also optionally make the use of user input to determine the operating system
or system utility to be loaded and invoked. When the DXE Core has dispatched
all the drivers on the dispatch queue, this function is called. This
function will attempt to connect the boot devices required to load and invoke
the selected operating system or system utility. During this process,
additional firmware volumes may be discovered that may contain addition DXE
drivers that can be dispatched by the DXE Core. If a boot device cannot be
fully connected, this function calls the DXE Service Dispatch() to allow the
DXE drivers from any newly discovered firmware volumes to be dispatched.
Then the boot device connection can be attempted again. If the same boot
device connection operation fails twice in a row, then that boot device has
failed, and should be skipped. This function should never return.
@param This The EFI_BDS_ARCH_PROTOCOL instance.
@return None.
**/
typedef
VOID
(EFIAPI *EFI_BDS_ENTRY) (
IN EFI_BDS_ARCH_PROTOCOL *This
);
/**
Interface stucture for the BDS Architectural Protocol.
@par Protocol Description:
The EFI_BDS_ARCH_PROTOCOL transfers control from DXE to an operating
system or a system utility. If there are not enough drivers initialized
when this protocol is used to access the required boot device(s), then
this protocol should add drivers to the dispatch queue and return control
back to the dispatcher. Once the required boot devices are available, then
the boot device can be used to load and invoke an OS or a system utility.
@par Protocol Parameters:
Entry - The entry point to BDS. This call does not take any parameters,
and the return value can be ignored. If it returns, then the
dispatcher must be invoked again, if it never returns, then an
operating system or a system utility have been invoked.
**/
struct _EFI_BDS_ARCH_PROTOCOL {
EFI_BDS_ENTRY Entry;
};
extern EFI_GUID gEfiBdsArchProtocolGuid;
#endif

View File

@@ -0,0 +1,326 @@
/** @file
CPU Architectural Protocol as defined in DXE CIS
This code abstracts the DXE core from processor implementation details.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Cpu.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_CPU_H__
#define __ARCH_PROTOCOL_CPU_H__
#define EFI_CPU_ARCH_PROTOCOL_GUID \
{ 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
typedef struct _EFI_CPU_ARCH_PROTOCOL EFI_CPU_ARCH_PROTOCOL;
typedef enum {
EfiCpuFlushTypeWriteBackInvalidate,
EfiCpuFlushTypeWriteBack,
EfiCpuFlushTypeInvalidate,
EfiCpuMaxFlushType
} EFI_CPU_FLUSH_TYPE;
typedef enum {
EfiCpuInit,
EfiCpuMaxInitType
} EFI_CPU_INIT_TYPE;
/**
EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs.
@param InterruptType Defines the type of interrupt or exception that
occurred on the processor.This parameter is processor architecture specific.
@param SystemContext A pointer to the processor context when
the interrupt occurred on the processor.
@return None
**/
typedef
VOID
(*EFI_CPU_INTERRUPT_HANDLER) (
IN EFI_EXCEPTION_TYPE InterruptType,
IN EFI_SYSTEM_CONTEXT SystemContext
);
/**
This function flushes the range of addresses from Start to Start+Length
from the processor's data cache. If Start is not aligned to a cache line
boundary, then the bytes before Start to the preceding cache line boundary
are also flushed. If Start+Length is not aligned to a cache line boundary,
then the bytes past Start+Length to the end of the next cache line boundary
are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be
supported. If the data cache is fully coherent with all DMA operations, then
this function can just return EFI_SUCCESS. If the processor does not support
flushing a range of the data cache, then the entire data cache can be flushed.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@param Start The beginning physical address to flush from the processor's data
cache.
@param Length The number of bytes to flush from the processor's data cache. This
function may flush more bytes than Length specifies depending upon
the granularity of the flush operation that the processor supports.
@param FlushType Specifies the type of flush operation to perform.
@retval EFI_SUCCESS The address range from Start to Start+Length was flushed from
the processor's data cache.
@retval EFI_UNSUPPORTEDT The processor does not support the cache flush type specified
by FlushType.
@retval EFI_DEVICE_ERROR The address range from Start to Start+Length could not be flushed
from the processor's data cache.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_FLUSH_DATA_CACHE) (
IN EFI_CPU_ARCH_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS Start,
IN UINT64 Length,
IN EFI_CPU_FLUSH_TYPE FlushType
);
/**
This function enables interrupt processing by the processor.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@retval EFI_SUCCESS Interrupts are enabled on the processor.
@retval EFI_DEVICE_ERROR Interrupts could not be enabled on the processor.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_ENABLE_INTERRUPT) (
IN EFI_CPU_ARCH_PROTOCOL *This
);
/**
This function disables interrupt processing by the processor.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@retval EFI_SUCCESS Interrupts are disabled on the processor.
@retval EFI_DEVICE_ERROR Interrupts could not be disabled on the processor.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_DISABLE_INTERRUPT) (
IN EFI_CPU_ARCH_PROTOCOL *This
);
/**
This function retrieves the processor's current interrupt state a returns it in
State. If interrupts are currently enabled, then TRUE is returned. If interrupts
are currently disabled, then FALSE is returned.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@param State A pointer to the processor's current interrupt state. Set to TRUE if
interrupts are enabled and FALSE if interrupts are disabled.
@retval EFI_SUCCESS The processor's current interrupt state was returned in State.
@retval EFI_INVALID_PARAMETER State is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_GET_INTERRUPT_STATE) (
IN EFI_CPU_ARCH_PROTOCOL *This,
OUT BOOLEAN *State
);
/**
This function generates an INIT on the processor. If this function succeeds, then the
processor will be reset, and control will not be returned to the caller. If InitType is
not supported by this processor, or the processor cannot programmatically generate an
INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error
occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@param InitType The type of processor INIT to perform.
@retval EFI_SUCCESS The processor INIT was performed. This return code should never be seen.
@retval EFI_UNSUPPORTED The processor INIT operation specified by InitType is not supported
by this processor.
@retval EFI_DEVICE_ERROR The processor INIT failed.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_INIT) (
IN EFI_CPU_ARCH_PROTOCOL *This,
IN EFI_CPU_INIT_TYPE InitType
);
/**
This function registers and enables the handler specified by InterruptHandler for a processor
interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the
handler for the processor interrupt or exception type specified by InterruptType is uninstalled.
The installed handler is called once for each processor interrupt or exception.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@param InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts
are enabled and FALSE if interrupts are disabled.
@param InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called
when a processor interrupt occurs. If this parameter is NULL, then the handler
will be uninstalled.
@retval EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.
@retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was
previously installed.
@retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER) (
IN EFI_CPU_ARCH_PROTOCOL *This,
IN EFI_EXCEPTION_TYPE InterruptType,
IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
);
/**
This function reads the processor timer specified by TimerIndex and returns it in TimerValue.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@param TimerIndex Specifies which processor timer is to be returned in TimerValue. This parameter
must be between 0 and NumberOfTimers-1.
@param TimerValue Pointer to the returned timer value.
@param TimerPeriod A pointer to the amount of time that passes in femtoseconds for each increment
of TimerValue.
@retval EFI_SUCCESS The processor timer value specified by TimerIndex was returned in TimerValue.
@retval EFI_DEVICE_ERROR An error occurred attempting to read one of the processor's timers.
@retval EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.
@retval EFI_UNSUPPORTED The processor does not have any readable timers.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_GET_TIMER_VALUE) (
IN EFI_CPU_ARCH_PROTOCOL *This,
IN UINT32 TimerIndex,
OUT UINT64 *TimerValue,
OUT UINT64 *TimerPeriod OPTIONAL
);
/**
This function modifies the attributes for the memory region specified by BaseAddress and
Length from their current attributes to the attributes specified by Attributes.
@param This The EFI_CPU_ARCH_PROTOCOL instance.
@param BaseAddress The physical address that is the start address of a memory region.
@param Length The size in bytes of the memory region.
@param Attributes The bit mask of attributes to set for the memory region.
@retval EFI_SUCCESS The attributes were set for the memory region.
@retval EFI_ACCESS_DENIED The attributes for the memory resource range specified by
BaseAddress and Length cannot be modified.
@retval EFI_INVALID_PARAMETER Length is zero.
@retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of
the memory resource range.
@retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
resource range specified by BaseAddress and Length.
The bit mask of attributes is not support for the memory resource
range specified by BaseAddress and Length.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES) (
IN EFI_CPU_ARCH_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length,
IN UINT64 Attributes
);
/**
@par Protocol Description:
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.
@param FlushDataCache
Flushes a range of the processor's data cache. If the processor does
not contain a data cache, or the data cache is fully coherent, then this
function can just return EFI_SUCCESS. If the processor does not support
flushing a range of addresses from the data cache, then the entire data
cache must be flushed.
@param EnableInterrupt Enables interrupt processing by the processor.
@param DisableInterrupt Disables interrupt processing by the processor.
@param GetInterruptState Retrieves the processor's current interrupt state.
@param Init
Generates an INIT on the processor. If a processor cannot programmatically
generate an INIT without help from external hardware, then this function
returns EFI_UNSUPPORTED.
@param RegisterInterruptHandler
Associates an interrupt service routine with one of the processor's interrupt
vectors. This function is typically used by the EFI_TIMER_ARCH_PROTOCOL to
hook the timer interrupt in a system. It can also be used by the debugger to
hook exception vectors.
@param GetTimerValue Returns the value of one of the processor's internal timers.
@param SetMemoryAttributes Attempts to set the attributes of a memory region.
@param NumberOfTimers
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.
@param DmaBufferAlignment
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.
**/
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;
UINT32 NumberOfTimers;
UINT32 DmaBufferAlignment;
};
extern EFI_GUID gEfiCpuArchProtocolGuid;
#endif

View File

@@ -0,0 +1,100 @@
/** @file
Metronome Architectural Protocol as defined in DXE CIS
This code abstracts the DXE core to provide delay services.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Metronome.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_METRONOME_H__
#define __ARCH_PROTOCOL_METRONOME_H__
//
// Global ID for the Metronome Architectural Protocol
//
#define EFI_METRONOME_ARCH_PROTOCOL_GUID \
{ 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
//
// Declare forward reference for the Metronome Architectural Protocol
//
typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;
/**
The WaitForTick() function waits for the number of ticks specified by
TickNumber from a known time source in the platform. If TickNumber of
ticks are detected, then EFI_SUCCESS is returned. The actual time passed
between entry of this function and the first tick is between 0 and
TickPeriod 100 nS units. If you want to guarantee that at least TickPeriod
time has elapsed, wait for two ticks. This function waits for a hardware
event to determine when a tick occurs. It is possible for interrupt
processing, or exception processing to interrupt the execution of the
WaitForTick() function. Depending on the hardware source for the ticks, it
is possible for a tick to be missed. This function cannot guarantee that
ticks will not be missed. If a timeout occurs waiting for the specified
number of ticks, then EFI_TIMEOUT is returned.
@param This The EFI_METRONOME_ARCH_PROTOCOL instance.
@param TickNumber Number of ticks to wait.
@retval EFI_SUCCESS The wait for the number of ticks specified by TickNumber
succeeded.
@retval EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK) (
IN EFI_METRONOME_ARCH_PROTOCOL *This,
IN UINT32 TickNumber
);
//
//
/**
Interface stucture for the Metronome Architectural Protocol.
@par Protocol Description:
This protocol provides access to a known time source in the platform to the
core. The core uses this known time source to produce core services that
require calibrated delays.
@param WaitForTick
Waits for a specified number of ticks from a known time source
in the platform. The actual time passed between entry of this
function and the first tick is between 0 and TickPeriod 100 nS
units. If you want to guarantee that at least TickPeriod time
has elapsed, wait for two ticks.
@param TickPeriod
The period of platform's known time source in 100 nS units.
This value on any platform must be at least 10 uS, and must not
exceed 200 uS. The value in this field is a constant that must
not be modified after the Metronome architectural protocol is
installed. All consumers must treat this as a read-only field.
**/
struct _EFI_METRONOME_ARCH_PROTOCOL {
EFI_METRONOME_WAIT_FOR_TICK WaitForTick;
UINT32 TickPeriod;
};
extern EFI_GUID gEfiMetronomeArchProtocolGuid;
#endif

View File

@@ -0,0 +1,33 @@
/** @file
Monotonic Counter Architectural Protocol as defined in DXE CIS
This code provides the services required to access the systems monotonic counter
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: MonotonicCounter.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_MONTONIC_COUNTER_H__
#define __ARCH_PROTOCOL_MONTONIC_COUNTER_H__
///
/// Global ID for the Monotonic Counter Architectural Protocol
///
#define EFI_MONTONIC_COUNTER_ARCH_PROTOCOL_GUID \
{0x1da97072, 0xbddc, 0x4b30, {0x99, 0xf1, 0x72, 0xa0, 0xb5, 0x6f, 0xff, 0x2a} }
extern EFI_GUID gEfiMonotonicCounterArchProtocolGuid;
#endif

View File

@@ -0,0 +1,41 @@
/** @file
Real Time clock Architectural Protocol as defined in DXE CIS
This code abstracts time and data functions. Used to provide
Time and date related EFI runtime services.
The GetTime (), SetTime (), GetWakeupTime (), and SetWakeupTime () EFI 1.0
services are added to the EFI system table and the
EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID protocol is registered with a NULL
pointer.
No CRC of the EFI system table is required, as it is done in the DXE core.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: RealTimeClock.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_REAL_TIME_CLOCK_H__
#define __ARCH_PROTOCOL_REAL_TIME_CLOCK_H__
//
// Global ID for the Real Time Clock Architectural Protocol
//
#define EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID \
{ 0x27CFAC87, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
extern EFI_GUID gEfiRealTimeClockArchProtocolGuid;
#endif

View File

@@ -0,0 +1,38 @@
/** @file
Reset Architectural Protocol as defined in the DXE CIS
Used to provide ResetSystem runtime services
The ResetSystem () EFI 1.0 service is added to the EFI system table and the
EFI_RESET_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.
No CRC of the EFI system table is required, as it is done in the DXE core.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Reset.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_RESET_H__
#define __ARCH_PROTOCOL_RESET_H__
//
// Global ID for the Reset Architectural Protocol
//
#define EFI_RESET_ARCH_PROTOCOL_GUID \
{ 0x27CFAC88, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
extern EFI_GUID gEfiResetArchProtocolGuid;
#endif

View File

@@ -0,0 +1,162 @@
/** @file
Runtime Architectural Protocol as defined in DXE CIS
This code is used to produce the EFI 1.0 runtime virtual switch over
This driver must add SetVirtualAddressMap () and ConvertPointer () to
the EFI system table. This driver is not responcible for CRCing the
EFI system table.
This driver will add EFI_RUNTIME_ARCH_PROTOCOL_GUID protocol with a
pointer to the Runtime Arch Protocol instance structure. The protocol
member functions are used by the DXE core to export information need
by this driver to produce the runtime transition to virtual mode
calling.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Runtime.h
@par Revision Reference:
Version 0.90.
**/
#ifndef __ARCH_PROTOCOL_RUNTIME_H__
#define __ARCH_PROTOCOL_RUNTIME_H__
//
// Global ID for the Runtime Architectural Protocol
//
#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \
{ 0x96d08253, 0x8483, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
typedef struct _EFI_RUNTIME_ARCH_PROTOCOL EFI_RUNTIME_ARCH_PROTOCOL;
/**
When a SetVirtualAddressMap() is performed all the runtime images loaded by
DXE must be fixed up with the new virtual address map. To facilitate this the
Runtime Architectural Protocol needs to be informed of every runtime driver
that is registered. All the runtime images loaded by DXE should be registered
with this service by the DXE Core when ExitBootServices() is called. The
images that are registered with this service must have successfully been
loaded into memory with the Boot Service LoadImage(). As a result, no
parameter checking needs to be performed.
@param This The EFI_RUNTIME_ARCH_PROTOCOL instance.
@param ImageBase Start of image that has been loaded in memory. It is either
a pointer to the DOS or PE header of the image.
@param ImageSize Size of the image in bytes.
@param RelocationData Information about the fixups that were performed on ImageBase
when it was loaded into memory. This information is needed
when the virtual mode fix-ups are reapplied so that data that
has been programmatically updated will not be fixed up. If
code updates a global variable the code is responsible for
fixing up the variable for virtual mode.
@retval EFI_SUCCESS The ImageBase has been registered.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to register ImageBase.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_RUNTIME_REGISTER_IMAGE) (
IN EFI_RUNTIME_ARCH_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS ImageBase,
IN UINTN ImageSize,
IN VOID *RelocationData
);
/**
This function is used to support the required runtime events. Currently only
runtime events of type EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE needs to be
registered with this service. All the runtime events that exist in the DXE
Core should be registered with this service when ExitBootServices() is called.
All the events that are registered with this service must have been created
with the Boot Service CreateEvent(). As a result, no parameter checking needs
to be performed.
@param This The EFI_RUNTIME_ARCH_PROTOCOL instance.
@param Type The same as Type passed into CreateEvent().
@param NotifyTpl The same as NotifyTpl passed into CreateEvent().
@param NotifyFunction The same as NotifyFunction passed into CreateEvent().
@param NotifyContext The same as NotifyContext passed into CreateEvent().
@param Event The EFI_EVENT returned by CreateEvent(). Event must be in
runtime memory.
@retval EFI_SUCCESS The Event has been registered.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to register Event.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_RUNTIME_REGISTER_EVENT) (
IN EFI_RUNTIME_ARCH_PROTOCOL *This,
IN UINT32 Type,
IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction,
IN VOID *NotifyContext,
IN EFI_EVENT *Event
);
//
// Interface stucture for the Runtime Architectural Protocol
//
/**
@par Protocol Description:
The DXE driver that produces this protocol must be a runtime driver. This
driver is responsible for initializing the SetVirtualAddressMap() and
ConvertPointer() fields of the EFI Runtime Services Table and the
CalculateCrc32() field of the EFI Boot Services Table. See the Runtime
Services chapter and the Boot Services chapter for details on these services.
After the two fields of the EFI Runtime Services Table and the one field of
the EFI Boot Services Table have been initialized, the driver must install
the EFI_RUNTIME_ARCH_PROTOCOL_GUID on a new handle with an EFI_RUNTIME_ARCH_
PROTOCOL interface pointer. The installation of this protocol informs the
DXE core that the virtual memory services and the 32-bit CRC services are
now available, and the DXE core must update the 32-bit CRC of the EFI Runtime
Services Table and the 32-bit CRC of the EFI Boot Services Table.
All runtime core services are provided by the EFI_RUNTIME_ARCH_PROTOCOL.
This includes the support for registering runtime images that must be
re-fixed up when a transition is made from physical mode to virtual mode.
This protocol also supports all events that are defined to fire at runtime.
This protocol also contains a CRC-32 function that will be used by the DXE
core as a boot service. The EFI_RUNTIME_ARCH_PROTOCOL needs the CRC-32
function when a transition is made from physical mode to virtual mode and
the EFI System Table and EFI Runtime Table are fixed up with virtual pointers.
@param RegisterRuntimeImage
Register a runtime image so it can be converted to virtual mode if the EFI Runtime Services
SetVirtualAddressMap() is called.
@param RegisterRuntimeEvent
Register an event than needs to be notified at runtime.
**/
struct _EFI_RUNTIME_ARCH_PROTOCOL {
EFI_RUNTIME_REGISTER_IMAGE RegisterImage;
EFI_RUNTIME_REGISTER_EVENT RegisterEvent;
};
extern EFI_GUID gEfiRuntimeArchProtocolGuid;
#endif

View File

@@ -0,0 +1,136 @@
/** @file
Security Architectural Protocol as defined in the DXE CIS
Used to provide Security services. Specifically, dependening upon the
authentication state of a discovered driver in a Firmware Volume, the
portable DXE Core Dispatcher will call into the Security Architectural
Protocol (SAP) with the authentication state of the driver.
This call-out allows for OEM-specific policy decisions to be made, such
as event logging for attested boots, locking flash in response to discovering
an unsigned driver or failed signature check, or other exception response.
The SAP can also change system behavior by having the DXE core put a driver
in the Schedule-On-Request (SOR) state. This will allow for later disposition
of the driver by platform agent, such as Platform BDS.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Security.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_SECURITY_H__
#define __ARCH_PROTOCOL_SECURITY_H__
//
// Global ID for the Security Code Architectural Protocol
//
#define EFI_SECURITY_ARCH_PROTOCOL_GUID \
{ 0xA46423E3, 0x4617, 0x49f1, {0xB9, 0xFF, 0xD1, 0xBF, 0xA9, 0x11, 0x58, 0x39 } }
typedef struct _EFI_SECURITY_ARCH_PROTOCOL EFI_SECURITY_ARCH_PROTOCOL;
/**
The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
policy from the DXE core response to an attempt to use a file that returns a
given status for the authentication check from the section extraction protocol.
The possible responses in a given SAP implementation may include locking
flash upon failure to authenticate, attestation logging for all signed drivers,
and other exception operations. The File parameter allows for possible logging
within the SAP of the driver.
If File is NULL, then EFI_INVALID_PARAMETER is returned.
If the file specified by File with an authentication status specified by
AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
If the file specified by File with an authentication status specified by
AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
then EFI_ACCESS_DENIED is returned.
If the file specified by File with an authentication status specified by
AuthenticationStatus is not safe for the DXE Core to use right now, but it
might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
returned.
@param This The EFI_SECURITY_ARCH_PROTOCOL instance.
@param AuthenticationStatus This is the authentication type returned from the Section
Extraction protocol. See the Section Extraction Protocol
Specification for details on this type.
@param File This is a pointer to the device path of the file that is
being dispatched. This will optionally be used for logging.
@retval EFI_SUCCESS The file specified by File did authenticate, and the
platform policy dictates that the DXE Core may use File.
@retval EFI_INVALID_PARAMETER Driver is NULL.
@retval EFI_SECURITY_VIOLATION The file specified by File did not authenticate, and
the platform policy dictates that File should be placed
in the untrusted state. A file may be promoted from
the untrusted to the trusted state at a future time
with a call to the Trust() DXE Service.
@retval EFI_ACCESS_DENIED The file specified by File did not authenticate, and
the platform policy dictates that File should not be
used for any purpose.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SECURITY_FILE_AUTHENTICATION_STATE) (
IN EFI_SECURITY_ARCH_PROTOCOL *This,
IN UINT32 AuthenticationStatus,
IN EFI_DEVICE_PATH_PROTOCOL *File
)
;
//
// Interface stucture for the Timer Architectural Protocol
//
/**
@par Protocol Description:
The EFI_SECURITY_ARCH_PROTOCOL is used to abstract platform-specific policy
from the DXE core. This includes locking flash upon failure to authenticate,
attestation logging, and other exception operations.
The driver that produces the EFI_SECURITY_ARCH_PROTOCOL may also optionally
install the EFI_SECURITY_POLICY_PROTOCOL_GUID onto a new handle with a NULL
interface. The existence of this GUID in the protocol database means that
the GUIDed Section Extraction Protocol should authenticate the contents of
an Authentication Section. The expectation is that the GUIDed Section
Extraction protocol will look for the existence of the EFI_SECURITY_POLICY_
PROTOCOL_GUID in the protocol database. If it exists, then the publication
thereof is taken as an injunction to attempt an authentication of any section
wrapped in an Authentication Section. See the Firmware File System
Specification for details on the GUIDed Section Extraction Protocol and
Authentication Sections.
@par Protocol Parameters:
FileAuthenticationState - This service is called upon fault with respect to
the authentication of a section of a file.
**/
struct _EFI_SECURITY_ARCH_PROTOCOL {
EFI_SECURITY_FILE_AUTHENTICATION_STATE FileAuthenticationState;
};
extern EFI_GUID gEfiSecurityArchProtocolGuid;
#endif

View File

@@ -0,0 +1,31 @@
/** @file
Security Policy protocol as defined in the DXE CIS
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SecurityPolicy.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef _SECURITY_POLICY_H_
#define _SECURITY_POLICY_H_
//
// Security policy protocol GUID definition
//
#define EFI_SECURITY_POLICY_PROTOCOL_GUID \
{0x78E4D245, 0xCD4D, 0x4a05, {0xA2, 0xBA, 0x47, 0x43, 0xE8, 0x6C, 0xFC, 0xAB} }
extern EFI_GUID gEfiSecurityPolicyProtocolGuid;
#endif

View File

@@ -0,0 +1,82 @@
/** @file
Status code Runtime Protocol as defined in the DXE CIS
The StatusCode () Tiano service is added to the EFI system table and the
EFI_STATUS_CODE_ARCH_PROTOCOL_GUID protocol is registered with a NULL
pointer.
No CRC of the EFI system table is required, as it is done in the DXE core.
This code abstracts Status Code reporting.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: StatusCode.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __STATUS_CODE_RUNTIME_PROTOCOL_H__
#define __STATUS_CODE_RUNTIME_PROTOCOL_H__
#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \
{ 0xd2b2b828, 0x826, 0x48a7, { 0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0 } }
/**
Provides an interface that a software module can call to report a status code.
@param Type Indicates the type of status code being reported.
@param Value Describes the current status of a hardware or software entity.
This included information about the class and subclass that is used to
classify the entity as well as an operation.
@param Instance The enumeration of a hardware or software entity within
the system. Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to
different callers.
@param Data This optional parameter may be used to pass additional data.
@retval EFI_SUCCESS The function completed successfully
@retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_REPORT_STATUS_CODE) (
IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value,
IN UINT32 Instance,
IN EFI_GUID *CallerId OPTIONAL,
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
);
/**
@par Protocol Description:
Provides the service required to report a status code to the platform firmware.
This protocol must be produced by a runtime DXE driver and may be consumed
only by the DXE Foundation.
@param ReportStatusCode Emit a status code.
**/
typedef struct _EFI_STATUS_CODE_PROTOCOL {
EFI_REPORT_STATUS_CODE ReportStatusCode;
} EFI_STATUS_CODE_PROTOCOL;
extern EFI_GUID gEfiStatusCodeRuntimeProtocolGuid;
#endif

View File

@@ -0,0 +1,222 @@
/** @file
Timer Architectural Protocol as defined in the DXE CIS
This code is used to provide the timer tick for the DXE core.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Timer.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_TIMER_H__
#define __ARCH_PROTOCOL_TIMER_H__
//
// Global ID for the Timer Architectural Protocol
//
#define EFI_TIMER_ARCH_PROTOCOL_GUID \
{ 0x26baccb3, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
//
// Declare forward reference for the Timer Architectural Protocol
//
typedef struct _EFI_TIMER_ARCH_PROTOCOL EFI_TIMER_ARCH_PROTOCOL;
/**
This function of this type is called when a timer interrupt fires. This
function executes at TPL_HIGH_LEVEL. The DXE Core will register a funtion
of tyis type to be called for the timer interrupt, so it can know how much
time has passed. This information is used to signal timer based events.
@param Time Time since the last timer interrupt in 100 ns units. This will
typically be TimerPeriod, but if a timer interrupt is missed, and the
EFI_TIMER_ARCH_PROTOCOL driver can detect missed interrupts, then Time
will contain the actual amount of time since the last interrupt.
None.
**/
typedef
VOID
(EFIAPI *EFI_TIMER_NOTIFY) (
IN UINT64 Time
);
/**
This function registers the handler NotifyFunction so it is called every time
the timer interrupt fires. It also passes the amount of time since the last
handler call to the NotifyFunction. If NotifyFunction is NULL, then the
handler is unregistered. If the handler is registered, then EFI_SUCCESS is
returned. If the CPU does not support registering a timer interrupt handler,
then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler
when a handler is already registered, then EFI_ALREADY_STARTED is returned.
If an attempt is made to unregister a handler when a handler is not registered,
then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to
register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR
is returned.
@param This The EFI_TIMER_ARCH_PROTOCOL instance.
@param NotifyFunction The function to call when a timer interrupt fires. This
function executes at TPL_HIGH_LEVEL. The DXE Core will
register a handler for the timer interrupt, so it can know
how much time has passed. This information is used to
signal timer based events. NULL will unregister the handler.
@retval EFI_SUCCESS The timer handler was registered.
@retval EFI_UNSUPPORTED The platform does not support timer interrupts.
@retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already
registered.
@retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not
previously registered.
@retval EFI_DEVICE_ERROR The timer handler could not be registered.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_REGISTER_HANDLER) (
IN EFI_TIMER_ARCH_PROTOCOL *This,
IN EFI_TIMER_NOTIFY NotifyFunction
);
/**
This function adjusts the period of timer interrupts to the value specified
by TimerPeriod. If the timer period is updated, then the selected timer
period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If
the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.
If an error occurs while attempting to update the timer period, then the
timer hardware will be put back in its state prior to this call, and
EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt
is disabled. This is not the same as disabling the CPU's interrupts.
Instead, it must either turn off the timer hardware, or it must adjust the
interrupt controller so that a CPU interrupt is not generated when the timer
interrupt fires.
@param This The EFI_TIMER_ARCH_PROTOCOL instance.
@param TimerPeriod The rate to program the timer interrupt in 100 nS units. If
the timer hardware is not programmable, then EFI_UNSUPPORTED is
returned. If the timer is programmable, then the timer period
will be rounded up to the nearest timer period that is supported
by the timer hardware. If TimerPeriod is set to 0, then the
timer interrupts will be disabled.
@retval EFI_SUCCESS The timer period was changed.
@retval EFI_UNSUPPORTED The platform cannot change the period of the timer interrupt.
@retval EFI_DEVICE_ERROR The timer period could not be changed due to a device error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_SET_TIMER_PERIOD) (
IN EFI_TIMER_ARCH_PROTOCOL *This,
IN UINT64 TimerPeriod
);
/**
This function retrieves the period of timer interrupts in 100 ns units,
returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod
is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is
returned, then the timer is currently disabled.
@param This The EFI_TIMER_ARCH_PROTOCOL instance.
@param TimerPeriod A pointer to the timer period to retrieve in 100 ns units. If
0 is returned, then the timer is currently disabled.
@retval EFI_SUCCESS The timer period was returned in TimerPeriod.
@retval EFI_INVALID_PARAMETER TimerPeriod is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_GET_TIMER_PERIOD) (
IN EFI_TIMER_ARCH_PROTOCOL *This,
OUT UINT64 *TimerPeriod
);
/**
This function generates a soft timer interrupt. If the platform does not support soft
timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.
If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()
service, then a soft timer interrupt will be generated. If the timer interrupt is
enabled when this service is called, then the registered handler will be invoked. The
registered handler should not be able to distinguish a hardware-generated timer
interrupt from a software-generated timer interrupt.
@param This The EFI_TIMER_ARCH_PROTOCOL instance.
@retval EFI_SUCCESS The soft timer interrupt was generated.
@retval EFI_UNSUPPORTEDT The platform does not support the generation of soft timer interrupts.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TIMER_GENERATE_SOFT_INTERRUPT) (
IN EFI_TIMER_ARCH_PROTOCOL *This
);
/**
Interface stucture for the Timer Architectural Protocol.
@par Protocol Description:
This protocol provides the services to initialize a periodic timer
interrupt, and to register a handler that is called each time the timer
interrupt fires. It may also provide a service to adjust the rate of the
periodic timer interrupt. When a timer interrupt occurs, the handler is
passed the amount of time that has passed since the previous timer
interrupt.
@param RegisterHandler
Registers a handler that will be called each time the
timer interrupt fires. TimerPeriod defines the minimum
time between timer interrupts, so TimerPeriod will also
be the minimum time between calls to the registered
handler.
@param SetTimerPeriod
Sets the period of the timer interrupt in 100 nS units.
This function is optional, and may return EFI_UNSUPPORTED.
If this function is supported, then the timer period will
be rounded up to the nearest supported timer period.
@param GetTimerPeriod
Retrieves the period of the timer interrupt in 100 nS units.
@param GenerateSoftInterrupt
Generates a soft timer interrupt that simulates the firing of
the timer interrupt. This service can be used to invoke the
registered handler if the timer interrupt has been masked for
a period of time.
**/
struct _EFI_TIMER_ARCH_PROTOCOL {
EFI_TIMER_REGISTER_HANDLER RegisterHandler;
EFI_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
EFI_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
EFI_TIMER_GENERATE_SOFT_INTERRUPT GenerateSoftInterrupt;
};
extern EFI_GUID gEfiTimerArchProtocolGuid;
#endif

View File

@@ -0,0 +1,39 @@
/** @file
Variable Architectural Protocol as defined in the DXE CIS
This code is used to produce the EFI 1.0 runtime variable services
The GetVariable (), GetNextVariableName (), and SetVariable () EFI 1.0
services are added to the EFI system table and the
EFI_VARIABLE_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.
No CRC of the EFI system table is required, as it is done in the DXE core.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Variable.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_VARIABLE_ARCH_H__
#define __ARCH_PROTOCOL_VARIABLE_ARCH_H__
//
// Global ID for the Variable Architectural Protocol
//
#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \
{ 0x1e5668e2, 0x8481, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
extern EFI_GUID gEfiVariableArchProtocolGuid;
#endif

View File

@@ -0,0 +1,38 @@
/** @file
Variable Write Architectural Protocol as defined in the DXE CIS
This code is used to produce the EFI 1.0 runtime variable services
The SetVariable () EFI 1.0 services may be updated to the EFI system table and the
EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.
No CRC of the EFI system table is required, as it is done in the DXE core.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: VariableWrite.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H__
#define __ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H__
//
// Global ID for the Variable Write Architectural Protocol
//
#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \
{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53 } }
extern EFI_GUID gEfiVariableWriteArchProtocolGuid;
#endif

View File

@@ -0,0 +1,172 @@
/** @file
Watchdog Timer Architectural Protocol as defined in the DXE CIS
Used to provide system watchdog timer services
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: WatchdogTimer.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
#define __ARCH_PROTOCOL_WATCHDOG_TIMER_H__
//
// Global ID for the Watchdog Timer Architectural Protocol
//
#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \
{ 0x665E3FF5, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }
//
// Declare forward reference for the Timer Architectural Protocol
//
typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL EFI_WATCHDOG_TIMER_ARCH_PROTOCOL;
/**
A function of this type is called when the watchdog timer fires if a
handler has been registered.
@param Time The time in 100 ns units that has passed since the watchdog
timer was armed. For the notify function to be called, this
must be greater than TimerPeriod.
@return None.
**/
typedef
VOID
(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY) (
IN UINT64 Time
);
/**
This function registers a handler that is to be invoked when the watchdog
timer fires. By default, the EFI_WATCHDOG_TIMER protocol will call the
Runtime Service ResetSystem() when the watchdog timer fires. If a
NotifyFunction is registered, then the NotifyFunction will be called before
the Runtime Service ResetSystem() is called. If NotifyFunction is NULL, then
the watchdog handler is unregistered. If a watchdog handler is registered,
then EFI_SUCCESS is returned. If an attempt is made to register a handler
when a handler is already registered, then EFI_ALREADY_STARTED is returned.
If an attempt is made to uninstall a handler when a handler is not installed,
then return EFI_INVALID_PARAMETER.
@param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
@param NotifyFunction The function to call when the watchdog timer fires. If this
is NULL, then the handler will be unregistered.
@retval EFI_SUCCESS The watchdog timer handler was registered or
unregistered.
@retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already
registered.
@retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not
previously registered.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) (
IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
);
/**
This function sets the amount of time to wait before firing the watchdog
timer to TimerPeriod 100 nS units. If TimerPeriod is 0, then the watchdog
timer is disabled.
@param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
@param TimerPeriod The amount of time in 100 nS units to wait before the watchdog
timer is fired. If TimerPeriod is zero, then the watchdog
timer is disabled.
@retval EFI_SUCCESS The watchdog timer has been programmed to fire in Time
100 nS units.
@retval EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device
error.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) (
IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
IN UINT64 TimerPeriod
);
/**
This function retrieves the amount of time the system will wait before firing
the watchdog timer. This period is returned in TimerPeriod, and EFI_SUCCESS
is returned. If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.
@param This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.
@param TimerPeriod A pointer to the amount of time in 100 nS units that the system
will wait before the watchdog timer is fired. If TimerPeriod of
zero is returned, then the watchdog timer is disabled.
@retval EFI_SUCCESS The amount of time that the system will wait before
firing the watchdog timer was returned in TimerPeriod.
@retval EFI_INVALID_PARAMETER TimerPeriod is NULL.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) (
IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
OUT UINT64 *TimerPeriod
);
/**
Interface stucture for the Watchdog Timer Architectural Protocol.
@par Protocol Description:
This protocol provides the services required to implement the Boot Service
SetWatchdogTimer(). It provides a service to set the amount of time to wait
before firing the watchdog timer, and it also provides a service to register
a handler that is invoked when the watchdog timer fires. This protocol can
implement the watchdog timer by using the event and timer Boot Services, or
it can make use of custom hardware. When the watchdog timer fires, control
will be passed to a handler if one has been registered. If no handler has
been registered, or the registered handler returns, then the system will be
reset by calling the Runtime Service ResetSystem().
@param RegisterHandler - Registers a handler that is invoked when the watchdog
timer fires.
@param SetTimerPeriod - Sets the amount of time in 100 ns units to wait before the
watchdog timer is fired. If this function is supported,
then the watchdog timer period will be rounded up to the
nearest supported watchdog timer period.
@param GetTimerPeriod - Retrieves the amount of time in 100 ns units that the
system will wait before the watchdog timer is fired.
**/
struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {
EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler;
EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
};
extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid;
#endif

589
MdePkg/Include/Dxe/DxeCis.h Normal file
View File

@@ -0,0 +1,589 @@
/** @file
Include file matches things in the DXE CIS.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: DxeCis.h
@par Revision Reference:
Version 0.91B.
**/
#ifndef __DXE_CIS__
#define __DXE_CIS__
#include <Uefi/UefiSpec.h>
#define TIANO_ERROR(a) (MAX_2_BITS | (a))
#if (EFI_SPECIFICATION_VERSION < 0x00020000)
//
// Tiano added a couple of return types. These are owned by UEFI specification
// and Tiano can not use them. Thus for UEFI 2.0/R9 support we moved the values
// to a UEFI OEM extension range to conform to UEFI specification.
//
#define EFI_NOT_AVAILABLE_YET EFIERR (28)
#define EFI_UNLOAD_IMAGE EFIERR (29)
#else
#define EFI_NOT_AVAILABLE_YET TIANO_ERROR (0)
#define EFI_UNLOAD_IMAGE TIANO_ERROR (1)
#endif
//
// BugBug: Implementation contamination of UEFI 2.0
// Pointer to internal runtime pointer
//
#define EFI_IPF_GP_POINTER 0x00000008
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//
// attributes for reserved memory before it is promoted to system memory
//
#define EFI_MEMORY_PRESENT 0x0100000000000000ULL
#define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
#define EFI_MEMORY_TESTED 0x0400000000000000ULL
//
// range for memory mapped port I/O on IPF
//
#define EFI_MEMORY_PORT_IO 0x4000000000000000ULL
//
// Modifier for EFI DXE Services
//
#define EFI_DXESERVICE
//
// Global Coherencey Domain types
//
typedef enum {
EfiGcdMemoryTypeNonExistent,
EfiGcdMemoryTypeReserved,
EfiGcdMemoryTypeSystemMemory,
EfiGcdMemoryTypeMemoryMappedIo,
EfiGcdMemoryTypeMaximum
} EFI_GCD_MEMORY_TYPE;
typedef enum {
EfiGcdIoTypeNonExistent,
EfiGcdIoTypeReserved,
EfiGcdIoTypeIo,
EfiGcdIoTypeMaximum
} EFI_GCD_IO_TYPE;
typedef enum {
EfiGcdAllocateAnySearchBottomUp,
EfiGcdAllocateMaxAddressSearchBottomUp,
EfiGcdAllocateAddress,
EfiGcdAllocateAnySearchTopDown,
EfiGcdAllocateMaxAddressSearchTopDown,
EfiGcdMaxAllocateType
} EFI_GCD_ALLOCATE_TYPE;
typedef struct {
EFI_PHYSICAL_ADDRESS BaseAddress;
UINT64 Length;
UINT64 Capabilities;
UINT64 Attributes;
EFI_GCD_MEMORY_TYPE GcdMemoryType;
EFI_HANDLE ImageHandle;
EFI_HANDLE DeviceHandle;
} EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
typedef struct {
EFI_PHYSICAL_ADDRESS BaseAddress;
UINT64 Length;
EFI_GCD_IO_TYPE GcdIoType;
EFI_HANDLE ImageHandle;
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 Memory type of the memory space.
@param BaseAddress Base address of the memory space.
@param Length Length of the memory space.
@param Capabilities alterable attributes of the memory space.
@retval EFI_SUCCESS Merged this memory space into GCD map.
**/
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 allocate operation
@param GcdMemoryType The desired memory type
@param Alignment Align with 2^Alignment
@param Length Length to allocate
@param BaseAddress Base address to allocate
@param Imagehandle The image handle consume the allocated space.
@param DeviceHandle The device handle consume the allocated space.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_NOT_FOUND No descriptor contains the desired space.
@retval EFI_SUCCESS Memory space successfully allocated.
**/
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 Base address of the segment.
@param Length Length of the segment.
@retval EFI_SUCCESS Space successfully freed.
**/
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 Base address of the memory space.
@param Length Length of the memory space.
@retval EFI_SUCCESS Successfully remove a segment of memory space.
**/
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 Specified start address
@param Descriptor Specified length
@retval EFI_INVALID_PARAMETER Invalid parameter
@retval EFI_SUCCESS Successfully get memory space descriptor.
**/
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 Specified start address
@param Length Specified length
@param Attributes Specified attributes
@retval EFI_SUCCESS Successfully set attribute of a segment of memory space.
**/
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 Number of descriptors.
@param MemorySpaceMap Descriptor array
@retval EFI_INVALID_PARAMETER Invalid parameter
@retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
@retval EFI_SUCCESS Successfully get memory space map.
**/
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 IO type of the segment.
@param BaseAddress Base address of the segment.
@param Length Length of the segment.
@retval EFI_SUCCESS Merged this segment into GCD map.
**/
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 allocate operation
@param GcdIoType The desired IO type
@param Alignment Align with 2^Alignment
@param Length Length to allocate
@param BaseAddress Base address to allocate
@param Imagehandle The image handle consume the allocated space.
@param DeviceHandle The device handle consume the allocated space.
@retval EFI_INVALID_PARAMETER Invalid parameter.
@retval EFI_NOT_FOUND No descriptor contains the desired space.
@retval EFI_SUCCESS IO space successfully allocated.
**/
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 Base address of the segment.
@param Length Length of the segment.
@retval EFI_SUCCESS Space successfully freed.
**/
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 Base address of the segment.
@param Length Length of the segment.
@retval EFI_SUCCESS Successfully removed a segment of IO space.
**/
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 Specified start address
@param Descriptor Specified length
@retval EFI_INVALID_PARAMETER Descriptor is NULL.
@retval EFI_SUCCESS Successfully get the IO space descriptor.
**/
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 Number of descriptors.
@param MemorySpaceMap Descriptor array
@retval EFI_INVALID_PARAMETER Invalid parameter
@retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
@retval EFI_SUCCESS Successfully get IO space map.
**/
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.
@return Status code
**/
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 DriverName A pointer to the name of the file in a firmware volume.
@return Status code
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SCHEDULE) (
IN EFI_HANDLE FirmwareVolumeHandle,
IN EFI_GUID *DriverName
)
;
/**
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 code
**/
typedef
EFI_STATUS
(EFIAPI *EFI_TRUST) (
IN EFI_HANDLE FirmwareVolumeHandle,
IN EFI_GUID *DriverName
)
;
/**
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.
@return Status code
**/
typedef
EFI_STATUS
(EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME) (
IN VOID *FvHeader,
IN UINTN Size,
OUT EFI_HANDLE *FirmwareVolumeHandle
)
;
//
// DXE Services Table
//
#define EFI_DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
#define EFI_DXE_SERVICES_REVISION ((0 << 16) | (25))
typedef struct {
EFI_TABLE_HEADER Hdr;
//
// Global Coherency Domain Services
//
EFI_ADD_MEMORY_SPACE AddMemorySpace;
EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
EFI_FREE_MEMORY_SPACE FreeMemorySpace;
EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
EFI_ADD_IO_SPACE AddIoSpace;
EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
EFI_FREE_IO_SPACE FreeIoSpace;
EFI_REMOVE_IO_SPACE RemoveIoSpace;
EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
//
// Dispatcher Services
//
EFI_DISPATCH Dispatch;
EFI_SCHEDULE Schedule;
EFI_TRUST Trust;
//
// Service to process a single firmware volume found in a capsule
//
EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
} EFI_DXE_SERVICES;
#include <Common/BootMode.h>
#include <Common/BootScript.h>
#include <Common/Capsule.h>
#include <Common/Dependency.h>
#include <Common/FirmwareVolumeImageFormat.h>
#include <Common/FirmwareVolumeHeader.h>
#include <Common/FirmwareFileSystem.h>
#include <Common/Hob.h>
#include <Common/InternalFormRepresentation.h>
#include <Common/StatusCode.h>
#include <Common/StatusCodeDataTypeId.h>
#include <Guid/AcpiTableStorage.h>
#include <Guid/Apriori.h>
#include <Guid/Capsule.h>
#include <Guid/DxeServices.h>
#include <Guid/EventLegacyBios.h>
#include <Guid/FirmwareFileSystem.h>
#include <Guid/FrameworkDevicePath.h>
#include <Guid/HobList.h>
#include <Guid/MemoryAllocationHob.h>
#include <Guid/SmramMemoryReserve.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Dxe/ArchProtocol/Bds.h>
#include <Dxe/ArchProtocol/Cpu.h>
#include <Dxe/ArchProtocol/Metronome.h>
#include <Dxe/ArchProtocol/MonotonicCounter.h>
#include <Dxe/ArchProtocol/RealTimeClock.h>
#include <Dxe/ArchProtocol/Reset.h>
#include <Dxe/ArchProtocol/Runtime.h>
#include <Dxe/ArchProtocol/Security.h>
#include <Dxe/ArchProtocol/SecurityPolicy.h>
#include <Dxe/ArchProtocol/StatusCode.h>
#include <Dxe/ArchProtocol/Timer.h>
#include <Dxe/ArchProtocol/Variable.h>
#include <Dxe/ArchProtocol/VariableWrite.h>
#include <Dxe/ArchProtocol/WatchdogTimer.h>
#include <Protocol/AcpiSupport.h>
#include <Protocol/BootScriptSave.h>
#include <Protocol/CpuIo.h>
#include <Protocol/DataHub.h>
#include <Protocol/FirmwareVolume.h>
#include <Protocol/FirmwareVolumeBlock.h>
#include <Protocol/FirmwareVolumeDispatch.h>
#include <Protocol/Hii.h>
#include <Protocol/FormBrowser.h>
#include <Protocol/FormCallback.h>
#include <Protocol/GuidedSectionExtraction.h>
#include <Protocol/IdeControllerInit.h>
#include <Protocol/IncompatiblePciDeviceSupport.h>
#include <Protocol/PciHostBridgeResourceAllocation.h>
#include <Protocol/PciHotPlugInit.h>
#include <Protocol/PciPlatform.h>
#include <Protocol/SectionExtraction.h>
#include <Protocol/Smbus.h>
#include <Protocol/LegacyBios.h>
#include <Protocol/Legacy8259.h>
#include <Protocol/LegacyRegion.h>
#include <Protocol/LegacyBiosPlatform.h>
#include <Protocol/LegacyInterrupt.h>
#endif

526
MdePkg/Include/Dxe/SmmCis.h Normal file
View File

@@ -0,0 +1,526 @@
/** @file
Include file matches things in the Smm CIS spec.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SmmCis.h
@par Revision Reference:
Version 0.9.
**/
#ifndef __SMM_CIS__
#define __SMM_CIS__
#define EFI_SMM_CPU_IO_GUID \
{ \
0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41 } \
}
typedef struct _EFI_SMM_SYSTEM_TABLE EFI_SMM_SYSTEM_TABLE;
typedef struct _EFI_SMM_CPU_IO_INTERFACE EFI_SMM_CPU_IO_INTERFACE;
//
// SMM Base specification constant and types
//
#define SMM_SMST_SIGNATURE EFI_SIGNATURE_32 ('S', 'M', 'S', 'T')
#define EFI_SMM_SYSTEM_TABLE_REVISION (0 << 16) | (0x09)
//
// *******************************************************
// EFI_SMM_IO_WIDTH
// *******************************************************
//
typedef enum {
SMM_IO_UINT8 = 0,
SMM_IO_UINT16 = 1,
SMM_IO_UINT32 = 2,
SMM_IO_UINT64 = 3
} EFI_SMM_IO_WIDTH;
/**
Provides the basic memory and I/O interfaces that are used to
abstract accesses to devices.
@param This The EFI_SMM_CPU_IO_INTERFACE instance.
@param Width Signifies the width of the I/O operations.
@param Address The base address of the I/O operations.
@param Count The number of I/O operations to perform.
@param Buffer For read operations, the destination buffer to store the results.
For write operations, the source buffer from which to write data.
@retval EFI_SUCCESS The data was read from or written to the device.
@retval EFI_UNSUPPORTED The Address is not valid for this system.
@retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_CPU_IO) (
IN EFI_SMM_CPU_IO_INTERFACE *This,
IN EFI_SMM_IO_WIDTH Width,
IN UINT64 Address,
IN UINTN Count,
IN OUT VOID *Buffer
);
typedef struct {
EFI_SMM_CPU_IO Read;
EFI_SMM_CPU_IO Write;
} EFI_SMM_IO_ACCESS;
struct _EFI_SMM_CPU_IO_INTERFACE {
EFI_SMM_IO_ACCESS Mem;
EFI_SMM_IO_ACCESS Io;
};
/**
Allocates pool memory from SMRAM for IA-32 or runtime memory for
the Itanium processor family.
@param PoolType The type of pool to allocate.The only supported type is EfiRuntimeServicesData
@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_UNSUPPORTED In runtime.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMMCORE_ALLOCATE_POOL) (
IN EFI_MEMORY_TYPE PoolType,
IN UINTN Size,
OUT VOID **Buffer
);
/**
Returns pool memory to the system.
@param Buffer Pointer to the buffer to free.
@retval EFI_SUCCESS The memory was returned to the system.
@retval EFI_INVALID_PARAMETER Buffer was invalid.
@retval EFI_UNSUPPORTED In runtime.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMMCORE_FREE_POOL) (
IN VOID *Buffer
);
/**
Allocates memory pages from the system.
@param Type The type of allocation to perform.
@param MemoryType The only supported type is EfiRuntimeServicesData
@param NumberofPages The number of contiguous 4 KB pages to allocate
@param Memory Pointer to a physical address. On input, the way in which
the address is used depends on the value of Type. On output, the address
is set to the base of the page range that was allocated.
@retval EFI_SUCCESS The requested pages were allocated.
@retval EFI_OUT_OF_RESOURCES The pages requested could not be allocated.
@retval EFI_NOT_FOUND The requested pages could not be found.
@retval EFI_INVALID_PARAMETER Type is not AllocateAnyPages or AllocateMaxAddress
or AllocateAddress. Or MemoryType is in the range EfiMaxMemoryType..0x7FFFFFFF.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMMCORE_ALLOCATE_PAGES) (
IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN NumberOfPages,
OUT EFI_PHYSICAL_ADDRESS *Memory
);
/**
Frees memory pages for the system.
@param Memory The base physical address of the pages to be freed
@param NumberOfPages The number of contiguous 4 KB pages to free.
@retval EFI_SUCCESS The requested memory pages were freed.
@retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or NumberOfPages is invalid.
@retval EFI_NOT_FOUND The requested memory pages were not allocated with SmmAllocatePages().
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMMCORE_FREE_PAGES) (
IN EFI_PHYSICAL_ADDRESS Memory,
IN UINTN NumberOfPages
);
typedef
VOID
(EFIAPI *EFI_AP_PROCEDURE) (
IN VOID *Buffer
);
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_STARTUP_THIS_AP) (
IN EFI_AP_PROCEDURE Procedure,
IN UINTN CpuNumber,
IN OUT VOID *ProcArguments OPTIONAL
);
typedef struct {
UINT8 Reserved1[248];
UINT32 SMBASE;
UINT32 SMMRevId;
UINT16 IORestart;
UINT16 AutoHALTRestart;
UINT8 Reserved2[164];
UINT32 ES;
UINT32 CS;
UINT32 SS;
UINT32 DS;
UINT32 FS;
UINT32 GS;
UINT32 LDTBase;
UINT32 TR;
UINT32 DR7;
UINT32 DR6;
UINT32 EAX;
UINT32 ECX;
UINT32 EDX;
UINT32 EBX;
UINT32 ESP;
UINT32 EBP;
UINT32 ESI;
UINT32 EDI;
UINT32 EIP;
UINT32 EFLAGS;
UINT32 CR3;
UINT32 CR0;
} EFI_SMI_CPU_SAVE_STATE;
typedef struct {
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 pr;
UINT64 b0;
UINT64 b1;
UINT64 b2;
UINT64 b3;
UINT64 b4;
UINT64 b5;
UINT64 b6;
UINT64 b7;
// application registers
UINT64 ar_rsc;
UINT64 ar_bsp;
UINT64 ar_bspstore;
UINT64 ar_rnat;
UINT64 ar_fcr;
UINT64 ar_eflag;
UINT64 ar_csd;
UINT64 ar_ssd;
UINT64 ar_cflg;
UINT64 ar_fsr;
UINT64 ar_fir;
UINT64 ar_fdr;
UINT64 ar_ccv;
UINT64 ar_unat;
UINT64 ar_fpsr;
UINT64 ar_pfs;
UINT64 ar_lc;
UINT64 ar_ec;
// control registers
UINT64 cr_dcr;
UINT64 cr_itm;
UINT64 cr_iva;
UINT64 cr_pta;
UINT64 cr_ipsr;
UINT64 cr_isr;
UINT64 cr_iip;
UINT64 cr_ifa;
UINT64 cr_itir;
UINT64 cr_iipa;
UINT64 cr_ifs;
UINT64 cr_iim;
UINT64 cr_iha;
// 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
UINT64 int_nat; // nat bits for R1-R31
} EFI_PMI_SYSTEM_CONTEXT;
typedef union {
EFI_SMI_CPU_SAVE_STATE Ia32SaveState;
EFI_PMI_SYSTEM_CONTEXT ItaniumSaveState;
} EFI_SMM_CPU_SAVE_STATE;
typedef struct {
UINT16 Fcw;
UINT16 Fsw;
UINT16 Ftw;
UINT16 Opcode;
UINT32 Eip;
UINT16 Cs;
UINT16 Rsvd1;
UINT32 DataOffset;
UINT16 Ds;
UINT8 Rsvd2[10];
UINT8 St0Mm0[10], Rsvd3[6];
UINT8 St0Mm1[10], Rsvd4[6];
UINT8 St0Mm2[10], Rsvd5[6];
UINT8 St0Mm3[10], Rsvd6[6];
UINT8 St0Mm4[10], Rsvd7[6];
UINT8 St0Mm5[10], Rsvd8[6];
UINT8 St0Mm6[10], Rsvd9[6];
UINT8 St0Mm7[10], Rsvd10[6];
UINT8 Rsvd11[22*16];
} EFI_SMI_OPTIONAL_FPSAVE_STATE;
typedef struct {
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];
} EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT;
typedef union {
EFI_SMI_OPTIONAL_FPSAVE_STATE Ia32FpSave;
EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT ItaniumFpSave;
} EFI_SMM_FLOATING_POINT_SAVE_STATE;
/**
This function is the main entry point for an SMM handler dispatch
or communicate-based callback.
@param SmmImageHandle A unique value returned by the SMM infrastructure
in response to registration for a communicate-based callback or dispatch.
@param CommunicationBuffer An optional buffer that will be populated
by the SMM infrastructure in response to a non-SMM agent (preboot or runtime)
invoking the EFI_SMM_BASE_PROTOCOL.Communicate() service.
@param SourceSize If CommunicationBuffer is non-NULL, this field
indicates the size of the data payload in this buffer.
@return Status Code
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT) (
IN EFI_HANDLE SmmImageHandle,
IN OUT VOID *CommunicationBuffer OPTIONAL,
IN OUT UINTN *SourceSize OPTIONAL
);
/**
The SmmInstallConfigurationTable() function is used to maintain the list
of configuration tables that are stored in the System Management System
Table. The list is stored as an array of (GUID, Pointer) pairs. The list
must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.
@param SystemTable A pointer to the SMM System Table.
@param Guid A pointer to the GUID for the entry to add, update, or remove.
@param Table A pointer to the buffer of the table to add.
@param TableSize The size of the table to install.
@retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.
@retval EFI_INVALID_PARAMETER Guid is not valid.
@retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry.
@retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.
**/
typedef
EFI_STATUS
(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE) (
IN EFI_SMM_SYSTEM_TABLE *SystemTable,
IN EFI_GUID *Guid,
IN VOID *Table,
IN UINTN TableSize
)
;
//
// System Management System Table (SMST)
//
struct _EFI_SMM_SYSTEM_TABLE {
EFI_TABLE_HEADER Hdr;
CHAR16 *SmmFirmwareVendor;
UINT32 SmmFirmwareRevision;
EFI_SMM_INSTALL_CONFIGURATION_TABLE SmmInstallConfigurationTable;
//
// I/O Services
//
EFI_GUID EfiSmmCpuIoGuid;
EFI_SMM_CPU_IO_INTERFACE SmmIo;
//
// Runtime memory service
//
EFI_SMMCORE_ALLOCATE_POOL SmmAllocatePool;
EFI_SMMCORE_FREE_POOL SmmFreePool;
EFI_SMMCORE_ALLOCATE_PAGES SmmAllocatePages;
EFI_SMMCORE_FREE_PAGES SmmFreePages;
//
// MP service
//
EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;
//
// CPU information records
//
UINTN CurrentlyExecutingCpu;
UINTN NumberOfCpus;
EFI_SMM_CPU_SAVE_STATE *CpuSaveState;
EFI_SMM_FLOATING_POINT_SAVE_STATE *CpuOptionalFloatingPointState;
//
// Extensibility table
//
UINTN NumberOfTableEntries;
EFI_CONFIGURATION_TABLE *SmmConfigurationTable;
};
#include <Guid/SmmCommunicate.h>
#include <Guid/SmramMemoryReserve.h>
#include <Protocol/SmmBase.h>
#include <Protocol/SmmAccess.h>
#include <Protocol/SmmControl.h>
#include <Protocol/SmmGpiDispatch.h>
#include <Protocol/SmmIchnDispatch.h>
#include <Protocol/SmmPeriodicTimerDispatch.h>
#include <Protocol/SmmPowerButtonDispatch.h>
#include <Protocol/SmmStandbyButtonDispatch.h>
#include <Protocol/SmmStatusCode.h>
#include <Protocol/SmmSwDispatch.h>
#include <Protocol/SmmSxDispatch.h>
#include <Protocol/SmmUsbDispatch.h>
extern EFI_GUID gEfiSmmCpuIoGuid;
#endif

50
MdePkg/Include/DxeCore.h Normal file
View File

@@ -0,0 +1,50 @@
/** @file
Root include file for DXE Core
The DXE Core has its own module type since its entry point definition is
unique. This module type should only be used by the DXE core. The build
infrastructure must set EFI_SPECIFICATION_VERSION before including this
file. To support R9/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To
support R8.5/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010.
EDK_RELEASE_VERSION must be set to a non zero value.
EFI_SPECIFIATION_VERSION and EDK_RELEASE_VERSION are set automatically
by the build infrastructure for every module.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __DXE_CORE_H__
#define __DXE_CORE_H__
//
// Check to make sure EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION are defined.
// also check for legal combinations
//
#if !defined(EFI_SPECIFICATION_VERSION)
#error EFI_SPECIFICATION_VERSION not defined
#elif !defined(EDK_RELEASE_VERSION)
#error EDK_RELEASE_VERSION not defined
#elif (EDK_RELEASE_VERSION == 0)
#error EDK_RELEASE_VERSION can not be zero
#endif
#include <Common/UefiBaseTypes.h>
#include <Dxe/DxeCis.h>
#include <Protocol/Pcd.h>
#endif

58
MdePkg/Include/DxeDepex.h Normal file
View File

@@ -0,0 +1,58 @@
/** @file
Include file for DXE Dependency Expression *.DXS file.
This include file is only for Dependency Expression *.DXS files and
should not be include directly in modules.
DEPEX (DEPendency EXpresion) BNF Grammer for DXE:
The BNF grammar is thus:
<pre>
<depex> ::= before GUID
| after GUID
| SOR <bool>
| <bool>
<bool> ::= <bool> and <term>
| <bool> or <term>
| <term>
<term> ::= not <factor>
| <factor>
<factor> ::= <bool>
| <boolval>
| <depinst>
| <termval>
<boolval> ::= true
| false
<depinst> ::= push GUID
<termval> ::= end
</pre>
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __DXE_DEPEX_H__
#define __DXE_DEPEX_H__
//
// The Depex grammer needs the following strings so we must undo
// any pre-processor redefinitions
//
#undef DEPENDENCY_START
#undef BEFORE
#undef AFTER
#undef SOR
#undef AND
#undef OR
#undef NOT
#undef TRUE
#undef FALSE
#undef DEPENDENCY_END
#endif

View File

@@ -0,0 +1,81 @@
/** @file
Processor or compiler specific defines and types for EBC.
We currently only have one EBC complier so there may be some Intel compiler
specific functions in this file.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: ProcessorBind.h
**/
#ifndef __PROCESSOR_BIND_H__
#define __PROCESSOR_BIND_H__
//
// Define the processor type so other code can make processor based choices
//
#define MDE_CPU_EBC
//
// Native integer types
//
typedef char INT8;
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef unsigned char CHAR8;
typedef short INT16;
typedef unsigned short UINT16;
typedef unsigned short CHAR16;
typedef int INT32;
typedef unsigned int UINT32;
typedef __int64 INT64;
typedef unsigned __int64 UINT64;
//
// "long" type scales to the processor native size with EBC compiler
//
typedef long INTN;
typedef unsigned long UINTN;
#define UINT8_MAX 0xff
//
// Scalable macro to set the most significant bit in a natural number
//
#define MAX_BIT 0x8000000000000000ULL
#define MAX_2_BITS 0xC000000000000000ULL
//
// Maximum legal EBC address
//
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
// EFI intrinsics are required to modify thier member functions with EFIAPI.
//
#define EFIAPI
//
// 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. Currently not supported by the EBC compiler
//
#define GLOBAL_REMOVE_IF_UNREFERENCED
#endif

View File

@@ -0,0 +1,48 @@
/** @file
GUIDs used for ACPI entries in the EFI 1.0 system table
These GUIDs point the ACPI tables as defined in the ACPI specifications.
ACPI 2.0 specification defines the ACPI 2.0 GUID. UEFI 2.0 defines the
ACPI 2.0 Table GUID and ACPI Table GUID.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Acpi.h
@par Revision Reference:
GUIDs defined in UEFI 2.0 spec.
**/
#ifndef __ACPI_GUID_H__
#define __ACPI_GUID_H__
#define EFI_ACPI_10_TABLE_GUID \
{ \
0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define EFI_ACPI_TABLE_GUID \
{ \
0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define ACPI_10_TABLE_GUID EFI_ACPI_10_TABLE_GUID
//
// ACPI 2.0 or newer tables should use EFI_ACPI_TABLE_GUID.
//
#define EFI_ACPI_20_TABLE_GUID EFI_ACPI_TABLE_GUID
#define EFI_ACPI_30_TABLE_GUID EFI_ACPI_TABLE_GUID
extern EFI_GUID gEfiAcpi10TableGuid;
extern EFI_GUID gEfiAcpi20TableGuid;
extern EFI_GUID gEfiAcpi30TableGuid;
#endif

View File

@@ -0,0 +1,30 @@
/** @file
The ACPI table storage file is fully FFS compliant.
The file is a number of sections of type EFI_SECTION_RAW.
This GUID is used to identify the file as an ACPI table storage file.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: AcpiTableStorage.h
@par Revision Reference:
GUID defined in ACPI Table Storage Spec Version 0.9.
**/
#ifndef _ACPI_TABLE_STORAGE_H_
#define _ACPI_TABLE_STORAGE_H_
#define EFI_ACPI_TABLE_STORAGE_GUID \
{ 0x7e374e25, 0x8e01, 0x4fee, {0x87, 0xf2, 0x39, 0xc, 0x23, 0xc6, 0x6, 0xcd } }
extern EFI_GUID gEfiAcpiTableStorageGuid;
#endif

View File

@@ -0,0 +1,32 @@
/** @file
GUID used as an FV filename for A Priori file. The A Priori file contains a
list of FV filenames that the DXE dispatcher will schedule reguardless of
the dependency grammer.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Apriori.h
@par Revision Reference:
GUID defined in DXE CIS spec version 0.91B
**/
#ifndef __APRIORI_GUID_H__
#define __APRIORI_GUID_H__
#define EFI_APRIORI_GUID \
{ \
0xfc510ee7, 0xffdc, 0x11d4, {0xbd, 0x41, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
extern EFI_GUID gAprioriGuid;
#endif

View File

@@ -0,0 +1,43 @@
/** @file
GUIDs used for EFI Capsule
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Capsule.h
@par Revision Reference:
GUIDs defined in Capsule Spec Version 0.9
**/
#ifndef __CAPSULE_GUID_H__
#define __CAPSULE_GUID_H__
//
// This is the GUID of the capsule header of the image on disk.
//
#define EFI_CAPSULE_GUID \
{ \
0x3B6686BD, 0x0D76, 0x4030, {0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } \
}
//
// This is the GUID of the configuration results file created by the capsule
// application.
//
#define EFI_CONFIG_FILE_NAME_GUID \
{ \
0x98B8D59B, 0xE8BA, 0x48EE, {0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } \
}
extern EFI_GUID gEfiCapsuleGuid;
extern EFI_GUID gEfiConfigFileNameGuid;
#endif

View File

@@ -0,0 +1,66 @@
/** @file
DataHubRecord.h include all data hub sub class GUID defitions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: DataHubRecords.h
@par Revision Reference:
These GUID are from Cache subclass spec 0.9, DataHub SubClass spec 0.9, Memory SubClass Spec 0.9,
Processor Subclass spec 0.9, Misc SubClass spec 0.9.
**/
#ifndef _DATAHUB_RECORDS_GUID_H_
#define _DATAHUB_RECORDS_GUID_H_
#define EFI_PROCESSOR_PRODUCER_GUID \
{ 0x1bf06aea, 0x5bec, 0x4a8d, {0x95, 0x76, 0x74, 0x9b, 0x09, 0x56, 0x2d, 0x30 } }
extern EFI_GUID gEfiProcessorProducerGuid;
#define EFI_PROCESSOR_SUBCLASS_GUID \
{ 0x26fdeb7e, 0xb8af, 0x4ccf, {0xaa, 0x97, 0x02, 0x63, 0x3c, 0xe4, 0x8c, 0xa7 } }
extern EFI_GUID gEfiProcessorSubClassGuid;
#define EFI_CACHE_SUBCLASS_GUID \
{ 0x7f0013a7, 0xdc79, 0x4b22, {0x80, 0x99, 0x11, 0xf7, 0x5f, 0xdc, 0x82, 0x9d } }
extern EFI_GUID gEfiCacheSubClassGuid;
#define EFI_MEMORY_PRODUCER_GUID \
{ 0x1d7add6e, 0xb2da, 0x4b0b, {0xb2, 0x9f, 0x49, 0xcb, 0x42, 0xf4, 0x63, 0x56 } }
extern EFI_GUID gEfiMemoryProducerGuid;
#define EFI_MEMORY_SUBCLASS_GUID \
{0x4E8F4EBB, 0x64B9, 0x4e05, {0x9B, 0x18, 0x4C, 0xFE, 0x49, 0x23, 0x50, 0x97} }
extern EFI_GUID gEfiMemorySubClassGuid;
#define EFI_MISC_PRODUCER_GUID \
{ 0x62512c92, 0x63c4, 0x4d80, {0x82, 0xb1, 0xc1, 0xa4, 0xdc, 0x44, 0x80, 0xe5 } }
extern EFI_GUID gEfiMiscProducerGuid;
#define EFI_MISC_SUBCLASS_GUID \
{ 0x772484B2, 0x7482, 0x4b91, {0x9F, 0x9A, 0xAD, 0x43, 0xF8, 0x1C, 0x58, 0x81 } }
extern EFI_GUID gEfiMiscSubClassGuid;
#endif

View File

@@ -0,0 +1,58 @@
/** @file
GUID and related data structures used with the Debug Image Info Table.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: DebugImageInfoTable.h
@par Revision Reference:
GUID defined in UEFI 2.0 spec.
**/
#ifndef __DEBUG_IMAGE_INFO_GUID_H__
#define __DEBUG_IMAGE_INFO_GUID_H__
#define EFI_DEBUG_IMAGE_INFO_TABLE_GUID \
{ \
0x49152e77, 0x1ada, 0x4764, {0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } \
}
extern EFI_GUID gEfiDebugImageInfoTableGuid;
#define EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS 0x01
#define EFI_DEBUG_IMAGE_INFO_TABLE_MODIFIED 0x02
#define EFI_DEBUG_IMAGE_INFO_INITIAL_SIZE (EFI_PAGE_SIZE / sizeof (UINTN))
#define EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL 0x01
typedef struct {
UINT64 Signature;
EFI_PHYSICAL_ADDRESS EfiSystemTableBase;
UINT32 Crc32;
} EFI_SYSTEM_TABLE_POINTER;
typedef struct {
UINT32 ImageInfoType;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImageProtocolInstance;
EFI_HANDLE ImageHandle;
} EFI_DEBUG_IMAGE_INFO_NORMAL;
typedef union {
UINTN *ImageInfoType;
EFI_DEBUG_IMAGE_INFO_NORMAL *NormalImage;
} EFI_DEBUG_IMAGE_INFO;
typedef struct {
volatile UINT32 UpdateStatus;
UINT32 TableSize;
EFI_DEBUG_IMAGE_INFO *EfiDebugImageInfoTable;
} EFI_DEBUG_IMAGE_INFO_TABLE_HEADER;
#endif

View File

@@ -0,0 +1,30 @@
/** @file
GUID used to identify the DXE Services Table
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: DxeServices.h
@par Revision Reference:
GUID defined in DXE CIS spec version 0.91B
**/
#ifndef __DXE_SERVICES_GUID_H__
#define __DXE_SERVICES_GUID_H__
#define EFI_DXE_SERVICES_TABLE_GUID \
{ \
0x5ad34ba, 0x6f02, 0x4214, {0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } \
}
extern EFI_GUID gEfiDxeServicesTableGuid;
#endif

View File

@@ -0,0 +1,45 @@
/** @file
GUIDs for gBS->CreateEventEx Event Groups. Defined in EFI 2.0.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: EventGroup.h
**/
#ifndef __EVENT_GROUP_GUID__
#define __EVENT_GROUP_GUID__
#define EFI_EVENT_GROUP_EXIT_BOOT_SERVICES \
{ 0x27abf055, 0xb1b8, 0x4c26, { 0x80, 0x48, 0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf } }
extern EFI_GUID gEfiEventExitBootServicesGuid;
#define EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE \
{ 0x13fa7698, 0xc831, 0x49c7, { 0x87, 0xea, 0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96 } }
extern EFI_GUID gEfiEventVirtualAddressChangeGuid;
#define EFI_EVENT_GROUP_MEMORY_MAP_CHANGE \
{ 0x78bee926, 0x692f, 0x48fd, { 0x9e, 0xdb, 0x1, 0x42, 0x2e, 0xf0, 0xd7, 0xab } }
extern EFI_GUID gEfiEventMemoryMapChangeGuid;
#define EFI_EVENT_GROUP_READY_TO_BOOT \
{ 0x7ce88fb3, 0x4bd7, 0x4679, { 0x87, 0xa8, 0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b } }
extern EFI_GUID gEfiEventReadyToBootGuid;
#endif

View File

@@ -0,0 +1,28 @@
/** @file
GUID is the name of events used with CreateEventEx in order to be notified when the EFI boot manager is about to boot a legacy boot option. Events of this type are notificated just before Int19h is invoked.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: EventLegacyBios.h
@par Revision Reference:
GUIDs defined in DXE CIS 0.91b.
**/
#ifndef __EVENT_LEGACY_BIOS_GUID_H__
#define __EVENT_LEGACY_BIOS_GUID_H__
#define EFI_EVENT_LEGACY_BOOT_GUID \
{ 0x2a571201, 0x4966, 0x47f6, {0x8b, 0x86, 0xf3, 0x1e, 0x41, 0xf3, 0x2f, 0x10 } }
extern EFI_GUID gEfiEventLegacyBootGuid;
#endif

View File

@@ -0,0 +1,40 @@
/** @file
Guid used to define the Firmware File System. See the Framework Firmware
File System Specification for more details.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: FirmwareFileSystem.h
@par Revision Reference:
Guids defined in Firmware File System Spec 0.9
**/
#ifndef __FIRMWARE_FILE_SYSTEM_GUID_H__
#define __FIRMWARE_FILE_SYSTEM_GUID_H__
//
// GUIDs defined by the FFS specification.
//
#define EFI_FIRMWARE_FILE_SYSTEM_GUID \
{ \
0x7A9354D9, 0x0468, 0x444a, {0x81, 0xCE, 0x0B, 0xF6, 0x17, 0xD8, 0x90, 0xDF } \
}
#define EFI_FFS_VOLUME_TOP_FILE_GUID \
{ \
0x1BA0062E, 0xC779, 0x4582, {0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x9 } \
}
extern EFI_GUID gEfiFirmwareFileSystemGuid;
extern EFI_GUID gEfiFirmwareVolumeTopFileGuid;
#endif

View File

@@ -0,0 +1,29 @@
/** @file
This GUID is used to define a vendor specific device path being owned by the
Framework specificaitons.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: FrameworkDevicePath.h
@par Revision Reference:
Spec Version 0.9
**/
#ifndef __FRAMEWORK_DEVICE_PATH_GUID_H__
#define __FRAMEWORK_DEVICE_PATH_GUID_H__
#define EFI_FRAMEWORK_DEVICE_PATH_GUID \
{ 0xb7084e63, 0x46b7, 0x4d1a, { 0x86, 0x77, 0xe3, 0x0b, 0x53, 0xdb, 0xf0, 0x50 } }
extern EFI_GUID gEfiFrameworkDevicePathGuid;
#endif

View File

@@ -0,0 +1,31 @@
/** @file
GUID for EFI (NVRAM) Variables.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: GlobalVariable.h
@par Revision Reference:
GUID defined in UEFI 2.0
**/
#ifndef __GLOBAL_VARIABLE_GUID_H__
#define __GLOBAL_VARIABLE_GUID_H__
#define EFI_GLOBAL_VARIABLE_GUID \
{ \
0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C } \
}
#define EFI_GLOBAL_VARIABLE EFI_GLOBAL_VARIABLE_GUID
extern EFI_GUID gEfiGlobalVariableGuid;
#endif

45
MdePkg/Include/Guid/Gpt.h Normal file
View File

@@ -0,0 +1,45 @@
/** @file
Guids used for the GPT (GUID Partition Table)
GPT defines a new disk partitioning scheme and also describes
usage of the legacy Master Boot Record (MBR) partitioning scheme.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Gpt.h
@par Revision Reference:
GUIDs defined in UEFI 2.0 spec.
**/
#ifndef __GPT_GUID_H__
#define __GPT_GUID_H__
#define EFI_PART_TYPE_UNUSED_GUID \
{ \
0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } \
}
#define EFI_PART_TYPE_EFI_SYSTEM_PART_GUID \
{ \
0xc12a7328, 0xf81f, 0x11d2, {0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } \
}
#define EFI_PART_TYPE_LEGACY_MBR_GUID \
{ \
0x024dee41, 0x33e7, 0x11d3, {0x9d, 0x69, 0x00, 0x08, 0xc7, 0x81, 0xf3, 0x9f } \
}
extern EFI_GUID gEfiPartTypeUnusedGuid;
extern EFI_GUID gEfiPartTypeSystemPartGuid;
extern EFI_GUID gEfiPartTypeLegacyMbrGuid;
#endif

View File

@@ -0,0 +1,32 @@
/** @file
GUIDs used for HOB List entries
These GUIDs point the HOB List passed from PEI to DXE.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: HobList.h
@par Revision Reference:
GUID defined in DXE CIS spec version 0.91
**/
#ifndef __HOB_LIST_GUID_H__
#define __HOB_LIST_GUID_H__
#define EFI_HOB_LIST_GUID \
{ \
0x7739f24c, 0x93d7, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
extern EFI_GUID gEfiHobListGuid;
#endif

View File

@@ -0,0 +1,36 @@
/** @file
GUIDs for HOBs used in memory allcation
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: MemoryAllocationHob.h
@par Revision Reference:
GUID defined in Hob Spec Version 0.9
**/
#ifndef __MEMORY_ALLOCATION_GUID_H__
#define __MEMORY_ALLOCATION_GUID_H__
#define EFI_HOB_MEMORY_ALLOC_BSP_STORE_GUID \
{0x564b33cd, 0xc92a, 0x4593, {0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c, 0x63, 0x22} };
#define EFI_HOB_MEMORY_ALLOC_STACK_GUID \
{0x4ed4bf27, 0x4092, 0x42e9, {0x80, 0x7d, 0x52, 0x7b, 0x1d, 0x0, 0xc9, 0xbd} }
#define EFI_HOB_MEMORY_ALLOC_MODULE_GUID \
{0xf8e21975, 0x899, 0x4f58, {0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6, 0xd7, 0x7a} }
extern EFI_GUID gEfiHobMemoryAllocBspStoreGuid;
extern EFI_GUID gEfiHobMemoryAllocStackGuid;
extern EFI_GUID gEfiHobMemoryAllocModuleGuid;
#endif

37
MdePkg/Include/Guid/Mps.h Normal file
View File

@@ -0,0 +1,37 @@
/** @file
GUIDs used for MPS entries in the EFI 1.0 system table
ACPI is the primary means of exporting MP information to the OS. MPS obly was
included to support Itanium-based platform power on. So don't use it if you don't have too.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Mps.h
@par Revision Reference:
GUIDs defined in UEFI 2.0 spec.
**/
#ifndef __MPS_GUID_H__
#define __MPS_GUID_H__
#define EFI_MPS_TABLE_GUID \
{ \
0xeb9d2d2f, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
//
// GUID name defined in spec.
//
#define MPS_TABLE_GUID EFI_MPS_TABLE_GUID
extern EFI_GUID gEfiMpsTableGuid;
#endif

View File

@@ -0,0 +1,48 @@
/** @file
Terminal Device Path Vendor Guid.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PcAnsi.h
@par Revision Reference:
GUIDs defined in UEFI 2.0 spec.
**/
#ifndef __PC_ANSI_H__
#define __PC_ANSI_H__
#define EFI_PC_ANSI_GUID \
{ \
0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define EFI_VT_100_GUID \
{ \
0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define EFI_VT_100_PLUS_GUID \
{ \
0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \
}
#define EFI_VT_UTF8_GUID \
{ \
0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \
}
extern EFI_GUID gEfiPcAnsiGuid;
extern EFI_GUID gEfiVT100Guid;
extern EFI_GUID gEfiVT100PlusGuid;
extern EFI_GUID gEfiVTUTF8Guid;
#endif

View File

@@ -0,0 +1,38 @@
/** @file
GUIDs used for SAL system table entries in the EFI system table.
SAL System Table contains Itanium-based processor centric information about
the system.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SalSystemTable.h
@par Revision Reference:
GUIDs defined in UEFI 2.0 spec.
**/
#ifndef __SAL_SYSTEM_TABLE_GUID_H__
#define __SAL_SYSTEM_TABLE_GUID_H__
#define EFI_SAL_SYSTEM_TABLE_GUID \
{ \
0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
//
// GUID name defined in spec.
//
#define SAL_SYSTEM_TABLE_GUID EFI_SAL_SYSTEM_TABLE_GUID
extern EFI_GUID gEfiSalSystemTableGuid;
#endif

View File

@@ -0,0 +1,68 @@
/** @file
GUIDs used to locate the SMBIOS tables in the EFI 1.0 system table.
This GUID in the system table is the only legal way to search for and
locate the SMBIOS tables. Do not search the 0xF0000 segment to find SMBIOS
tables.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SmBios.h
@par Revision Reference:
GUIDs defined in UEFI 2.0 spec.
**/
#ifndef __SMBIOS_GUID_H__
#define __SMBIOS_GUID_H__
#define EFI_SMBIOS_TABLE_GUID \
{ \
0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}
#define SMBIOS_TABLE_GUID EFI_SMBIOS_TABLE_GUID
//
// Smbios Table Entry Point Structure
//
#pragma pack(1)
typedef struct {
UINT8 AnchorString[4];
UINT8 EntryPointStructureChecksum;
UINT8 EntryPointLength;
UINT8 MajorVersion;
UINT8 MinorVersion;
UINT16 MaxStructureSize;
UINT8 EntryPointRevision;
UINT8 FormattedArea[5];
UINT8 IntermediateAnchorString[5];
UINT8 IntermediateChecksum;
UINT16 TableLength;
UINT32 TableAddress;
UINT16 NumberOfSmbiosStructures;
UINT8 SmbiosBcdRevision;
} SMBIOS_TABLE_ENTRY_POINT;
//
// The Smbios structure header
//
typedef struct {
UINT8 Type;
UINT8 Length;
UINT16 Handle;
} SMBIOS_STRUCTURE;
#pragma pack()
extern EFI_GUID gEfiSmbiosTableGuid;
#endif

View File

@@ -0,0 +1,39 @@
/** @file
Definitions EFI_SMM_COMMUNICATE_HEADER used by EFI_SMM_BASE_PROTOCOL.Communicate() functions
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SmmCommunicate.h
@par Revision Reference:
GUIDs defined in SmmCis spec version 0.9
**/
#ifndef __SMM_COMMUNICATE_GUID_H__
#define __SMM_COMMUNICATE_GUID_H__
//******************************************************
// EFI_SMM_COMMUNICATE_HEADER
//******************************************************
#define SMM_COMMUNICATE_HEADER_GUID \
{ \
0xf328e36c, 0x23b6, 0x4a95, {0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 } \
}
typedef struct {
EFI_GUID HeaderGuid;
UINTN MessageLength;
UINT8 Data[1];
} EFI_SMM_COMMUNICATE_HEADER;
extern EFI_GUID gSmmCommunicateHeaderGuid;
#endif

View File

@@ -0,0 +1,67 @@
/** @file
GUID for use in reserving SMRAM regions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SmramMemoryReserve.h
@par Revision Reference:
GUIDs defined in SmmCis spec version 0.9
**/
#ifndef _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_
#define _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_
#define EFI_SMM_PEI_SMRAM_MEMORY_RESERVE \
{ \
0x6dadf1d1, 0xd4cc, 0x4910, {0xbb, 0x6e, 0x82, 0xb1, 0xfd, 0x80, 0xff, 0x3d } \
}
//
// *******************************************************
// EFI_SMRAM_DESCRIPTOR
// *******************************************************
//
typedef struct {
EFI_PHYSICAL_ADDRESS PhysicalStart; // Phsyical location in DRAM
EFI_PHYSICAL_ADDRESS CpuStart; // Address CPU uses to access the SMI handler
// May or may not match PhysicalStart
//
UINT64 PhysicalSize;
UINT64 RegionState;
} EFI_SMRAM_DESCRIPTOR;
//
// *******************************************************
// EFI_SMRAM_STATE
// *******************************************************
//
#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
//
// *******************************************************
// EFI_SMRAM_HOB_DESCRIPTOR_BLOCK
// *******************************************************
//
typedef struct {
UINTN NumberOfSmmReservedRegions;
EFI_SMRAM_DESCRIPTOR Descriptor[1];
} EFI_SMRAM_HOB_DESCRIPTOR_BLOCK;
extern EFI_GUID gEfiSmmPeiSmramMemoryReserve;
#endif

View File

@@ -0,0 +1,82 @@
/** @file
GUID used to identify id for the caller who is initiating the Status Code.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: StatusCodeDataTypeId.h
@par Revision Reference:
GUIDs defined in Status Codes Specification 0.92
**/
#ifndef __STATUS_CODE_DATA_TYPE_ID_GUID_H__
#define __STATUS_CODE_DATA_TYPE_ID_GUID_H__
//
// String Data Type defintion. This is part of Status Code Specification
//
#define EFI_STATUS_CODE_DATA_TYPE_STRING_GUID \
{ 0x92D11080, 0x496F, 0x4D95, { 0xBE, 0x7E, 0x03, 0x74, 0x88, 0x38, 0x2B, 0x0A } }
extern EFI_GUID gEfiStatusCodeDataTypeStringGuid;
//
// This GUID indicates that the format of the accompanying data depends
// upon the Status Code Value, but follows this Specification
//
#define EFI_STATUS_CODE_SPECIFIC_DATA_GUID \
{ 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }
extern EFI_GUID gEfiStatusCodeSpecificDataGuid;
//
// Debug Assert Data. This is part of Status Code Specification
//
#define EFI_STATUS_CODE_DATA_TYPE_ASSERT_GUID \
{ 0xDA571595, 0x4D99, 0x487C, { 0x82, 0x7C, 0x26, 0x22, 0x67, 0x7D, 0x33, 0x07 } }
extern EFI_GUID gEfiStatusCodeDataTypeAssertGuid;
//
// Exception Data type (CPU REGS)
//
#define EFI_STATUS_CODE_DATA_TYPE_EXCEPTION_HANDLER_GUID \
{ 0x3BC2BD12, 0xAD2E, 0x11D5, { 0x87, 0xDD, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xB9 } }
extern EFI_GUID gEfiStatusCodeDataTypeExceptionHandlerGuid;
//
// Debug DataType defintions. User Defined Data Types.
//
#define EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID \
{ 0x9A4E9246, 0xD553, 0x11D5, { 0x87, 0xE2, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xb9 } }
extern EFI_GUID gEfiStatusCodeDataTypeDebugGuid;
//
// Progress Code. User Defined Data Type Guid.
//
#define EFI_STATUS_CODE_DATA_TYPE_ERROR_GUID \
0xAB359CE3, 0x99B3, 0xAE18, { 0xC8, 0x9D, 0x95, 0xD3, 0xB0, 0x72, 0xE1, 0x9B } }
extern EFI_GUID gEfiStatusCodeDataTypeErrorGuid;
//
// Progress Code. User Defined Data Type Guid.
//
#define EFI_STATUS_CODE_DATA_TYPE_PROGRESS_CODE_GUID \
{ 0xA356AB39, 0x35C4, 0x35DA, { 0xB3, 0x7A, 0xF8, 0xEA, 0x9E, 0x8B, 0x36, 0xA3 } }
extern EFI_GUID gEfiStatusCodeDataTypeProgressCodeGuid;
#endif

View File

@@ -0,0 +1,167 @@
/** @file
Processor or Compiler specific defines and types for x64.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: ProcessorBind.h
**/
#ifndef __PROCESSOR_BIND_H__
#define __PROCESSOR_BIND_H__
//
// Define the processor type so other code can make processor based choices
//
#define MDE_CPU_IA32
//
// Make sure we are useing the correct packing rules per EFI specification
//
#ifndef __GNUC__
#pragma pack()
#endif
#if _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 )
#endif
#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
//
// No ANSI C 2000 stdint.h integer width declarations, so define equivalents
//
#if _MSC_EXTENSIONS
//
// use Microsoft* C complier dependent interger width types
//
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
typedef unsigned __int32 UINT32;
typedef __int32 INT32;
typedef unsigned short UINT16;
typedef unsigned short CHAR16;
typedef short INT16;
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef char CHAR8;
typedef char INT8;
#else
//
// Assume standard IA-32 alignment.
// BugBug: Need to check portability of long long
//
typedef unsigned long long UINT64;
typedef long long INT64;
typedef unsigned int UINT32;
typedef int INT32;
typedef unsigned short UINT16;
typedef unsigned short CHAR16;
typedef short INT16;
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef char CHAR8;
typedef char INT8;
#endif
#define UINT8_MAX 0xff
#else
//
// Use ANSI C 2000 stdint.h integer width declarations
//
#include "stdint.h"
typedef uint8_t BOOLEAN;
typedef int8_t INT8;
typedef uint8_t UINT8;
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int32_t INT32;
typedef uint32_t UINT32;
typedef int64_t INT64;
typedef uint64_t UINT64;
typedef char CHAR8;
typedef uint16_t CHAR16;
#endif
typedef UINT32 UINTN;
typedef INT32 INTN;
//
// Processor specific defines
//
#define MAX_BIT 0x80000000
#define MAX_2_BITS 0xC0000000
//
// Maximum legal IA-32 address
//
#define MAX_ADDRESS 0xFFFFFFFF
//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
// EFI intrinsics are required to modify thier member functions with EFIAPI.
//
#if _MSC_EXTENSIONS
//
// Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
//
#define EFIAPI __cdecl
#endif
#if __GNUC__
#define EFIAPI __attribute__((cdecl))
#endif
//
// The Microsoft* C compiler can removed references to unreferenced data items
// if the /OPT:REF linker option is used. We defined a macro as this is a
// a non standard extension
//
#if _MSC_EXTENSIONS
#define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
#else
#define GLOBAL_REMOVE_IF_UNREFERENCED
#endif
#endif

View File

@@ -0,0 +1,91 @@
/** @file
This file contains some basic ACPI definitions that are consumed by drivers
that do not care about ACPI versions.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Acpi.h
**/
#ifndef _ACPI_H_
#define _ACPI_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;
//
// Common ACPI description table header. This structure prefaces most ACPI tables.
//
#pragma pack(1)
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 Pci Host Bridge Resource Allocation
//
#define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
#define ACPI_END_TAG_DESCRIPTOR 0x79
#define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
#define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
#define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
//
// Make sure structures match spec
//
#pragma pack(1)
typedef 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 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
#pragma pack()
#endif

View File

@@ -0,0 +1,282 @@
/** @file
Support for USB 1.1 standard.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: Usb.h
**/
#ifndef __USB_H__
#define __USB_H__
//
// USB Descriptor types
//
#define USB_DT_DEVICE 0x01
#define USB_DT_CONFIG 0x02
#define USB_DT_STRING 0x03
#define USB_DT_INTERFACE 0x04
#define USB_DT_ENDPOINT 0x05
#define USB_DT_HUB 0x29
#define USB_DT_HID 0x21
//
// USB request type
//
#define USB_TYPE_STANDARD (0x00 << 5)
#define USB_TYPE_CLASS (0x01 << 5)
#define USB_TYPE_VENDOR (0x02 << 5)
#define USB_TYPE_RESERVED (0x03 << 5)
//
// USB request targer device
//
#define USB_RECIP_DEVICE 0x00
#define USB_RECIP_INTERFACE 0x01
#define USB_RECIP_ENDPOINT 0x02
#define USB_RECIP_OTHER 0x03
//
// Request target types.
//
#define USB_RT_DEVICE 0x00
#define USB_RT_INTERFACE 0x01
#define USB_RT_ENDPOINT 0x02
#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
//
// USB Transfer Results
//
#define EFI_USB_NOERROR 0x00
#define EFI_USB_ERR_NOTEXECUTE 0x01
#define EFI_USB_ERR_STALL 0x02
#define EFI_USB_ERR_BUFFER 0x04
#define EFI_USB_ERR_BABBLE 0x08
#define EFI_USB_ERR_NAK 0x10
#define EFI_USB_ERR_CRC 0x20
#define EFI_USB_ERR_TIMEOUT 0x40
#define EFI_USB_ERR_BITSTUFF 0x80
#define EFI_USB_ERR_SYSTEM 0x100
//
//Use 200 ms to increase the error handling response time
//
#define EFI_USB_INTERRUPT_DELAY 2000000
//
// USB transation direction
//
typedef enum {
EfiUsbDataOut,
EfiUsbDataIn,
EfiUsbNoData
} EFI_USB_DATA_DIRECTION;
//
// Usb Data recipient type
//
typedef enum {
EfiUsbDevice,
EfiUsbInterface,
EfiUsbEndpoint
} EFI_USB_RECIPIENT;
typedef enum {
EfiUsbEndpointHalt,
EfiUsbDeviceRemoteWakeup
} EFI_USB_STANDARD_FEATURE_SELECTOR;
#pragma pack(1)
//
// Usb device request structure
//
typedef struct {
UINT8 RequestType;
UINT8 Request;
UINT16 Value;
UINT16 Index;
UINT16 Length;
} EFI_USB_DEVICE_REQUEST;
//
// Standard USB request
//
#define USB_DEV_GET_STATUS 0x00
#define USB_DEV_CLEAR_FEATURE 0x01
#define USB_DEV_SET_FEATURE 0x03
#define USB_DEV_SET_ADDRESS 0x05
#define USB_DEV_SET_ADDRESS_REQ_TYPE 0x00
#define USB_DEV_GET_DESCRIPTOR 0x06
#define USB_DEV_GET_DESCRIPTOR_REQ_TYPE 0x80
#define USB_DEV_SET_DESCRIPTOR 0x07
#define USB_DEV_SET_DESCRIPTOR_REQ_TYPE 0x00
#define USB_DEV_GET_CONFIGURATION 0x08
#define USB_DEV_GET_CONFIGURATION_REQ_TYPE 0x80
#define USB_DEV_SET_CONFIGURATION 0x09
#define USB_DEV_SET_CONFIGURATION_REQ_TYPE 0x00
#define USB_DEV_GET_INTERFACE 0x0A
#define USB_DEV_GET_INTERFACE_REQ_TYPE 0x81
#define USB_DEV_SET_INTERFACE 0x0B
#define USB_DEV_SET_INTERFACE_REQ_TYPE 0x01
#define USB_DEV_SYNCH_FRAME 0x0C
#define USB_DEV_SYNCH_FRAME_REQ_TYPE 0x82
//
// Device descriptor. refer USB1.1
//
typedef struct usb_device_descriptor {
UINT8 Length;
UINT8 DescriptorType;
UINT16 BcdUSB;
UINT8 DeviceClass;
UINT8 DeviceSubClass;
UINT8 DeviceProtocol;
UINT8 MaxPacketSize0;
UINT16 IdVendor;
UINT16 IdProduct;
UINT16 BcdDevice;
UINT8 StrManufacturer;
UINT8 StrProduct;
UINT8 StrSerialNumber;
UINT8 NumConfigurations;
} EFI_USB_DEVICE_DESCRIPTOR;
//
// Endpoint descriptor
//
typedef struct {
UINT8 Length;
UINT8 DescriptorType;
UINT8 EndpointAddress;
UINT8 Attributes;
UINT16 MaxPacketSize;
UINT8 Interval;
} EFI_USB_ENDPOINT_DESCRIPTOR;
//
// Interface descriptor
//
typedef struct {
UINT8 Length;
UINT8 DescriptorType;
UINT8 InterfaceNumber;
UINT8 AlternateSetting;
UINT8 NumEndpoints;
UINT8 InterfaceClass;
UINT8 InterfaceSubClass;
UINT8 InterfaceProtocol;
UINT8 Interface;
} EFI_USB_INTERFACE_DESCRIPTOR;
//
// USB alternate setting
//
typedef struct {
EFI_USB_INTERFACE_DESCRIPTOR *Interface;
} USB_ALT_SETTING;
//
// Configuration descriptor
//
typedef struct {
UINT8 Length;
UINT8 DescriptorType;
UINT16 TotalLength;
UINT8 NumInterfaces;
UINT8 ConfigurationValue;
UINT8 Configuration;
UINT8 Attributes;
UINT8 MaxPower;
} EFI_USB_CONFIG_DESCRIPTOR;
//
// Supported String Languages
//
typedef struct {
UINT8 Length;
UINT8 DescriptorType;
UINT16 SupportedLanID[1];
} EFI_USB_SUPPORTED_LANGUAGES;
//
// String descriptor
//
typedef struct {
UINT8 Length;
UINT8 DescriptorType;
CHAR16 String[1];
} EFI_USB_STRING_DESCRIPTOR;
//
// Hub descriptor
//
#define MAXBYTES 8
typedef struct {
UINT8 Length;
UINT8 DescriptorType;
UINT8 NbrPorts;
UINT8 HubCharacteristics[2];
UINT8 PwrOn2PwrGood;
UINT8 HubContrCurrent;
UINT8 Filler[MAXBYTES];
} EFI_USB_HUB_DESCRIPTOR;
typedef struct {
UINT16 PortStatus;
UINT16 PortChangeStatus;
} EFI_USB_PORT_STATUS;
//
// Constant value for Port Status & Port Change Status
//
#define USB_PORT_STAT_CONNECTION 0x0001
#define USB_PORT_STAT_ENABLE 0x0002
#define USB_PORT_STAT_SUSPEND 0x0004
#define USB_PORT_STAT_OVERCURRENT 0x0008
#define USB_PORT_STAT_RESET 0x0010
#define USB_PORT_STAT_POWER 0x0100
#define USB_PORT_STAT_LOW_SPEED 0x0200
#define USB_PORT_STAT_C_CONNECTION 0x0001
#define USB_PORT_STAT_C_ENABLE 0x0002
#define USB_PORT_STAT_C_SUSPEND 0x0004
#define USB_PORT_STAT_C_OVERCURRENT 0x0008
#define USB_PORT_STAT_C_RESET 0x0010
//
// Used for set/clear port feature request
//
typedef enum {
EfiUsbPortEnable = 1,
EfiUsbPortSuspend = 2,
EfiUsbPortReset = 4,
EfiUsbPortPower = 8,
EfiUsbPortConnectChange = 16,
EfiUsbPortEnableChange = 17,
EfiUsbPortSuspendChange = 18,
EfiUsbPortOverCurrentChange = 19,
EfiUsbPortResetChange = 20
} EFI_USB_PORT_FEATURE;
#pragma pack()
#endif

View File

@@ -0,0 +1,481 @@
/** @file
Support for PCI 2.2 standard.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: pci22.h
**/
#ifndef _PCI22_H
#define _PCI22_H
#define PCI_MAX_SEGMENT 0
#define PCI_MAX_BUS 255
#define PCI_MAX_DEVICE 31
#define PCI_MAX_FUNC 7
//
// Command
//
#define PCI_VGA_PALETTE_SNOOP_DISABLED 0x20
#pragma pack(push, 1)
typedef struct {
UINT16 VendorId;
UINT16 DeviceId;
UINT16 Command;
UINT16 Status;
UINT8 RevisionID;
UINT8 ClassCode[3];
UINT8 CacheLineSize;
UINT8 LatencyTimer;
UINT8 HeaderType;
UINT8 BIST;
} PCI_DEVICE_INDEPENDENT_REGION;
typedef struct {
UINT32 Bar[6];
UINT32 CISPtr;
UINT16 SubsystemVendorID;
UINT16 SubsystemID;
UINT32 ExpansionRomBar;
UINT8 CapabilityPtr;
UINT8 Reserved1[3];
UINT32 Reserved2;
UINT8 InterruptLine;
UINT8 InterruptPin;
UINT8 MinGnt;
UINT8 MaxLat;
} PCI_DEVICE_HEADER_TYPE_REGION;
typedef struct {
PCI_DEVICE_INDEPENDENT_REGION Hdr;
PCI_DEVICE_HEADER_TYPE_REGION Device;
} PCI_TYPE00;
typedef struct {
UINT32 Bar[2];
UINT8 PrimaryBus;
UINT8 SecondaryBus;
UINT8 SubordinateBus;
UINT8 SecondaryLatencyTimer;
UINT8 IoBase;
UINT8 IoLimit;
UINT16 SecondaryStatus;
UINT16 MemoryBase;
UINT16 MemoryLimit;
UINT16 PrefetchableMemoryBase;
UINT16 PrefetchableMemoryLimit;
UINT32 PrefetchableBaseUpper32;
UINT32 PrefetchableLimitUpper32;
UINT16 IoBaseUpper16;
UINT16 IoLimitUpper16;
UINT8 CapabilityPtr;
UINT8 Reserved[3];
UINT32 ExpansionRomBAR;
UINT8 InterruptLine;
UINT8 InterruptPin;
UINT16 BridgeControl;
} PCI_BRIDGE_CONTROL_REGISTER;
typedef struct {
PCI_DEVICE_INDEPENDENT_REGION Hdr;
PCI_BRIDGE_CONTROL_REGISTER Bridge;
} PCI_TYPE01;
typedef union {
PCI_TYPE00 Device;
PCI_TYPE01 Bridge;
} PCI_TYPE_GENERIC;
typedef struct {
UINT32 CardBusSocketReg; // Cardus Socket/ExCA Base
// Address Register
//
UINT16 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 // obsolete
#define PCI_CLASS_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_ETHERNET 0x00 // obsolete
#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_CTRL 0x03 // obsolete
#define PCI_CLASS_DISPLAY_VGA 0x00
#define PCI_CLASS_VGA 0x00 // obsolete
#define PCI_CLASS_DISPLAY_XGA 0x01
#define PCI_CLASS_DISPLAY_3D 0x02
#define PCI_CLASS_DISPLAY_OTHER 0x80
#define PCI_CLASS_DISPLAY_GFX 0x80
#define PCI_CLASS_GFX 0x80 // obsolete
#define PCI_CLASS_BRIDGE 0x06
#define PCI_CLASS_BRIDGE_HOST 0x00
#define PCI_CLASS_BRIDGE_ISA 0x01
#define PCI_CLASS_ISA 0x01 // obsolete
#define PCI_CLASS_BRIDGE_EISA 0x02
#define PCI_CLASS_BRIDGE_MCA 0x03
#define PCI_CLASS_BRIDGE_P2P 0x04
#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_ISA_PDECODE 0x80
#define PCI_CLASS_ISA_POSITIVE_DECODE 0x80 // obsolete
#define PCI_CLASS_SERIAL 0x0C
#define PCI_CLASS_SERIAL_FIREWIRE 0x00
#define PCI_CLASS_SERIAL_ACCESS_BUS 0x01
#define PCI_CLASS_SERIAL_SSA 0x02
#define PCI_CLASS_SERIAL_USB 0x03
#define PCI_CLASS_SERIAL_FIBRECHANNEL 0x04
#define PCI_CLASS_SERIAL_SMB 0x05
#define IS_CLASS1(_p, c) ((_p)->Hdr.ClassCode[2] == (c))
#define IS_CLASS2(_p, c, s) (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s)))
#define IS_CLASS3(_p, c, s, p) (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p)))
#define IS_PCI_DISPLAY(_p) IS_CLASS1 (_p, PCI_CLASS_DISPLAY)
#define IS_PCI_VGA(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 0)
#define IS_PCI_8514(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 1)
#define IS_PCI_GFX(_p) IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_GFX, 0)
#define IS_PCI_OLD(_p) IS_CLASS1 (_p, PCI_CLASS_OLD)
#define IS_PCI_OLD_VGA(_p) IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA)
#define IS_PCI_IDE(_p) IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE)
#define IS_PCI_SCSI(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI, 0)
#define IS_PCI_RAID(_p) IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID, 0)
#define IS_PCI_LPC(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, 0)
#define IS_PCI_P2P(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 0)
#define IS_PCI_P2P_SUB(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 1)
#define IS_PCI_USB(_p) IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)
#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
#define HEADER_LAYOUT_CODE 0x7f
#define IS_PCI_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE))
#define IS_CARDBUS_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE))
#define IS_PCI_MULTI_FUNC(_p) ((_p)->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)
#define PCI_DEVICE_ROMBAR 0x30
#define PCI_BRIDGE_ROMBAR 0x38
#define PCI_MAX_BAR 6
#define PCI_MAX_CONFIG_OFFSET 0x100
//
// bugbug: this is supported in PCI spec v2.3
//
#define PCI_EXP_MAX_CONFIG_OFFSET 0x1000
#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_BRIDGE_CONTROL_REGISTER_OFFSET 0x3E
#define PCI_BRIDGE_STATUS_REGISTER_OFFSET 0x1E
#define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET 0x18
#define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET 0x19
#define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET 0x1a
typedef struct {
UINT8 Register;
UINT8 Function;
UINT8 Device;
UINT8 Bus;
UINT8 Reserved[4];
} DEFIO_PCI_ADDR;
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_ROOT_BRIDGE_LIST 'eprb'
#define PCI_EXPANSION_ROM_HEADER_SIGNATURE 0xaa55
#define EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE 0x0EF1
#define PCI_DATA_STRUCTURE_SIGNATURE EFI_SIGNATURE_32 ('P', 'C', 'I', 'R')
#define PCI_CODE_TYPE_PCAT_IMAGE 0x00
#define PCI_CODE_TYPE_EFI_IMAGE 0x03
#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED 0x0001
#define EFI_PCI_COMMAND_IO_SPACE 0x0001
#define EFI_PCI_COMMAND_MEMORY_SPACE 0x0002
#define EFI_PCI_COMMAND_BUS_MASTER 0x0004
#define EFI_PCI_COMMAND_SPECIAL_CYCLE 0x0008
#define EFI_PCI_COMMAND_MEMORY_WRITE_AND_INVALIDATE 0x0010
#define EFI_PCI_COMMAND_VGA_PALETTE_SNOOP 0x0020
#define EFI_PCI_COMMAND_PARITY_ERROR_RESPOND 0x0040
#define EFI_PCI_COMMAND_STEPPING_CONTROL 0x0080
#define EFI_PCI_COMMAND_SERR 0x0100
#define EFI_PCI_COMMAND_FAST_BACK_TO_BACK 0x0200
#define EFI_PCI_BRIDGE_CONTROL_PARITY_ERROR_RESPONSE 0x0001
#define EFI_PCI_BRIDGE_CONTROL_SERR 0x0002
#define EFI_PCI_BRIDGE_CONTROL_ISA 0x0004
#define EFI_PCI_BRIDGE_CONTROL_VGA 0x0008
#define EFI_PCI_BRIDGE_CONTROL_VGA_16 0x0010
#define EFI_PCI_BRIDGE_CONTROL_MASTER_ABORT 0x0020
#define EFI_PCI_BRIDGE_CONTROL_RESET_SECONDARY_BUS 0x0040
#define EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK 0x0080
#define EFI_PCI_BRIDGE_CONTROL_PRIMARY_DISCARD_TIMER 0x0100
#define EFI_PCI_BRIDGE_CONTROL_SECONDARY_DISCARD_TIMER 0x0200
#define EFI_PCI_BRIDGE_CONTROL_TIMER_STATUS 0x0400
#define EFI_PCI_BRIDGE_CONTROL_DISCARD_TIMER_SERR 0x0800
//
// Following are the PCI-CARDBUS bridge control bit
//
#define EFI_PCI_BRIDGE_CONTROL_IREQINT_ENABLE 0x0080
#define EFI_PCI_BRIDGE_CONTROL_RANGE0_MEMORY_TYPE 0x0100
#define EFI_PCI_BRIDGE_CONTROL_RANGE1_MEMORY_TYPE 0x0200
#define EFI_PCI_BRIDGE_CONTROL_WRITE_POSTING_ENABLE 0x0400
//
// Following are the PCI status control bit
//
#define EFI_PCI_STATUS_CAPABILITY 0x0010
#define EFI_PCI_STATUS_66MZ_CAPABLE 0x0020
#define EFI_PCI_FAST_BACK_TO_BACK_CAPABLE 0x0080
#define EFI_PCI_MASTER_DATA_PARITY_ERROR 0x0100
#define EFI_PCI_CAPABILITY_PTR 0x34
#define EFI_PCI_CARDBUS_BRIDGE_CAPABILITY_PTR 0x14
#pragma pack(1)
typedef struct {
UINT16 Signature; // 0xaa55
UINT8 Reserved[0x16];
UINT16 PcirOffset;
} PCI_EXPANSION_ROM_HEADER;
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 struct {
UINT16 Signature; // 0xaa55
UINT8 Size512;
UINT8 Reserved[15];
UINT16 PcirOffset;
} EFI_LEGACY_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;
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;
//
// 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
#define EFI_PCI_CAPABILITY_ID_PCIX 0x07
//
// bugbug: this ID is defined in PCI spec v2.3
//
#define EFI_PCI_CAPABILITY_ID_PCIEXP 0x10
typedef struct {
UINT8 CapabilityID;
UINT8 NextItemPtr;
} EFI_PCI_CAPABILITY_HDR;
//
// Capability EFI_PCI_CAPABILITY_ID_PMI
//
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT16 PMC;
UINT16 PMCSR;
UINT8 BridgeExtention;
UINT8 Data;
} EFI_PCI_CAPABILITY_PMI;
//
// Capability EFI_PCI_CAPABILITY_ID_AGP
//
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT8 Rev;
UINT8 Reserved;
UINT32 Status;
UINT32 Command;
} EFI_PCI_CAPABILITY_AGP;
//
// Capability EFI_PCI_CAPABILITY_ID_VPD
//
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT16 AddrReg;
UINT32 DataReg;
} EFI_PCI_CAPABILITY_VPD;
//
// Capability EFI_PCI_CAPABILITY_ID_SLOTID
//
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT8 ExpnsSlotReg;
UINT8 ChassisNo;
} EFI_PCI_CAPABILITY_SLOTID;
//
// Capability EFI_PCI_CAPABILITY_ID_MSI
//
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT16 MsgCtrlReg;
UINT32 MsgAddrReg;
UINT16 MsgDataReg;
} EFI_PCI_CAPABILITY_MSI32;
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT16 MsgCtrlReg;
UINT32 MsgAddrRegLsdw;
UINT32 MsgAddrRegMsdw;
UINT16 MsgDataReg;
} EFI_PCI_CAPABILITY_MSI64;
//
// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG
//
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
//
// not finished - fields need to go here
//
} EFI_PCI_CAPABILITY_HOTPLUG;
//
// Capability EFI_PCI_CAPABILITY_ID_PCIX
//
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT16 CommandReg;
UINT32 StatusReg;
} EFI_PCI_CAPABILITY_PCIX;
typedef struct {
EFI_PCI_CAPABILITY_HDR Hdr;
UINT16 SecStatusReg;
UINT32 StatusReg;
UINT32 SplitTransCtrlRegUp;
UINT32 SplitTransCtrlRegDn;
} EFI_PCI_CAPABILITY_PCIX_BRDG;
#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
#pragma pack(pop)
#endif

View File

@@ -0,0 +1,282 @@
/** @file
support for SCSI standard
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: scsi.h
**/
#ifndef _SCSI_H
#define _SCSI_H
//
// SCSI command OP Code
//
//
// Commands for all device types
//
#define EFI_SCSI_OP_CHANGE_DEFINITION 0x40
#define EFI_SCSI_OP_COMPARE 0x39
#define EFI_SCSI_OP_COPY 0x18
#define EFI_SCSI_OP_COPY_VERIFY 0x3a
#define EFI_SCSI_OP_INQUIRY 0x12
#define EFI_SCSI_OP_LOG_SELECT 0x4c
#define EFI_SCSI_OP_LOG_SENSE 0x4d
#define EFI_SCSI_OP_MODE_SEL6 0x15
#define EFI_SCSI_OP_MODE_SEL10 0x55
#define EFI_SCSI_OP_MODE_SEN6 0x1a
#define EFI_SCSI_OP_MODE_SEN10 0x5a
#define EFI_SCSI_OP_READ_BUFFER 0x3c
#define EFI_SCSI_OP_REQUEST_SENSE 0x03
#define EFI_SCSI_OP_SEND_DIAG 0x1d
#define EFI_SCSI_OP_TEST_UNIT_READY 0x00
#define EFI_SCSI_OP_WRITE_BUFF 0x3b
//
// Commands unique to Direct Access Devices
//
#define EFI_SCSI_OP_COMPARE 0x39
#define EFI_SCSI_OP_FORMAT 0x04
#define EFI_SCSI_OP_LOCK_UN_CACHE 0x36
#define EFI_SCSI_OP_PREFETCH 0x34
#define EFI_SCSI_OP_MEDIA_REMOVAL 0x1e
#define EFI_SCSI_OP_READ6 0x08
#define EFI_SCSI_OP_READ10 0x28
#define EFI_SCSI_OP_READ_CAPACITY 0x25
#define EFI_SCSI_OP_READ_DEFECT 0x37
#define EFI_SCSI_OP_READ_LONG 0x3e
#define EFI_SCSI_OP_REASSIGN_BLK 0x07
#define EFI_SCSI_OP_RECEIVE_DIAG 0x1c
#define EFI_SCSI_OP_RELEASE 0x17
#define EFI_SCSI_OP_REZERO 0x01
#define EFI_SCSI_OP_SEARCH_DATA_E 0x31
#define EFI_SCSI_OP_SEARCH_DATA_H 0x30
#define EFI_SCSI_OP_SEARCH_DATA_L 0x32
#define EFI_SCSI_OP_SEEK6 0x0b
#define EFI_SCSI_OP_SEEK10 0x2b
#define EFI_SCSI_OP_SEND_DIAG 0x1d
#define EFI_SCSI_OP_SET_LIMIT 0x33
#define EFI_SCSI_OP_START_STOP_UNIT 0x1b
#define EFI_SCSI_OP_SYNC_CACHE 0x35
#define EFI_SCSI_OP_VERIFY 0x2f
#define EFI_SCSI_OP_WRITE6 0x0a
#define EFI_SCSI_OP_WRITE10 0x2a
#define EFI_SCSI_OP_WRITE_VERIFY 0x2e
#define EFI_SCSI_OP_WRITE_LONG 0x3f
#define EFI_SCSI_OP_WRITE_SAME 0x41
//
// Commands unique to Sequential Access Devices
//
#define EFI_SCSI_OP_ERASE 0x19
#define EFI_SCSI_OP_LOAD_UNLOAD 0x1b
#define EFI_SCSI_OP_LOCATE 0x2b
#define EFI_SCSI_OP_READ_BLOCK_LIMIT 0x05
#define EFI_SCSI_OP_READ_POS 0x34
#define EFI_SCSI_OP_READ_REVERSE 0x0f
#define EFI_SCSI_OP_RECOVER_BUF_DATA 0x14
#define EFI_SCSI_OP_RESERVE_UNIT 0x16
#define EFI_SCSI_OP_REWIND 0x01
#define EFI_SCSI_OP_SPACE 0x11
#define EFI_SCSI_OP_VERIFY_TAPE 0x13
#define EFI_SCSI_OP_WRITE_FILEMARK 0x10
//
// Commands unique to Printer Devices
//
#define EFI_SCSI_OP_PRINT 0x0a
#define EFI_SCSI_OP_SLEW_PRINT 0x0b
#define EFI_SCSI_OP_STOP_PRINT 0x1b
#define EFI_SCSI_OP_SYNC_BUFF 0x10
//
// Commands unique to Processor Devices
//
#define EFI_SCSI_OP_RECEIVE 0x08
#define EFI_SCSI_OP_SEND 0x0a
//
// Commands unique to Write-Once Devices
//
#define EFI_SCSI_OP_MEDIUM_SCAN 0x38
#define EFI_SCSI_OP_SEARCH_DAT_E10 0x31
#define EFI_SCSI_OP_SEARCH_DAT_E12 0xb1
#define EFI_SCSI_OP_SEARCH_DAT_H10 0x30
#define EFI_SCSI_OP_SEARCH_DAT_H12 0xb0
#define EFI_SCSI_OP_SEARCH_DAT_L10 0x32
#define EFI_SCSI_OP_SEARCH_DAT_L12 0xb2
#define EFI_SCSI_OP_SET_LIMIT10 0x33
#define EFI_SCSI_OP_SET_LIMIT12 0xb3
#define EFI_SCSI_OP_VERIFY10 0x2f
#define EFI_SCSI_OP_VERIFY12 0xaf
#define EFI_SCSI_OP_WRITE12 0xaa
#define EFI_SCSI_OP_WRITE_VERIFY10 0x2e
#define EFI_SCSI_OP_WRITE_VERIFY12 0xae
//
// Commands unique to CD-ROM Devices
//
#define EFI_SCSI_OP_PLAY_AUD_10 0x45
#define EFI_SCSI_OP_PLAY_AUD_12 0xa5
#define EFI_SCSI_OP_PLAY_AUD_MSF 0x47
#define EFI_SCSI_OP_PLAY_AUD_TKIN 0x48
#define EFI_SCSI_OP_PLAY_TK_REL10 0x49
#define EFI_SCSI_OP_PLAY_TK_REL12 0xa9
#define EFI_SCSI_OP_READ_CD_CAPACITY 0x25
#define EFI_SCSI_OP_READ_HEADER 0x44
#define EFI_SCSI_OP_READ_SUB_CHANNEL 0x42
#define EFI_SCSI_OP_READ_TOC 0x43
//
// Commands unique to Scanner Devices
//
#define EFI_SCSI_OP_GET_DATABUFF_STAT 0x34
#define EFI_SCSI_OP_GET_WINDOW 0x25
#define EFI_SCSI_OP_OBJECT_POS 0x31
#define EFI_SCSI_OP_SCAN 0x1b
#define EFI_SCSI_OP_SET_WINDOW 0x24
//
// Commands unique to Optical Memory Devices
//
#define EFI_SCSI_OP_UPDATE_BLOCK 0x3d
//
// Commands unique to Medium Changer Devices
//
#define EFI_SCSI_OP_EXCHANGE_MEDIUM 0xa6
#define EFI_SCSI_OP_INIT_ELEMENT_STAT 0x07
#define EFI_SCSI_OP_POS_TO_ELEMENT 0x2b
#define EFI_SCSI_OP_REQUEST_VE_ADDR 0xb5
#define EFI_SCSI_OP_SEND_VOL_TAG 0xb6
//
// Commands unique to Communition Devices
//
#define EFI_SCSI_OP_GET_MESSAGE6 0x08
#define EFI_SCSI_OP_GET_MESSAGE10 0x28
#define EFI_SCSI_OP_GET_MESSAGE12 0xa8
#define EFI_SCSI_OP_SEND_MESSAGE6 0x0a
#define EFI_SCSI_OP_SEND_MESSAGE10 0x2a
#define EFI_SCSI_OP_SEND_MESSAGE12 0xaa
//
// SCSI Data Transfer Direction
//
#define EFI_SCSI_DATA_IN 0
#define EFI_SCSI_DATA_OUT 1
//
// Peripheral Device Type Definitions
//
#define EFI_SCSI_TYPE_DISK 0x00 // Disk device
#define EFI_SCSI_TYPE_TAPE 0x01 // Tape device
#define EFI_SCSI_TYPE_PRINTER 0x02 // Printer
#define EFI_SCSI_TYPE_PROCESSOR 0x03 // Processor
#define EFI_SCSI_TYPE_WORM 0x04 // Write-once read-multiple
#define EFI_SCSI_TYPE_CDROM 0x05 // CD-ROM device
#define EFI_SCSI_TYPE_SCANNER 0x06 // Scanner device
#define EFI_SCSI_TYPE_OPTICAL 0x07 // Optical memory device
#define EFI_SCSI_TYPE_MEDIUMCHANGER 0x08 // Medium Changer device
#define EFI_SCSI_TYPE_COMMUNICATION 0x09 // Communications device
#define EFI_SCSI_TYPE_RESERVED_LOW 0x0A // Reserved (low)
#define EFI_SCSI_TYPE_RESERVED_HIGH 0x1E // Reserved (high)
#define EFI_SCSI_TYPE_UNKNOWN 0x1F // Unknown or no device type
#pragma pack(1)
//
// Data structures for scsi command use
//
typedef struct {
UINT8 Peripheral_Type : 5;
UINT8 Peripheral_Qualifier : 3;
UINT8 DeviceType_Modifier : 7;
UINT8 RMB : 1;
UINT8 Version;
UINT8 Response_Data_Format;
UINT8 Addnl_Length;
UINT8 Reserved_5_95[95 - 5 + 1];
} EFI_SCSI_INQUIRY_DATA;
typedef struct {
UINT8 Error_Code : 7;
UINT8 Valid : 1;
UINT8 Segment_Number;
UINT8 Sense_Key : 4;
UINT8 Reserved_21 : 1;
UINT8 ILI : 1;
UINT8 Reserved_22 : 2;
UINT8 Information_3_6[4];
UINT8 Addnl_Sense_Length; // n - 7
UINT8 Vendor_Specific_8_11[4];
UINT8 Addnl_Sense_Code; // mandatory
UINT8 Addnl_Sense_Code_Qualifier; // mandatory
UINT8 Field_Replaceable_Unit_Code; // optional
UINT8 Reserved_15_17[3];
} EFI_SCSI_SENSE_DATA;
typedef struct {
UINT8 LastLba3;
UINT8 LastLba2;
UINT8 LastLba1;
UINT8 LastLba0;
UINT8 BlockSize3;
UINT8 BlockSize2;
UINT8 BlockSize1;
UINT8 BlockSize0;
} EFI_SCSI_DISK_CAPACITY_DATA;
#pragma pack()
//
// Sense Key
//
#define EFI_SCSI_REQUEST_SENSE_ERROR (0x70)
#define EFI_SCSI_SK_NO_SENSE (0x0)
#define EFI_SCSI_SK_RECOVERY_ERROR (0x1)
#define EFI_SCSI_SK_NOT_READY (0x2)
#define EFI_SCSI_SK_MEDIUM_ERROR (0x3)
#define EFI_SCSI_SK_HARDWARE_ERROR (0x4)
#define EFI_SCSI_SK_ILLEGAL_REQUEST (0x5)
#define EFI_SCSI_SK_UNIT_ATTENTION (0x6)
#define EFI_SCSI_SK_DATA_PROTECT (0x7)
#define EFI_SCSI_SK_BLANK_CHECK (0x8)
#define EFI_SCSI_SK_VENDOR_SPECIFIC (0x9)
#define EFI_SCSI_SK_RESERVED_A (0xA)
#define EFI_SCSI_SK_ABORT (0xB)
#define EFI_SCSI_SK_RESERVED_C (0xC)
#define EFI_SCSI_SK_OVERFLOW (0xD)
#define EFI_SCSI_SK_MISCOMPARE (0xE)
#define EFI_SCSI_SK_RESERVED_F (0xF)
//
// Additional Sense Codes
//
#define EFI_SCSI_ASC_NOT_READY (0x04)
#define EFI_SCSI_ASC_MEDIA_ERR1 (0x10)
#define EFI_SCSI_ASC_MEDIA_ERR2 (0x11)
#define EFI_SCSI_ASC_MEDIA_ERR3 (0x14)
#define EFI_SCSI_ASC_MEDIA_ERR4 (0x30)
#define EFI_SCSI_ASC_MEDIA_UPSIDE_DOWN (0x06)
#define EFI_SCSI_ASC_INVALID_CMD (0x20)
#define EFI_SCSI_ASC_LBA_OUT_OF_RANGE (0x21)
#define EFI_SCSI_ASC_INVALID_FIELD (0x24)
#define EFI_SCSI_ASC_WRITE_PROTECTED (0x27)
#define EFI_SCSI_ASC_MEDIA_CHANGE (0x28)
#define EFI_SCSI_ASC_RESET (0x29) /* Power On Reset or Bus Reset occurred */
#define EFI_SCSI_ASC_ILLEGAL_FIELD (0x26)
#define EFI_SCSI_ASC_NO_MEDIA (0x3A)
#define EFI_SCSI_ASC_ILLEGAL_MODE_FOR_THIS_TRACK (0x64)
//
// Additional Sense Code Qualifier
//
#define EFI_SCSI_ASCQ_IN_PROGRESS (0x01)
#endif

View File

@@ -0,0 +1,553 @@
///** @file
// IPF Processor Defines for assembly code
//
// @note
// This file is included by assembly files as well. The assmber can NOT deal
// with /* */ commnets this is why this file is commented not following the
// coding standard
//
//Copyright (c) 2006, Intel Corporation
//All rights reserved. This program and the accompanying materials
//are licensed and made available under the terms and conditions of the BSD License
//which accompanies this distribution. The full text of the license may be found at
//http://opensource.org/licenses/bsd-license.php
//
//THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
//WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//Module Name: IpfDefines.h
//
//**/
#ifndef _IPFDEFINES_H
#define _IPFDEFINES_H
//
// IPI DElivery Methods
//
#define IPI_INT_DELIVERY 0x0
#define IPI_PMI_DELIVERY 0x2
#define IPI_NMI_DELIVERY 0x4
#define IPI_INIT_DELIVERY 0x5
#define IPI_ExtINT_DELIVERY 0x7
//
// Define Itanium-based system registers.
//
// Define Itanium-based system register bit field offsets.
//
// Processor Status Register (PSR) Bit positions
//
// User / System mask
//
#define PSR_RV0 0
#define PSR_BE 1
#define PSR_UP 2
#define PSR_AC 3
#define PSR_MFL 4
#define PSR_MFH 5
//
// PSR bits 6-12 reserved (must be zero)
//
#define PSR_MBZ0 6
#define PSR_MBZ0_V 0x1ffUL L
//
// System only mask
//
#define PSR_IC 13
#define PSR_IC_MASK (1 << 13)
#define PSR_I 14
#define PSR_PK 15
#define PSR_MBZ1 16
#define PSR_MBZ1_V 0x1UL L
#define PSR_DT 17
#define PSR_DFL 18
#define PSR_DFH 19
#define PSR_SP 20
#define PSR_PP 21
#define PSR_DI 22
#define PSR_SI 23
#define PSR_DB 24
#define PSR_LP 25
#define PSR_TB 26
#define PSR_RT 27
//
// PSR bits 28-31 reserved (must be zero)
//
#define PSR_MBZ2 28
#define PSR_MBZ2_V 0xfUL L
//
// Neither mask
//
#define PSR_CPL 32
#define PSR_CPL_LEN 2
#define PSR_IS 34
#define PSR_MC 35
#define PSR_IT 36
#define PSR_IT_MASK 0x1000000000
#define PSR_ID 37
#define PSR_DA 38
#define PSR_DD 39
#define PSR_SS 40
#define PSR_RI 41
#define PSR_RI_LEN 2
#define PSR_ED 43
#define PSR_BN 44
//
// PSR bits 45-63 reserved (must be zero)
//
#define PSR_MBZ3 45
#define PSR_MBZ3_V 0xfffffUL L
//
// Floating Point Status Register (FPSR) Bit positions
//
//
// Traps
//
#define FPSR_VD 0
#define FPSR_DD 1
#define FPSR_ZD 2
#define FPSR_OD 3
#define FPSR_UD 4
#define FPSR_ID 5
//
// Status Field 0 - Controls
//
#define FPSR0_FTZ0 6
#define FPSR0_WRE0 7
#define FPSR0_PC0 8
#define FPSR0_RC0 10
#define FPSR0_TD0 12
//
// Status Field 0 - Flags
//
#define FPSR0_V0 13
#define FPSR0_D0 14
#define FPSR0_Z0 15
#define FPSR0_O0 16
#define FPSR0_U0 17
#define FPSR0_I0 18
//
// Status Field 1 - Controls
//
#define FPSR1_FTZ0 19
#define FPSR1_WRE0 20
#define FPSR1_PC0 21
#define FPSR1_RC0 23
#define FPSR1_TD0 25
//
// Status Field 1 - Flags
//
#define FPSR1_V0 26
#define FPSR1_D0 27
#define FPSR1_Z0 28
#define FPSR1_O0 29
#define FPSR1_U0 30
#define FPSR1_I0 31
//
// Status Field 2 - Controls
//
#define FPSR2_FTZ0 32
#define FPSR2_WRE0 33
#define FPSR2_PC0 34
#define FPSR2_RC0 36
#define FPSR2_TD0 38
//
// Status Field 2 - Flags
//
#define FPSR2_V0 39
#define FPSR2_D0 40
#define FPSR2_Z0 41
#define FPSR2_O0 42
#define FPSR2_U0 43
#define FPSR2_I0 44
//
// Status Field 3 - Controls
//
#define FPSR3_FTZ0 45
#define FPSR3_WRE0 46
#define FPSR3_PC0 47
#define FPSR3_RC0 49
#define FPSR3_TD0 51
//
// Status Field 0 - Flags
//
#define FPSR3_V0 52
#define FPSR3_D0 53
#define FPSR3_Z0 54
#define FPSR3_O0 55
#define FPSR3_U0 56
#define FPSR3_I0 57
//
// FPSR bits 58-63 Reserved -- Must be zero
//
#define FPSR_MBZ0 58
#define FPSR_MBZ0_V 0x3fUL L
//
// For setting up FPSR on kernel entry
// All traps are disabled.
//
#define FPSR_FOR_KERNEL 0x3f
#define FP_REG_SIZE 16 // 16 byte spill size
#define HIGHFP_REGS_LENGTH (96 * 16)
//
// Define hardware Task Priority Register (TPR)
//
//
// TPR bit positions
//
#define TPR_MIC 4 // Bits 0 - 3 ignored
#define TPR_MIC_LEN 4
#define TPR_MMI 16 // Mask Maskable Interrupt
//
// Define hardware Interrupt Status Register (ISR)
//
//
// ISR bit positions
//
#define ISR_CODE 0
#define ISR_CODE_LEN 16
#define ISR_CODE_MASK 0xFFFF
#define ISR_IA_VECTOR 16
#define ISR_IA_VECTOR_LEN 8
#define ISR_MBZ0 24
#define ISR_MBZ0_V 0xff
#define ISR_X 32
#define ISR_W 33
#define ISR_R 34
#define ISR_NA 35
#define ISR_SP 36
#define ISR_RS 37
#define ISR_IR 38
#define ISR_NI 39
#define ISR_MBZ1 40
#define ISR_EI 41
#define ISR_ED 43
#define ISR_MBZ2 44
#define ISR_MBZ2_V 0xfffff
//
// ISR codes
//
// For General exceptions: ISR{3:0}
//
#define ISR_ILLEGAL_OP 0 // Illegal operation fault
#define ISR_PRIV_OP 1 // Privileged operation fault
#define ISR_PRIV_REG 2 // Privileged register fauls
#define ISR_RESVD_REG 3 // Reserved register/field flt
#define ISR_ILLEGAL_ISA 4 // Disabled instruction set transition fault
//
// Define hardware Default Control Register (DCR)
//
//
// DCR bit positions
//
#define DCR_PP 0
#define DCR_BE 1
#define DCR_LC 2
#define DCR_MBZ0 4
#define DCR_MBZ0_V 0xf
#define DCR_DM 8
#define DCR_DP 9
#define DCR_DK 10
#define DCR_DX 11
#define DCR_DR 12
#define DCR_DA 13
#define DCR_DD 14
#define DCR_DEFER_ALL 0x7f00
#define DCR_MBZ1 2
#define DCR_MBZ1_V 0xffffffffffffUL L
//
// Define hardware RSE Configuration Register
//
// RS Configuration (RSC) bit field positions
//
#define RSC_MODE 0
#define RSC_PL 2
#define RSC_BE 4
#define RSC_MBZ0 5
#define RSC_MBZ0_V 0x3ff
#define RSC_LOADRS 16
#define RSC_LOADRS_LEN 14
#define RSC_MBZ1 30
#define RSC_MBZ1_V 0x3ffffffffUL L
//
// RSC modes
//
#define RSC_MODE_LY (0x0) // Lazy
#define RSC_MODE_SI (0x1) // Store intensive
#define RSC_MODE_LI (0x2) // Load intensive
#define RSC_MODE_EA (0x3) // Eager
//
// RSC Endian bit values
//
#define RSC_BE_LITTLE 0
#define RSC_BE_BIG 1
//
// Define Interruption Function State (IFS) Register
//
// IFS bit field positions
//
#define IFS_IFM 0
#define IFS_IFM_LEN 38
#define IFS_MBZ0 38
#define IFS_MBZ0_V 0x1ffffff
#define IFS_V 63
#define IFS_V_LEN 1
//
// IFS is valid when IFS_V = IFS_VALID
//
#define IFS_VALID 1
//
// Define Page Table Address (PTA)
//
#define PTA_VE 0
#define PTA_VF 8
#define PTA_SIZE 2
#define PTA_SIZE_LEN 6
#define PTA_BASE 15
//
// Define Region Register (RR)
//
//
// RR bit field positions
//
#define RR_VE 0
#define RR_MBZ0 1
#define RR_PS 2
#define RR_PS_LEN 6
#define RR_RID 8
#define RR_RID_LEN 24
#define RR_MBZ1 32
//
// SAL uses region register 0 and RID of 1000
//
#define SAL_RID 0x1000
#define SAL_RR_REG 0x0
#define SAL_TR 0x0
//
// Total number of region registers
//
#define RR_SIZE 8
//
// Define Protection Key Register (PKR)
//
// PKR bit field positions
//
#define PKR_V 0
#define PKR_WD 1
#define PKR_RD 2
#define PKR_XD 3
#define PKR_MBZ0 4
#define PKR_KEY 8
#define PKR_KEY_LEN 24
#define PKR_MBZ1 32
#define PKR_VALID (1 << PKR_V)
//
// Number of protection key registers
//
#define PKRNUM 8
//
// Define Interruption TLB Insertion register (ITIR)
//
//
// Define Translation Insertion Format (TR)
//
// PTE0 bit field positions
//
#define PTE0_P 0
#define PTE0_MBZ0 1
#define PTE0_MA 2
#define PTE0_A 5
#define PTE0_D 6
#define PTE0_PL 7
#define PTE0_AR 9
#define PTE0_PPN 12
#define PTE0_MBZ1 48
#define PTE0_ED 52
#define PTE0_IGN0 53
//
// ITIR bit field positions
//
#define ITIR_MBZ0 0
#define ITIR_PS 2
#define ITIR_PS_LEN 6
#define ITIR_KEY 8
#define ITIR_KEY_LEN 24
#define ITIR_MBZ1 32
#define ITIR_MBZ1_LEN 16
#define ITIR_PPN 48
#define ITIR_PPN_LEN 15
#define ITIR_MBZ2 63
#define ATTR_IPAGE 0x661 // Access Rights = RWX (bits 11-9=011), PL 0(8-7=0)
#define ATTR_DEF_BITS 0x661 // Access Rights = RWX (bits 11-9=010), PL 0(8-7=0)
// Dirty (bit 6=1), Accessed (bit 5=1),
// MA WB (bits 4-2=000), Present (bit 0=1)
//
// Memory access rights
//
#define AR_UR_KR 0x0 // user/kernel read
#define AR_URX_KRX 0x1 // user/kernel read and execute
#define AR_URW_KRW 0x2 // user/kernel read & write
#define AR_URWX_KRWX 0x3 // user/kernel read,write&execute
#define AR_UR_KRW 0x4 // user read/kernel read,write
#define AR_URX_KRWX 0x5 // user read/execute, kernel all
#define AR_URWX_KRW 0x6 // user all, kernel read & write
#define AR_UX_KRX 0x7 // user execute only, kernel read and execute
//
// Memory attribute values
//
//
// The next 4 are all cached, non-sequential & speculative, coherent
//
#define MA_WBU 0x0 // Write back, unordered
//
// The next 3 are all non-cached, sequential & non-speculative
//
#define MA_UC 0x4 // Non-coalescing, sequential & non-speculative
#define MA_UCE 0x5 // Non-coalescing, sequential, non-speculative
// & fetchadd exported
//
#define MA_WC 0x6 // Non-cached, Coalescing, non-seq., spec.
#define MA_NAT 0xf // NaT page
//
// Definition of the offset of TRAP/INTERRUPT/FAULT handlers from the
// base of IVA (Interruption Vector Address)
//
#define IVT_SIZE 0x8000
#define EXTRA_ALIGNMENT 0x1000
#define OFF_VHPTFLT 0x0000 // VHPT Translation fault
#define OFF_ITLBFLT 0x0400 // Instruction TLB fault
#define OFF_DTLBFLT 0x0800 // Data TLB fault
#define OFF_ALTITLBFLT 0x0C00 // Alternate ITLB fault
#define OFF_ALTDTLBFLT 0x1000 // Alternate DTLB fault
#define OFF_NESTEDTLBFLT 0x1400 // Nested TLB fault
#define OFF_IKEYMISSFLT 0x1800 // Inst Key Miss fault
#define OFF_DKEYMISSFLT 0x1C00 // Data Key Miss fault
#define OFF_DIRTYBITFLT 0x2000 // Dirty-Bit fault
#define OFF_IACCESSBITFLT 0x2400 // Inst Access-Bit fault
#define OFF_DACCESSBITFLT 0x2800 // Data Access-Bit fault
#define OFF_BREAKFLT 0x2C00 // Break Inst fault
#define OFF_EXTINT 0x3000 // External Interrupt
//
// Offset 0x3400 to 0x0x4C00 are reserved
//
#define OFF_PAGENOTPFLT 0x5000 // Page Not Present fault
#define OFF_KEYPERMFLT 0x5100 // Key Permission fault
#define OFF_IACCESSRTFLT 0x5200 // Inst Access-Rights flt
#define OFF_DACCESSRTFLT 0x5300 // Data Access-Rights fault
#define OFF_GPFLT 0x5400 // General Exception fault
#define OFF_FPDISFLT 0x5500 // Disable-FP fault
#define OFF_NATFLT 0x5600 // NAT Consumption fault
#define OFF_SPECLNFLT 0x5700 // Speculation fault
#define OFF_DBGFLT 0x5900 // Debug fault
#define OFF_ALIGNFLT 0x5A00 // Unaligned Reference fault
#define OFF_LOCKDREFFLT 0x5B00 // Locked Data Reference fault
#define OFF_FPFLT 0x5C00 // Floating Point fault
#define OFF_FPTRAP 0x5D00 // Floating Point Trap
#define OFF_LOPRIVTRAP 0x5E00 // Lower-Privilege Transfer Trap
#define OFF_TAKENBRTRAP 0x5F00 // Taken Branch Trap
#define OFF_SSTEPTRAP 0x6000 // Single Step Trap
//
// Offset 0x6100 to 0x6800 are reserved
//
#define OFF_IA32EXCEPTN 0x6900 // iA32 Exception
#define OFF_IA32INTERCEPT 0x6A00 // iA32 Intercept
#define OFF_IA32INT 0x6B00 // iA32 Interrupt
#define NUMBER_OF_VECTORS 0x100
//
// Privilege levels
//
#define PL_KERNEL 0
#define PL_USER 3
//
// Instruction set (IS) bits
//
#define IS_IA64 0
#define IS_IA 1
//
// RSC while in kernel: enabled, little endian, PL = 0, eager mode
//
#define RSC_KERNEL ((RSC_MODE_EA << RSC_MODE) | (RSC_BE_LITTLE << RSC_BE))
//
// Lazy RSC in kernel: enabled, little endian, pl = 0, lazy mode
//
#define RSC_KERNEL_LAZ ((RSC_MODE_LY << RSC_MODE) | (RSC_BE_LITTLE << RSC_BE))
//
// RSE disabled: disabled, PL = 0, little endian, eager mode
//
#define RSC_KERNEL_DISABLED ((RSC_MODE_LY << RSC_MODE) | (RSC_BE_LITTLE << RSC_BE))
#define NAT_BITS_PER_RNAT_REG 63
//
// Macros for generating PTE0 and PTE1 value
//
#define PTE0(ed, ppn12_47, ar, pl, d, a, ma, p) \
( ( ed << PTE0_ED ) | \
( ppn12_47 << PTE0_PPN ) | \
( ar << PTE0_AR ) | \
( pl << PTE0_PL ) | \
( d << PTE0_D ) | \
( a << PTE0_A ) | \
( ma << PTE0_MA ) | \
( p << PTE0_P ) \
)
#define ITIR(ppn48_63, key, ps) \
( ( ps << ITIR_PS ) | \
( key << ITIR_KEY ) | \
( ppn48_63 << ITIR_PPN ) \
)
//
// Macro to generate mask value from bit position. The result is a
// 64-bit.
//
#define BITMASK(bp, value) (value << bp)
#define BUNDLE_SIZE 16
#define SPURIOUS_INT 0xF
#define FAST_DISABLE_INTERRUPTS rsm BITMASK (PSR_I, 1);;
#define FAST_ENABLE_INTERRUPTS ssm BITMASK (PSR_I, 1);;
#endif

View File

@@ -0,0 +1,64 @@
//++
// Copyright (c) 2006, Intel Corporation
// All rights reserved. This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Module Name:
// IpfMacro.i
//
// Abstract:
// Contains the macros needed for calling procedures in Itanium-based assembly code.
//
//
// Revision History:
//
//--
#ifndef __IA64PROC_I__
#define __IA64PROC_I__
#define PROCEDURE_ENTRY(name) .##text; \
.##type name, @function; \
.##proc name; \
name::
#define PROCEDURE_EXIT(name) .##endp name
// Note: use of NESTED_SETUP requires number of locals (l) >= 3
#define NESTED_SETUP(i,l,o,r) \
alloc loc1=ar##.##pfs,i,l,o,r ;\
mov loc0=b0
#define NESTED_RETURN \
mov b0=loc0 ;\
mov ar##.##pfs=loc1 ;;\
br##.##ret##.##dpnt b0;;
#define INTERRUPT_HANDLER_BEGIN(name) \
PROCEDURE_ENTRY(name##HandlerBegin) \
;; \
PROCEDURE_EXIT(name##HandlerBegin)
#define INTERRUPT_HANDLER_END(name) \
PROCEDURE_ENTRY(name##HandlerEnd) \
;; \
PROCEDURE_EXIT(name##HandlerEnd)
#define INTERRUPT_HANDLER_BLOCK_BEGIN \
INTERRUPT_HANDLER_BEGIN(First)
#define INTERRUPT_HANDLER_BLOCK_END \
INTERRUPT_HANDLER_END(Last)
#endif

View File

@@ -0,0 +1,202 @@
/** @file
Processor or Compiler specific defines and types for Intel Itanium(TM).
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: ProcessorBind.h
**/
#ifndef __PROCESSOR_BIND_H__
#define __PROCESSOR_BIND_H__
//
// Define the processor type so other code can make processor based choices
//
#define MDE_CPU_IPF
//
// Make sure we are useing the correct packing rules per EFI specification
//
#pragma pack()
#if _MSC_EXTENSIONS
//
// Disable warning that make it impossible to compile at /W4
// This only works for Microsoft tools. Copied from the
// IA-32 version of efibind.h
//
//
// 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 )
//
// Can not cast a function pointer to a data pointer. We need to do this on
// IPF to get access to the PLABEL.
//
#pragma warning ( disable : 4514 )
#endif
#if (__STDC_VERSION__ < 199901L)
//
// No ANSI C 2000 stdint.h integer width declarations, so define equivalents
//
#if _MSC_EXTENSIONS
//
// use Microsoft C complier dependent interger width types
//
typedef unsigned __int64 UINT64;
typedef __int64 INT64;
typedef unsigned __int32 UINT32;
typedef __int32 INT32;
typedef unsigned short UINT16;
typedef unsigned short CHAR16;
typedef short INT16;
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef char CHAR8;
typedef char INT8;
#else
#ifdef _EFI_P64
//
// P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints
// are 32-bits
//
typedef unsigned long long UINT64;
typedef long long INT64;
typedef unsigned int UINT32;
typedef int INT32;
typedef unsigned short CHAR16;
typedef unsigned short UINT16;
typedef short INT16;
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef char CHAR8;
typedef char INT8;
#else
//
// Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit.
//
typedef unsigned long UINT64;
typedef long INT64;
typedef unsigned int UINT32;
typedef int INT32;
typedef unsigned short UINT16;
typedef unsigned short CHAR16;
typedef short INT16;
typedef unsigned char BOOLEAN;
typedef unsigned char UINT8;
typedef char CHAR8;
typedef char INT8;
#endif
#endif
#define UINT8_MAX 0xff
#else
//
// Use ANSI C 2000 stdint.h integer width declarations
//
#include <stdint.h>
typedef uint8_t BOOLEAN;
typedef int8_t INT8;
typedef uint8_t UINT8;
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int32_t INT32;
typedef uint32_t UINT32;
typedef int64_t INT64;
typedef uint64_t UINT64;
typedef char CHAR8;
typedef uint16_t CHAR16;
#endif
typedef UINT64 UINTN;
typedef INT64 INTN;
//
// Processor specific defines
//
#define MAX_BIT 0x8000000000000000ULL
#define MAX_2_BITS 0xC000000000000000ULL
//
// Maximum legal Itanium-based address
//
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
// EFI intrinsics are required to modify thier member functions with EFIAPI.
//
#if _MSC_EXTENSIONS
//
// Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
//
#define EFIAPI __cdecl
#else
#define EFIAPI
#endif
//
// The Microsoft* C compiler can removed references to unreferenced data items
// if the /OPT:REF linker option is used. We defined a macro as this is a
// a non standard extension
//
#define GLOBAL_REMOVE_IF_UNREFERENCED
//
// A pointer to a function in IPF points to a plabel.
//
typedef struct {
UINT64 EntryPoint;
UINT64 GP;
} EFI_PLABEL;
typedef struct {
UINTN BootPhase; // entry r20 value
UINTN UniqueId; // PAL arbitration ID
UINTN HealthStat; // Health Status
UINTN PALRetAddress; // return address to PAL
} IPF_HANDOFF_STATUS;
#endif

691
MdePkg/Include/Ipf/SalApi.h Normal file
View File

@@ -0,0 +1,691 @@
/** @file
Main SAL API's defined in SAL 3.0 specification.
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: SalApi.h
**/
#ifndef __SAL_API_H__
#define __SAL_API_H__
typedef UINTN EFI_SAL_STATUS;
//
// EFI_SAL_STATUS defines
//
#define EFI_SAL_SUCCESS ((EFI_SAL_STATUS) 0)
#define EFI_SAL_MORE_RECORDS ((EFI_SAL_STATUS) 3)
#define EFI_SAL_NOT_IMPLEMENTED ((EFI_SAL_STATUS) - 1)
#define EFI_SAL_INVALID_ARGUMENT ((EFI_SAL_STATUS) - 2)
#define EFI_SAL_ERROR ((EFI_SAL_STATUS) - 3)
#define EFI_SAL_VIRTUAL_ADDRESS_ERROR ((EFI_SAL_STATUS) - 4)
#define EFI_SAL_NO_INFORMATION ((EFI_SAL_STATUS) - 5)
#define EFI_SAL_NOT_ENOUGH_SCRATCH ((EFI_SAL_STATUS) - 9)
//
// Return values from SAL
//
typedef struct {
EFI_SAL_STATUS Status; // register r8
UINTN r9;
UINTN r10;
UINTN r11;
} SAL_RETURN_REGS;
typedef SAL_RETURN_REGS (EFIAPI *SAL_PROC)
(
IN UINT64 FunctionId,
IN UINT64 Arg2,
IN UINT64 Arg3,
IN UINT64 Arg4,
IN UINT64 Arg5,
IN UINT64 Arg6,
IN UINT64 Arg7,
IN UINT64 Arg8
);
//
// SAL Procedure FunctionId definition
//
#define EFI_SAL_SET_VECTORS 0x01000000
#define EFI_SAL_GET_STATE_INFO 0x01000001
#define EFI_SAL_GET_STATE_INFO_SIZE 0x01000002
#define EFI_SAL_CLEAR_STATE_INFO 0x01000003
#define EFI_SAL_MC_RENDEZ 0x01000004
#define EFI_SAL_MC_SET_PARAMS 0x01000005
#define EFI_SAL_REGISTER_PHYSICAL_ADDR 0x01000006
#define EFI_SAL_CACHE_FLUSH 0x01000008
#define EFI_SAL_CACHE_INIT 0x01000009
#define EFI_SAL_PCI_CONFIG_READ 0x01000010
#define EFI_SAL_PCI_CONFIG_WRITE 0x01000011
#define EFI_SAL_FREQ_BASE 0x01000012
#define EFI_SAL_UPDATE_PAL 0x01000020
#define EFI_SAL_FUNCTION_ID_MASK 0x0000ffff
#define EFI_SAL_MAX_SAL_FUNCTION_ID 0x00000021
//
// SAL Procedure parameter definitions
// Not much point in using typedefs or enums because all params
// are UINT64 and the entry point is common
//
// EFI_SAL_SET_VECTORS
//
#define EFI_SAL_SET_MCA_VECTOR 0x0
#define EFI_SAL_SET_INIT_VECTOR 0x1
#define EFI_SAL_SET_BOOT_RENDEZ_VECTOR 0x2
typedef struct {
UINT64 Length : 32;
UINT64 ChecksumValid : 1;
UINT64 Reserved1 : 7;
UINT64 ByteChecksum : 8;
UINT64 Reserved2 : 16;
} SAL_SET_VECTORS_CS_N;
//
// EFI_SAL_GET_STATE_INFO, EFI_SAL_GET_STATE_INFO_SIZE,
// EFI_SAL_CLEAR_STATE_INFO
//
#define EFI_SAL_MCA_STATE_INFO 0x0
#define EFI_SAL_INIT_STATE_INFO 0x1
#define EFI_SAL_CMC_STATE_INFO 0x2
#define EFI_SAL_CP_STATE_INFO 0x3
//
// EFI_SAL_MC_SET_PARAMS
//
#define EFI_SAL_MC_SET_RENDEZ_PARAM 0x1
#define EFI_SAL_MC_SET_WAKEUP_PARAM 0x2
#define EFI_SAL_MC_SET_CPE_PARAM 0x3
#define EFI_SAL_MC_SET_INTR_PARAM 0x1
#define EFI_SAL_MC_SET_MEM_PARAM 0x2
//
// EFI_SAL_REGISTER_PAL_PHYSICAL_ADDR
//
#define EFI_SAL_REGISTER_PAL_ADDR 0x0
//
// EFI_SAL_CACHE_FLUSH
//
#define EFI_SAL_FLUSH_I_CACHE 0x01
#define EFI_SAL_FLUSH_D_CACHE 0x02
#define EFI_SAL_FLUSH_BOTH_CACHE 0x03
#define EFI_SAL_FLUSH_MAKE_COHERENT 0x04
//
// EFI_SAL_PCI_CONFIG_READ, EFI_SAL_PCI_CONFIG_WRITE
//
#define EFI_SAL_PCI_CONFIG_ONE_BYTE 0x1
#define EFI_SAL_PCI_CONFIG_TWO_BYTES 0x2
#define EFI_SAL_PCI_CONFIG_FOUR_BYTES 0x4
typedef struct {
UINT64 Register : 8;
UINT64 Function : 3;
UINT64 Device : 5;
UINT64 Bus : 8;
UINT64 Segment : 8;
UINT64 Reserved : 32;
} SAL_PCI_ADDRESS;
//
// EFI_SAL_FREQ_BASE
//
#define EFI_SAL_CPU_INPUT_FREQ_BASE 0x0
#define EFI_SAL_PLATFORM_IT_FREQ_BASE 0x1
#define EFI_SAL_PLATFORM_RTC_FREQ_BASE 0x2
//
// EFI_SAL_UPDATE_PAL
//
#define EFI_SAL_UPDATE_BAD_PAL_VERSION ((UINT64) -1)
#define EFI_SAL_UPDATE_PAL_AUTH_FAIL ((UINT64) -2)
#define EFI_SAL_UPDATE_PAL_BAD_TYPE ((UINT64) -3)
#define EFI_SAL_UPDATE_PAL_READONLY ((UINT64) -4)
#define EFI_SAL_UPDATE_PAL_WRITE_FAIL ((UINT64) -10)
#define EFI_SAL_UPDATE_PAL_ERASE_FAIL ((UINT64) -11)
#define EFI_SAL_UPDATE_PAL_READ_FAIL ((UINT64) -12)
#define EFI_SAL_UPDATE_PAL_CANT_FIT ((UINT64) -13)
typedef struct {
UINT32 Size;
UINT32 MmddyyyyDate;
UINT16 Version;
UINT8 Type;
UINT8 Reserved[5];
UINT64 FwVendorId;
} SAL_UPDATE_PAL_DATA_BLOCK;
typedef struct _SAL_UPDATE_PAL_INFO_BLOCK {
struct _SAL_UPDATE_PAL_INFO_BLOCK *Next;
struct SAL_UPDATE_PAL_DATA_BLOCK *DataBlock;
UINT8 StoreChecksum;
UINT8 Reserved[15];
} SAL_UPDATE_PAL_INFO_BLOCK;
//
// SAL System Table Definitions
//
#pragma pack(1)
typedef struct {
UINT32 Signature;
UINT32 Length;
UINT16 SalRevision;
UINT16 EntryCount;
UINT8 CheckSum;
UINT8 Reserved[7];
UINT16 SalAVersion;
UINT16 SalBVersion;
UINT8 OemId[32];
UINT8 ProductId[32];
UINT8 Reserved2[8];
} SAL_SYSTEM_TABLE_HEADER;
#pragma pack()
#define EFI_SAL_ST_HEADER_SIGNATURE "SST_"
#define EFI_SAL_REVISION 0x0300
//
// SAL System Types
//
#define EFI_SAL_ST_ENTRY_POINT 0
#define EFI_SAL_ST_MEMORY_DESCRIPTOR 1
#define EFI_SAL_ST_PLATFORM_FEATURES 2
#define EFI_SAL_ST_TR_USAGE 3
#define EFI_SAL_ST_PTC 4
#define EFI_SAL_ST_AP_WAKEUP 5
#pragma pack(1)
typedef struct {
UINT8 Type; // Type == 0
UINT8 Reserved[7];
UINT64 PalProcEntry;
UINT64 SalProcEntry;
UINT64 SalGlobalDataPointer;
UINT64 Reserved2[2];
} SAL_ST_ENTRY_POINT_DESCRIPTOR;
//
// Not needed for Itanium-based OS boot
//
typedef struct {
UINT8 Type; // Type == 1
UINT8 NeedVirtualRegistration;
UINT8 MemoryAttributes;
UINT8 PageAccessRights;
UINT8 SupportedAttributes;
UINT8 Reserved;
UINT8 MemoryType;
UINT8 MemoryUsage;
UINT64 PhysicalMemoryAddress;
UINT32 Length;
UINT32 Reserved1;
UINT64 OemReserved;
} SAL_ST_MEMORY_DESCRIPTOR_ENTRY;
#pragma pack()
//
// Memory Attributes
//
#define SAL_MDT_ATTRIB_WB 0x00
//
// #define SAL_MDT_ATTRIB_UC 0x02
//
#define SAL_MDT_ATTRIB_UC 0x04
#define SAL_MDT_ATTRIB_UCE 0x05
#define SAL_MDT_ATTRIB_WC 0x06
//
// Supported memory Attributes
//
#define SAL_MDT_SUPPORT_WB 0x1
#define SAL_MDT_SUPPORT_UC 0x2
#define SAL_MDT_SUPPORT_UCE 0x4
#define SAL_MDT_SUPPORT_WC 0x8
//
// Virtual address registration
//
#define SAL_MDT_NO_VA 0x00
#define SAL_MDT_NEED_VA 0x01
//
// MemoryType info
//
#define SAL_REGULAR_MEMORY 0x0000
#define SAL_MMIO_MAPPING 0x0001
#define SAL_SAPIC_IPI_BLOCK 0x0002
#define SAL_IO_PORT_MAPPING 0x0003
#define SAL_FIRMWARE_MEMORY 0x0004
#define SAL_BLACK_HOLE 0x000A
//
// Memory Usage info
//
#define SAL_MDT_USAGE_UNSPECIFIED 0x00
#define SAL_PAL_CODE 0x01
#define SAL_BOOTSERVICE_CODE 0x02
#define SAL_BOOTSERVICE_DATA 0x03
#define SAL_RUNTIMESERVICE_CODE 0x04
#define SAL_RUNTIMESERVICE_DATA 0x05
#define SAL_IA32_OPTIONROM 0x06
#define SAL_IA32_SYSTEMROM 0x07
#define SAL_PMI_CODE 0x0a
#define SAL_PMI_DATA 0x0b
#pragma pack(1)
typedef struct {
UINT8 Type; // Type == 2
UINT8 PlatformFeatures;
UINT8 Reserved[14];
} SAL_ST_PLATFORM_FEATURES;
#pragma pack()
#define SAL_PLAT_FEAT_BUS_LOCK 0x01
#define SAL_PLAT_FEAT_PLAT_IPI_HINT 0x02
#define SAL_PLAT_FEAT_PROC_IPI_HINT 0x04
#pragma pack(1)
typedef struct {
UINT8 Type; // Type == 3
UINT8 TRType;
UINT8 TRNumber;
UINT8 Reserved[5];
UINT64 VirtualAddress;
UINT64 EncodedPageSize;
UINT64 Reserved1;
} SAL_ST_TR_DECRIPTOR;
#pragma pack()
#define EFI_SAL_ST_TR_USAGE_INSTRUCTION 00
#define EFI_SAL_ST_TR_USAGE_DATA 01
#pragma pack(1)
typedef struct {
UINT64 NumberOfProcessors;
UINT64 LocalIDRegister;
} SAL_COHERENCE_DOMAIN_INFO;
#pragma pack()
#pragma pack(1)
typedef struct {
UINT8 Type; // Type == 4
UINT8 Reserved[3];
UINT32 NumberOfDomains;
SAL_COHERENCE_DOMAIN_INFO *DomainInformation;
} SAL_ST_CACHE_COHERENCE_DECRIPTOR;
#pragma pack()
#pragma pack(1)
typedef struct {
UINT8 Type; // Type == 5
UINT8 WakeUpType;
UINT8 Reserved[6];
UINT64 ExternalInterruptVector;
} SAL_ST_AP_WAKEUP_DECRIPTOR;
#pragma pack()
//
// FIT Entry
//
#define EFI_SAL_FIT_ENTRY_PTR (0x100000000 - 32) // 4GB - 24
#define EFI_SAL_FIT_PALA_ENTRY (0x100000000 - 48) // 4GB - 32
#define EFI_SAL_FIT_PALB_TYPE 01
typedef struct {
UINT64 Address;
UINT8 Size[3];
UINT8 Reserved;
UINT16 Revision;
UINT8 Type : 7;
UINT8 CheckSumValid : 1;
UINT8 CheckSum;
} EFI_SAL_FIT_ENTRY;
//
// SAL Common Record Header
//
typedef struct {
UINT16 Length;
UINT8 Data[1024];
} SAL_OEM_DATA;
typedef struct {
UINT8 Seconds;
UINT8 Minutes;
UINT8 Hours;
UINT8 Reserved;
UINT8 Day;
UINT8 Month;
UINT8 Year;
UINT8 Century;
} SAL_TIME_STAMP;
typedef struct {
UINT64 RecordId;
UINT16 Revision;
UINT8 ErrorSeverity;
UINT8 ValidationBits;
UINT32 RecordLength;
SAL_TIME_STAMP TimeStamp;
UINT8 OemPlatformId[16];
} SAL_RECORD_HEADER;
typedef struct {
EFI_GUID Guid;
UINT16 Revision;
UINT8 ErrorRecoveryInfo;
UINT8 Reserved;
UINT32 SectionLength;
} SAL_SEC_HEADER;
//
// SAL Processor Record
//
#define SAL_PROCESSOR_ERROR_RECORD_INFO \
{ \
0xe429faf1, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define CHECK_INFO_VALID_BIT_MASK 0x1
#define REQUESTOR_ID_VALID_BIT_MASK 0x2
#define RESPONDER_ID_VALID_BIT_MASK 0x4
#define TARGER_ID_VALID_BIT_MASK 0x8
#define PRECISE_IP_VALID_BIT_MASK 0x10
typedef struct {
UINT64 InfoValid : 1;
UINT64 ReqValid : 1;
UINT64 RespValid : 1;
UINT64 TargetValid : 1;
UINT64 IpValid : 1;
UINT64 Reserved : 59;
UINT64 Info;
UINT64 Req;
UINT64 Resp;
UINT64 Target;
UINT64 Ip;
} MOD_ERROR_INFO;
typedef struct {
UINT8 CpuidInfo[40];
UINT8 Reserved;
} CPUID_INFO;
typedef struct {
UINT64 FrLow;
UINT64 FrHigh;
} FR_STRUCT;
#define MIN_STATE_VALID_BIT_MASK 0x1
#define BR_VALID_BIT_MASK 0x2
#define CR_VALID_BIT_MASK 0x4
#define AR_VALID_BIT_MASK 0x8
#define RR_VALID_BIT_MASK 0x10
#define FR_VALID_BIT_MASK 0x20
typedef struct {
UINT64 ValidFieldBits;
UINT8 MinStateInfo[1024];
UINT64 Br[8];
UINT64 Cr[128];
UINT64 Ar[128];
UINT64 Rr[8];
FR_STRUCT Fr[128];
} PSI_STATIC_STRUCT;
#define PROC_ERROR_MAP_VALID_BIT_MASK 0x1
#define PROC_STATE_PARAMETER_VALID_BIT_MASK 0x2
#define PROC_CR_LID_VALID_BIT_MASK 0x4
#define PROC_STATIC_STRUCT_VALID_BIT_MASK 0x8
#define CPU_INFO_VALID_BIT_MASK 0x1000000
typedef struct {
SAL_SEC_HEADER SectionHeader;
UINT64 ValidationBits;
UINT64 ProcErrorMap;
UINT64 ProcStateParameter;
UINT64 ProcCrLid;
MOD_ERROR_INFO CacheError[15];
MOD_ERROR_INFO TlbError[15];
MOD_ERROR_INFO BusError[15];
MOD_ERROR_INFO RegFileCheck[15];
MOD_ERROR_INFO MsCheck[15];
CPUID_INFO CpuInfo;
PSI_STATIC_STRUCT PsiValidData;
} SAL_PROCESSOR_ERROR_RECORD;
//
// Sal Platform memory Error Record
//
#define SAL_MEMORY_ERROR_RECORD_INFO \
{ \
0xe429faf2, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define MEMORY_ERROR_STATUS_VALID_BIT_MASK 0x1
#define MEMORY_PHYSICAL_ADDRESS_VALID_BIT_MASK 0x2
#define MEMORY_ADDR_BIT_MASK 0x4
#define MEMORY_NODE_VALID_BIT_MASK 0x8
#define MEMORY_CARD_VALID_BIT_MASK 0x10
#define MEMORY_MODULE_VALID_BIT_MASK 0x20
#define MEMORY_BANK_VALID_BIT_MASK 0x40
#define MEMORY_DEVICE_VALID_BIT_MASK 0x80
#define MEMORY_ROW_VALID_BIT_MASK 0x100
#define MEMORY_COLUMN_VALID_BIT_MASK 0x200
#define MEMORY_BIT_POSITION_VALID_BIT_MASK 0x400
#define MEMORY_PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x800
#define MEMORY_PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x1000
#define MEMORY_PLATFORM_TARGET_VALID_BIT_MASK 0x2000
#define MEMORY_PLATFORM_BUS_SPECIFIC_DATA_VALID_BIT_MASK 0x4000
#define MEMORY_PLATFORM_OEM_ID_VALID_BIT_MASK 0x8000
#define MEMORY_PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x10000
typedef struct {
SAL_SEC_HEADER SectionHeader;
UINT64 ValidationBits;
UINT64 MemErrorStatus;
UINT64 MemPhysicalAddress;
UINT64 MemPhysicalAddressMask;
UINT16 MemNode;
UINT16 MemCard;
UINT16 MemModule;
UINT16 MemBank;
UINT16 MemDevice;
UINT16 MemRow;
UINT16 MemColumn;
UINT16 MemBitPosition;
UINT64 ModRequestorId;
UINT64 ModResponderId;
UINT64 ModTargetId;
UINT64 BusSpecificData;
UINT8 MemPlatformOemId[16];
} SAL_MEMORY_ERROR_RECORD;
//
// PCI BUS Errors
//
#define SAL_PCI_BUS_ERROR_RECORD_INFO \
{ \
0xe429faf4, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define PCI_BUS_ERROR_STATUS_VALID_BIT_MASK 0x1
#define PCI_BUS_ERROR_TYPE_VALID_BIT_MASK 0x2
#define PCI_BUS_ID_VALID_BIT_MASK 0x4
#define PCI_BUS_ADDRESS_VALID_BIT_MASK 0x8
#define PCI_BUS_DATA_VALID_BIT_MASK 0x10
#define PCI_BUS_CMD_VALID_BIT_MASK 0x20
#define PCI_BUS_REQUESTOR_ID_VALID_BIT_MASK 0x40
#define PCI_BUS_RESPONDER_ID_VALID_BIT_MASK 0x80
#define PCI_BUS_TARGET_VALID_BIT_MASK 0x100
#define PCI_BUS_OEM_ID_VALID_BIT_MASK 0x200
#define PCI_BUS_OEM_DATA_STRUCT_VALID_BIT_MASK 0x400
typedef struct {
UINT8 BusNumber;
UINT8 SegmentNumber;
} PCI_BUS_ID;
typedef struct {
SAL_SEC_HEADER SectionHeader;
UINT64 ValidationBits;
UINT64 PciBusErrorStatus;
UINT16 PciBusErrorType;
PCI_BUS_ID PciBusId;
UINT32 Reserved;
UINT64 PciBusAddress;
UINT64 PciBusData;
UINT64 PciBusCommand;
UINT64 PciBusRequestorId;
UINT64 PciBusResponderId;
UINT64 PciBusTargetId;
UINT8 PciBusOemId[16];
} SAL_PCI_BUS_ERROR_RECORD;
//
// PCI Component Errors
//
#define SAL_PCI_COMP_ERROR_RECORD_INFO \
{ \
0xe429faf6, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define PCI_COMP_ERROR_STATUS_VALID_BIT_MASK 0x1
#define PCI_COMP_INFO_VALID_BIT_MASK 0x2
#define PCI_COMP_MEM_NUM_VALID_BIT_MASK 0x4
#define PCI_COMP_IO_NUM_VALID_BIT_MASK 0x8
#define PCI_COMP_REG_DATA_PAIR_VALID_BIT_MASK 0x10
#define PCI_COMP_OEM_DATA_STRUCT_VALID_BIT_MASK 0x20
typedef struct {
UINT16 VendorId;
UINT16 DeviceId;
UINT8 ClassCode[3];
UINT8 FunctionNumber;
UINT8 DeviceNumber;
UINT8 BusNumber;
UINT8 SegmentNumber;
UINT8 Reserved[5];
} PCI_COMP_INFO;
typedef struct {
SAL_SEC_HEADER SectionHeader;
UINT64 ValidationBits;
UINT64 PciComponentErrorStatus;
PCI_COMP_INFO PciComponentInfo;
UINT32 PciComponentMemNum;
UINT32 PciComponentIoNum;
UINT8 PciBusOemId[16];
} SAL_PCI_COMPONENT_ERROR_RECORD;
//
// Sal Device Errors Info.
//
#define SAL_DEVICE_ERROR_RECORD_INFO \
{ \
0xe429faf3, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define SEL_RECORD_ID_VALID_BIT_MASK 0x1;
#define SEL_RECORD_TYPE_VALID_BIT_MASK 0x2;
#define SEL_GENERATOR_ID_VALID_BIT_MASK 0x4;
#define SEL_EVM_REV_VALID_BIT_MASK 0x8;
#define SEL_SENSOR_TYPE_VALID_BIT_MASK 0x10;
#define SEL_SENSOR_NUM_VALID_BIT_MASK 0x20;
#define SEL_EVENT_DIR_TYPE_VALID_BIT_MASK 0x40;
#define SEL_EVENT_DATA1_VALID_BIT_MASK 0x80;
#define SEL_EVENT_DATA2_VALID_BIT_MASK 0x100;
#define SEL_EVENT_DATA3_VALID_BIT_MASK 0x200;
typedef struct {
SAL_SEC_HEADER SectionHeader;
UINT64 ValidationBits;
UINT16 SelRecordId;
UINT8 SelRecordType;
UINT32 TimeStamp;
UINT16 GeneratorId;
UINT8 EvmRevision;
UINT8 SensorType;
UINT8 SensorNum;
UINT8 EventDirType;
UINT8 Data1;
UINT8 Data2;
UINT8 Data3;
} SAL_DEVICE_ERROR_RECORD;
//
// Sal SMBIOS Device Errors Info.
//
#define SAL_SMBIOS_ERROR_RECORD_INFO \
{ \
0xe429faf5, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define SMBIOS_EVENT_TYPE_VALID_BIT_MASK 0x1
#define SMBIOS_LENGTH_VALID_BIT_MASK 0x2
#define SMBIOS_TIME_STAMP_VALID_BIT_MASK 0x4
#define SMBIOS_DATA_VALID_BIT_MASK 0x8
typedef struct {
SAL_SEC_HEADER SectionHeader;
UINT64 ValidationBits;
UINT8 SmbiosEventType;
UINT8 SmbiosLength;
UINT8 SmbiosBcdTimeStamp[6];
} SAL_SMBIOS_DEVICE_ERROR_RECORD;
//
// Sal Platform Specific Errors Info.
//
#define SAL_PLATFORM_ERROR_RECORD_INFO \
{ \
0xe429faf7, 0x3cb7, 0x11d4, {0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
}
#define PLATFORM_ERROR_STATUS_VALID_BIT_MASK 0x1
#define PLATFORM_REQUESTOR_ID_VALID_BIT_MASK 0x2
#define PLATFORM_RESPONDER_ID_VALID_BIT_MASK 0x4
#define PLATFORM_TARGET_VALID_BIT_MASK 0x8
#define PLATFORM_SPECIFIC_DATA_VALID_BIT_MASK 0x10
#define PLATFORM_OEM_ID_VALID_BIT_MASK 0x20
#define PLATFORM_OEM_DATA_STRUCT_VALID_BIT_MASK 0x40
#define PLATFORM_OEM_DEVICE_PATH_VALID_BIT_MASK 0x80
typedef struct {
SAL_SEC_HEADER SectionHeader;
UINT64 ValidationBits;
UINT64 PlatformErrorStatus;
UINT64 PlatformRequestorId;
UINT64 PlatformResponderId;
UINT64 PlatformTargetId;
UINT64 PlatformBusSpecificData;
UINT8 OemComponentId[16];
} SAL_PLATFORM_SPECIFIC_ERROR_RECORD;
//
// Union of all the possible Sal Record Types
//
typedef union {
SAL_RECORD_HEADER *RecordHeader;
SAL_PROCESSOR_ERROR_RECORD *SalProcessorRecord;
SAL_PCI_BUS_ERROR_RECORD *SalPciBusRecord;
SAL_PCI_COMPONENT_ERROR_RECORD *SalPciComponentRecord;
SAL_DEVICE_ERROR_RECORD *ImpiRecord;
SAL_SMBIOS_DEVICE_ERROR_RECORD *SmbiosRecord;
SAL_PLATFORM_SPECIFIC_ERROR_RECORD *PlatformRecord;
SAL_MEMORY_ERROR_RECORD *MemoryRecord;
UINT8 *Raw;
} SAL_ERROR_RECORDS_POINTERS;
#pragma pack()
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,395 @@
/** @file
Memory-only library functions with no library constructor/destructor
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: BaseMemoryLib.h
**/
#ifndef __BASE_MEMORY_LIB__
#define __BASE_MEMORY_LIB__
/**
Copy Length bytes from Source to Destination.
This function copies Length bytes from SourceBuffer to DestinationBuffer, and
returns DestinationBuffer. The implementation must be reentrant, and it must
handle the case where SourceBuffer overlaps DestinationBuffer.
If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
ASSERT().
If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
@param Destination Target of copy
@param Source Place to copy from
@param Length Number of bytes to copy
@return Destination
**/
VOID *
EFIAPI
CopyMem (
OUT VOID *DestinationBuffer,
IN CONST VOID *SourceBuffer,
IN UINTN Length
);
/**
Set Buffer to Value for Size bytes.
This function fills Length bytes of Buffer with Value, and returns Buffer.
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Memory to set.
@param Size Number of bytes to set
@param Value Value of the set operation.
@return Buffer
**/
VOID *
EFIAPI
SetMem (
OUT VOID *Buffer,
IN UINTN Length,
IN UINT8 Value
);
/**
Fills a target buffer with a 16-bit value, and returns the target buffer.
This function fills Length bytes of Buffer with the 16-bit value specified by
Value, and returns Buffer. Value is repeated every 16-bits in for Length
bytes of Buffer.
If Buffer is NULL and Length > 0, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@param Buffer Pointer to the target buffer to fill.
@param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
@return Buffer
**/
VOID *
EFIAPI
SetMem16 (
OUT VOID *Buffer,
IN UINTN Length,
IN UINT16 Value
);
/**
Fills a target buffer with a 32-bit value, and returns the target buffer.
This function fills Length bytes of Buffer with the 32-bit value specified by
Value, and returns Buffer. Value is repeated every 32-bits in for Length
bytes of Buffer.
If Buffer is NULL and Length > 0, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@param Buffer Pointer to the target buffer to fill.
@param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
@return Buffer
**/
VOID *
EFIAPI
SetMem32 (
OUT VOID *Buffer,
IN UINTN Length,
IN UINT32 Value
);
/**
Fills a target buffer with a 64-bit value, and returns the target buffer.
This function fills Length bytes of Buffer with the 64-bit value specified by
Value, and returns Buffer. Value is repeated every 64-bits in for Length
bytes of Buffer.
If Buffer is NULL and Length > 0, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), 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().
@param Buffer Pointer to the target buffer to fill.
@param Length Number of bytes in Buffer to fill.
@param Value Value with which to fill Length bytes of Buffer.
@return Buffer
**/
VOID *
EFIAPI
SetMem64 (
OUT VOID *Buffer,
IN UINTN Length,
IN UINT64 Value
);
/**
Set Buffer to 0 for Size bytes.
This function fills Length bytes of Buffer with zeros, and returns Buffer.
If Buffer is NULL and Length > 0, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Memory to set.
@param Size Number of bytes to set
@return Buffer
**/
VOID *
EFIAPI
ZeroMem (
OUT VOID *Buffer,
IN UINTN Length
);
/**
Compares two memory buffers of a given length.
This function compares Length bytes of SourceBuffer to Length bytes of
DestinationBuffer. If all Length bytes of the two buffers are identical, then
0 is returned. Otherwise, the value returned is the first mismatched byte in
SourceBuffer subtracted from the first mismatched byte in DestinationBuffer.
If DestinationBuffer is NULL and Length > 0, then ASSERT().
If SourceBuffer is NULL and Length > 0, then ASSERT().
If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then
ASSERT().
If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
@param DestinationBuffer First memory buffer
@param SourceBuffer Second memory buffer
@param Length Length of DestinationBuffer and SourceBuffer memory
regions to compare
@retval 0 if DestinationBuffer == SourceBuffer
@retval Non-zero if DestinationBuffer != SourceBuffer
**/
INTN
EFIAPI
CompareMem (
IN CONST VOID *DestinationBuffer,
IN CONST VOID *SourceBuffer,
IN UINTN Length
);
/**
Scans a target buffer for an 8-bit value, and returns a pointer to the
matching 8-bit value in the target buffer.
This function searches target the buffer specified by Buffer and Length from
the lowest address to the highest address for an 8-bit value that matches
Value. If a match is found, then a pointer to the matching byte in the target
buffer is returned. If no match is found, then NULL is returned. If Length is
0, then NULL is returned.
If Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence or NULL if not found.
@retval NULL if Length == 0 or Value was not found.
**/
VOID *
EFIAPI
ScanMem8 (
IN CONST VOID *Buffer,
IN UINTN Length,
IN UINT8 Value
);
/**
Scans a target buffer for a 16-bit value, and returns a pointer to the
matching 16-bit value in the target buffer.
This function searches target the buffer specified by Buffer and Length from
the lowest address to the highest address at 16-bit increments for a 16-bit
value that matches Value. If a match is found, then a pointer to the matching
value in the target buffer is returned. If no match is found, then NULL is
returned. If Length is 0, then NULL is returned.
If Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence.
@retval NULL if Length == 0 or Value was not found.
**/
VOID *
EFIAPI
ScanMem16 (
IN CONST VOID *Buffer,
IN UINTN Length,
IN UINT16 Value
);
/**
Scans a target buffer for a 32-bit value, and returns a pointer to the
matching 32-bit value in the target buffer.
This function searches target the buffer specified by Buffer and Length from
the lowest address to the highest address at 32-bit increments for a 32-bit
value that matches Value. If a match is found, then a pointer to the matching
value in the target buffer is returned. If no match is found, then NULL is
returned. If Length is 0, then NULL is returned.
If Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 32-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence or NULL if not found.
@retval NULL if Length == 0 or Value was not found.
**/
VOID *
EFIAPI
ScanMem32 (
IN CONST VOID *Buffer,
IN UINTN Length,
IN UINT32 Value
);
/**
Scans a target buffer for a 64-bit value, and returns a pointer to the
matching 64-bit value in the target buffer.
This function searches target the buffer specified by Buffer and Length from
the lowest address to the highest address at 64-bit increments for a 64-bit
value that matches Value. If a match is found, then a pointer to the matching
value in the target buffer is returned. If no match is found, then NULL is
returned. If Length is 0, then NULL is returned.
If Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Value Value to search for in the target buffer.
@return Pointer to the first occurrence or NULL if not found.
@retval NULL if Length == 0 or Value was not found.
**/
VOID *
EFIAPI
ScanMem64 (
IN CONST VOID *Buffer,
IN UINTN Length,
IN UINT64 Value
);
/**
This function copies a source GUID to a destination GUID.
This function copies the contents of the 128-bit GUID specified by SourceGuid
to DestinationGuid, and returns DestinationGuid.
If DestinationGuid is NULL, then ASSERT().
If SourceGuid is NULL, then ASSERT().
@param DestinationGuid Pointer to the destination GUID.
@param SourceGuid Pointer to the source GUID.
@return DestinationGuid
**/
GUID *
EFIAPI
CopyGuid (
OUT GUID *DestinationGuid,
IN CONST GUID *SourceGuid
);
/**
Compares two GUIDs
This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE
is returned. If there are any bit differences in the two GUIDs, then FALSE is
returned.
If Guid1 is NULL, then ASSERT().
If Guid2 is NULL, then ASSERT().
@param Guid1 guid to compare
@param Guid2 guid to compare
@retval TRUE if Guid1 == Guid2
@retval FALSE if Guid1 != Guid2
**/
BOOLEAN
EFIAPI
CompareGuid (
IN CONST GUID *Guid1,
IN CONST GUID *Guid2
);
/**
Scans a target buffer for a GUID, and returns a pointer to the matching GUID
in the target buffer.
This function searches target the buffer specified by Buffer and Length from
the lowest address to the highest address at 128-bit increments for the
128-bit GUID value that matches Guid. If a match is found, then a pointer to
the matching GUID in the target buffer is returned. If no match is found,
then NULL is returned. If Length is 0, then NULL is returned.
If Buffer is NULL, then ASSERT().
If Buffer is not aligned on a 64-bit boundary, then ASSERT().
If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to scan.
@param Length Number of bytes in Buffer to scan.
@param Guid Value to search for in the target buffer.
@return Pointer to the first occurrence.
@retval NULL if Length == 0 or Guid was not found.
**/
VOID *
EFIAPI
ScanGuid (
IN CONST VOID *Buffer,
IN UINTN Length,
IN CONST GUID *Guid
);
#endif

View File

@@ -0,0 +1,72 @@
/** @file
Cache Maintenance Functions
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: CacheMaintenanceLib.h
**/
#ifndef __CACHE_MAINTENANCE_LIB__
#define __CACHE_MAINTENANCE_LIB__
VOID
EFIAPI
InvalidateInstructionCache (
VOID
);
VOID *
EFIAPI
InvalidateInstructionCacheRange (
IN VOID *Address,
IN UINTN Length
);
VOID
EFIAPI
WriteBackInvalidateDataCache (
VOID
);
VOID *
EFIAPI
WriteBackInvalidateDataCacheRange (
IN VOID *Address,
IN UINTN Length
);
VOID
EFIAPI
WriteBackDataCache (
VOID
);
VOID *
EFIAPI
WriteBackDataCacheRange (
IN VOID *Address,
IN UINTN Length
);
VOID
EFIAPI
InvalidateDataCache (
VOID
);
VOID *
EFIAPI
InvalidateInstructionCacheRange (
IN VOID *Address,
IN UINTN Length
);
#endif

View File

@@ -0,0 +1,20 @@
/** @file
Library that provides processor specific library services
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: CpuLib.h
**/
#ifndef __CPU_LIB_H__
#define __CPU_LIB_H__
#endif

View File

@@ -0,0 +1,439 @@
/** @file
Public include file for the Debug Library
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __DEBUG_LIB_H__
#define __DEBUG_LIB_H__
//
// Declare bits for PcdDebugPropertyMask
//
#define DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED 0x01
#define DEBUG_PROPERTY_DEBUG_PRINT_ENABLED 0x02
#define DEBUG_PROPERTY_DEBUG_CODE_ENABLED 0x04
#define DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED 0x08
#define DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED 0x10
#define DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED 0x20
//
// Declare bits for PcdDebugPrintErrorLevel and the ErrorLevel parameter of DebugPrint()
//
#define EFI_D_INIT 0x00000001 // Initialization style messages
#define EFI_D_WARN 0x00000002 // Warnings
#define EFI_D_LOAD 0x00000004 // Load events
#define EFI_D_FS 0x00000008 // EFI File system
#define EFI_D_POOL 0x00000010 // Alloc & Free's
#define EFI_D_PAGE 0x00000020 // Alloc & Free's
#define EFI_D_INFO 0x00000040 // Verbose
#define EFI_D_VARIABLE 0x00000100 // Variable
#define EFI_D_BM 0x00000400 // Boot Manager (BDS)
#define EFI_D_BLKIO 0x00001000 // BlkIo Driver
#define EFI_D_NET 0x00004000 // SNI Driver
#define EFI_D_UNDI 0x00010000 // UNDI Driver
#define EFI_D_LOADFILE 0x00020000 // UNDI Driver
#define EFI_D_EVENT 0x00080000 // Event messages
#define EFI_D_ERROR 0x80000000 // Error
/**
Prints a debug message to the debug output device if the specified error level is enabled.
If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print
the message specified by Format and the associated variable argument list to
the debug output device.
If Format is NULL, then ASSERT().
@param ErrorLevel The error level of the debug message.
@param Format Format string for the debug message to print.
**/
VOID
EFIAPI
DebugPrint (
IN UINTN ErrorLevel,
IN CHAR8 *Format,
...
);
/**
Prints an assert message containing a filename, line number, and description.
This may be followed by a breakpoint or a dead loop.
Print a message of the form <20>ASSERT <FileName>(<LineNumber>): <Description>\n<>
to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
CpuDeadLoop() is called. If neither of these bits are set, then this function
returns immediately after the message is printed to the debug output device.
DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
processing another DebugAssert(), then DebugAssert() must return immediately.
If FileName is NULL, then a <FileName> string of <20>(NULL) Filename<6D> is printed.
If Description is NULL, then a <Description> string of <20>(NULL) Description<6F> is printed.
@param FileName Pointer to the name of the source file that generated the assert condition.
@param LineNumber The line number in the source file that generated the assert condition
@param Description Pointer to the description of the assert condition.
**/
VOID
EFIAPI
DebugAssert (
IN CHAR8 *FileName,
IN INTN LineNumber,
IN CHAR8 *Description
);
/**
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.
This function fills Length bytes of Buffer with the value specified by
PcdDebugClearMemoryValue, and returns Buffer.
If Buffer is NULL, then ASSERT().
If Length is greater than (MAX_ADDRESS <20> Buffer + 1), then ASSERT().
@param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue.
@param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.
@return Buffer
**/
VOID *
EFIAPI
DebugClearMemory (
OUT VOID *Buffer,
IN UINTN Length
);
/**
Returns TRUE if ASSERT() macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugAssertEnabled (
VOID
);
/**
Returns TRUE if DEBUG()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugPrintEnabled (
VOID
);
/**
Returns TRUE if DEBUG_CODE()macros are enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugCodeEnabled (
VOID
);
/**
Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.
This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of
PcdDebugProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.
@retval FALSE The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.
**/
BOOLEAN
EFIAPI
DebugClearMemoryEnabled (
VOID
);
/**
Internal worker macro that calls DebugAssert().
This macro calls DebugAssert() passing in the filename, line number, and
expression that evailated to FALSE.
@param Expression Boolean expression that evailated to FALSE
**/
#define _ASSERT(Expression) DebugAssert (__FILE__, __LINE__, #Expression)
/**
Internal worker macro that calls DebugPrint().
This macro calls DebugPrint() passing in the debug error level, a format
string, and a variable argument list.
@param Expression Expression containing an error level, a format string,
and a variable argument list based on the format string.
**/
#define _DEBUG(Expression) DebugPrint Expression
/**
Macro that calls DebugAssert() if a expression evaluates to FALSE.
If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
then this macro evaluates the Boolean expression specified by Expression. If
Expression evaluates to FALSE, then DebugAssert() is called passing in the
source filename, source line number, and Expression.
@param Expression Boolean expression
**/
#define ASSERT(Expression) \
do { \
if (DebugAssertEnabled ()) { \
if (!(Expression)) { \
_ASSERT (Expression); \
} \
} \
} while (FALSE)
/**
Macro that calls DebugPrint().
If the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set,
then this macro passes Expression to DebugPrint().
@param Expression Expression containing an error level, a format string,
and a variable argument list based on the format string.
**/
#define DEBUG(Expression) \
do { \
if (DebugPrintEnabled ()) { \
_DEBUG (Expression); \
} \
} while (FALSE)
/**
Macro that calls DebugAssert() if an EFI_STATUS evaluates to an error code.
If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
then this macro evaluates the EFI_STATUS value specified by StatusParameter.
If StatusParameter is an error code, then DebugAssert() is called passing in
the source filename, source line number, and StatusParameter.
@param StatusParameter EFI_STATUS value to evaluate.
**/
#define ASSERT_EFI_ERROR(StatusParameter) \
do { \
if (DebugAssertEnabled ()) { \
if (EFI_ERROR (StatusParameter)) { \
DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \
_ASSERT (!EFI_ERROR (StatusParameter)); \
} \
} \
} while (FALSE)
/**
Macro that calls DebugAssert() if a protocol is already installed in the
handle database.
If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear,
then return.
If Handle is NULL, then a check is made to see if the protocol specified by Guid
is present on any handle in the handle database. If Handle is not NULL, then
a check is made to see if the protocol specified by Guid is present on the
handle specified by Handle. If the check finds the protocol, then DebugAssert()
is called passing in the source filename, source line number, and Guid.
If Guid is NULL, then ASSERT().
@param Handle The handle to check for the protocol. This is an optional
parameter that may be NULL. If it is NULL, then the entire
handle database is searched.
@param Guid Pointer to a protocol GUID.
**/
#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \
do { \
if (DebugAssertEnabled ()) { \
VOID *Instance; \
ASSERT (Guid != NULL); \
if (Handle == NULL) { \
if (!EFI_ERROR (gBS->LocateProtocol (Guid, NULL, &Instance))) { \
_ASSERT (Guid already installed in database); \
} \
} else { \
if (!EFI_ERROR (gBS->LocateProtocol (Handle, Guid, &Instance))) { \
_ASSERT (Guid already installed on Handle); \
} \
} \
} \
} while (FALSE)
/**
Macro that marks the beginning of debug source code.
If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
then this macro marks the beginning of source code that is included in a module.
Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()
are not included in a module.
**/
#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal
/**
Macro that marks the end of debug source code.
If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
then this macro marks the end of source code that is included in a module.
Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()
are not included in a module.
**/
#define DEBUG_CODE_END() __DebugCodeLocal = 0; } } while (FALSE)
/**
Macro that declares a section of debug source code.
If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,
then the source code specified by Expression is included in a module.
Otherwise, the source specified by Expression is not included in a module.
**/
#define DEBUG_CODE(Expression) \
DEBUG_CODE_BEGIN (); \
Expression \
DEBUG_CODE_END ()
/**
Macro that calls DebugClearMemory() to clear a buffer to a default value.
If the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set,
then this macro calls DebugClearMemory() passing in Address and Length.
@param Address Pointer to a buffer.
@param Length The number of bytes in the buffer to set.
**/
#define DEBUG_CLEAR_MEMORY(Address, Length) \
do { \
if (DebugClearMemoryEnabled ()) { \
DebugClearMemory (Address, Length); \
} \
} while (FALSE)
/**
Macro that calls DebugAssert() if the containing record does not have a
matching signature. If the signatures matches, then a pointer to the data
structure that contains a specified field of that data structure is returned.
This is a light weight method 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.
If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear,
then this macro 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 DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
then this macro 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 compute a pointer to a data structure of
the type specified by TYPE. The Signature field of the data structure specified
by TYPE is compared to TestSignature. If the signatures match, then a pointer
to the pointer to a data structure of the type specified by TYPE is returned.
If the signatures do not match, then DebugAssert() is called with a description
of <20>CR has a bad signature<72> and Record is returned.
If the data type specified by TYPE does not contain the field specified by Field,
then the module will not compile.
If TYPE does not contain a field called Signature, 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.
@param TestSignature The 32-bit signature value to match.
**/
#define CR(Record, TYPE, Field, TestSignature) \
(DebugAssertEnabled () && (_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \
(TYPE *) (_ASSERT (CR has Bad Signature), Record) : \
_CR (Record, TYPE, Field)
#endif

View File

@@ -0,0 +1,197 @@
/** @file
Entry point to a DXE Boot Services Driver
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: DevicePathLib.h
**/
#ifndef __DEVICE_PATH_LIB_H__
#define __DEVICE_PATH_LIB_H__
/**
This function returns the size, in bytes,
of the device path data structure specified by DevicePath.
If DevicePath is NULL, then 0 is returned.
@param DevicePath A pointer to a device path data structure.
@return The size of a device path in bytes.
**/
UINTN
EFIAPI
GetDevicePathSize (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
/**
This function allocates space for a new copy of the device path
specified by DevicePath.
@param DevicePath A pointer to a device path data structure.
@return The duplicated device path.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
DuplicateDevicePath (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
/**
This function appends the device path SecondDevicePath
to every device path instance in FirstDevicePath.
@param FirstDevicePath A pointer to a device path data structure.
@param SecondDevicePath A pointer to a device path data structure.
@return
A pointer to the new device path is returned.
NULL is returned if space for the new device path could not be allocated from pool.
It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath
if they are no longer needed.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
AppendDevicePath (
IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath
)
;
/**
This function appends the device path node SecondDevicePath
to every device path instance in FirstDevicePath.
@param FirstDevicePath A pointer to a device path data structure.
@param SecondDevicePath A pointer to a single device path node.
@return
A pointer to the new device path.
If there is not enough temporary pool memory available to complete this function,
then NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
AppendDevicePathNode (
IN CONST EFI_DEVICE_PATH_PROTOCOL *FirstDevicePath,
IN CONST EFI_DEVICE_PATH_PROTOCOL *SecondDevicePath
)
;
/**
This function appends the device path instance Instance to the device path Source.
If Source is NULL, then a new device path with one instance is created.
@param Source A pointer to a device path data structure.
@param Instance A pointer to a device path instance.
@return
A pointer to the new device path.
If there is not enough temporary pool memory available to complete this function,
then NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
AppendDevicePathInstance (
IN CONST EFI_DEVICE_PATH_PROTOCOL *Source,
IN CONST EFI_DEVICE_PATH_PROTOCOL *Instance
)
;
/**
Function retrieves the next device path instance from a device path data structure.
@param DevicePath A pointer to a device path data structure.
@param Size A pointer to the size of a device path instance in bytes.
@return
This function returns a pointer to the current device path instance.
In addition, it returns the size in bytes of the current device path instance in Size,
and a pointer to the next device path instance in DevicePath.
If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
GetNextDevicePathInstance (
IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
OUT UINTN *Size
)
;
/**
Return TRUE is this is a multi instance device path.
@param DevicePath A pointer to a device path data structure.
@retval TRUE If DevicePath is multi-instance.
@retval FALSE If DevicePath is not multi-instance or DevicePath is NULL.
**/
BOOLEAN
EFIAPI
IsDevicePathMultiInstance (
IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
)
;
/**
This function retrieves the device path protocol from a handle.
@param Handle The handle from which to retrieve the device path protocol.
@return
This function returns the device path protocol from the handle specified by Handle.
If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
DevicePathFromHandle (
IN EFI_HANDLE Handle
)
;
/**
This function allocates a device path for a file and appends it to an existing device path.
@param Device A pointer to a device handle. This parameter is optional and may be NULL.
@param FileName A pointer to a Null-terminated Unicode string.
@return
If Device is a valid device handle that contains a device path protocol,
then a device path for the file specified by FileName is allocated
and appended to the device path associated with the handle Device. The allocated device path is returned.
If Device is NULL or Device is a handle that does not support the device path protocol,
then a device path containing a single device path node for the file specified by FileName
is allocated and returned.
**/
EFI_DEVICE_PATH_PROTOCOL *
EFIAPI
FileDevicePath (
IN EFI_HANDLE Device, OPTIONAL
IN CONST CHAR16 *FileName
)
;
#endif

View File

@@ -0,0 +1,77 @@
/** @file
Entry point to the DXE Core
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __MODULE_ENTRY_POINT_H__
#define __MODULE_ENTRY_POINT_H__
//
// Declare the cache of copy of HobList.
//
extern VOID *gHobList;
/**
Enrty point to DXE core.
@param HobStart Pointer of HobList.
**/
VOID
EFIAPI
_ModuleEntryPoint (
IN VOID *HobStart
);
/**
Wrapper of enrty point to DXE CORE.
@param HobStart Pointer of HobList.
**/
VOID
EFIAPI
EfiMain (
IN VOID *HobStart
);
/**
Call constructs for all libraries. Automatics Generated by tool.
@param ImageHandle ImageHandle of the loaded driver.
@param SystemTable Pointer to the EFI System Table.
**/
VOID
EFIAPI
ProcessLibraryConstructorList (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Call the list of driver entry points. Automatics Generated by tool.
@param HobStart Pointer to HobList.
**/
VOID
EFIAPI
ProcessModuleEntryPointList (
IN VOID *HobStart
);
#endif

View File

@@ -0,0 +1,332 @@
/** @file
Library to abstract runtime services
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: DxeRuntimeDriverLib.h
**/
#ifndef __DXE_RUNTIME_DRIVER_LIB__
#define __DXE_RUNTIME_DRIVER_LIB__
extern const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[];
extern const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[];
/**
Check to see if the execute context is in Runtime phase or not.
@param None.
@retval TRUE The driver is in SMM.
@retval FALSE The driver is not in SMM.
**/
BOOLEAN
EFIAPI
EfiAtRuntime (
VOID
);
/**
Check to see if the SetVirtualAddressMsp() is invoked or not.
@retval TRUE SetVirtualAddressMsp() has been called.
@retval FALSE SetVirtualAddressMsp() has not been called.
**/
BOOLEAN
EFIAPI
EfiGoneVirtual (
VOID
);
/**
Return current time and date information, and time-keeping
capabilities of 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<63><65>s
capabilities.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiGetTime (
OUT EFI_TIME *Time,
OUT EFI_TIME_CAPABILITIES *Capabilities
);
/**
Set current time and date information.
@param Time A pointer to cache of time setting.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to execute the function.
**/
EFI_STATUS
EFIAPI
EfiSetTime (
IN EFI_TIME *Time
);
/**
Return current wakeup alarm clock setting.
@param Enabled Indicate if the alarm clock is enabled or disabled.
@param Pending Indicate if the alarm signal is pending and requires acknowledgement.
@param Time Current alarm clock setting.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiGetWakeupTime (
OUT BOOLEAN *Enabled,
OUT BOOLEAN *Pending,
OUT EFI_TIME *Time
);
/**
Set current wakeup alarm clock.
@param Enable Enable or disable current alarm clock..
@param Time Point to alarm clock setting.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiSetWakeupTime (
IN BOOLEAN Enable,
IN EFI_TIME *Time
);
/**
Return value of variable.
@param VariableName the name of the vendor's variable, it's a
Null-Terminated Unicode String
@param VendorGuid Unify identifier for vendor.
@param Attributes Point to memory location to return the attributes of variable. If the point
is NULL, the parameter would be ignored.
@param DataSize As input, point to the maxinum size of return Data-Buffer.
As output, point to the actual size of the returned Data-Buffer.
@param Data Point to return Data-Buffer.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiGetVariable (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
OUT UINT32 *Attributes,
IN OUT UINTN *DataSize,
OUT VOID *Data
)
;
/**
Enumerates variable's name.
@param VariableNameSize As input, point to maxinum size of variable name.
As output, point to actual size of varaible name.
@param VariableName As input, supplies the last VariableName that was returned by
GetNextVariableName().
As output, returns the name of variable. The name
string is Null-Terminated Unicode string.
@param VendorGuid As input, supplies the last VendorGuid that was returned by
GetNextVriableName().
As output, returns the VendorGuid of the current variable.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiGetNextVariableName (
IN OUT UINTN *VariableNameSize,
IN OUT CHAR16 *VariableName,
IN OUT EFI_GUID *VendorGuid
);
/**
Sets value of variable.
@param VariableName the name of the vendor's variable, it's a
Null-Terminated Unicode String
@param VendorGuid Unify identifier for vendor.
@param Attributes Point to memory location to return the attributes of variable. If the point
is NULL, the parameter would be ignored.
@param DataSize The size in bytes of Data-Buffer.
@param Data Point to the content of the variable.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiSetVariable (
IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid,
IN UINT32 Attributes,
IN UINTN DataSize,
IN VOID *Data
);
/**
Returns the next high 32 bits of platform's monotonic counter.
@param HighCount Pointer to returned value.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiGetNextHighMonotonicCount (
OUT UINT32 *HighCount
);
/**
Resets the entire platform.
@param ResetType The type of reset to perform.
@param ResetStatus The status code for reset.
@param DataSize The size in bytes of reset data.
@param ResetData Pointer to data buffer that includes
Null-Terminated Unicode string.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
VOID
EfiResetSystem (
IN EFI_RESET_TYPE ResetType,
IN EFI_STATUS ResetStatus,
IN UINTN DataSize,
IN CHAR16 *ResetData
);
/**
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 The pointer to a pointer that is to be fixed to be the
value needed for the new virtual address mapping being
applied.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiConvertPointer (
IN UINTN DebugDisposition,
IN OUT VOID *Address
);
/**
Change 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. Type
EFI_MEMORY_DESCRIPTOR is defined in the
GetMemoryMap() function description.
@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.
**/
EFI_STATUS
EFIAPI
EfiSetVirtualAddressMap (
IN UINTN MemoryMapSize,
IN UINTN DescriptorSize,
IN UINT32 DescriptorVersion,
IN CONST EFI_MEMORY_DESCRIPTOR *VirtualMap
);
/**
Conver the standard Lib double linked list to a virtual mapping.
@param DebugDisposition Supplies type information for the pointer being converted.
@param ListHead Head of linked list to convert.
@retval EFI_SUCCESS Success to execute the function.
@retval !EFI_SUCCESS Failed to e3xecute the function.
**/
EFI_STATUS
EFIAPI
EfiConvertList (
IN UINTN DebugDisposition,
IN OUT LIST_ENTRY *ListHead
);
EFI_STATUS
EFIAPI
EfiUpdateCapsule (
IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
IN UINTN CapsuleCount,
IN EFI_PHYSICAL_ADDRESS ScatterGatherList
);
EFI_STATUS
EFIAPI
EfiQueryCapsuleCapabilities (
IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
IN UINTN CapsuleCount,
OUT UINT64 *MaximumCapsuleSize,
OUT EFI_RESET_TYPE *ResetType
);
EFI_STATUS
EFIAPI
EfiQueryVariableInfo (
IN UINT32 Attrubutes,
OUT UINT64 *MaximumVariableStorageSize,
OUT UINT64 *RemainingVariableStorageSize,
OUT UINT64 *MaximumVariableSize
);
#endif

View File

@@ -0,0 +1,26 @@
/** @file
Library that provides a global pointer to the DXE Services Table
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: DxeServicesTableLib.h
**/
#ifndef __DXE_SERVICES_TABLE_LIB_H__
#define __DXE_SERVICES_TABLE_LIB_H__
//
//
//
extern EFI_DXE_SERVICES *gDS;
#endif

View File

@@ -0,0 +1,140 @@
/** @file
Entry point to a DXE SMM Driver
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __MODULE_ENTRY_POINT_H__
#define __MODULE_ENTRY_POINT_H__
//
// Declare the EFI/UEFI Specification Revision to which this driver is implemented
//
extern const UINT32 _gUefiDriverRevision;
//
// Declare the number of entry points in the image.
//
extern const UINT8 _gDriverEntryPointCount;
//
// Declare the number of unload handler in the image.
//
extern const UINT8 _gDriverUnloadImageCount;
/**
Enrty point to DXE SMM Driver.
@param ImageHandle ImageHandle of the loaded driver.
@param SystemTable Pointer to the EFI System Table.
@retval EFI_SUCCESS One or more of the drivers returned a success code.
@retval !EFI_SUCESS The return status from the last driver entry point in the list.
**/
EFI_STATUS
EFIAPI
_ModuleEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Enrty point wrapper of DXE SMM Driver.
@param ImageHandle ImageHandle of the loaded driver.
@param SystemTable Pointer to the EFI System Table.
@retval EFI_SUCCESS One or more of the drivers returned a success code.
@retval !EFI_SUCESS The return status from the last driver entry point in the list.
**/
EFI_STATUS
EFIAPI
EfiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Computes the cummulative return status for the driver entry point and perform
a long jump back into DriverEntryPoint().
@param Status Status returned by the driver that is exiting.
**/
VOID
EFIAPI
ExitDriver (
IN EFI_STATUS Status
);
/**
Call constructs for all libraries. Automatics Generated by tool.
@param ImageHandle ImageHandle of the loaded driver.
@param SystemTable Pointer to the EFI System Table.
**/
VOID
EFIAPI
ProcessLibraryConstructorList (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Call destructors for all libraries. Automatics Generated by tool.
@param ImageHandle ImageHandle of the loaded driver.
@param SystemTable Pointer to the EFI System Table.
**/
VOID
EFIAPI
ProcessLibraryDestructorList (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Call the list of driver entry points. Automatics Generated by tool.
@param ImageHandle ImageHandle of the loaded driver.
@param SystemTable Pointer to the EFI System Table.
@return Status returned by entry points of drivers.
**/
EFI_STATUS
EFIAPI
ProcessModuleEntryPointList (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
/**
Call the unload handlers for all the modules. Automatics Generated by tool.
@param ImageHandle ImageHandle of the loaded driver.
@return Status returned by unload handlers of drivers.
**/
EFI_STATUS
EFIAPI
ProcessModuleUnloadList (
IN EFI_HANDLE ImageHandle
);
#endif

View File

@@ -0,0 +1,44 @@
/** @file
Public include file for the HII Library
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: HiiLib.h
**/
#ifndef __HII_LIB_H__
#define __HII_LIB_H__
/**
This function allocates pool for an EFI_HII_PACKAGES structure
with enough space for the variable argument list of package pointers.
The allocated structure is initialized using NumberOfPackages, Guid,
and the variable length argument list of package pointers.
@param NumberOfPackages The number of HII packages to prepare.
@param Guid Package GUID.
@return
The allocated and initialized packages.
**/
EFI_HII_PACKAGES *
EFIAPI
PreparePackages (
IN UINTN NumberOfPackages,
IN CONST EFI_GUID *Guid OPTIONAL,
...
)
;
#endif

View File

@@ -0,0 +1,275 @@
/** @file
Public include file for the HOB Library
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: HobLib.h
**/
#ifndef __HOB_LIB_H__
#define __HOB_LIB_H__
/**
Returns the pointer to the HOB list.
@return The pointer to the HOB list.
**/
VOID *
EFIAPI
GetHobList (
VOID
)
;
/**
This function searches the first instance of a HOB type from the starting HOB pointer.
If there does not exist such HOB type from the starting HOB pointer, it will return NULL.
@param Type The HOB type to return.
@param HobStart The starting HOB pointer to search from.
@return The next instance of a HOB type from the starting HOB.
**/
VOID *
EFIAPI
GetNextHob (
IN UINT16 Type,
IN CONST VOID *HobStart
)
;
/**
This function searches the first instance of a HOB type among the whole HOB list.
If there does not exist such HOB type in the HOB list, it will return NULL.
@param Type The HOB type to return.
@return The next instance of a HOB type from the starting HOB.
**/
VOID *
EFIAPI
GetFirstHob (
IN UINT16 Type
)
;
/**
This function searches the first instance of a HOB from the starting HOB pointer.
Such HOB should satisfy two conditions:
its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
If there does not exist such HOB from the starting HOB pointer, it will return NULL.
@param Guid The GUID to match with in the HOB list.
@param HobStart A pointer to a Guid.
@return The next instance of the matched GUID HOB from the starting HOB.
**/
VOID *
EFIAPI
GetNextGuidHob (
IN CONST EFI_GUID *Guid,
IN CONST VOID *HobStart
)
;
/**
This function searches the first instance of a HOB among the whole HOB list.
Such HOB should satisfy two conditions:
its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid.
If there does not exist such HOB from the starting HOB pointer, it will return NULL.
@param Guid The GUID to match with in the HOB list.
@return The first instance of the matched GUID HOB among the whole HOB list.
**/
VOID *
EFIAPI
GetFirstGuidHob (
IN CONST EFI_GUID *Guid
)
;
/**
This function builds a HOB for a loaded PE32 module.
@param ModuleName The GUID File Name of the module.
@param MemoryAllocationModule The 64 bit physical address of the module.
@param ModuleLength The length of the module in bytes.
@param EntryPoint The 64 bit physical address of the module<6C>s entry point.
**/
VOID
EFIAPI
BuildModuleHob (
IN CONST EFI_GUID *ModuleName,
IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule,
IN UINT64 ModuleLength,
IN EFI_PHYSICAL_ADDRESS EntryPoint
)
;
/**
Builds a HOB that describes a chunk of system memory.
@param ResourceType The type of resource described by this HOB.
@param ResourceAttribute The resource attributes of the memory described by this HOB.
@param PhysicalStart The 64 bit physical address of memory described by this HOB.
@param NumberOfBytes The length of the memory described by this HOB in bytes.
**/
VOID
EFIAPI
BuildResourceDescriptorHob (
IN EFI_RESOURCE_TYPE ResourceType,
IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
IN EFI_PHYSICAL_ADDRESS PhysicalStart,
IN UINT64 NumberOfBytes
)
;
/**
This function builds a customized HOB tagged with a GUID for identification
and returns the start address of GUID HOB data so that caller can fill the customized data.
@param Guid The GUID to tag the customized HOB.
@param DataLength The size of the data payload for the GUID HOB.
@return The start address of GUID HOB data.
**/
VOID *
EFIAPI
BuildGuidHob (
IN CONST EFI_GUID *Guid,
IN UINTN DataLength
)
;
/**
This function builds a customized HOB tagged with a GUID for identification,
copies the input data to the HOB data field, and returns the start address of GUID HOB data.
@param Guid The GUID to tag the customized HOB.
@param Data The data to be copied into the data field of the GUID HOB.
@param DataLength The size of the data payload for the GUID HOB.
@return The start address of GUID HOB data.
**/
VOID *
EFIAPI
BuildGuidDataHob (
IN CONST EFI_GUID *Guid,
IN VOID *Data,
IN UINTN DataLength
)
;
/**
Builds a Firmware Volume HOB.
@param BaseAddress The base address of the Firmware Volume.
@param Length The size of the Firmware Volume in bytes.
**/
VOID
EFIAPI
BuildFvHob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length
)
;
/**
Builds a Capsule Volume HOB.
@param BaseAddress The base address of the Capsule Volume.
@param Length The size of the Capsule Volume in bytes.
**/
VOID
EFIAPI
BuildCvHob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length
)
;
/**
Builds a HOB for the CPU.
@param SizeOfMemorySpace The maximum physical memory addressability of the processor.
@param SizeOfIoSpace The maximum physical I/O addressability of the processor.
**/
VOID
EFIAPI
BuildCpuHob (
IN UINT8 SizeOfMemorySpace,
IN UINT8 SizeOfIoSpace
)
;
/**
Builds a HOB for the Stack.
@param BaseAddress The 64 bit physical address of the Stack.
@param Length The length of the stack in bytes.
**/
VOID
EFIAPI
BuildStackHob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length
)
;
/**
Builds a HOB for the BSP store.
@param BaseAddress The 64 bit physical address of the BSP.
@param Length The length of the BSP store in bytes.
@param MemoryType Type of memory allocated by this HOB.
**/
VOID
EFIAPI
BuildBspStoreHob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length,
IN EFI_MEMORY_TYPE MemoryType
)
;
/**
Builds a HOB for the memory allocation.
@param BaseAddress The 64 bit physical address of the memory.
@param Length The length of the memory allocation in bytes.
@param MemoryType Type of memory allocated by this HOB.
**/
VOID
EFIAPI
BuildMemoryAllocationHob (
IN EFI_PHYSICAL_ADDRESS BaseAddress,
IN UINT64 Length,
IN EFI_MEMORY_TYPE MemoryType
)
;
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,547 @@
/** @file
Memory Allocation Library Services
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: MemoryAllocationLib.h
**/
#ifndef __MEMORY_ALLOCATION_LIB_H__
#define __MEMORY_ALLOCATION_LIB_H__
/**
Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData.
@param Pages The number of 4 KB pages to allocate.
@return
A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
If Pages is 0, then NULL is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocatePages (
IN UINTN Pages
)
;
/**
Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData.
@param Pages The number of 4 KB pages to allocate.
@return
A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
If Pages is 0, then NULL is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateRuntimePages (
IN UINTN Pages
)
;
/**
Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType.
@param Pages The number of 4 KB pages to allocate.
@return
A pointer to the allocated buffer. The buffer returned is aligned on a 4KB boundary.
If Pages is 0, then NULL is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateReservedPages (
IN UINTN Pages
)
;
/**
Frees one or more 4KB pages that were previously allocated with
one of the page allocation functions in the Memory Allocation Library.
@param Buffer Pointer to the buffer of pages to free.
@param Pages The number of 4 KB pages to free.
None.
**/
VOID
EFIAPI
FreePages (
IN VOID *Buffer,
IN UINTN Pages
)
;
/**
Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an alignment specified by Alignment.
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
The allocated buffer is returned. If Pages is 0, then NULL is returned.
If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedPages (
IN UINTN Pages,
IN UINTN Alignment
)
;
/**
Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an alignment specified by Alignment.
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
The allocated buffer is returned. If Pages is 0, then NULL is returned.
If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedRuntimePages (
IN UINTN Pages,
IN UINTN Alignment
)
;
/**
Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
The allocated buffer is returned. If Pages is 0, then NULL is returned.
If there is not enough memory at the specified alignment remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedReservedPages (
IN UINTN Pages,
IN UINTN Alignment
)
;
/**
Frees one or more 4KB pages that were previously allocated with
one of the aligned page allocation functions in the Memory Allocation Library.
@param Buffer Pointer to the buffer of pages to free.
@param Pages The number of 4 KB pages to free.
None.
**/
VOID
EFIAPI
FreeAlignedPages (
IN VOID *Buffer,
IN UINTN Pages
)
;
/**
Allocates a buffer of type EfiBootServicesData.
@param AllocationSize The number of bytes to allocate.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocatePool (
IN UINTN AllocationSize
)
;
/**
Allocates a buffer of type EfiRuntimeServicesData.
@param AllocationSize The number of bytes to allocate.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateRuntimePool (
IN UINTN AllocationSize
)
;
/**
Allocates a buffer of type EfiReservedMemoryType.
@param AllocationSize The number of bytes to allocate.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateReservedPool (
IN UINTN AllocationSize
)
;
/**
Allocates and zeros a buffer of type EfiBootServicesData.
@param AllocationSize The number of bytes to allocate and zero.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateZeroPool (
IN UINTN AllocationSize
)
;
/**
Allocates and zeros a buffer of type EfiRuntimeServicesData.
@param AllocationSize The number of bytes to allocate and zero.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateRuntimeZeroPool (
IN UINTN AllocationSize
)
;
/**
Allocates and zeros a buffer of type EfiReservedMemoryType.
@param AllocationSize The number of bytes to allocate and zero.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateReservedZeroPool (
IN UINTN AllocationSize
)
;
/**
Copies a buffer to an allocated buffer of type EfiBootServicesData.
@param AllocationSize The number of bytes to allocate.
@param Buffer The buffer to copy to the allocated buffer.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateCopyPool (
IN UINTN AllocationSize,
IN CONST VOID *Buffer
)
;
/**
Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
@param AllocationSize The number of bytes to allocate.
@param Buffer The buffer to copy to the allocated buffer.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateRuntimeCopyPool (
IN UINTN AllocationSize,
IN CONST VOID *Buffer
)
;
/**
Copies a buffer to an allocated buffer of type EfiReservedMemoryType.
@param AllocationSize The number of bytes to allocate.
@param Buffer The buffer to copy to the allocated buffer.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateReservedCopyPool (
IN UINTN AllocationSize,
IN CONST VOID *Buffer
)
;
/**
Frees a buffer that was previously allocated with one of the pool allocation functions
in the Memory Allocation Library.
@param Buffer Pointer to the buffer to free.
None.
**/
VOID
EFIAPI
FreePool (
IN VOID *Buffer
)
;
/**
Allocates a buffer of type EfiBootServicesData at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedPool (
IN UINTN AllocationSize,
IN UINTN Alignment
)
;
/**
Allocates a buffer of type EfiRuntimeServicesData at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedRuntimePool (
IN UINTN AllocationSize,
IN UINTN Alignment
)
;
/**
Allocates a buffer of type EfiReservedMemoryType at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedReservedPool (
IN UINTN AllocationSize,
IN UINTN Alignment
)
;
/**
Allocates and zeros a buffer of type EfiBootServicesData at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedZeroPool (
IN UINTN AllocationSize,
IN UINTN Alignment
)
;
/**
Allocates and zeros a buffer of type EfiRuntimeServicesData at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedRuntimeZeroPool (
IN UINTN AllocationSize,
IN UINTN Alignment
)
;
/**
Allocates and zeros a buffer of type EfiReservedMemoryType at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedReservedZeroPool (
IN UINTN AllocationSize,
IN UINTN Alignment
)
;
/**
Copies a buffer to an allocated buffer of type EfiBootServicesData at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Buffer The buffer to copy to the allocated buffer.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedCopyPool (
IN UINTN AllocationSize,
IN CONST VOID *Buffer,
IN UINTN Alignment
)
;
/**
Copies a buffer to an allocated buffer of type EfiRuntimeServicesData at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Buffer The buffer to copy to the allocated buffer.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedRuntimeCopyPool (
IN UINTN AllocationSize,
IN CONST VOID *Buffer,
IN UINTN Alignment
)
;
/**
Copies a buffer to an allocated buffer of type EfiReservedMemoryType at a specified alignment.
@param AllocationSize The number of bytes to allocate.
@param Buffer The buffer to copy to the allocated buffer.
@param Alignment The requested alignment of the allocation. Must be a power of two.
If Alignment is zero, then byte alignment is used.
@return
A pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned.
If there is not enough memory remaining to satisfy the request, then NULL is returned.
**/
VOID *
EFIAPI
AllocateAlignedReservedCopyPool (
IN UINTN AllocationSize,
IN CONST VOID *Buffer,
IN UINTN Alignment
)
;
/**
Frees a buffer that was previously allocated with one of the aligned pool allocation functions
in the Memory Allocation Library.
@param Buffer Pointer to the buffer to free.
None.
**/
VOID
EFIAPI
FreeAlignedPool (
IN VOID *Buffer
)
;
#endif

View File

@@ -0,0 +1,690 @@
/** @file
PCD Library Class Interface Declarations
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PcdLib.h
**/
#ifndef __PCD_LIB_H__
#define __PCD_LIB_H__
#define PcdToken(TokenName) _PCD_TOKEN_##TokenName
//
// Feature Flag is in the form of a global constant
//
#define FeaturePcdGet(TokenName) _gPcd_FixedAtBuild_##TokenName
//
// Fixed is fixed at build time
//
#define FixedPcdGet8(TokenName) _gPcd_FixedAtBuild_##TokenName
#define FixedPcdGet16(TokenName) _gPcd_FixedAtBuild_##TokenName
#define FixedPcdGet32(TokenName) _gPcd_FixedAtBuild_##TokenName
#define FixedPcdGet64(TokenName) _gPcd_FixedAtBuild_##TokenName
#define FixedPcdGetBool(TokenName) _gPcd_FixedAtBuild_##TokenName
//
// BugBug: This works for strings, but not constants.
//
#define FixedPcdGetPtr(TokenName) ((VOID *)_gPcd_FixedAtBuild_##TokenName)
//
// (Binary) Patch is in the form of a global variable
//
#define PatchPcdGet8(TokenName) _gPcd_BinaryPatch_##TokenName
#define PatchPcdGet16(TokenName) _gPcd_BinaryPatch_##TokenName
#define PatchPcdGet32(TokenName) _gPcd_BinaryPatch_##TokenName
#define PatchPcdGet64(TokenName) _gPcd_BinaryPatch_##TokenName
#define PatchPcdGetBool(TokenName) _gPcd_BinaryPatch_##TokenName
#define PatchPcdGetPtr(TokenName) ((VOID *)_gPcd_BinaryPatch_##TokenName)
//
// Dynamic is via the protocol with only the TokenNumber as argument
// It can also be Patch or Fixed type based on a build option
//
#define PcdGet8(TokenName) _PCD_MODE_8_##TokenName
#define PcdGet16(TokenName) _PCD_MODE_16_##TokenName
#define PcdGet32(TokenName) _PCD_MODE_32_##TokenName
#define PcdGet64(TokenName) _PCD_MODE_64_##TokenName
#define PcdGetPtr(TokenName) _PCD_MODE_PTR_##TokenName
#define PcdGetBool(TokenName) _PCD_MODE_BOOL_##TokenName
//
// Dynamic Ex is to support binary distribution
//
#define PcdGetEx8(Guid, TokenName) LibPcdGetEx8 (Guid, _PCD_TOKEN_##TokenName)
#define PcdGetEx16(Guid, TokenName) LibPcdGetEx16 (Guid, _PCD_TOKEN_##TokenName)
#define PcdGetEx32(Guid, TokenName) LibPcdGetEx32 (Guid, _PCD_TOKEN_##TokenName)
#define PcdGetEx64(Guid, TokenName) LibPcdGetEx64 (Guid, _PCD_TOKEN_##TokenName)
#define PcdGetExPtr(Guid, TokenName) LibPcdGetExPtr (Guid, _PCD_TOKEN_##TokenName)
#define PcdGetExBool(Guid, TokenName) LibPcdGetExBool (Guid, _PCD_TOKEN_##TokenName)
//
// Dynamic Set
//
#define PcdSet8(TokenName, Value) LibPcdSet8 (_PCD_TOKEN_##TokenName, Value)
#define PcdSet16(TokenName, Value) LibPcdSet16 (_PCD_TOKEN_##TokenName, Value)
#define PcdSet32(TokenName, Value) LibPcdSet32 (_PCD_TOKEN_##TokenName, Value)
#define PcdSet64(TokenName, Value) LibPcdSet64 (_PCD_TOKEN_##TokenName, Value)
#define PcdSetPtr(TokenName, Value) LibPcdSetPtr (_PCD_TOKEN_##TokenName, Value)
#define PcdSetBool(TokenName, Value) LibPcdSetBool(_PCD_TOKEN_##TokenName, Value)
//
// Dynamic Set Ex
//
#define PcdSetEx8 (Guid, TokenName, Value) LibPcdSetEx8 (Guid, _PCD_TOKEN_##TokenName, Value)
#define PcdSetEx16 (Guid, TokenName, Value) LibPcdSetEx16 (Guid, _PCD_TOKEN_##TokenName, Value)
#define PcdSetEx32 (Guid, TokenName, Value) LibPcdSetEx32 (Guid, _PCD_TOKEN_##TokenName, Value)
#define PcdSetEx64 (Guid, TokenName, Value) LibPcdSetEx64 (Guid, _PCD_TOKEN_##TokenName, Value)
#define PcdSetExPtr (Guid, TokenName, Value) LibPcdSetExPtr (Guid, _PCD_TOKEN_##TokenName, Value)
#define PcdSetExBool(Guid, TokenName, Value) LibPcdSetExBool(Guid, _PCD_TOKEN_##TokenName, Value)
/**
Sets the current SKU in the PCD database to the value specified by SkuId. SkuId is returned.
@param[in] SkuId The SKU value that will be used when the PCD service will retrieve and
set values associated with a PCD token.
@retval UINTN Return the SKU ID that just be set.
**/
UINTN
EFIAPI
LibPcdSetSku (
IN UINTN SkuId
);
/**
Returns the 8-bit value for the token specified by TokenNumber.
@param[in] The PCD token number to retrieve a current value for.
@retval UINT8 Returns the 8-bit value for the token specified by TokenNumber.
**/
UINT8
EFIAPI
LibPcdGet8 (
IN UINTN TokenNumber
);
/**
Returns the 16-bit value for the token specified by TokenNumber.
@param[in] The PCD token number to retrieve a current value for.
@retval UINT16 Returns the 16-bit value for the token specified by TokenNumber.
**/
UINT16
EFIAPI
LibPcdGet16 (
IN UINTN TokenNumber
);
/**
Returns the 32-bit value for the token specified by TokenNumber.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.
**/
UINT32
EFIAPI
LibPcdGet32 (
IN UINTN TokenNumber
);
/**
Returns the 64-bit value for the token specified by TokenNumber.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.
**/
UINT64
EFIAPI
LibPcdGet64 (
IN UINTN TokenNumber
);
/**
Returns the pointer to the buffer of the token specified by TokenNumber.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval VOID* Returns the pointer to the token specified by TokenNumber.
**/
VOID *
EFIAPI
LibPcdGetPtr (
IN UINTN TokenNumber
);
/**
Returns the Boolean value of the token specified by TokenNumber.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber.
**/
BOOLEAN
EFIAPI
LibPcdGetBool (
IN UINTN TokenNumber
);
/**
Returns the size of the token specified by TokenNumber.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINTN Returns the size of the token specified by TokenNumber.
**/
UINTN
EFIAPI
LibPcdGetSize (
IN UINTN TokenNumber
);
/**
Returns the 8-bit value for the token specified by TokenNumber and Guid.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINT8 Return the UINT8.
**/
UINT8
EFIAPI
LibPcdGetEx8 (
IN CONST GUID *Guid,
IN UINTN TokenNumber
);
/**
Returns the 16-bit value for the token specified by TokenNumber and Guid.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINT16 Return the UINT16.
**/
UINT16
EFIAPI
LibPcdGetEx16 (
IN CONST GUID *Guid,
IN UINTN TokenNumber
);
/**
Returns the 32-bit value for the token specified by TokenNumber and Guid.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINT32 Return the UINT32.
**/
UINT32
EFIAPI
LibPcdGetEx32 (
IN CONST GUID *Guid,
IN UINTN TokenNumber
);
/**
Returns the 64-bit value for the token specified by TokenNumber and Guid.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINT64 Return the UINT64.
**/
UINT64
EFIAPI
LibPcdGetEx64 (
IN CONST GUID *Guid,
IN UINTN TokenNumber
);
/**
Returns the pointer to the buffer of token specified by TokenNumber and Guid.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval VOID* Return the VOID* pointer.
**/
VOID *
EFIAPI
LibPcdGetExPtr (
IN CONST GUID *Guid,
IN UINTN TokenNumber
);
/**
Returns the Boolean value of the token specified by TokenNumber and Guid.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval BOOLEAN Return the BOOLEAN.
**/
BOOLEAN
EFIAPI
LibPcdGetExBool (
IN CONST GUID *Guid,
IN UINTN TokenNumber
);
/**
Returns the size of the token specified by TokenNumber and Guid.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@param[in] TokenNumber The PCD token number to retrieve a current value for.
@retval UINTN Return the size.
**/
UINTN
EFIAPI
LibPcdGetExSize (
IN CONST GUID *Guid,
IN UINTN TokenNumber
);
/**
Sets the 8-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 8-bit value to set.
@retval UINT8 Return the value been set.
**/
UINT8
EFIAPI
LibPcdSet8 (
IN UINTN TokenNumber,
IN UINT8 Value
);
/**
Sets the 16-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 16-bit value to set.
@retval UINT16 Return the value been set.
**/
UINT16
EFIAPI
LibPcdSet16 (
IN UINTN TokenNumber,
IN UINT16 Value
);
/**
Sets the 32-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 32-bit value to set.
@retval UINT32 Return the value been set.
**/
UINT32
EFIAPI
LibPcdSet32 (
IN UINTN TokenNumber,
IN UINT32 Value
);
/**
Sets the 64-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 64-bit value to set.
@retval UINT64 Return the value been set.
**/
UINT64
EFIAPI
LibPcdSet64 (
IN UINTN TokenNumber,
IN UINT64 Value
);
/**
Sets a buffer for the token specified by TokenNumber to
the value specified by Value. Value is returned.
If Value is NULL, then ASSERT().
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value A pointer to the buffer to set.
@retval VOID* Return the pointer for the buffer been set.
**/
VOID*
EFIAPI
LibPcdSetPtr (
IN UINTN TokenNumber,
IN CONST VOID *Value
);
/**
Sets the Boolean value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The boolean value to set.
@retval BOOLEAN Return the value been set.
**/
BOOLEAN
EFIAPI
LibPcdSetBool (
IN UINTN TokenNumber,
IN BOOLEAN Value
);
/**
Sets the 8-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 8-bit value to set.
@retval UINT8 Return the value been set.
**/
UINT8
EFIAPI
LibPcdSetEx8 (
IN CONST GUID *Guid,
IN UINTN TokenNumber,
IN UINT8 Value
);
/**
Sets the 16-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 16-bit value to set.
@retval UINT8 Return the value been set.
**/
UINT16
EFIAPI
LibPcdSetEx16 (
IN CONST GUID *Guid,
IN UINTN TokenNumber,
IN UINT16 Value
);
/**
Sets the 32-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 32-bit value to set.
@retval UINT32 Return the value been set.
**/
UINT32
EFIAPI
LibPcdSetEx32 (
IN CONST GUID *Guid,
IN UINTN TokenNumber,
IN UINT32 Value
);
/**
Sets the 64-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 64-bit value to set.
@retval UINT64 Return the value been set.
**/
UINT64
EFIAPI
LibPcdSetEx64 (
IN CONST GUID *Guid,
IN UINTN TokenNumber,
IN UINT64 Value
);
/**
Sets a buffer for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
If Guid is NULL, then ASSERT().
If Value is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 8-bit value to set.
@retval VOID * Return the value been set.
**/
VOID *
EFIAPI
LibPcdSetExPtr (
IN CONST GUID *Guid,
IN UINTN TokenNumber,
IN CONST VOID *Value
);
/**
Sets the Boolean value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
If Guid is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The Boolean value to set.
@retval Boolean Return the value been set.
**/
BOOLEAN
EFIAPI
LibPcdSetExBool (
IN CONST GUID *Guid,
IN UINTN TokenNumber,
IN BOOLEAN Value
);
/**
When the token specified by TokenNumber and Guid is set,
then notification function specified by NotificationFunction is called.
If Guid is NULL, then the default token space is used.
If NotificationFunction is NULL, then ASSERT().
@param[in] CallBackGuid The PCD token GUID being set.
@param[in] CallBackToken The PCD token number being set.
@param[in] TokenData A pointer to the token data being set.
@param[in] TokenDataSize The size, in bytes, of the data being set.
@retval VOID
**/
typedef
VOID
(EFIAPI *PCD_CALLBACK) (
IN CONST GUID *CallBackGuid, OPTIONAL
IN UINTN CallBackToken,
IN VOID *TokenData,
IN UINTN TokenDataSize
);
/**
When the token specified by TokenNumber and Guid is set,
then notification function specified by NotificationFunction is called.
If Guid is NULL, then the default token space is used.
If NotificationFunction is NULL, then ASSERT().
@param[in] Guid Pointer to a 128-bit unique value that designates which
namespace to set a value from. If NULL, then the default
token space is used.
@param[in] TokenNumber The PCD token number to monitor.
@param[in] NotificationFunction The function to call when the token
specified by Guid and TokenNumber is set.
@retval VOID
**/
VOID
EFIAPI
LibPcdCallbackOnSet (
IN CONST GUID *Guid, OPTIONAL
IN UINTN TokenNumber,
IN PCD_CALLBACK NotificationFunction
);
/**
Disable a notification function that was established with LibPcdCallbackonSet().
@param[in] Guid Specify the GUID token space.
@param[in] TokenNumber Specify the token number.
@param[in] NotificationFunction The callback function to be unregistered.
@retval VOID
**/
VOID
EFIAPI
LibPcdCancelCallback (
IN CONST GUID *Guid, OPTIONAL
IN UINTN TokenNumber,
IN PCD_CALLBACK NotificationFunction
);
/**
Retrieves the next PCD token number from the token space specified by Guid.
If Guid is NULL, then the default token space is used. If TokenNumber is 0,
then the first token number is returned. Otherwise, the token number that
follows TokenNumber in the token space is returned. If TokenNumber is the last
token number in the token space, then 0 is returned. If TokenNumber is not 0 and
is not in the token space specified by Guid, then ASSERT().
@param[in] Pointer to a 128-bit unique value that designates which namespace
to set a value from. If NULL, then the default token space is used.
@param[in] The previous PCD token number. If 0, then retrieves the first PCD
token number.
@retval UINTN The next valid token number.
**/
UINTN
EFIAPI
LibPcdGetNextToken (
IN CONST GUID *Guid, OPTIONAL
IN UINTN *TokenNumber
);
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,924 @@
/** @file
Functions accessing PCI configuration registers on any supported PCI segment
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PciSegmentLib.h
**/
#ifndef __PCI_SEGMENT_LIB__
#define __PCI_SEGMENT_LIB__
/**
Macro that converts PCI Segment, PCI Bus, PCI Device, PCI Function,
and PCI Register to an address that can be passed to the PCI Segment Library functions.
Computes an address that is compatible with the PCI Segment Library functions.
The unused upper bits of Segment, Bus, Device, Function,
and Register are stripped prior to the generation of the address.
@param Segment PCI Segment number. Range 0..65535.
@param Bus PCI Bus number. Range 0..255.
@param Device PCI Device number. Range 0..31.
@param Function PCI Function number. Range 0..7.
@param Register PCI Register number. Range 0..255 for PCI. Range 0..4095 for PCI Express.
@return The address that is compatible with the PCI Segment Library functions.
**/
#define PCI_SEGMENT_LIB_ADDRESS(Segment,Bus,Device,Function,Register) \
( ((Register) & 0xfff) | \
(((Function) & 0x07) << 12) | \
(((Device) & 0x1f) << 15) | \
(((Bus) & 0xff) << 20) | \
(LShiftU64((Segment) & 0xffff, 32)) \
)
/**
Reads an 8-bit PCI configuration register.
Reads and returns the 8-bit PCI configuration register specified by Address.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@return The 8-bit PCI configuration register specified by Address.
**/
UINT8
EFIAPI
PciSegmentRead8 (
IN UINT64 Address
)
;
/**
Writes an 8-bit PCI configuration register.
Writes the 8-bit PCI configuration register specified by Address with the value specified by Value.
Value is returned. This function must guarantee that all PCI read and write operations are serialized.
If Address > 0x0FFFFFFF, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Value The value to write.
@return The parameter of Value.
**/
UINT8
EFIAPI
PciSegmentWrite8 (
IN UINT64 Address,
IN UINT8 Value
)
;
/**
Performs a bitwise inclusive OR of an 8-bit PCI configuration register with an 8-bit value.
Reads the 8-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 8-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param OrData The value to OR with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT8
EFIAPI
PciSegmentOr8 (
IN UINT64 Address,
IN UINT8 OrData
)
;
/**
Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value.
Reads the 8-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
and writes the result to the 8-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Andata The value to AND with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT8
EFIAPI
PciSegmentAnd8 (
IN UINT64 Address,
IN UINT8 AndData
)
;
/**
Performs a bitwise AND of an 8-bit PCI configuration register with an 8-bit value,
followed a bitwise inclusive OR with another 8-bit value.
Reads the 8-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
performs a bitwise inclusive OR between the result of the AND operation and the value specified by OrData,
and writes the result to the 8-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Andata The value to AND with the PCI configuration register.
@param OrData The value to OR with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT8
EFIAPI
PciSegmentAndThenOr8 (
IN UINT64 Address,
IN UINT8 AndData,
IN UINT8 OrData
)
;
/**
Reads a bit field of a PCI configuration register.
Reads the bit field in an 8-bit PCI configuration register.
The bit field is specified by the StartBit and the EndBit.
The value of the bit field is returned.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@return The value of the bit field.
**/
UINT8
EFIAPI
PciSegmentBitFieldRead8 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit
)
;
/**
Writes a bit field to a PCI configuration register.
Writes Value to the bit field of the PCI configuration register.
The bit field is specified by the StartBit and the EndBit.
All other bits in the destination PCI configuration register are preserved.
The new value of the 8-bit register is returned.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param Value New value of the bit field.
@return The new value of the 8-bit register.
**/
UINT8
EFIAPI
PciSegmentBitFieldWrite8 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 Value
)
;
/**
Reads the 8-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 8-bit PCI configuration register specified by Address.
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param OrData The value to OR with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT8
EFIAPI
PciSegmentBitFieldOr8 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 OrData
)
;
/**
Reads a bit field in an 8-bit PCI configuration, performs a bitwise OR,
and writes the result back to the bit field in the 8-bit port.
Reads the 8-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 8-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
Extra left bits in OrData are stripped.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param AndData The value to AND with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT8
EFIAPI
PciSegmentBitFieldAnd8 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 AndData
)
;
/**
Reads a bit field in an 8-bit PCI configuration register, performs a bitwise AND,
and writes the result back to the bit field in the 8-bit register.
Reads the 8-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
and writes the result to the 8-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
Extra left bits in AndData are stripped.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param AndData The value to AND with the read value from the PCI configuration register.
@param OrData The value to OR with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT8
EFIAPI
PciSegmentBitFieldAndThenOr8 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT8 AndData,
IN UINT8 OrData
)
;
/**
Reads a 16-bit PCI configuration register.
Reads and returns the 16-bit PCI configuration register specified by Address.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@return The 16-bit PCI configuration register specified by Address.
**/
UINT16
EFIAPI
PciSegmentRead16 (
IN UINT64 Address
)
;
/**
Writes a 16-bit PCI configuration register.
Writes the 16-bit PCI configuration register specified by Address with the value specified by Value.
Value is returned. This function must guarantee that all PCI read and write operations are serialized.
If Address > 0x0FFFFFFF, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Value The value to write.
@return The parameter of Value.
**/
UINT16
EFIAPI
PciSegmentWrite16 (
IN UINT64 Address,
IN UINT16 Value
)
;
/**
Performs a bitwise inclusive OR of a 16-bit PCI configuration register with a 16-bit value.
Reads the 16-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 16-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param OrData The value to OR with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT16
EFIAPI
PciSegmentOr16 (
IN UINT64 Address,
IN UINT16 OrData
)
;
/**
Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value.
Reads the 16-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
and writes the result to the 16-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Andata The value to AND with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT16
EFIAPI
PciSegmentAnd16 (
IN UINT64 Address,
IN UINT16 AndData
)
;
/**
Performs a bitwise AND of a 16-bit PCI configuration register with a 16-bit value,
followed a bitwise inclusive OR with another 16-bit value.
Reads the 16-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
performs a bitwise inclusive OR between the result of the AND operation and the value specified by OrData,
and writes the result to the 16-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Andata The value to AND with the PCI configuration register.
@param OrData The value to OR with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT16
EFIAPI
PciSegmentAndThenOr16 (
IN UINT64 Address,
IN UINT16 AndData,
IN UINT16 OrData
)
;
/**
Reads a bit field of a PCI configuration register.
Reads the bit field in a 16-bit PCI configuration register.
The bit field is specified by the StartBit and the EndBit.
The value of the bit field is returned.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@return The value of the bit field.
**/
UINT16
EFIAPI
PciSegmentBitFieldRead16 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit
)
;
/**
Writes a bit field to a PCI configuration register.
Writes Value to the bit field of the PCI configuration register.
The bit field is specified by the StartBit and the EndBit.
All other bits in the destination PCI configuration register are preserved.
The new value of the 16-bit register is returned.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param Value New value of the bit field.
@return The new value of the 16-bit register.
**/
UINT16
EFIAPI
PciSegmentBitFieldWrite16 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 Value
)
;
/**
Reads the 16-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 16-bit PCI configuration register specified by Address.
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param OrData The value to OR with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT16
EFIAPI
PciSegmentBitFieldOr16 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 OrData
)
;
/**
Reads a bit field in a 16-bit PCI configuration, performs a bitwise OR,
and writes the result back to the bit field in the 16-bit port.
Reads the 16-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 16-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
Extra left bits in OrData are stripped.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param AndData The value to AND with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT16
EFIAPI
PciSegmentBitFieldAnd16 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 AndData
)
;
/**
Reads a bit field in a 16-bit PCI configuration register, performs a bitwise AND,
and writes the result back to the bit field in the 16-bit register.
Reads the 16-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
and writes the result to the 16-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
Extra left bits in AndData are stripped.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param AndData The value to AND with the read value from the PCI configuration register.
@param OrData The value to OR with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT16
EFIAPI
PciSegmentBitFieldAndThenOr16 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT16 AndData,
IN UINT16 OrData
)
;
/**
Reads a 32-bit PCI configuration register.
Reads and returns the 32-bit PCI configuration register specified by Address.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@return The 32-bit PCI configuration register specified by Address.
**/
UINT32
EFIAPI
PciSegmentRead32 (
IN UINT64 Address
)
;
/**
Writes a 32-bit PCI configuration register.
Writes the 32-bit PCI configuration register specified by Address with the value specified by Value.
Value is returned. This function must guarantee that all PCI read and write operations are serialized.
If Address > 0x0FFFFFFF, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Value The value to write.
@return The parameter of Value.
**/
UINT32
EFIAPI
PciSegmentWrite32 (
IN UINT64 Address,
IN UINT32 Value
)
;
/**
Performs a bitwise inclusive OR of a 32-bit PCI configuration register with a 32-bit value.
Reads the 32-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 32-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param OrData The value to OR with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT32
EFIAPI
PciSegmentOr32 (
IN UINT64 Address,
IN UINT32 OrData
)
;
/**
Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value.
Reads the 32-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
and writes the result to the 32-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Andata The value to AND with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT32
EFIAPI
PciSegmentAnd32 (
IN UINT64 Address,
IN UINT32 AndData
)
;
/**
Performs a bitwise AND of a 32-bit PCI configuration register with a 32-bit value,
followed a bitwise inclusive OR with another 32-bit value.
Reads the 32-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
performs a bitwise inclusive OR between the result of the AND operation and the value specified by OrData,
and writes the result to the 32-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
If any reserved bits in Address are set, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Andata The value to AND with the PCI configuration register.
@param OrData The value to OR with the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT32
EFIAPI
PciSegmentAndThenOr32 (
IN UINT64 Address,
IN UINT32 AndData,
IN UINT32 OrData
)
;
/**
Reads a bit field of a PCI configuration register.
Reads the bit field in a 32-bit PCI configuration register.
The bit field is specified by the StartBit and the EndBit.
The value of the bit field is returned.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@return The value of the bit field.
**/
UINT32
EFIAPI
PciSegmentBitFieldRead32 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit
)
;
/**
Writes a bit field to a PCI configuration register.
Writes Value to the bit field of the PCI configuration register.
The bit field is specified by the StartBit and the EndBit.
All other bits in the destination PCI configuration register are preserved.
The new value of the 32-bit register is returned.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param Value New value of the bit field.
@return The new value of the 32-bit register.
**/
UINT32
EFIAPI
PciSegmentBitFieldWrite32 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 Value
)
;
/**
Reads the 32-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 32-bit PCI configuration register specified by Address.
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param OrData The value to OR with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT32
EFIAPI
PciSegmentBitFieldOr32 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 OrData
)
;
/**
Reads a bit field in a 32-bit PCI configuration, performs a bitwise OR,
and writes the result back to the bit field in the 32-bit port.
Reads the 32-bit PCI configuration register specified by Address,
performs a bitwise inclusive OR between the read result and the value specified by OrData,
and writes the result to the 32-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
Extra left bits in OrData are stripped.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param AndData The value to AND with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT32
EFIAPI
PciSegmentBitFieldAnd32 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 AndData
)
;
/**
Reads a bit field in a 32-bit PCI configuration register, performs a bitwise AND,
and writes the result back to the bit field in the 32-bit register.
Reads the 32-bit PCI configuration register specified by Address,
performs a bitwise AND between the read result and the value specified by AndData,
and writes the result to the 32-bit PCI configuration register specified by Address.
The value written to the PCI configuration register is returned.
This function must guarantee that all PCI read and write operations are serialized.
Extra left bits in AndData are stripped.
If any reserved bits in Address are set, then ASSERT().
If StartBit is greater than 7, then ASSERT().
If EndBit is greater than 7, then ASSERT().
If EndBit is less than or equal to StartBit, then ASSERT().
@param Address Address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param StartBit The ordinal of the least significant bit in the bit field.
The ordinal of the least significant bit in a byte is bit 0.
@param EndBit The ordinal of the most significant bit in the bit field.
The ordinal of the most significant bit in a byte is bit 7.
@param AndData The value to AND with the read value from the PCI configuration register.
@param OrData The value to OR with the read value from the PCI configuration register.
@return The value written to the PCI configuration register.
**/
UINT32
EFIAPI
PciSegmentBitFieldAndThenOr32 (
IN UINT64 Address,
IN UINTN StartBit,
IN UINTN EndBit,
IN UINT32 AndData,
IN UINT32 OrData
)
;
/**
Reads a range of PCI configuration registers into a caller supplied buffer.
Reads the range of PCI configuration registers specified by StartAddress
and Size into the buffer specified by Buffer.
This function only allows the PCI configuration registers from a single PCI function to be read.
Size is returned.
If any reserved bits in StartAddress are set, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Size Size in bytes of the transfer.
@param Buffer Pointer to a buffer receiving the data read.
@return The paramter of Size.
**/
UINTN
EFIAPI
PciSegmentReadBuffer (
IN UINT64 StartAddress,
IN UINTN Size,
OUT VOID *Buffer
)
;
/**
Copies the data in a caller supplied buffer to a specified range of PCI configuration space.
Writes the range of PCI configuration registers specified by StartAddress
and Size from the buffer specified by Buffer.
This function only allows the PCI configuration registers from a single PCI function to be written.
Size is returned.
If any reserved bits in StartAddress are set, then ASSERT().
If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().
If (StartAddress + Size - 1) > 0x0FFFFFFF, then ASSERT().
If Buffer is NULL, then ASSERT().
@param StartAddress Starting address that encodes the PCI Segment, Bus, Device, Function, and Register.
@param Size Size in bytes of the transfer.
@param Buffer Pointer to a buffer containing the data to write.
@return The paramter of Size.
**/
UINTN
EFIAPI
PciSegmentWriteBuffer (
IN UINT64 StartAddress,
IN UINTN Size,
IN VOID *Buffer
)
;
#endif

View File

@@ -0,0 +1,39 @@
/** @file
Memory Only PE COFF loader
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PeCoffGetEntryPointLib.h
**/
#ifndef __PE_COFF_GET_ENTRY_POINT_LIB_H__
#define __PE_COFF_GET_ENTRY_POINT_LIB_H__
/**
Loads a PE/COFF image into memory
@param Pe32Data Pointer to a PE/COFF Image
@param EntryPoint Pointer to the entry point of the PE/COFF image
@retval EFI_SUCCESS if the EntryPoint was returned
@retval EFI_INVALID_PARAMETER if the EntryPoint could not be found from Pe32Data
**/
RETURN_STATUS
EFIAPI
PeCoffLoaderGetEntryPoint (
IN VOID *Pe32Data,
IN OUT VOID **EntryPoint
)
;
#endif

View File

@@ -0,0 +1,131 @@
/** @file
Memory Only PE COFF loader
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PeCoffLib.h
**/
#ifndef __BASE_PE_COFF_LIB_H__
#define __BASE_PE_COFF_LIB_H__
//
// Return status codes from the PE/COFF Loader services
// BUGBUG: Find where used and see if can be replaced by RETURN_STATUS codes
//
#define IMAGE_ERROR_SUCCESS 0
#define IMAGE_ERROR_IMAGE_READ 1
#define IMAGE_ERROR_INVALID_PE_HEADER_SIGNATURE 2
#define IMAGE_ERROR_INVALID_MACHINE_TYPE 3
#define IMAGE_ERROR_INVALID_SUBSYSTEM 4
#define IMAGE_ERROR_INVALID_IMAGE_ADDRESS 5
#define IMAGE_ERROR_INVALID_IMAGE_SIZE 6
#define IMAGE_ERROR_INVALID_SECTION_ALIGNMENT 7
#define IMAGE_ERROR_SECTION_NOT_LOADED 8
#define IMAGE_ERROR_FAILED_RELOCATION 9
#define IMAGE_ERROR_FAILED_ICACHE_FLUSH 10
//
// PE/COFF Loader Read Function passed in by caller
//
typedef
RETURN_STATUS
(EFIAPI *PE_COFF_LOADER_READ_FILE) (
IN VOID *FileHandle,
IN UINTN FileOffset,
IN OUT UINTN *ReadSize,
OUT VOID *Buffer
);
//
// Context structure used while PE/COFF image is being loaded and relocated
//
typedef struct {
PHYSICAL_ADDRESS ImageAddress;
UINT64 ImageSize;
PHYSICAL_ADDRESS DestinationAddress;
PHYSICAL_ADDRESS EntryPoint;
PE_COFF_LOADER_READ_FILE ImageRead;
VOID *Handle;
VOID *FixupData;
UINT32 SectionAlignment;
UINT32 PeCoffHeaderOffset;
UINT32 DebugDirectoryEntryRva;
VOID *CodeView;
CHAR8 *PdbPointer;
UINTN SizeOfHeaders;
UINT32 ImageCodeMemoryType;
UINT32 ImageDataMemoryType;
UINT32 ImageError;
UINTN FixupDataSize;
UINT16 Machine;
UINT16 ImageType;
BOOLEAN RelocationsStripped;
BOOLEAN IsTeImage;
} PE_COFF_LOADER_IMAGE_CONTEXT;
/**
Retrieves information on a PE/COFF image
@param ImageContext The context of the image being loaded
@retval EFI_SUCCESS The information on the PE/COFF image was collected.
@retval EFI_INVALID_PARAMETER ImageContext is NULL.
@retval EFI_UNSUPPORTED The PE/COFF image is not supported.
@retval Otherwise The error status from reading the PE/COFF image using the
ImageContext->ImageRead() function
**/
RETURN_STATUS
EFIAPI
PeCoffLoaderGetImageInfo (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
;
/**
Relocates a PE/COFF image in memory
@param ImageContext Contains information on the loaded image to relocate
@retval EFI_SUCCESS if the PE/COFF image was relocated
@retval EFI_LOAD_ERROR if the image is not a valid PE/COFF image
@retval EFI_UNSUPPORTED not support
**/
RETURN_STATUS
EFIAPI
PeCoffLoaderRelocateImage (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
;
/**
Loads a PE/COFF image into memory
@param ImageContext Contains information on image to load into memory
@retval EFI_SUCCESS if the PE/COFF image was loaded
@retval EFI_BUFFER_TOO_SMALL if the caller did not provide a large enough buffer
@retval EFI_LOAD_ERROR if the image is a runtime driver with no relocations
@retval EFI_INVALID_PARAMETER if the image address is invalid
**/
RETURN_STATUS
EFIAPI
PeCoffLoaderLoadImage (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
)
;
#endif

View File

@@ -0,0 +1,50 @@
/** @file
Entry point to the PEI Core
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __MODULE_ENTRY_POINT_H__
#define __MODULE_ENTRY_POINT_H__
/**
Call constructs for all libraries. Automatics Generated by tool.
@param FfsHeader Pointer to header of FFS.
@param PeiServices Pointer to the PEI Services Table.
**/
VOID
EFIAPI
ProcessLibraryConstructorList (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
);
/**
Call the list of driver entry points. Automatics Generated by tool.
@param PeiStartupDescriptor Pointer to startup information .
@param OldCoreData Pointer to Original startup information.
@return Status returned by entry points of drivers.
**/
EFI_STATUS
EFIAPI
ProcessModuleEntryPointList (
IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,
IN VOID *OldCoreData
);
#endif

View File

@@ -0,0 +1,306 @@
/** @file
PEI Core Library implementation
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PeiCoreLib.h
**/
#ifndef __PEI_CORE_LIB_H__
#define __PEI_CORE_LIB_H__
/**
This service enables a given PEIM to register an interface into the PEI Foundation.
@param PpiList A pointer to the list of interfaces that the caller shall install.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
**/
EFI_STATUS
EFIAPI
PeiCoreInstallPpi (
IN EFI_PEI_PPI_DESCRIPTOR *PpiList
)
;
/**
This service enables PEIMs to replace an entry in the PPI database with an alternate entry.
@param OldPpi Pointer to the old PEI PPI Descriptors.
@param NewPpi Pointer to the new PEI PPI Descriptors.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have
the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
@retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.
**/
EFI_STATUS
EFIAPI
PeiCoreReinstallPpi (
IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
)
;
/**
This service enables PEIMs to discover a given instance of an interface.
@param Guid A pointer to the GUID whose corresponding interface needs to be found.
@param Instance The N-th instance of the interface that is required.
@param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
@param Ppi A pointer to the instance of the interface.
@retval EFI_SUCCESS The interface was successfully returned.
@retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
**/
EFI_STATUS
EFIAPI
PeiCoreLocatePpi (
IN EFI_GUID *Guid,
IN UINTN Instance,
IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
IN OUT VOID **Ppi
)
;
/**
This service enables PEIMs to register a given service to be invoked
when another service is installed or reinstalled.
@param NotifyList A pointer to the list of notification interfaces that the caller shall install.
@retval EFI_SUCCESS The interface was successfully installed.
@retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.
@retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have
the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.
@retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
**/
EFI_STATUS
EFIAPI
PeiCoreNotifyPpi (
IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
)
;
/**
This service enables PEIMs to ascertain the present value of the boot mode.
@param BootMode A pointer to contain the value of the boot mode.
@retval EFI_SUCCESS The boot mode was returned successfully.
@retval EFI_INVALID_PARAMETER BootMode is NULL.
**/
EFI_STATUS
EFIAPI
PeiCoreGetBootMode (
IN OUT EFI_BOOT_MODE *BootMode
)
;
/**
This service enables PEIMs to update the boot mode variable.
@param BootMode The value of the boot mode to set.
@retval EFI_SUCCESS The value was successfully updated
**/
EFI_STATUS
EFIAPI
PeiCoreSetBootMode (
IN EFI_BOOT_MODE BootMode
)
;
/**
This service enables a PEIM to ascertain the address of the list of HOBs in memory.
@param HobList A pointer to the list of HOBs that the PEI Foundation will initialize.
@retval EFI_SUCCESS The list was successfully returned.
@retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
**/
EFI_STATUS
EFIAPI
PeiCoreGetHobList (
IN OUT VOID **HobList
)
;
/**
This service enables PEIMs to create various types of HOBs.
@param Type The type of HOB to be installed.
@param Length The length of the HOB to be added.
@param Hob The address of a pointer that will contain the HOB header.
@retval EFI_SUCCESS The HOB was successfully created.
@retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
**/
EFI_STATUS
EFIAPI
PeiCoreCreateHob (
IN UINT16 Type,
IN UINT16 Length,
IN OUT VOID **Hob
)
;
/**
This service enables PEIMs to discover additional firmware volumes.
@param Instance This instance of the firmware volume to find.
The value 0 is the Boot Firmware Volume (BFV).
@param FwVolHeader Pointer to the firmware volume header of the volume to return.
@retval EFI_SUCCESS The volume was found.
@retval EFI_NOT_FOUND The volume was not found.
@retval EFI_INVALID_PARAMETER FwVolHeader is NULL.
**/
EFI_STATUS
EFIAPI
PeiCoreFfsFindNextVolume (
IN UINTN Instance,
IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
)
;
/**
This service enables PEIMs to discover additional firmware files.
@param SearchType A filter to find files only of this type.
@param FwVolHeader Pointer to the firmware volume header of the volume to search.
This parameter must point to a valid FFS volume.
@param FileHeader Pointer to the current file from which to begin searching.
@retval EFI_SUCCESS The file was found.
@retval EFI_NOT_FOUND The file was not found.
@retval EFI_NOT_FOUND The header checksum was not zero.
**/
EFI_STATUS
EFIAPI
PeiCoreFfsFindNextFile (
IN EFI_FV_FILETYPE SearchType,
IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
IN OUT EFI_FFS_FILE_HEADER **FileHeader
)
;
/**
This service enables PEIMs to discover sections of a given type within a valid FFS file.
@param SearchType The value of the section type to find.
@param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
@param SectionData A pointer to the discovered section, if successful.
@retval EFI_SUCCESS The section was found.
@retval EFI_NOT_FOUND The section was not found.
**/
EFI_STATUS
EFIAPI
PeiCoreFfsFindSectionData (
IN EFI_SECTION_TYPE SectionType,
IN EFI_FFS_FILE_HEADER *FfsFileHeader,
IN OUT VOID **SectionData
)
;
/**
This service enables PEIMs to register the permanent memory configuration
that has been initialized with the PEI Foundation.
@param MemoryBegin The value of a region of installed memory.
@param MemoryLength The corresponding length of a region of installed memory.
@retval EFI_SUCCESS The region was successfully installed in a HOB.
@retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
@retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
**/
EFI_STATUS
EFIAPI
PeiCoreInstallPeiMemory (
IN EFI_PHYSICAL_ADDRESS MemoryBegin,
IN UINT64 MemoryLength
)
;
/**
This service enables PEIMs to allocate memory after the permanent memory has been installed by a PEIM.
@param MemoryType Type of memory to allocate.
@param Pages Number of pages to allocate.
@param Memory Pointer of memory allocated.
@retval EFI_SUCCESS The memory range was successfully allocated.
@retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
@retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.
@retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
**/
EFI_STATUS
EFIAPI
PeiCoreAllocatePages (
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT EFI_PHYSICAL_ADDRESS *Memory
)
;
/**
This service allocates memory from the Hand-Off Block (HOB) heap.
@param Size The number of bytes to allocate from the pool.
@param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer;
undefined otherwise.
@retval EFI_SUCCESS The allocation was successful
@retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
**/
EFI_STATUS
EFIAPI
PeiCoreAllocatePool (
IN UINTN Size,
OUT VOID **Buffer
)
;
/**
This service resets the entire platform, including all processors and devices, and reboots the system.
@retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
**/
EFI_STATUS
EFIAPI
PeiCoreResetSystem (
VOID
)
;
#endif

View File

@@ -0,0 +1,26 @@
/** @file
PEI Services Table Pointer Library services
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PeiServicesTablePointerLib.h
**/
#ifndef __PEI_SERVICES_TABLE_POINTER_LIB_H__
#define __PEI_SERVICES_TABLE_POINTER_LIB_H__
EFI_PEI_SERVICES **
GetPeiServicesTablePointer (
VOID
);
#endif

View File

@@ -0,0 +1,103 @@
/** @file
Entry point to a PEIM
Copyright (c) 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __MODULE_ENTRY_POINT_H__
#define __MODULE_ENTRY_POINT_H__
//
// Declare the EFI/UEFI Specification Revision to which this driver is implemented
//
extern const UINT32 _gPeimRevision;
/**
Image entry point of Peim.
@param FfsHeader Pointer to FFS header the loaded driver.
@param PeiServices Pointer to the PEI services.
@return Status returned by entry points of Peims.
**/
EFI_STATUS
EFIAPI
_ModuleEntryPoint (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
);
/**
Wrapper of Peim image entry point.
@param FfsHeader Pointer to FFS header the loaded driver.
@param PeiServices Pointer to the PEI services.
@return Status returned by entry points of Peims.
**/
EFI_STATUS
EFIAPI
EfiMain (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
);
/**
Call constructs for all libraries. Automatics Generated by tool.
@param FfsHeader Pointer to FFS header the loaded driver.
@param PeiServices Pointer to the PEI services.
**/
VOID
EFIAPI
ProcessLibraryConstructorList (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
);
/**
Call destructors for all libraries. Automatics Generated by tool.
@param FfsHeader Pointer to FFS header the loaded driver.
@param PeiServices Pointer to the PEI services.
**/
VOID
EFIAPI
ProcessLibraryDestructorList (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
);
/**
Call the list of driver entry points. Automatics Generated by tool.
@param FfsHeader Pointer to FFS header the loaded driver.
@param PeiServices Pointer to the PEI services.
@return Status returned by entry points of drivers.
**/
EFI_STATUS
EFIAPI
ProcessModuleEntryPointList (
IN EFI_FFS_FILE_HEADER *FfsHeader,
IN EFI_PEI_SERVICES **PeiServices
);
#endif

View File

@@ -0,0 +1,201 @@
/** @file
Library that provides services to measure module execution performance
Copyright (c) 2004, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PerformanceLib.h
**/
#ifndef __PERFORMANCE_LIB_H__
#define __PERFORMANCE_LIB_H__
//
// Performance library propery mask bits
//
#define PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED 0x00000001
/**
Creates a record for the beginning of a performance measurement.
Creates a record that contains the Handle, Token, and Module.
If TimeStamp is not zero, then TimeStamp is added to the record as the start time.
If TimeStamp is zero, then this function reads the current time stamp
and adds that time stamp value to the record as the start time.
@param Handle Pointer to environment specific context used
to identify the component being measured.
@param Token Pointer to a Null-terminated ASCII string
that identifies the component being measured.
@param Module Pointer to a Null-terminated ASCII string
that identifies the module being measured.
@param TimeStamp 64-bit time stamp.
@retval RETURN_SUCCESS The start of the measurement was recorded.
@retval RETURN_OUT_OF_RESOURCES There are not enough resources to record the measurement.
**/
RETURN_STATUS
EFIAPI
StartPerformanceMeasurement (
IN CONST VOID *Handle, OPTIONAL
IN CONST CHAR8 *Token, OPTIONAL
IN CONST CHAR8 *Module, OPTIONAL
IN UINT64 TimeStamp
);
/**
Fills in the end time of a performance measurement.
Looks up the record that matches Handle, Token, and Module.
If the record can not be found then return RETURN_NOT_FOUND.
If the record is found and TimeStamp is not zero,
then TimeStamp is added to the record as the end time.
If the record is found and TimeStamp is zero, then this function reads
the current time stamp and adds that time stamp value to the record as the end time.
If this function is called multiple times for the same record, then the end time is overwritten.
@param Handle Pointer to environment specific context used
to identify the component being measured.
@param Token Pointer to a Null-terminated ASCII string
that identifies the component being measured.
@param Module Pointer to a Null-terminated ASCII string
that identifies the module being measured.
@param TimeStamp 64-bit time stamp.
@retval RETURN_SUCCESS The end of the measurement was recorded.
@retval RETURN_NOT_FOUND The specified measurement record could not be found.
**/
RETURN_STATUS
EFIAPI
EndPerformanceMeasurement (
IN CONST VOID *Handle, OPTIONAL
IN CONST CHAR8 *Token, OPTIONAL
IN CONST CHAR8 *Module, OPTIONAL
IN UINT64 TimeStamp
);
/**
Retrieves a previously logged performance measurement.
Looks up the record that matches Handle, Token, and Module.
If the record can not be found then return RETURN_NOT_FOUND.
If the record is found then the start of the measurement is returned in StartTimeStamp,
and the end of the measurement is returned in EndTimeStamp.
@param LogEntryKey The key for the previous performance measurement log entry.
If 0, then the first performance measurement log entry is retrieved.
@param Handle Pointer to environment specific context used
to identify the component being measured.
@param Token Pointer to a Null-terminated ASCII string
that identifies the component being measured.
@param Module Pointer to a Null-terminated ASCII string
that identifies the module being measured.
@param StartTimeStamp The 64-bit time stamp that was recorded when the measurement was started.
@param EndTimeStamp The 64-bit time stamp that was recorded when the measurement was ended.
@return The key for the current performance log entry.
**/
UINTN
EFIAPI
GetPerformanceMeasurement (
UINTN LogEntryKey,
OUT CONST VOID **Handle,
OUT CONST CHAR8 **Token,
OUT CONST CHAR8 **Module,
OUT UINT64 *StartTimeStamp,
OUT UINT64 *EndTimeStamp
);
/**
Returns TRUE if the performance measurement macros are enabled.
This function returns TRUE if the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
PcdPerformanceLibraryPropertyMask is set. Otherwise FALSE is returned.
@retval TRUE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
PcdPerformanceLibraryPropertyMask is set.
@retval FALSE The PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of
PcdPerformanceLibraryPropertyMask is clear.
**/
BOOLEAN
EFIAPI
PerformanceMeasurementEnabled (
VOID
);
/**
Macro that calls EndPerformanceMeasurement().
If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
then EndPerformanceMeasurement() is called.
**/
#define PERF_END(Handle, Token, Module, TimeStamp) \
do { \
if (PerformanceMeasurementEnabled ()) { \
EndPerformanceMeasurement (Handle, Token, Module, TimeStamp); \
} \
} while (FALSE)
/**
Macro that calls StartPerformanceMeasurement().
If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
then StartPerformanceMeasurement() is called.
**/
#define PERF_START(Handle, Token, Module, TimeStamp) \
do { \
if (PerformanceMeasurementEnabled ()) { \
StartPerformanceMeasurement (Handle, Token, Module, TimeStamp); \
} \
} while (FALSE)
/**
Macro that marks the beginning of performance measurement source code.
If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
then this macro marks the beginning of source code that is included in a module.
Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module.
**/
#define PERF_CODE_BEGIN() do { if (PerformanceMeasurementEnabled ()) { UINT8 __PerformanceCodeLocal
/**
Macro that marks the end of performance measurement source code.
If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
then this macro marks the end of source code that is included in a module.
Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module.
**/
#define PERF_CODE_END() __PerformanceCodeLocal = 0; } } while (FALSE)
/**
Macro that declares a section of performance measurement source code.
If the PERFORMANCE_LIBRARY_PROPERTY_MEASUREMENT_ENABLED bit of PcdPerformanceLibraryPropertyMask is set,
then the source code specified by Expression is included in a module.
Otherwise, the source specified by Expression is not included in a module.
@param Expression Performance measurement source code to include in a module.
**/
#define PERF_CODE(Expression) \
PERF_CODE_BEGIN (); \
Expression \
PERF_CODE_END ()
#endif

View File

@@ -0,0 +1,116 @@
/** @file
Library that provides print services
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: PrintLib.h
**/
#ifndef __PRINT_LIB_H__
#define __PRINT_LIB_H__
//
// Print primitives
//
#define LEFT_JUSTIFY 0x01
#define COMMA_TYPE 0x08
#define PREFIX_ZERO 0x20
UINTN
EFIAPI
UnicodeVSPrint (
OUT CHAR16 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR16 *FormatString,
IN VA_LIST Marker
);
UINTN
EFIAPI
UnicodeSPrint (
OUT CHAR16 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR16 *FormatString,
...
);
UINTN
EFIAPI
UnicodeVSPrintAsciiFormat (
OUT CHAR16 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR8 *FormatString,
IN VA_LIST Marker
);
UINTN
EFIAPI
UnicodeSPrintAsciiFormat (
OUT CHAR16 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR8 *FormatString,
...
);
UINTN
EFIAPI
AsciiVSPrint (
OUT CHAR8 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR8 *FormatString,
IN VA_LIST Marker
);
UINTN
EFIAPI
AsciiSPrint (
OUT CHAR8 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR8 *FormatString,
...
);
UINTN
EFIAPI
AsciiVSPrintUnicodeFormat (
OUT CHAR8 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR16 *FormatString,
IN VA_LIST Marker
);
UINTN
EFIAPI
AsciiSPrintUnicodeFormat (
OUT CHAR8 *StartOfBuffer,
IN UINTN BufferSize,
IN CONST CHAR16 *FormatString,
...
);
UINTN
UnicodeValueToString (
IN OUT CHAR16 *Buffer,
IN UINTN Flags,
IN INT64 Value,
IN UINTN Width
);
UINTN
AsciiValueToString (
IN OUT CHAR8 *Buffer,
IN UINTN Flags,
IN INT64 Value,
IN UINTN Width
);
#endif

View File

@@ -0,0 +1,763 @@
/** @file
Report Status Code Library public .h file
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __REPORT_STATUS_CODE_LIB_H__
#define __REPORT_STATUS_CODE_LIB_H__
//
// Declare bits for PcdReportStatusCodePropertyMask
//
#define REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED 0x00000001
#define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x00000002
#define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x00000004
#define REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED 0x00000008
#define REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED 0x00000010
//
// Extended Data structure definitions with EFI_STATUS_CODE_DATA headers removed
//
///
/// Voltage Extended Error Data
///
typedef struct {
EFI_EXP_BASE10_DATA Voltage;
EFI_EXP_BASE10_DATA Threshold;
} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;
///
/// Microcode Update Extended Error Data
///
typedef struct {
UINT32 Version;
} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;
///
/// Asynchronous Timer Extended Error Data
///
typedef struct {
EFI_EXP_BASE10_DATA TimerLimit;
} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;
///
/// Host Processor Mismatch Extended Error Data
///
typedef struct {
UINT32 Instance;
UINT16 Attributes;
} REPORT_STATUS_CODE_LIBRARY_HOST_PROCESSOR_MISMATCH_ERROR_DATA;
///
/// Thermal Extended Error Data
///
typedef struct {
EFI_EXP_BASE10_DATA Temperature;
EFI_EXP_BASE10_DATA Threshold;
} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_THERMAL_ERROR_DATA;
///
/// Processor Disabled Extended Error Data
///
typedef struct {
UINT32 Cause;
BOOLEAN SoftwareDisabled;
} REPORT_STATUS_CODE_LIBRARY_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;
///
/// Embedded cache init extended data
///
typedef struct {
UINT32 Level;
EFI_INIT_CACHE_TYPE Type;
} REPORT_STATUS_CODE_LIBRARY_CACHE_INIT_DATA;
///
/// Memory Extended Error Data
///
typedef struct {
EFI_MEMORY_ERROR_GRANULARITY Granularity;
EFI_MEMORY_ERROR_OPERATION Operation;
UINTN Syndrome;
EFI_PHYSICAL_ADDRESS Address;
UINTN Resolution;
} REPORT_STATUS_CODE_LIBRARY_MEMORY_EXTENDED_ERROR_DATA;
///
/// DIMM number
///
typedef struct {
UINT16 Array;
UINT16 Device;
} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_DIMM_NUMBER;
///
/// Memory Module Mismatch Extended Error Data
///
typedef struct {
EFI_STATUS_CODE_DIMM_NUMBER Instance;
} REPORT_STATUS_CODE_LIBRARY_MEMORY_MODULE_MISMATCH_ERROR_DATA;
///
/// Memory Range Extended Data
///
typedef struct {
EFI_PHYSICAL_ADDRESS Start;
EFI_PHYSICAL_ADDRESS Length;
} REPORT_STATUS_CODE_LIBRARY_MEMORY_RANGE_EXTENDED_DATA;
///
/// Device handle Extended Data. Used for many
/// errors and progress codes to point to the device.
///
typedef struct {
EFI_HANDLE Handle;
} REPORT_STATUS_CODE_LIBRARY_DEVICE_HANDLE_EXTENDED_DATA;
typedef struct {
UINT8 *DevicePath;
} REPORT_STATUS_CODE_LIBRARY_DEVICE_PATH_EXTENDED_DATA;
typedef struct {
EFI_HANDLE ControllerHandle;
EFI_HANDLE DriverBindingHandle;
UINT16 DevicePathSize;
UINT8 *RemainingDevicePath;
} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_START_EXTENDED_DATA;
///
/// Resource Allocation Failure Extended Error Data
///
typedef struct {
UINT32 Bar;
UINT16 DevicePathSize;
UINT16 ReqResSize;
UINT16 AllocResSize;
UINT8 *DevicePath;
UINT8 *ReqRes;
UINT8 *AllocRes;
} REPORT_STATUS_CODE_LIBRARY_RESOURCE_ALLOC_FAILURE_ERROR_DATA;
///
/// Extended Error Data for Assert
///
typedef struct {
UINT32 LineNumber;
UINT32 FileNameSize;
EFI_STATUS_CODE_STRING_DATA *FileName;
} REPORT_STATUS_CODE_LIBRARY_DEBUG_ASSERT_DATA;
///
/// System Context Data EBC/IA32/IPF
///
typedef struct {
EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT Context;
} REPORT_STATUS_CODE_LIBRARY_STATUS_CODE_EXCEP_EXTENDED_DATA;
///
/// Legacy Oprom extended data
///
typedef struct {
EFI_HANDLE DeviceHandle;
EFI_PHYSICAL_ADDRESS RomImageBase;
} REPORT_STATUS_CODE_LIBRARY_LEGACY_OPROM_EXTENDED_DATA;
//
// Extern for the modules Caller ID GUID
//
extern EFI_GUID gEfiCallerIdGuid;
/**
Converts a status code to an 8-bit POST code value.
Converts the status code specified by CodeType and Value to an 8-bit POST code
and returns the 8-bit POST code in PostCode. If CodeType is an
EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode
are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits
24..26 of Value., and TRUE is returned. Otherwise, FALSE is returned.
If PostCode is NULL, then ASSERT().
@param CodeType The type of status code being converted.
@param Value The status code value being converted.
@param PostCode A pointer to the 8-bit POST code value to return.
@retval TRUE The status code specified by CodeType and Value was converted
to an 8-bit POST code and returned in PostCode.
@retval FALSE The status code specified by CodeType and Value could not be
converted to an 8-bit POST code value.
**/
BOOLEAN
EFIAPI
CodeTypeToPostCode (
IN EFI_STATUS_CODE_TYPE CodeType,
IN EFI_STATUS_CODE_VALUE Value,
OUT UINT8 *PostCode
);
/**
Extracts ASSERT() information from a status code structure.
Converts the status code specified by CodeType, Value, and Data to the ASSERT()
arguments specified by Filename, Description, and LineNumber. If CodeType is
an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and
Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract
Filename, Description, and LineNumber from the optional data area of the
status code buffer specified by Data. The optional data area of Data contains
a Null-terminated ASCII string for the FileName, followed by a Null-terminated
ASCII string for the Description, followed by a 32-bit LineNumber. If the
ASSERT() information could be extracted from Data, then return TRUE.
Otherwise, FALSE is returned.
If Data is NULL, then ASSERT().
If Filename is NULL, then ASSERT().
If Description is NULL, then ASSERT().
If LineNumber is NULL, then ASSERT().
@param CodeType The type of status code being converted.
@param Value The status code value being converted.
@param Data Pointer to status code data buffer.
@param Filename Pointer to the source file name that generated the ASSERT().
@param Description Pointer to the description of the ASSERT().
@param LineNumber Pointer to source line number that generated the ASSERT().
@retval TRUE The status code specified by CodeType, Value, and Data was
converted ASSERT() arguments specified by Filename, Description,
and LineNumber.
@retval FALSE The status code specified by CodeType, Value, and Data could
not be converted to ASSERT() arguments.
**/
BOOLEAN
EFIAPI
ReportStatusCodeExtractAssertInfo (
IN EFI_STATUS_CODE_TYPE CodeType,
IN EFI_STATUS_CODE_VALUE Value,
IN EFI_STATUS_CODE_DATA *Data,
OUT CHAR8 **Filename,
OUT CHAR8 **Description,
OUT UINT32 *LineNumber
);
/**
Extracts DEBUG() information from a status code structure.
Converts the status code specified by Data to the DEBUG() arguments specified
by ErrorLevel, Marker, and Format. If type GUID in Data is
EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and
Format from the optional data area of the status code buffer specified by Data.
The optional data area of Data contains a 32-bit ErrorLevel followed by Marker
which is 12 UINTN parameters, followed by a Null-terminated ASCII string for
the Format. If the DEBUG() information could be extracted from Data, then
return TRUE. Otherwise, FALSE is returned.
If Data is NULL, then ASSERT().
If ErrorLevel is NULL, then ASSERT().
If Marker is NULL, then ASSERT().
If Format is NULL, then ASSERT().
@param Data Pointer to status code data buffer.
@param ErrorLevel Pointer to error level mask for a debug message.
@param Marker Pointer to the variable argument list associated with Format.
@param Format Pointer to a Null-terminated ASCII format string of a
debug message.
@retval TRUE The status code specified by Data was converted DEBUG() arguments
specified by ErrorLevel, Marker, and Format.
@retval FALSE The status code specified by Data could not be converted to
DEBUG() arguments.
**/
BOOLEAN
EFIAPI
ReportStatusCodeExtractDebugInfo (
IN EFI_STATUS_CODE_DATA *Data,
OUT UINT32 *ErrorLevel,
OUT VA_LIST *Marker,
OUT CHAR8 **Format
);
/**
Reports a status code.
Reports the status code specified by the parameters Type and Value. Status
code also require an instance, caller ID, and extended data. This function
passed in a zero instance, NULL extended data, and a caller ID of
gEfiCallerIdGuid, which is the GUID for the module.
ReportStatusCode()must actively prevent recusrsion. If ReportStatusCode()
is called while processing another any other Report Status Code Library function,
then ReportStatusCode() must return immediately.
@param Type Status code type.
@param Value Status code value.
@retval EFI_SUCCESS The status code was reported.
@retval EFI_DEVICE_ERROR There status code could not be reported due to a
device error.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
EFI_STATUS
EFIAPI
ReportStatusCode (
IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value
);
/**
Reports a status code with a Device Path Protocol as the extended data.
Allocates and fills in the extended data section of a status code with the
Device Path Protocol specified by DevicePath. This function is responsible
for allocating a buffer large enough for the standard header and the device
path. The standard header is filled in with a GUID of
gEfiStatusCodeSpecificDataGuid. The status code is reported with a zero
instance and a caller ID of gEfiCallerIdGuid.
ReportStatusCodeWithDevicePath()must actively prevent recursion. If
ReportStatusCodeWithDevicePath() is called while processing another any other
Report Status Code Library function, then ReportStatusCodeWithDevicePath()
must return EFI_DEVICE_ERROR immediately.
If DevicePath is NULL, then ASSERT().
@param Type Status code type.
@param Value Status code value.
@param DevicePath Pointer to the Device Path Protocol to be reported.
@retval EFI_SUCCESS The status code was reported with the extended
data specified by DevicePath.
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
extended data section.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
EFI_STATUS
EFIAPI
ReportStatusCodeWithDevicePath (
IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value,
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
);
/**
Reports a status code with an extended data buffer.
Allocates and fills in the extended data section of a status code with the
extended data specified by ExtendedData and ExtendedDataSize. ExtendedData
is assumed to be one of the data structures specified in Related Definitions.
These data structure do not have the standard header, so this function is
responsible for allocating a buffer large enough for the standard header and
the extended data passed into this function. The standard header is filled
in with a GUID of gEfiStatusCodeSpecificDataGuid. The status code is reported
with a zero instance and a caller ID of gEfiCallerIdGuid.
ReportStatusCodeWithExtendedData()must actively prevent recursion. If
ReportStatusCodeWithExtendedData() is called while processing another any other
Report Status Code Library function, then ReportStatusCodeWithExtendedData()
must return EFI_DEVICE_ERROR immediately.
If ExtendedData is NULL, then ASSERT().
If ExtendedDataSize is 0, then ASSERT().
@param Type Status code type.
@param Value Status code value.
@param ExtendedData Pointer to the extended data buffer to be reported.
@param ExtendedDataSize The size, in bytes, of the extended data buffer to
be reported.
@retval EFI_SUCCESS The status code was reported with the extended
data specified by ExtendedData and ExtendedDataSize.
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
extended data section.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
EFI_STATUS
EFIAPI
ReportStatusCodeWithExtendedData (
IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value,
IN VOID *ExtendedData,
IN UINTN ExtendedDataSize
);
/**
Reports a status code with full parameters.
The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
is 0, then an extended data buffer is not reported. If ExtendedData is not
NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
ExtendedData is assumed not have the standard status code header, so this function
is responsible for allocating a buffer large enough for the standard header and
the extended data passed into this function. The standard header is filled in
with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
an instance specified by Instance and a caller ID specified by CallerId. If
CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
is called while processing another any other Report Status Code Library function,
then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
@param Type Status code type.
@param Value Status code value.
@param Instance Status code instance number.
@param CallerId Pointer to a GUID that identifies the caller of this
function. If this parameter is NULL, then a caller
ID of gEfiCallerIdGuid is used.
@param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
If this parameter is NULL, then a the status code
standard header is filled in with
gEfiStatusCodeSpecificDataGuid.
@param ExtendedData Pointer to the extended data buffer. This is an
optional parameter that may be NULL.
@param ExtendedDataSize The size, in bytes, of the extended data buffer.
@retval EFI_SUCCESS The status code was reported.
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
the extended data section if it was specified.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
EFI_STATUS
EFIAPI
ReportStatusCodeEx (
IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value,
IN UINT32 Instance,
IN EFI_GUID *CallerId OPTIONAL,
IN EFI_GUID *ExtendedDataGuid OPTIONAL,
IN VOID *ExtendedData OPTIONAL,
IN UINTN ExtendedDataSize
);
/**
Sends an 32-bit value to a POST card.
Sends the 32-bit value specified by Value to a POST card, and returns Value.
Some implementations of this library function may perform I/O operations
directly to a POST card device. Other implementations may send Value to
ReportStatusCode(), and the status code reporting mechanism will eventually
display the 32-bit value on the status reporting device.
PostCode() must actively prevent recursion. If PostCode() is called while
processing another any other Report Status Code Library function, then
PostCode() must return Value immediately.
@param Value The 32-bit value to write to the POST card.
@return Value
**/
UINT32
EFIAPI
PostCode (
IN UINT32 Value
);
/**
Sends an 32-bit value to a POST and associated ASCII string.
Sends the 32-bit value specified by Value to a POST card, and returns Value.
If Description is not NULL, then the ASCII string specified by Description is
also passed to the handler that displays the POST card value. Some
implementations of this library function may perform I/O operations directly
to a POST card device. Other implementations may send Value to ReportStatusCode(),
and the status code reporting mechanism will eventually display the 32-bit
value on the status reporting device.
PostCodeWithDescription()must actively prevent recursion. If
PostCodeWithDescription() is called while processing another any other Report
Status Code Library function, then PostCodeWithDescription() must return Value
immediately.
@param Value The 32-bit value to write to the POST card.
@param Description Pointer to an ASCII string that is a description of the
POST code value. This is an optional parameter that may
be NULL.
@return Value
**/
UINT32
EFIAPI
PostCodeWithDescription (
IN UINT32 Value,
IN CONST CHAR8 *Description OPTIONAL
);
/**
Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled
This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED
bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is set.
@retval FALSE The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is clear.
**/
BOOLEAN
EFIAPI
ReportProgressCodeEnabled (
VOID
);
/**
Returns TRUE if status codes of type EFI_ERROR_CODE are enabled
This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED
bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is set.
@retval FALSE The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is clear.
**/
BOOLEAN
EFIAPI
ReportErrorCodeEnabled (
VOID
);
/**
Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled
This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED
bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is set.
@retval FALSE The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is clear.
**/
BOOLEAN
EFIAPI
ReportDebugCodeEnabled (
VOID
);
/**
Returns TRUE if POST Codes are enabled.
This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED
bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is set.
@retval FALSE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED bit of
PcdReportStatusCodeProperyMask is clear.
**/
BOOLEAN
EFIAPI
ReportPostCodeEnabled (
VOID
);
/**
Returns TRUE if POST code descriptions are enabled.
This function returns TRUE if the
REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED bit of
PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.
@retval TRUE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED
bit of PcdReportStatusCodeProperyMask is set.
@retval FALSE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED
bit of PcdReportStatusCodeProperyMask is clear.
**/
BOOLEAN
EFIAPI
ReportPostCodeDescriptionEnabled (
VOID
);
/**
Reports a status code with minimal parameters if the status code type is enabled.
If the status code type specified by Type is enabled in
PcdReportStatusCodeProperyMask, then call ReportStatusCode() passing in Type
and Value.
@param Type Status code type.
@param Value Status code value.
@retval EFI_SUCCESS The status code was reported.
@retval EFI_DEVICE_ERROR There status code could not be reported due to a device error.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
#define REPORT_STATUS_CODE(Type,Value) \
(ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
ReportStatusCode(Type,Value) : \
(ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
ReportStatusCode(Type,Value) : \
(ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
ReportStatusCode(Type,Value) : \
EFI_UNSUPPORTED
/**
Reports a status code with a Device Path Protocol as the extended data if the
status code type is enabled.
If the status code type specified by Type is enabled in
PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithDevicePath()
passing in Type, Value, and DevicePath.
@param Type Status code type.
@param Value Status code value.
@param DevicePath Pointer to the Device Path Protocol to be reported.
@retval EFI_SUCCESS The status code was reported with the extended
data specified by DevicePath.
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
extended data section.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type,Value,DevicePathParameter) \
(ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
(ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
(ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter) : \
EFI_UNSUPPORTED
/**
Reports a status code with an extended data buffer if the status code type
is enabled.
If the status code type specified by Type is enabled in
PcdReportStatusCodeProperyMask, then call ReportStatusCodeWithExtendedData()
passing in Type, Value, ExtendedData, and ExtendedDataSize.
@param Type Status code type.
@param Value Status code value.
@param ExtendedData Pointer to the extended data buffer to be reported.
@param ExtendedDataSize The size, in bytes, of the extended data buffer to
be reported.
@retval EFI_SUCCESS The status code was reported with the extended
data specified by ExtendedData and ExtendedDataSize.
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
extended data section.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
#define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type,Value,ExtendedData,ExtendedDataSize) \
(ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
(ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
(ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
ReportStatusCodeWithExtendedData(Type,Value,ExtendedData,ExtendedDataSize) : \
EFI_UNSUPPORTED
/**
Reports a status code specifying all parameters if the status code type is enabled.
If the status code type specified by Type is enabled in
PcdReportStatusCodeProperyMask, then call ReportStatusCodeEx() passing in Type,
Value, Instance, CallerId, ExtendedDataGuid, ExtendedData, and ExtendedDataSize.
@param Type Status code type.
@param Value Status code value.
@param Instance Status code instance number.
@param CallerId Pointer to a GUID that identifies the caller of this
function. If this parameter is NULL, then a caller
ID of gEfiCallerIdGuid is used.
@param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
If this parameter is NULL, then a the status code
standard header is filled in with
gEfiStatusCodeSpecificDataGuid.
@param ExtendedData Pointer to the extended data buffer. This is an
optional parameter that may be NULL.
@param ExtendedDataSize The size, in bytes, of the extended data buffer.
@retval EFI_SUCCESS The status code was reported.
@retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate the
extended data section if it was specified.
@retval EFI_UNSUPPORTED Report status code is not supported
**/
#define REPORT_STATUS_CODE_EX(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) \
(ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ? \
ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
(ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) ? \
ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
(ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) ? \
ReportStatusCodeEx(Type,Value,Instance,CallerId,ExtendedDataGuid,ExtendedData,ExtendedDataSize) : \
EFI_UNSUPPORTED
/**
Sends an 32-bit value to a POST card.
If POST codes are enabled in PcdReportStatusCodeProperyMask, then call PostCode()
passing in Value. Value is returned.
@param Value The 32-bit value to write to the POST card.
@return Value
**/
#define POST_CODE(Value) ReportPostCodeEnabled() ? PostCode(Value) : Value
/**
Sends an 32-bit value to a POST and associated ASCII string.
If POST codes and POST code descriptions are enabled in
PcdReportStatusCodeProperyMask, then call PostCodeWithDescription() passing in
Value and Description. If only POST codes are enabled, then call PostCode()
passing in Value. Value is returned.
@param Value The 32-bit value to write to the POST card.
@param Description Pointer to an ASCII string that is a description of the
POST code value.
**/
#define POST_CODE_WITH_DESCRIPTION(Value,Description) \
ReportPostCodeEnabled() ? \
(ReportPostCodeDescriptionEnabled() ? \
PostCodeWithDescription(Value,Description) : \
PostCode(Value)) : \
Value
#endif

View File

@@ -0,0 +1,44 @@
/** @file
Declare presence of resources in the platform
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: ResourcePublicationLib.h
**/
#ifndef __RESOURCE_PUBLICATION_LIB__
#define __RESOURCE_PUBLICATION_LIB__
/**
Declares the presence of permanent system memory in the platform.
Declares that the system memory buffer specified by MemoryBegin and MemoryLength
as permanent memory that may be used for general purpose use by software.
The amount of memory available to software may be less than MemoryLength
if published memory has alignment restrictions.
@param MemoryBegin The start address of the memory being declared.
@param MemoryLength The number of bytes of memory being declared.
@retval RETURN_SUCCESS The memory buffer was published.
@retval RETURN_OUT_OF_RESOURCES There are not enough resources to publish the memory buffer
**/
RETURN_STATUS
EFIAPI
PublishSystemMemory (
IN PHYSICAL_ADDRESS MemoryBegin,
IN UINT64 MemoryLength
)
;
#endif

Some files were not shown because too many files have changed in this diff Show More