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
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.
15 #ifndef _EFI_PCI_HOT_PLUG_SUPPORT_H_
16 #define _EFI_PCI_HOT_PLUG_SUPPORT_H_
22 #define STALL_1_SECOND 1000000
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
;
36 Init HPC private data.
38 @param Event event object
39 @param Context HPC private data.
49 Compare two device path
51 @param DevicePath1 the first device path want to be compared.
52 @param DevicePath2 the first device path want to be compared.
55 @retval FALSE different.
58 EfiCompareDevicePath (
59 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath1
,
60 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath2
64 Init hot plug support and root hot plug private data.
68 InitializeHotPlugSupport (
73 Test whether PCI device is hot plug bus.
75 @param PciIoDevice PCI device instance.
77 @retval EFI_SUCCESS PCI device is hot plug bus.
78 @retval EFI_NOT_FOUND PCI device is not hot plug bus.
82 PCI_IO_DEVICE
*PciIoDevice
86 Test whether device path is for root pci hot plug bus
88 @param HpbDevicePath tested device path
89 @param HpIndex Return the index of root hot plug in global array.
91 @retval TRUE device path is for root pci hot plug
92 @retval FALSE device path is not for root pci hot plug
96 IN EFI_DEVICE_PATH_PROTOCOL
*HpbDevicePath
,
101 Test whether device path is for root pci hot plug controller
103 @param HpcDevicePath tested device path.
104 @param HpIndex Return the index of root hot plug in global array.
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.
110 IsRootPciHotPlugController (
111 IN EFI_DEVICE_PATH_PROTOCOL
*HpcDevicePath
,
116 Wrapper for creating event object for HPC
118 @param HpIndex index of hot plug device in global array.
119 @param Event event object.
121 @return status of create event invoken.
130 Wait for all root HPC initialized.
132 @param TimeoutInMicroSeconds microseconds to wait for all root hpc's initialization.
135 AllRootHPCInitialized (
136 IN UINTN TimeoutInMicroSeconds
140 Check HPC capability register block
142 @param PciIoDevice PCI device instance.
144 @retval EFI_SUCCESS PCI device is HPC.
145 @retval EFI_NOT_FOUND PCI device is not HPC.
149 PCI_IO_DEVICE
*PciIoDevice
153 Get resource padding for hot plug bus
155 @param PciIoDevice PCI device instance.
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.
161 GetResourcePaddingForHpb (
162 IN PCI_IO_DEVICE
*PciIoDevice