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 Oct 16, 2014
1 parent b9a5ff2 commit 318b5fc
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 15 deletions.
25 changes: 12 additions & 13 deletions src/include/ipxe/efi/Base.h
Expand Up @@ -81,21 +81,20 @@ VERIFY_SIZE_OF (CHAR16, 2);
#endif

//
// For symbol name in GNU assembly code, an extra "_" is necessary
// For symbol name in assembly code, an extra "_" is sometimes necessary
//
#if defined(__GNUC__)
///
/// Private worker functions for ASM_PFX()
///
#define _CONCATENATE(a, b) __CONCATENATE(a, b)
#define __CONCATENATE(a, b) a ## b

///
/// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
/// on symbols in assembly language.
///
#define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)
#endif
///
/// Private worker functions for ASM_PFX()
///
#define _CONCATENATE(a, b) __CONCATENATE(a, b)
#define __CONCATENATE(a, b) a ## b

///
/// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
/// on symbols in assembly language.
///
#define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)

#if __APPLE__
//
Expand Down
4 changes: 4 additions & 0 deletions src/include/ipxe/efi/Ia32/ProcessorBind.h
Expand Up @@ -286,5 +286,9 @@ typedef INT32 INTN;
**/
#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)

#ifndef __USER_LABEL_PREFIX__
#define __USER_LABEL_PREFIX__ _
#endif

#endif

39 changes: 39 additions & 0 deletions src/include/ipxe/efi/IndustryStandard/Pci22.h
Expand Up @@ -6,7 +6,10 @@
PCI-to-PCI Bridge Architecture Specification, Revision 1.2
PC Card Standard, 8.0
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
Expand Down Expand Up @@ -656,6 +659,42 @@ typedef struct {
UINT8 Data;
} EFI_PCI_CAPABILITY_PMI;

///
/// PMC - Power Management Capabilities
/// Section 3.2.3, PCI Power Management Interface Specifiction, Revision 1.2
///
typedef union {
struct {
UINT16 Version : 3;
UINT16 PmeClock : 1;
UINT16 : 1;
UINT16 DeviceSpecificInitialization : 1;
UINT16 AuxCurrent : 3;
UINT16 D1Support : 1;
UINT16 D2Support : 1;
UINT16 PmeSupport : 5;
} Bits;
UINT16 Data;
} EFI_PCI_PMC;

#define EFI_PCI_PMC_D3_COLD_MASK (BIT15)

///
/// PMCSR - Power Management Control/Status
/// Section 3.2.4, PCI Power Management Interface Specifiction, Revision 1.2
///
typedef union {
struct {
UINT16 PowerState : 2;
UINT16 : 6;
UINT16 PmeEnable : 1;
UINT16 DataSelect : 4;
UINT16 DataScale : 2;
UINT16 PmeStatus : 1;
} Bits;
UINT16 Data;
} EFI_PCI_PMCSR;

///
/// A.G.P Capability
/// Section 6.1.4, Accelerated Graphics Port Interface Specification, Revision 1.0
Expand Down
4 changes: 4 additions & 0 deletions src/include/ipxe/efi/X64/ProcessorBind.h
Expand Up @@ -292,5 +292,9 @@ typedef INT64 INTN;
**/
#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)

#ifndef __USER_LABEL_PREFIX__
#define __USER_LABEL_PREFIX__
#endif

#endif

3 changes: 1 addition & 2 deletions src/include/ipxe/efi/import.pl
Expand Up @@ -78,9 +78,8 @@ sub try_import_file {
# Write out line
print $outfh "$_\n";
# Apply FILE_LICENCE() immediately after include guard
if ( defined $maybe_guard ) {
if ( defined $maybe_guard && ! defined $guard ) {
if ( /^\#define\s+_?_${maybe_guard}_?_$/ ) {
die "Duplicate header guard detected in $infile\n" if $guard;
$guard = $maybe_guard;
print $outfh "\nFILE_LICENCE ( $licence );\n" if $licence;
}
Expand Down

0 comments on commit 318b5fc

Please sign in to comment.