]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Bus/Pci/PciBusDxe/PciOptionRomSupport.h
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciOptionRomSupport.h
CommitLineData
9060e3ec 1/** @file\r
2 PCI Rom supporting funtions declaration for PCI Bus module.\r
3\r
cd5ebaa0
HT
4Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
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
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
79\r
80/**\r
81 Get Pci device's oprom information.\r
82\r
83 @param PciIoDevice Input Pci device instance.\r
84 Output Pci device instance with updated OptionRom size.\r
85\r
86 @retval EFI_NOT_FOUND Pci device has not Option Rom.\r
87 @retval EFI_SUCCESS Pci device has Option Rom.\r
88\r
89**/\r
90EFI_STATUS\r
91GetOpRomInfo (\r
92 IN OUT PCI_IO_DEVICE *PciIoDevice\r
93 );\r
94\r
95/**\r
96 Load Option Rom image for specified PCI device.\r
97\r
98 @param PciDevice Pci device instance.\r
99 @param RomBase Base address of Option Rom.\r
100\r
101 @retval EFI_OUT_OF_RESOURCES No enough memory to hold image.\r
102 @retval EFI_SUCESS Successfully loaded Option Rom.\r
103\r
104**/\r
105EFI_STATUS\r
106LoadOpRomImage (\r
107 IN PCI_IO_DEVICE *PciDevice,\r
108 IN UINT64 RomBase\r
109 );\r
110\r
111/**\r
112 Enable/Disable Option Rom decode.\r
113\r
114 @param PciDevice Pci device instance.\r
115 @param RomBarIndex The BAR index of the standard PCI Configuration header to use as the\r
116 base address for resource range. The legal range for this field is 0..5.\r
117 @param RomBar Base address of Option Rom.\r
118 @param Enable Flag for enable/disable decode.\r
119\r
120**/\r
121VOID\r
122RomDecode (\r
123 IN PCI_IO_DEVICE *PciDevice,\r
124 IN UINT8 RomBarIndex,\r
125 IN UINT32 RomBar,\r
126 IN BOOLEAN Enable\r
127 );\r
128\r
129/**\r
130 Load and start the Option Rom image.\r
131\r
132 @param PciDevice Pci device instance.\r
133\r
134 @retval EFI_SUCCESS Successfully loaded and started PCI Option Rom image.\r
135 @retval EFI_NOT_FOUND Failed to process PCI Option Rom image.\r
136\r
137**/\r
138EFI_STATUS\r
139ProcessOpRomImage (\r
140 IN PCI_IO_DEVICE *PciDevice\r
141 );\r
142\r
143#endif\r