mirror of
https://github.com/xcat2/xNBA.git
synced 2025-03-27 02:26:14 +00:00
[legal] Add FILE_LICENCE declarations to EFI header files
Autodetect the BSD licence statement in EFI header files, and add a suitable FILE_LICENCE macro to the version imported into the iPXE tree. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
ae5ce45afe
commit
03b1020acc
@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __BASE_H__
|
||||
#define __BASE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
//
|
||||
// Include processor specific binding
|
||||
//
|
||||
|
@ -17,6 +17,8 @@
|
||||
#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 } }
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
#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 } \
|
||||
|
@ -22,6 +22,8 @@
|
||||
#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 } \
|
||||
|
@ -17,6 +17,8 @@
|
||||
#ifndef __EFI_WIN_CERTIFICATE_H__
|
||||
#define __EFI_WIN_CERTIFICATE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
//
|
||||
// _WIN_CERTIFICATE.wCertificateType
|
||||
//
|
||||
|
@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PROCESSOR_BIND_H__
|
||||
#define __PROCESSOR_BIND_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// Define the processor type so other code can make processor based choices.
|
||||
///
|
||||
|
@ -20,6 +20,8 @@
|
||||
#ifndef _PCI22_H_
|
||||
#define _PCI22_H_
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#define PCI_MAX_BUS 255
|
||||
#define PCI_MAX_DEVICE 31
|
||||
#define PCI_MAX_FUNC 7
|
||||
|
@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PE_IMAGE_H__
|
||||
#define __PE_IMAGE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
//
|
||||
// PE32+ Subsystem type for EFI images
|
||||
//
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef __PI_BOOT_MODE_H__
|
||||
#define __PI_BOOT_MODE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// EFI boot mode
|
||||
///
|
||||
|
@ -17,6 +17,8 @@
|
||||
#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.
|
||||
|
@ -18,6 +18,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PI_DXECIS_H__
|
||||
#define __PI_DXECIS_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Uefi/UefiMultiPhase.h>
|
||||
#include <ipxe/efi/Pi/PiMultiPhase.h>
|
||||
|
||||
|
@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PI_FIRMWARE_FILE_H__
|
||||
#define __PI_FIRMWARE_FILE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#pragma pack(1)
|
||||
///
|
||||
/// Used to verify the integrity of the file.
|
||||
|
@ -18,6 +18,8 @@
|
||||
#ifndef __PI_FIRMWAREVOLUME_H__
|
||||
#define __PI_FIRMWAREVOLUME_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// EFI_FV_FILE_ATTRIBUTES
|
||||
///
|
||||
|
@ -18,6 +18,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PI_HOB_H__
|
||||
#define __PI_HOB_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
//
|
||||
// HobType of EFI_HOB_GENERIC_HEADER.
|
||||
//
|
||||
|
@ -18,6 +18,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#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>
|
||||
|
@ -16,6 +16,8 @@
|
||||
#ifndef _PI_S3_BOOT_SCRIPT_H_
|
||||
#define _PI_S3_BOOT_SCRIPT_H_
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
//*******************************************
|
||||
// EFI Boot Script Opcode definitions
|
||||
//*******************************************
|
||||
|
@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PI_STATUS_CODE_H__
|
||||
#define __PI_STATUS_CODE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
//
|
||||
// Required for IA32 and IPF defines for CPU exception types
|
||||
//
|
||||
|
@ -16,6 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PI_DXE_H__
|
||||
#define __PI_DXE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Uefi/UefiBaseType.h>
|
||||
#include <ipxe/efi/Uefi/UefiSpec.h>
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
#ifndef __EFI_COMPONENT_NAME2_H__
|
||||
#define __EFI_COMPONENT_NAME2_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// Global ID for the Component Name Protocol
|
||||
///
|
||||
|
@ -17,6 +17,8 @@
|
||||
#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 \
|
||||
|
@ -24,6 +24,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef _CPUIO_H_
|
||||
#define _CPUIO_H_
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Protocol/CpuIo2.h>
|
||||
|
||||
#define EFI_CPU_IO_PROTOCOL_GUID \
|
||||
|
@ -30,6 +30,8 @@
|
||||
#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} \
|
||||
|
@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __DEBUG_SUPPORT_H__
|
||||
#define __DEBUG_SUPPORT_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/IndustryStandard/PeImage.h>
|
||||
|
||||
typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;
|
||||
|
@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__
|
||||
#define __EFI_DEVICE_PATH_PROTOCOL_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Guid/PcAnsi.h>
|
||||
|
||||
///
|
||||
|
@ -18,6 +18,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __EFI_DRIVER_BINDING_H__
|
||||
#define __EFI_DRIVER_BINDING_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// The global ID for the ControllerHandle Driver Protocol.
|
||||
///
|
||||
|
@ -18,6 +18,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__
|
||||
#define __EFI_NETWORK_INTERFACE_IDENTIFER_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
//
|
||||
// GUID retired from UEFI Specification 2.1b
|
||||
//
|
||||
|
@ -16,6 +16,8 @@
|
||||
#ifndef __PCI_IO_H__
|
||||
#define __PCI_IO_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// Global ID for the PCI I/O Protocol
|
||||
///
|
||||
|
@ -19,6 +19,8 @@
|
||||
#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 } \
|
||||
|
@ -26,6 +26,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#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 } \
|
||||
|
@ -18,6 +18,8 @@
|
||||
#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 } \
|
||||
|
@ -20,6 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __SIMPLE_TEXT_OUT_H__
|
||||
#define __SIMPLE_TEXT_OUT_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
|
||||
|
@ -20,6 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __PI_UEFI_H__
|
||||
#define __PI_UEFI_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Uefi/UefiBaseType.h>
|
||||
#include <ipxe/efi/Uefi/UefiSpec.h>
|
||||
|
||||
|
@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __UEFI_BASETYPE_H__
|
||||
#define __UEFI_BASETYPE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Base.h>
|
||||
|
||||
//
|
||||
|
@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __UEFI_GPT_H__
|
||||
#define __UEFI_GPT_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// The primary GUID Partition Table Header must be
|
||||
/// located in LBA 1 (i.e., the second logical block).
|
||||
|
@ -20,6 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
|
||||
#define __UEFI_INTERNAL_FORMREPRESENTATION_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Guid/HiiFormMapMethodGuid.h>
|
||||
|
||||
///
|
||||
|
@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __UEFI_MULTIPHASE_H__
|
||||
#define __UEFI_MULTIPHASE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Guid/WinCertificate.h>
|
||||
///
|
||||
/// Enumeration of memory types introduced in UEFI.
|
||||
|
@ -21,6 +21,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __EFI_PXE_H__
|
||||
#define __EFI_PXE_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#define PXE_BUSTYPE(a, b, c, d) \
|
||||
|
@ -19,6 +19,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#ifndef __UEFI_SPEC_H__
|
||||
#define __UEFI_SPEC_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
#include <ipxe/efi/Uefi/UefiMultiPhase.h>
|
||||
|
||||
#include <ipxe/efi/Protocol/DevicePath.h>
|
||||
|
@ -15,6 +15,8 @@
|
||||
#ifndef __PROCESSOR_BIND_H__
|
||||
#define __PROCESSOR_BIND_H__
|
||||
|
||||
FILE_LICENCE ( BSD3 );
|
||||
|
||||
///
|
||||
/// Define the processor type so other code can make processor based choices
|
||||
///
|
||||
|
@ -16,6 +16,7 @@ sub try_import_file {
|
||||
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 );
|
||||
@ -27,6 +28,8 @@ sub try_import_file {
|
||||
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;
|
||||
@ -36,10 +39,25 @@ sub try_import_file {
|
||||
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 ) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user