summaryrefslogtreecommitdiff
path: root/Silicon/Intel/PurleySktPkg/Include/Protocol/PciCallback.h
diff options
context:
space:
mode:
Diffstat (limited to 'Silicon/Intel/PurleySktPkg/Include/Protocol/PciCallback.h')
-rw-r--r--Silicon/Intel/PurleySktPkg/Include/Protocol/PciCallback.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/Silicon/Intel/PurleySktPkg/Include/Protocol/PciCallback.h b/Silicon/Intel/PurleySktPkg/Include/Protocol/PciCallback.h
new file mode 100644
index 0000000000..9b8bfecc45
--- /dev/null
+++ b/Silicon/Intel/PurleySktPkg/Include/Protocol/PciCallback.h
@@ -0,0 +1,90 @@
+/** @file
+
+Copyright (c) 2018, 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 that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _EFI_PCI_CALLBACK_H
+#define _EFI_PCI_CALLBACK_H
+
+#include <Include/IndustryStandard/Pci22.h>
+#include <Protocol/CpuIo2.h>
+#include <Protocol/PciRootBridgeIo.h>
+
+
+//
+// Global Id for PCI callback
+//
+#define EFI_PCI_CALLBACK_PROTOCOL_GUID \
+ { \
+ 0x1ca0e202, 0xfe9e, 0x4776, 0x9f, 0xaa, 0x57, 0xc, 0x19, 0x61, 0x7a, 0x06 \
+ }
+
+typedef struct _EFI_PCI_CALLBACK_PROTOCOL EFI_PCI_CALLBACK_PROTOCOL;
+
+typedef enum {
+ EfiPciEnumerationDeviceScanning = 1,
+ EfiPciEnumerationBusNumberAssigned = 2,
+ EfiPciEnumerationResourceAssigned = 4,
+} EFI_PCI_ENUMERATION_PHASE;
+
+typedef struct {
+ PCI_TYPE00 PciHeader;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
+ EFI_CPU_IO2_PROTOCOL *CpuIo;
+} EFI_PCI_CALLBACK_CONTEXT;
+
+typedef
+VOID
+(EFIAPI *EFI_PCI_CALLBACK_FUNC) (
+ IN EFI_HANDLE RootBridgeHandle,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,
+ IN EFI_PCI_ENUMERATION_PHASE Phase,
+ IN EFI_PCI_CALLBACK_CONTEXT *Context
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_REGISTER_PCI_CALLBACK) (
+ IN EFI_PCI_CALLBACK_PROTOCOL *This,
+ IN EFI_PCI_CALLBACK_FUNC Function,
+ IN EFI_PCI_ENUMERATION_PHASE Phase
+)
+/*++
+
+Routine Description:
+
+ Register a callback during PCI bus enumeration
+
+Arguments:
+
+ This - Protocol instance pointer.
+ Function - Callback function pointer.
+ Phase - PCI enumeration phase.
+
+Returns:
+
+ EFI_SUCCESS - Function has registed successfully
+ EFI_UNSUPPORTED - The function has been regisered
+ EFI_InVALID_PARAMETER - The parameter is incorrect
+
+--*/
+;
+
+//
+// Protocol definition
+//
+typedef struct _EFI_PCI_CALLBACK_PROTOCOL {
+ EFI_REGISTER_PCI_CALLBACK RegisterPciCallback;
+} EFI_PCI_CALLBACK_PROTOCOL;
+
+extern EFI_GUID gEfiPciCallbackProtocolGuid;
+
+#endif