2 PCI Rom supporting functions declaration for PCI Bus module.
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _EFI_PCI_OPTION_ROM_SUPPORT_H_
10 #define _EFI_PCI_OPTION_ROM_SUPPORT_H_
14 Initialize a PCI LoadFile2 instance.
16 @param PciIoDevice PCI IO Device.
20 InitializePciLoadFile2 (
21 IN PCI_IO_DEVICE
*PciIoDevice
25 Causes the driver to load a specified file.
27 @param This Indicates a pointer to the calling context.
28 @param FilePath The device specific path of the file to load.
29 @param BootPolicy Should always be FALSE.
30 @param BufferSize On input the size of Buffer in bytes. On output with a return
31 code of EFI_SUCCESS, the amount of data transferred to Buffer.
32 On output with a return code of EFI_BUFFER_TOO_SMALL,
33 the size of Buffer required to retrieve the requested file.
34 @param Buffer The memory buffer to transfer the file to. If Buffer is NULL,
35 then no the size of the requested file is returned in BufferSize.
37 @retval EFI_SUCCESS The file was loaded.
38 @retval EFI_UNSUPPORTED BootPolicy is TRUE.
39 @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
41 @retval EFI_NOT_FOUND Not found PCI Option Rom on PCI device.
42 @retval EFI_DEVICE_ERROR Failed to decompress PCI Option Rom image.
43 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.
44 BufferSize has been updated with the size needed to complete the request.
50 IN EFI_LOAD_FILE2_PROTOCOL
*This
,
51 IN EFI_DEVICE_PATH_PROTOCOL
*FilePath
,
52 IN BOOLEAN BootPolicy
,
53 IN OUT UINTN
*BufferSize
,
54 IN VOID
*Buffer OPTIONAL
58 Check if the RomImage contains EFI Images.
60 @param RomImage The ROM address of Image for check.
61 @param RomSize Size of ROM for check.
63 @retval TRUE ROM contain EFI Image.
64 @retval FALSE ROM not contain EFI Image.
74 Get Pci device's oprom information.
76 @param PciIoDevice Input Pci device instance.
77 Output Pci device instance with updated OptionRom size.
79 @retval EFI_NOT_FOUND Pci device has not Option Rom.
80 @retval EFI_SUCCESS Pci device has Option Rom.
85 IN OUT PCI_IO_DEVICE
*PciIoDevice
89 Load Option Rom image for specified PCI device.
91 @param PciDevice Pci device instance.
92 @param RomBase Base address of Option Rom.
94 @retval EFI_OUT_OF_RESOURCES No enough memory to hold image.
95 @retval EFI_SUCESS Successfully loaded Option Rom.
100 IN PCI_IO_DEVICE
*PciDevice
,
105 Enable/Disable Option Rom decode.
107 @param PciDevice Pci device instance.
108 @param RomBarIndex The BAR index of the standard PCI Configuration header to use as the
109 base address for resource range. The legal range for this field is 0..5.
110 @param RomBar Base address of Option Rom.
111 @param Enable Flag for enable/disable decode.
116 IN PCI_IO_DEVICE
*PciDevice
,
117 IN UINT8 RomBarIndex
,
123 Load and start the Option Rom image.
125 @param PciDevice Pci device instance.
127 @retval EFI_SUCCESS Successfully loaded and started PCI Option Rom image.
128 @retval EFI_NOT_FOUND Failed to process PCI Option Rom image.
133 IN PCI_IO_DEVICE
*PciDevice