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