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