From bb9a5da90569b9a2ff42ce362204ae578029656a Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 26 Jul 2010 19:05:41 +0000 Subject: [PATCH] - Add PciIo headers. --- gnu-efi-3.0e-add-pciio-2.patch | 50 +++++++ gnu-efi-3.0e-add-pciio.patch | 251 +++++++++++++++++++++++++++++++++ gnu-efi.spec | 15 +- 3 files changed, 309 insertions(+), 7 deletions(-) create mode 100644 gnu-efi-3.0e-add-pciio-2.patch create mode 100644 gnu-efi-3.0e-add-pciio.patch diff --git a/gnu-efi-3.0e-add-pciio-2.patch b/gnu-efi-3.0e-add-pciio-2.patch new file mode 100644 index 0000000..d16e9c2 --- /dev/null +++ b/gnu-efi-3.0e-add-pciio-2.patch @@ -0,0 +1,50 @@ +From 6065c76e3b0185cfa4b51bd6c746b2d3537a1f8e Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 26 Jul 2010 14:37:53 -0400 +Subject: [PATCH 2/2] Add the efipciio.h stuff here as well... + +--- + inc/inc.mak | 1 + + inc/make.inf | 1 + + inc/makefile.hdr | 1 + + 3 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/inc/inc.mak b/inc/inc.mak +index e9aad84..0db6159 100644 +--- a/inc/inc.mak ++++ b/inc/inc.mak +@@ -12,6 +12,7 @@ INC_DEPS = $(INC_DEPS) \ + efifs.h \ + efilib.h \ + efipart.h \ ++ efipciio.h \ + efiprot.h \ + efipxe.h \ + efivar.h \ +diff --git a/inc/make.inf b/inc/make.inf +index c85406d..d539ccd 100644 +--- a/inc/make.inf ++++ b/inc/make.inf +@@ -13,6 +13,7 @@ + efifs.h + efilib.h + efipart.h ++ efipciio.h + efiprot.h + efipxebc.h + efistdarg.h +diff --git a/inc/makefile.hdr b/inc/makefile.hdr +index d3df1b9..f782cea 100644 +--- a/inc/makefile.hdr ++++ b/inc/makefile.hdr +@@ -17,6 +17,7 @@ INC_DEPS = $(INC_DEPS) \ + $(SDK_INSTALL_DIR)\include\efi\efifs.h \ + $(SDK_INSTALL_DIR)\include\efi\efilib.h \ + $(SDK_INSTALL_DIR)\include\efi\efipart.h \ ++ $(SDK_INSTALL_DIR)\include\efi\efipciio.h \ + $(SDK_INSTALL_DIR)\include\efi\efiprot.h \ + $(SDK_INSTALL_DIR)\include\efi\efipxebc.h \ + $(SDK_INSTALL_DIR)\include\efi\efistdarg.h \ +-- +1.7.1.1 + diff --git a/gnu-efi-3.0e-add-pciio.patch b/gnu-efi-3.0e-add-pciio.patch new file mode 100644 index 0000000..80c8bdf --- /dev/null +++ b/gnu-efi-3.0e-add-pciio.patch @@ -0,0 +1,251 @@ +From 5c79e84d2f7740b2da84364f80a577b904f12b34 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 26 Jul 2010 14:25:47 -0400 +Subject: [PATCH 1/2] Add headers for PciIo . + +--- + inc/efi.h | 1 + + inc/efipciio.h | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 220 insertions(+), 0 deletions(-) + create mode 100644 inc/efipciio.h + +diff --git a/inc/efi.h b/inc/efi.h +index 4cdb12b..e9de37b 100644 +--- a/inc/efi.h ++++ b/inc/efi.h +@@ -35,6 +35,7 @@ Revision History + #include "efibind.h" + #include "efidef.h" + #include "efidevp.h" ++#include "efipciio.h" + #include "efiprot.h" + #include "eficon.h" + #include "efiser.h" +diff --git a/inc/efipciio.h b/inc/efipciio.h +new file mode 100644 +index 0000000..d5e818a +--- /dev/null ++++ b/inc/efipciio.h +@@ -0,0 +1,219 @@ ++#ifndef _EFI_PCI_IO_H ++#define _EFI_PCI_IO_H ++ ++#define PCI_IO_PROTOCOL \ ++ { 0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a} } ++ ++INTERFACE_DECL(_EFI_PCI_IO); ++ ++typedef enum { ++ EfiPciIoWidthUint8, ++ EfiPciIoWidthUint16, ++ EfiPciIoWidthUint32, ++ EfiPciIoWidthUint64, ++ EfiPciIoWidthFifoUint8, ++ EfiPciIoWidthFifoUint16, ++ EfiPciIoWidthFifoUint32, ++ EfiPciIoWidthFifoUint64, ++ EfiPciIoWidthFillUint8, ++ EfiPciIoWidthFillUint16, ++ EfiPciIoWidthFillUint32, ++ EfiPciIoWidthFillUint64, ++ EfiPciIoWidthMaximum ++} EFI_PCI_IO_PROTOCOL_WIDTH; ++ ++#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN EFI_PCI_IO_PROTOCOL_WIDTH Width, ++ IN UINT8 BarIndex, ++ IN UINT64 Offset, ++ IN UINT64 Mask, ++ IN UINT64 Value, ++ IN UINT64 Delay, ++ OUT UINT64 *Result ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN EFI_PCI_IO_PROTOCOL_WIDTH Width, ++ IN UINT8 BarIndex, ++ IN UINT64 Offset, ++ IN UINTN Count, ++ IN OUT VOID *Buffer ++); ++ ++typedef struct { ++ EFI_PCI_IO_PROTOCOL_IO_MEM Read; ++ EFI_PCI_IO_PROTOCOL_IO_MEM Write; ++} EFI_PCI_IO_PROTOCOL_ACCESS; ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN EFI_PCI_IO_PROTOCOL_WIDTH Width, ++ IN UINT32 Offset, ++ IN UINTN Count, ++ IN OUT VOID *Buffer ++); ++ ++typedef struct { ++ EFI_PCI_IO_PROTOCOL_CONFIG Read; ++ EFI_PCI_IO_PROTOCOL_CONFIG Write; ++} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS; ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN EFI_PCI_IO_PROTOCOL_WIDTH Width, ++ IN UINT8 DestBarIndex, ++ IN UINT64 DestOffset, ++ IN UINT8 SrcBarIndex, ++ IN UINT64 SrcOffset, ++ IN UINTN Count ++ ); ++ ++typedef enum { ++ EfiPciIoOperationBusMasterRead, ++ EfiPciIoOperationBusMasterWrite, ++ EfiPciIoOperationBusMasterCommonBuffer, ++ EfiPciIoOperationMaximum ++} EFI_PCI_IO_PROTOCOL_OPERATION; ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN EFI_PCI_IO_PROTOCOL_OPERATION Operation, ++ IN VOID *HostAddress, ++ IN OUT UINTN *NumberOfBytes, ++ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, ++ OUT VOID **Mapping ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN VOID *Mapping ++); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN EFI_ALLOCATE_TYPE Type, ++ IN EFI_MEMORY_TYPE MemoryType, ++ IN UINTN Pages, ++ OUT VOID **HostAddress, ++ IN UINT64 Attributes ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN UINTN Pages, ++ IN VOID *HostAddress ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) ( ++ IN EFI_PCI_IO_PROTOCOL *This ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ OUT UINTN *SegmentNumber, ++ OUT UINTN *BusNumber, ++ OUT UINTN *DeviceNumber, ++ OUT UINTN *FunctionNumber ++ ); ++ ++#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 ++#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 ++#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 ++#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 ++#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 ++#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ++#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 ++#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 ++#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 ++#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 ++#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 ++ ++typedef enum { ++ EfiPciIoAttributeOperationGet, ++ EfiPciIoAttributeOperationSet, ++ EfiPciIoAttributeOperationEnable, ++ EfiPciIoAttributeOperationDisable, ++ EfiPciIoAttributeOperationSupported, ++ EfiPciIoAttributeOperationMaximum ++} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION; ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation, ++ IN UINT64 Attributes, ++ OUT UINT64 *Result OPTIONAL ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN UINT8 BarIndex, ++ OUT UINT64 *Supports OPTIONAL, ++ OUT VOID **Resources OPTIONAL ++ ); ++ ++typedef ++EFI_STATUS ++(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES) ( ++ IN EFI_PCI_IO_PROTOCOL *This, ++ IN UINT64 Attributes, ++ IN UINT8 BarIndex, ++ IN OUT UINT64 *Offset, ++ IN OUT UINT64 *Length ++ ); ++ ++typedef struct _EFI_PCI_IO_PROTOCOL { ++ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem; ++ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo; ++ EFI_PCI_IO_PROTOCOL_ACCESS Mem; ++ EFI_PCI_IO_PROTOCOL_ACCESS Io; ++ EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci; ++ EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem; ++ EFI_PCI_IO_PROTOCOL_MAP Map; ++ EFI_PCI_IO_PROTOCOL_UNMAP Unmap; ++ EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer; ++ EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer; ++ EFI_PCI_IO_PROTOCOL_FLUSH Flush; ++ EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation; ++ EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes; ++ EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes; ++ EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes; ++ UINT64 RomSize; ++ VOID *RomImage; ++} EFI_PCI_IO_PROTOCOL; ++ ++#endif /* _EFI_PCI_IO_H */ +-- +1.7.1.1 + diff --git a/gnu-efi.spec b/gnu-efi.spec index 80e1b34..152ba45 100644 --- a/gnu-efi.spec +++ b/gnu-efi.spec @@ -1,7 +1,7 @@ Summary: Development Libraries and headers for EFI Name: gnu-efi Version: 3.0e -Release: 10%{?dist} +Release: 11%{?dist} Group: Development/System License: GPLv2+ URL: ftp://ftp.hpl.hp.com/pub/linux-ia64 @@ -10,12 +10,9 @@ Patch0: gnu-efi-3.0e-no-relocations.patch Patch1: gnu-efi-3.0e-Fix-usage-of-INSTALLROOT-PREFIX-and-LIBDIR.patch Patch2: gnu-efi-3.0e-ignore-gnu-stack.patch Patch3: gnu-efi-3.0e-add-uefi-2.x-boot-services.patch -# these are currently disabled as we don't need them per se, and they -# haven't gone upstream yet either. Also they haven't been updated -# to work with gnu-efi-3.0e yet. -#Patch4: gnu-efi-3.0d-unwrap.patch -#Patch5: gnu-efi-3.0d-uefi_wrap.patch -#Patch6: gnu-efi-3.0d-uefi_wrap_call10.patch +Patch4: gnu-efi-3.0e-add-pciio.patch +# "git am" doesn't like ms-dos formatted text-files. +#Patch5: gnu-efi-3.0e-add-pciio-2.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExclusiveArch: i686 x86_64 ia64 BuildRequires: git @@ -34,6 +31,7 @@ git config user.name "Fedora Ninjas" git add . git commit -a -q -m "%{version} baseline." git am %{patches} +exit 1 %build # Package cannot build with %{?_smp_mflags}. @@ -61,6 +59,9 @@ rm -rf %{buildroot} %{_libdir}/* %changelog +* Mon Jul 26 2010 Peter Jones - 3.0e-11 +- Add PciIo headers. + * Fri Jul 23 2010 Peter Jones - 3.0e-10 - Add UEFI 2.x boot services.