#ifndef __BASE_H__
#define __BASE_H__
+FILE_LICENCE ( BSD3 );
+
//
// Include processor specific binding
//
#ifndef __EFI_HII_FORMMAP_GUID_H__
#define __EFI_HII_FORMMAP_GUID_H__
+FILE_LICENCE ( BSD3 );
+
#define EFI_HII_STANDARD_FORM_GUID \
{ 0x3bd2f4ec, 0xe524, 0x46e4, { 0xa9, 0xd8, 0x51, 0x1, 0x17, 0x42, 0x55, 0x62 } }
#ifndef __PC_ANSI_H__
#define __PC_ANSI_H__
+FILE_LICENCE ( BSD3 );
+
#define EFI_PC_ANSI_GUID \
{ \
0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
#ifndef __SMBIOS_GUID_H__
#define __SMBIOS_GUID_H__
+FILE_LICENCE ( BSD3 );
+
#define SMBIOS_TABLE_GUID \
{ \
0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
#ifndef __EFI_WIN_CERTIFICATE_H__
#define __EFI_WIN_CERTIFICATE_H__
+FILE_LICENCE ( BSD3 );
+
//
// _WIN_CERTIFICATE.wCertificateType
//
#ifndef __PROCESSOR_BIND_H__
#define __PROCESSOR_BIND_H__
+FILE_LICENCE ( BSD3 );
+
///
/// Define the processor type so other code can make processor based choices.
///
#ifndef _PCI22_H_
#define _PCI22_H_
+FILE_LICENCE ( BSD3 );
+
#define PCI_MAX_BUS 255
#define PCI_MAX_DEVICE 31
#define PCI_MAX_FUNC 7
#ifndef __PE_IMAGE_H__
#define __PE_IMAGE_H__
+FILE_LICENCE ( BSD3 );
+
//
// PE32+ Subsystem type for EFI images
//
#ifndef __PI_BOOT_MODE_H__
#define __PI_BOOT_MODE_H__
+FILE_LICENCE ( BSD3 );
+
///
/// EFI boot mode
///
#ifndef __PI_DEPENDENCY_H__
#define __PI_DEPENDENCY_H__
+FILE_LICENCE ( BSD3 );
+
///
/// If present, this must be the first and only opcode,
/// EFI_DEP_BEFORE is only used by DXE driver.
#ifndef __PI_DXECIS_H__
#define __PI_DXECIS_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Uefi/UefiMultiPhase.h>
#include <ipxe/efi/Pi/PiMultiPhase.h>
#ifndef __PI_FIRMWARE_FILE_H__
#define __PI_FIRMWARE_FILE_H__
+FILE_LICENCE ( BSD3 );
+
#pragma pack(1)
///
/// Used to verify the integrity of the file.
#ifndef __PI_FIRMWAREVOLUME_H__
#define __PI_FIRMWAREVOLUME_H__
+FILE_LICENCE ( BSD3 );
+
///
/// EFI_FV_FILE_ATTRIBUTES
///
#ifndef __PI_HOB_H__
#define __PI_HOB_H__
+FILE_LICENCE ( BSD3 );
+
//
// HobType of EFI_HOB_GENERIC_HEADER.
//
#ifndef __PI_MULTIPHASE_H__
#define __PI_MULTIPHASE_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Pi/PiFirmwareVolume.h>
#include <ipxe/efi/Pi/PiFirmwareFile.h>
#include <ipxe/efi/Pi/PiBootMode.h>
#ifndef _PI_S3_BOOT_SCRIPT_H_
#define _PI_S3_BOOT_SCRIPT_H_
+FILE_LICENCE ( BSD3 );
+
//*******************************************
// EFI Boot Script Opcode definitions
//*******************************************
#ifndef __PI_STATUS_CODE_H__
#define __PI_STATUS_CODE_H__
+FILE_LICENCE ( BSD3 );
+
//
// Required for IA32 and IPF defines for CPU exception types
//
#ifndef __PI_DXE_H__
#define __PI_DXE_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Uefi/UefiBaseType.h>
#include <ipxe/efi/Uefi/UefiSpec.h>
#ifndef __EFI_COMPONENT_NAME2_H__
#define __EFI_COMPONENT_NAME2_H__
+FILE_LICENCE ( BSD3 );
+
///
/// Global ID for the Component Name Protocol
///
#ifndef __ARCH_PROTOCOL_CPU_H__
#define __ARCH_PROTOCOL_CPU_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Protocol/DebugSupport.h>
#define EFI_CPU_ARCH_PROTOCOL_GUID \
#ifndef _CPUIO_H_
#define _CPUIO_H_
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Protocol/CpuIo2.h>
#define EFI_CPU_IO_PROTOCOL_GUID \
#ifndef __CPU_IO2_H__
#define __CPU_IO2_H__
+FILE_LICENCE ( BSD3 );
+
#define EFI_CPU_IO2_PROTOCOL_GUID \
{ \
0xad61f191, 0xae5f, 0x4c0e, {0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f} \
#ifndef __DEBUG_SUPPORT_H__
#define __DEBUG_SUPPORT_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/IndustryStandard/PeImage.h>
typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;
#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__
#define __EFI_DEVICE_PATH_PROTOCOL_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Guid/PcAnsi.h>
///
#ifndef __EFI_DRIVER_BINDING_H__
#define __EFI_DRIVER_BINDING_H__
+FILE_LICENCE ( BSD3 );
+
///
/// The global ID for the ControllerHandle Driver Protocol.
///
#ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__
#define __EFI_NETWORK_INTERFACE_IDENTIFER_H__
+FILE_LICENCE ( BSD3 );
+
//
// GUID retired from UEFI Specification 2.1b
//
#ifndef __PCI_IO_H__
#define __PCI_IO_H__
+FILE_LICENCE ( BSD3 );
+
///
/// Global ID for the PCI I/O Protocol
///
#ifndef __PCI_ROOT_BRIDGE_IO_H__
#define __PCI_ROOT_BRIDGE_IO_H__
+FILE_LICENCE ( BSD3 );
+
#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
{ \
0x2f707ebb, 0x4a1a, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
#ifndef __SIMPLE_NETWORK_H__
#define __SIMPLE_NETWORK_H__
+FILE_LICENCE ( BSD3 );
+
#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \
{ \
0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } \
#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
#define __SIMPLE_TEXT_IN_PROTOCOL_H__
+FILE_LICENCE ( BSD3 );
+
#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
{ \
0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
#ifndef __SIMPLE_TEXT_OUT_H__
#define __SIMPLE_TEXT_OUT_H__
+FILE_LICENCE ( BSD3 );
+
#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
{ \
0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
#ifndef __PI_UEFI_H__
#define __PI_UEFI_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Uefi/UefiBaseType.h>
#include <ipxe/efi/Uefi/UefiSpec.h>
#ifndef __UEFI_BASETYPE_H__
#define __UEFI_BASETYPE_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Base.h>
//
#ifndef __UEFI_GPT_H__
#define __UEFI_GPT_H__
+FILE_LICENCE ( BSD3 );
+
///
/// The primary GUID Partition Table Header must be
/// located in LBA 1 (i.e., the second logical block).
#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
#define __UEFI_INTERNAL_FORMREPRESENTATION_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Guid/HiiFormMapMethodGuid.h>
///
#ifndef __UEFI_MULTIPHASE_H__
#define __UEFI_MULTIPHASE_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Guid/WinCertificate.h>
///
/// Enumeration of memory types introduced in UEFI.
#ifndef __EFI_PXE_H__
#define __EFI_PXE_H__
+FILE_LICENCE ( BSD3 );
+
#pragma pack(1)
#define PXE_BUSTYPE(a, b, c, d) \
#ifndef __UEFI_SPEC_H__
#define __UEFI_SPEC_H__
+FILE_LICENCE ( BSD3 );
+
#include <ipxe/efi/Uefi/UefiMultiPhase.h>
#include <ipxe/efi/Protocol/DevicePath.h>
#ifndef __PROCESSOR_BIND_H__
#define __PROCESSOR_BIND_H__
+FILE_LICENCE ( BSD3 );
+
///
/// Define the processor type so other code can make processor based choices
///
return unless $filename =~ /\.h$/;
print "$filename...";
+ ( undef, undef, my $basename ) = splitpath ( $filename );
my $outfile = catfile ( $ipxedir, $filename );
foreach my $edkdir ( @$edkdirs ) {
my $infile = catfile ( $edkdir, $filename );
mkpath ( $outdir );
open my $outfh, ">$outfile" or die "Could not open $outfile: $!\n";
my @dependencies = ();
+ my $licence;
+ my $guard;
while ( <$infh> ) {
# Strip CR and trailing whitespace
s/\r//g;
if ( s/^\#include\s+[<\"](\S+)[>\"]/\#include <ipxe\/efi\/$1>/ ) {
push @dependencies, $1;
}
+ # Check for BSD licence statement
+ if ( /^\s*THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE/ ) {
+ die "Licence detected after header guard\n" if $guard;
+ $licence = "BSD3";
+ }
+ # Write out line
print $outfh "$_\n";
+ # Apply FILE_LICENCE() immediately after include guard
+ if ( /^\#define\s+_?_\S+_H_?_$/ ) {
+ die "Duplicate header guard detected in $infile\n" if $guard;
+ $guard = 1;
+ print $outfh "\nFILE_LICENCE ( $licence );\n" if $licence;
+ }
}
close $outfh;
close $infh;
+ # Warn if no licence was detected
+ warn "Cannot detect licence in $infile\n" unless $licence;
+ warn "Cannot detect header guard in $infile\n" unless $guard;
# Recurse to handle any included files that we don't already have
foreach my $dependency ( @dependencies ) {
if ( ! -e catfile ( $ipxedir, $dependency ) ) {