]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.h
Loaded Image device paths for EFI Drivers loaded from PCI Option ROM
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciOptionRomSupport.h
1 /** @file
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 **/
13
14 #ifndef _EFI_PCI_OP_ROM_SUPPORT_H_
15 #define _EFI_PCI_OP_ROM_SUPPORT_H_
16
17 #include <Protocol/LoadFile2.h>
18
19 /**
20 Initialize a PCI LoadFile2 instance
21
22 @param PciIoDevice - PCI IO Device
23
24 **/
25 VOID
26 InitializePciLoadFile2 (
27 PCI_IO_DEVICE *PciIoDevice
28 );
29
30 /**
31 Causes the driver to load a specified file.
32
33 @param This Indicates a pointer to the calling context.
34 @param FilePath The device specific path of the file to load.
35 @param BootPolicy Should always be FALSE.
36 @param BufferSize On input the size of Buffer in bytes. On output with a return
37 code of EFI_SUCCESS, the amount of data transferred to Buffer.
38 On output with a return code of EFI_BUFFER_TOO_SMALL,
39 the size of Buffer required to retrieve the requested file.
40 @param Buffer The memory buffer to transfer the file to. If Buffer is NULL,
41 then no the size of the requested file is returned in BufferSize.
42
43 @retval EFI_SUCCESS The file was loaded.
44 @retval EFI_UNSUPPORTED BootPolicy is TRUE.
45 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current directory entry.
46 BufferSize has been updated with the size needed to complete the request.
47
48 **/
49 EFI_STATUS
50 EFIAPI
51 LoadFile2 (
52 IN EFI_LOAD_FILE2_PROTOCOL *This,
53 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
54 IN BOOLEAN BootPolicy,
55 IN OUT UINTN *BufferSize,
56 IN VOID *Buffer OPTIONAL
57 );
58
59 /**
60
61 Check if the RomImage contains EFI Images.
62
63 @param RomImage The ROM address of Image for check.
64 @param RomSize Size of ROM for check.
65
66 @retval TRUE ROM contain EFI Image.
67 @retval FALSE ROM not contain EFI Image.
68
69 **/
70 BOOLEAN
71 ContainEfiImage (
72 IN VOID *RomImage,
73 IN UINT64 RomSize
74 );
75
76
77 /**
78 Get Pci device's oprom infor bits.
79
80 @param PciIoDevice Pci device instance
81
82 @retval EFI_NOT_FOUND Pci device has not oprom
83 @retval EFI_SUCCESS Pci device has oprom
84 **/
85 EFI_STATUS
86 GetOpRomInfo (
87 IN PCI_IO_DEVICE *PciIoDevice
88 );
89
90 /**
91 Load option rom image for specified PCI device
92
93 @param PciDevice Pci device instance
94 @param RomBase Base address of oprom.
95
96 @retval EFI_OUT_OF_RESOURCES not enough memory to hold image
97 @retval EFI_SUCESS Success
98 **/
99 EFI_STATUS
100 LoadOpRomImage (
101 IN PCI_IO_DEVICE *PciDevice,
102 IN UINT64 RomBase
103 );
104
105 /**
106 enable/disable oprom decode
107
108 @param PciDevice pci device instance
109 @param RomBarIndex The BAR index of the standard PCI Configuration header to use as the
110 base address for resource range. The legal range for this field is 0..5.
111 @param RomBar Base address of rom
112 @param Enable Flag for enable/disable decode.
113
114 @retval EFI_SUCCESS Success
115 **/
116 EFI_STATUS
117 RomDecode (
118 IN PCI_IO_DEVICE *PciDevice,
119 IN UINT8 RomBarIndex,
120 IN UINT32 RomBar,
121 IN BOOLEAN Enable
122 );
123
124 /**
125 Process the oprom image.
126
127 @param PciDevice Pci device instance
128 **/
129 EFI_STATUS
130 ProcessOpRomImage (
131 PCI_IO_DEVICE *PciDevice
132 );
133
134 #endif