Skip to content

Commit

Permalink
[efi] Update to current EDK2 headers
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 10, 2017
1 parent afdebdc commit 0463ec3
Show file tree
Hide file tree
Showing 14 changed files with 1,233 additions and 44 deletions.
6 changes: 6 additions & 0 deletions src/include/ipxe/efi/AArch64/ProcessorBind.h
Expand Up @@ -106,6 +106,12 @@ typedef INT64 INTN;
///
#define CPU_STACK_ALIGNMENT 16

///
/// Page allocation granularity for AARCH64
///
#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x10000)

//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
Expand Down
6 changes: 6 additions & 0 deletions src/include/ipxe/efi/Arm/ProcessorBind.h
Expand Up @@ -112,6 +112,12 @@ typedef INT32 INTN;
///
#define CPU_STACK_ALIGNMENT sizeof(UINT64)

///
/// Page allocation granularity for ARM
///
#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)

//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
Expand Down
57 changes: 56 additions & 1 deletion src/include/ipxe/efi/Base.h
Expand Up @@ -6,7 +6,7 @@
environment. There are a set of base libraries in the Mde Package that can
be used to implement base modules.
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
Expand Down Expand Up @@ -65,6 +65,29 @@ VERIFY_SIZE_OF (UINT64, 8);
VERIFY_SIZE_OF (CHAR8, 1);
VERIFY_SIZE_OF (CHAR16, 2);

//
// The following three enum types are used to verify that the compiler
// configuration for enum types is compliant with Section 2.3.1 of the
// UEFI 2.3 Specification. These enum types and enum values are not
// intended to be used. A prefix of '__' is used avoid conflicts with
// other types.
//
typedef enum {
__VerifyUint8EnumValue = 0xff
} __VERIFY_UINT8_ENUM_SIZE;

typedef enum {
__VerifyUint16EnumValue = 0xffff
} __VERIFY_UINT16_ENUM_SIZE;

typedef enum {
__VerifyUint32EnumValue = 0xffffffff
} __VERIFY_UINT32_ENUM_SIZE;

VERIFY_SIZE_OF (__VERIFY_UINT8_ENUM_SIZE, 4);
VERIFY_SIZE_OF (__VERIFY_UINT16_ENUM_SIZE, 4);
VERIFY_SIZE_OF (__VERIFY_UINT32_ENUM_SIZE, 4);

//
// 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
Expand Down Expand Up @@ -244,6 +267,20 @@ typedef struct {
UINT8 Data4[8];
} GUID;

///
/// 4-byte buffer. An IPv4 internet protocol address.
///
typedef struct {
UINT8 Addr[4];
} IPv4_ADDRESS;

///
/// 16-byte buffer. An IPv6 internet protocol address.
///
typedef struct {
UINT8 Addr[16];
} IPv6_ADDRESS;

//
// 8-bytes unsigned value that represents a physical system address.
//
Expand Down Expand Up @@ -324,6 +361,11 @@ struct _LIST_ENTRY {
///
#define NULL ((VOID *) 0)

//
// Null character
//
#define CHAR_NULL 0x0000

///
/// Maximum values for common UEFI Data Types
///
Expand Down Expand Up @@ -1213,5 +1255,18 @@ typedef UINTN RETURN_STATUS;
#define RETURN_ADDRESS(L) ((VOID *) 0)
#endif

/**
Return the number of elements in an array.
@param Array An object of array type. Array is only used as an argument to
the sizeof operator, therefore Array is never evaluated. The
caller is responsible for ensuring that Array's type is not
incomplete; that is, Array must have known constant size.
@return The number of elements in Array. The result has type UINTN.
**/
#define ARRAY_SIZE(Array) (sizeof (Array) / sizeof ((Array)[0]))

#endif

6 changes: 6 additions & 0 deletions src/include/ipxe/efi/Ia32/ProcessorBind.h
Expand Up @@ -259,6 +259,12 @@ typedef INT32 INTN;
///
#define CPU_STACK_ALIGNMENT sizeof(UINTN)

///
/// Page allocation granularity for IA-32.
///
#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)

//
// Modifier to ensure that all protocol member functions and EFI intrinsics
// use the correct C calling convention. All protocol member functions and
Expand Down
8 changes: 4 additions & 4 deletions src/include/ipxe/efi/IndustryStandard/Acpi51.h
@@ -1,8 +1,8 @@
/** @file
ACPI 5.1 definitions from the ACPI Specification Revision 5.1 July, 2014.
ACPI 5.1 definitions from the ACPI Specification Revision 5.1 Errata B January, 2016.
Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>
Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
Expand Down Expand Up @@ -539,8 +539,8 @@ typedef struct {
///
/// GIC Version
///
#define EFI_ACPI_5_1_GIC_V2 0x01
#define EFI_ACPI_5_1_GIC_V2m 0x02
#define EFI_ACPI_5_1_GIC_V1 0x01
#define EFI_ACPI_5_1_GIC_V2 0x02
#define EFI_ACPI_5_1_GIC_V3 0x03
#define EFI_ACPI_5_1_GIC_V4 0x04

Expand Down
12 changes: 6 additions & 6 deletions src/include/ipxe/efi/IndustryStandard/Acpi60.h
@@ -1,7 +1,7 @@
/** @file
ACPI 6.0 definitions from the ACPI Specification Revision 6.0 April, 2015.
ACPI 6.0 definitions from the ACPI Specification Revision 6.0 Errata A January, 2016.
Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
Expand Down Expand Up @@ -292,9 +292,9 @@ typedef struct {
} EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;

///
/// MADT Revision (as defined in ACPI 6.0 spec.)
/// MADT Revision (as defined in ACPI 6.0 Errata A spec.)
///
#define EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x03
#define EFI_ACPI_6_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x04

///
/// Multiple APIC Flags
Expand Down Expand Up @@ -2254,9 +2254,9 @@ typedef struct {
#define EFI_ACPI_6_0_ISCSI_BOOT_FIRMWARE_TABLE_SIGNATURE SIGNATURE_32('i', 'B', 'F', 'T')

///
/// "IORT" Interrupt Source Override
/// "IORT" I/O Remapping Table
///
#define EFI_ACPI_6_0_INTERRUPT_SOURCE_OVERRIDE_SIGNATURE SIGNATURE_32('I', 'O', 'R', 'T')
#define EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE SIGNATURE_32('I', 'O', 'R', 'T')

///
/// "IVRS" I/O Virtualization Reporting Structure
Expand Down
12 changes: 1 addition & 11 deletions src/include/ipxe/efi/IndustryStandard/Pci22.h
Expand Up @@ -7,7 +7,7 @@
PC Card Standard, 8.0
PCI Power Management Interface Specifiction, Revision 1.2
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014 - 2015, Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
Expand Down Expand Up @@ -782,22 +782,12 @@ typedef struct {
///
} EFI_PCI_CAPABILITY_HOTPLUG;

#define DEVICE_ID_NOCARE 0xFFFF

#define PCI_ACPI_UNUSED 0
#define PCI_BAR_NOCHANGE 0
#define PCI_BAR_OLD_ALIGN 0xFFFFFFFFFFFFFFFFULL
#define PCI_BAR_EVEN_ALIGN 0xFFFFFFFFFFFFFFFEULL
#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL
#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL

#define PCI_BAR_IDX0 0x00
#define PCI_BAR_IDX1 0x01
#define PCI_BAR_IDX2 0x02
#define PCI_BAR_IDX3 0x03
#define PCI_BAR_IDX4 0x04
#define PCI_BAR_IDX5 0x05
#define PCI_BAR_ALL 0xFF

///
/// EFI PCI Option ROM definitions
Expand Down
57 changes: 56 additions & 1 deletion src/include/ipxe/efi/IndustryStandard/UefiTcgPlatform.h
@@ -1,7 +1,7 @@
/** @file
TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Expand Down Expand Up @@ -153,6 +153,7 @@ typedef struct tdEFI_HANDOFF_TABLE_POINTERS {
/// This structure serves as the header for measuring variables. The name of the
/// variable (in Unicode format) should immediately follow, then the variable
/// data.
/// This is defined in TCG EFI Platform Spec for TPM1.1 or 1.2 V1.22
///
typedef struct tdEFI_VARIABLE_DATA {
EFI_GUID VariableName;
Expand All @@ -162,6 +163,22 @@ typedef struct tdEFI_VARIABLE_DATA {
INT8 VariableData[1]; ///< Driver or platform-specific data
} EFI_VARIABLE_DATA;

///
/// UEFI_VARIABLE_DATA
///
/// This structure serves as the header for measuring variables. The name of the
/// variable (in Unicode format) should immediately follow, then the variable
/// data.
/// This is defined in TCG PC Client Firmware Profile Spec 00.21
///
typedef struct tdUEFI_VARIABLE_DATA {
EFI_GUID VariableName;
UINT64 UnicodeNameLength;
UINT64 VariableDataLength;
CHAR16 UnicodeName[1];
INT8 VariableData[1]; ///< Driver or platform-specific data
} UEFI_VARIABLE_DATA;

//
// For TrEE1.0 compatibility
//
Expand Down Expand Up @@ -190,6 +207,17 @@ typedef struct tdTCG_PCR_EVENT2 {
UINT8 Event[1];
} TCG_PCR_EVENT2;

//
// TCG PCR Event2 Header
// Follow TCG EFI Protocol Spec 5.2 Crypto Agile Log Entry Format
//
typedef struct tdTCG_PCR_EVENT2_HDR{
TCG_PCRINDEX PCRIndex;
TCG_EVENTTYPE EventType;
TPML_DIGEST_VALUES Digests;
UINT32 EventSize;
} TCG_PCR_EVENT2_HDR;

//
// Log Header Entry Data
//
Expand Down Expand Up @@ -270,6 +298,33 @@ typedef struct {
//UINT8 vendorInfo[vendorInfoSize];
} TCG_EfiSpecIDEventStruct;



#define TCG_EfiStartupLocalityEvent_SIGNATURE "StartupLocality"


//
// PC Client PTP spec Table 8 Relationship between Locality and Locality Attribute
//
#define LOCALITY_0_INDICATOR 0x01
#define LOCALITY_1_INDICATOR 0x02
#define LOCALITY_2_INDICATOR 0x03
#define LOCALITY_3_INDICATOR 0x04
#define LOCALITY_4_INDICATOR 0x05


//
// Startup Locality Event
//
typedef struct tdTCG_EfiStartupLocalityEvent{
UINT8 Signature[16];
//
// The Locality Indicator which sent the TPM2_Startup command
//
UINT8 StartupLocality;
} TCG_EfiStartupLocalityEvent;


//
// Restore original structure alignment
//
Expand Down

0 comments on commit 0463ec3

Please sign in to comment.