]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciHotPlugSupport.h
clean up the un-suitable ';' location when declaring the functions.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciHotPlugSupport.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
15 #ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H
16 #define _EFI_PCI_HOT_PLUG_SUPPORT_H
17
18
19 //
20 // stall 1 second
21 //
22 #define STALL_1_SECOND 1000000
23
24 typedef struct {
25 EFI_EVENT Event;
26 BOOLEAN Initialized;
27 VOID *Padding;
28 } ROOT_HPC_DATA;
29
30 extern EFI_PCI_HOT_PLUG_INIT_PROTOCOL *gPciHotPlugInit;
31 extern EFI_HPC_LOCATION *gPciRootHpcPool;
32 extern UINTN gPciRootHpcCount;
33 extern ROOT_HPC_DATA *gPciRootHpcData;
34
35 /**
36 Init HPC private data.
37
38 @param Event event object
39 @param Context HPC private data.
40 **/
41 VOID
42 EFIAPI
43 PciHPCInitialized (
44 IN EFI_EVENT Event,
45 IN VOID *Context
46 );
47
48 /**
49 Compare two device path
50
51 @param DevicePath1 the first device path want to be compared
52 @param DevicePath2 the first device path want to be compared
53
54 @retval TRUE equal
55 @retval FALSE different
56 **/
57 BOOLEAN
58 EfiCompareDevicePath (
59 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath1,
60 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath2
61 );
62
63 /**
64 Init hot plug support and root hot plug private data.
65
66 **/
67 EFI_STATUS
68 InitializeHotPlugSupport (
69 VOID
70 );
71
72 /**
73 Test whether PCI device is hot plug bus.
74
75 @param PciIoDevice PCI device instance
76
77 @retval EFI_SUCCESS PCI device is hot plug bus
78 @retval EFI_NOT_FOUND PCI device is not hot plug bus
79 **/
80 EFI_STATUS
81 IsPciHotPlugBus (
82 PCI_IO_DEVICE *PciIoDevice
83 );
84
85 /**
86 Test whether device path is for root pci hot plug bus
87
88 @param HpbdevicePath tested device path
89 @param HpIndex Return the index of root hot plug in global array.
90
91 @retval TRUE device path is for root pci hot plug
92 @retval FALSE device path is not for root pci hot plug
93 **/
94 BOOLEAN
95 IsRootPciHotPlugBus (
96 IN EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath,
97 OUT UINTN *HpIndex
98 );
99
100 /**
101 Test whether device path is for root pci hot plug controller
102
103 @param HpbdevicePath tested device path
104 @param HpIndex Return the index of root hot plug in global array.
105
106 @retval TRUE device path is for root pci hot plug controller
107 @retval FALSE device path is not for root pci hot plug controller
108 **/
109 BOOLEAN
110 IsRootPciHotPlugController (
111 IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
112 OUT UINTN *HpIndex
113 );
114
115 /**
116 Wrapper for creating event object for HPC
117
118 @param HpIndex index of hot plug device in global array
119 @param Event event object
120
121 @return status of create event invoken
122 **/
123 EFI_STATUS
124 CreateEventForHpc (
125 IN UINTN HpIndex,
126 OUT EFI_EVENT *Event
127 );
128
129 /**
130 Wait for all root HPC initialized.
131
132 @param TimeoutInMicroSeconds microseconds to wait for all root hpc's initialization
133 **/
134 EFI_STATUS
135 AllRootHPCInitialized (
136 IN UINTN TimeoutInMicroSeconds
137 );
138
139 /**
140 Check HPC capability register block
141
142 @param PciIoDevice PCI device instance
143
144 @retval EFI_SUCCESS PCI device is HPC
145 @retval EFI_NOT_FOUND PCI device is not HPC
146 **/
147 EFI_STATUS
148 IsSHPC (
149 PCI_IO_DEVICE *PciIoDevice
150 );
151
152 /**
153 Get resource padding for hot plug bus
154
155 @param PciIoDevice PCI device instance
156
157 @retval EFI_SUCCESS success get padding and set it into PCI device instance
158 @retval EFI_NOT_FOUND PCI device is not a hot plug bus.
159 **/
160 EFI_STATUS
161 GetResourcePaddingForHpb (
162 IN PCI_IO_DEVICE *PciIoDevice
163 );
164
165 #endif