]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciDriverOverride.h
1 /** @file
2 Functions declaration for Bus Specific Driver Override protocol.
3
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _EFI_PCI_DRIVER_OVERRRIDE_H_
10 #define _EFI_PCI_DRIVER_OVERRRIDE_H_
11
12 #define DRIVER_OVERRIDE_SIGNATURE SIGNATURE_32 ('d', 'r', 'o', 'v')
13
14 //
15 // PCI driver override driver image list
16 //
17 typedef struct {
18 UINT32 Signature;
19 LIST_ENTRY Link;
20 EFI_HANDLE DriverImageHandle;
21 EFI_DEVICE_PATH_PROTOCOL *DriverImagePath;
22 } PCI_DRIVER_OVERRIDE_LIST;
23
24 #define DRIVER_OVERRIDE_FROM_LINK(a) \
25 CR (a, PCI_DRIVER_OVERRIDE_LIST, Link, DRIVER_OVERRIDE_SIGNATURE)
26
27 /**
28 Initializes a PCI Driver Override Instance.
29
30 @param PciIoDevice PCI Device instance.
31
32 **/
33 VOID
34 InitializePciDriverOverrideInstance (
35 IN OUT PCI_IO_DEVICE *PciIoDevice
36 );
37
38 /**
39 Add an overriding driver image.
40
41 @param PciIoDevice Instance of PciIo device.
42 @param DriverImageHandle Image handle of newly added driver image.
43 @param DriverImagePath Device path of newly added driver image.
44
45 @retval EFI_SUCCESS Successfully added driver.
46 @retval EFI_OUT_OF_RESOURCES No memory resource for new driver instance.
47 @retval other Some error occurred when locating gEfiLoadedImageProtocolGuid.
48
49 **/
50 EFI_STATUS
51 AddDriver (
52 IN PCI_IO_DEVICE *PciIoDevice,
53 IN EFI_HANDLE DriverImageHandle,
54 IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath
55 );
56
57 /**
58 Uses a bus specific algorithm to retrieve a driver image handle for a controller.
59
60 @param This A pointer to the EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL instance.
61 @param DriverImageHandle On input, a pointer to the previous driver image handle returned
62 by GetDriver(). On output, a pointer to the next driver
63 image handle. Passing in a NULL, will return the first driver
64 image handle.
65
66 @retval EFI_SUCCESS A bus specific override driver is returned in DriverImageHandle.
67 @retval EFI_NOT_FOUND The end of the list of override drivers was reached.
68 A bus specific override driver is not returned in DriverImageHandle.
69 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a
70 previous call to GetDriver().
71
72 **/
73 EFI_STATUS
74 EFIAPI
75 GetDriver (
76 IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This,
77 IN OUT EFI_HANDLE *DriverImageHandle
78 );
79
80 #endif