]>
Commit | Line | Data |
---|---|---|
eeefcb9d | 1 | /** @file\r |
8e8227d1 | 2 | PCI Rom supporting funtions declaration for PCI Bus module.\r |
ead42efc | 3 | \r |
8e8227d1 | 4 | Copyright (c) 2006 - 2009, Intel Corporation\r |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
ead42efc | 12 | \r |
3db51098 | 13 | **/\r |
ead42efc | 14 | \r |
8e8227d1 | 15 | #ifndef _EFI_PCI_OPTION_ROM_SUPPORT_H_\r |
16 | #define _EFI_PCI_OPTION_ROM_SUPPORT_H_\r | |
ead42efc | 17 | \r |
8e6b0dcb | 18 | \r |
19 | /**\r | |
c72216a6 | 20 | Initialize a PCI LoadFile2 instance.\r |
8e8227d1 | 21 | \r |
c72216a6 | 22 | @param PciIoDevice PCI IO Device.\r |
8e6b0dcb | 23 | \r |
24 | **/\r | |
25 | VOID\r | |
26 | InitializePciLoadFile2 (\r | |
8e8227d1 | 27 | IN PCI_IO_DEVICE *PciIoDevice\r |
8e6b0dcb | 28 | );\r |
29 | \r | |
30 | /**\r | |
31 | Causes the driver to load a specified file.\r | |
8e8227d1 | 32 | \r |
8e6b0dcb | 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 | |
8e8227d1 | 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 |
8e8227d1 | 43 | @retval EFI_SUCCESS The file was loaded.\r |
8e6b0dcb | 44 | @retval EFI_UNSUPPORTED BootPolicy is TRUE.\r |
8e8227d1 | 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 | |
8e6b0dcb | 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 | |
8e8227d1 | 51 | \r |
8e6b0dcb | 52 | **/\r |
53 | EFI_STATUS\r | |
54 | EFIAPI\r | |
55 | LoadFile2 (\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 | |
8e6b0dcb | 64 | Check if the RomImage contains EFI Images.\r |
65 | \r | |
8e8227d1 | 66 | @param RomImage The ROM address of Image for check.\r |
8e6b0dcb | 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 | |
8e8227d1 | 71 | \r |
8e6b0dcb | 72 | **/\r |
73 | BOOLEAN\r | |
74 | ContainEfiImage (\r | |
75 | IN VOID *RomImage,\r | |
76 | IN UINT64 RomSize\r | |
8e8227d1 | 77 | );\r |
8e6b0dcb | 78 | \r |
79 | \r | |
57076f45 | 80 | /**\r |
9eb130ff | 81 | Get Pci device's oprom information.\r |
eeefcb9d | 82 | \r |
9eb130ff | 83 | @param PciIoDevice Input Pci device instance.\r |
84 | Output Pci device instance with updated OptionRom size.\r | |
8e8227d1 | 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 | |
57076f45 | 89 | **/\r |
ead42efc | 90 | EFI_STATUS\r |
91 | GetOpRomInfo (\r | |
9eb130ff | 92 | IN OUT PCI_IO_DEVICE *PciIoDevice\r |
ed66e1bc | 93 | );\r |
ead42efc | 94 | \r |
57076f45 | 95 | /**\r |
8e8227d1 | 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 | |
57076f45 | 104 | **/\r |
ead42efc | 105 | EFI_STATUS\r |
106 | LoadOpRomImage (\r | |
107 | IN PCI_IO_DEVICE *PciDevice,\r | |
108 | IN UINT64 RomBase\r | |
ed66e1bc | 109 | );\r |
ead42efc | 110 | \r |
57076f45 | 111 | /**\r |
8e8227d1 | 112 | Enable/Disable Option Rom decode.\r |
113 | \r | |
114 | @param PciDevice Pci device instance.\r | |
57076f45 | 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 | |
8e8227d1 | 117 | @param RomBar Base address of Option Rom.\r |
57076f45 | 118 | @param Enable Flag for enable/disable decode.\r |
8e8227d1 | 119 | \r |
57076f45 | 120 | **/\r |
8e8227d1 | 121 | VOID\r |
ead42efc | 122 | RomDecode (\r |
123 | IN PCI_IO_DEVICE *PciDevice,\r | |
124 | IN UINT8 RomBarIndex,\r | |
125 | IN UINT32 RomBar,\r | |
126 | IN BOOLEAN Enable\r | |
ed66e1bc | 127 | );\r |
ead42efc | 128 | \r |
57076f45 | 129 | /**\r |
8e8227d1 | 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 | |
57076f45 | 137 | **/\r |
ead42efc | 138 | EFI_STATUS\r |
139 | ProcessOpRomImage (\r | |
8e8227d1 | 140 | IN PCI_IO_DEVICE *PciDevice\r |
ed66e1bc | 141 | );\r |
ead42efc | 142 | \r |
143 | #endif\r |