25#define PCI_VENDOR_ID_XEN 0x5853
26#define PCI_DEVICE_ID_XEN_PLATFORM 0x0001
70 Status =
gBS->OpenProtocol (
72 &gEfiPciIoProtocolGuid,
74 This->DriverBindingHandle,
77 EFI_OPEN_PROTOCOL_BY_DRIVER
80 if (EFI_ERROR (Status)) {
87 Status = PciIo->Pci.
Read (
93 sizeof Pci /
sizeof (UINT32),
98 if ((Pci.Hdr.VendorId == PCI_VENDOR_ID_XEN) &&
99 (Pci.Hdr.DeviceId == PCI_DEVICE_ID_XEN_PLATFORM))
103 Status = EFI_UNSUPPORTED;
113 &gEfiPciIoProtocolGuid,
114 This->DriverBindingHandle,
163 return EFI_OUT_OF_RESOURCES;
166 Status =
gBS->OpenProtocol (
168 &gEfiPciIoProtocolGuid,
170 This->DriverBindingHandle,
172 EFI_OPEN_PROTOCOL_BY_DRIVER
174 if (EFI_ERROR (Status)) {
183 Status = PciIo->GetBarAttributes (PciIo, PCI_BAR_IDX1,
NULL, (VOID **)&BarDesc);
185 ASSERT (BarDesc->ResType == ACPI_ADDRESS_SPACE_TYPE_MEM);
188 DEBUG ((DEBUG_INFO,
"XenIoPci: BAR at %LX\n", BarDesc->AddrRangeMin));
189 XenIo->GrantTableAddress = BarDesc->AddrRangeMin;
192 Status =
gBS->InstallProtocolInterface (
199 if (!EFI_ERROR (Status)) {
205 &gEfiPciIoProtocolGuid,
206 This->DriverBindingHandle,
254 Status =
gBS->OpenProtocol (
258 This->DriverBindingHandle,
260 EFI_OPEN_PROTOCOL_GET_PROTOCOL
262 if (EFI_ERROR (Status)) {
269 Status =
gBS->UninstallProtocolInterface (
274 if (EFI_ERROR (Status)) {
278 Status =
gBS->CloseProtocol (
280 &gEfiPciIoProtocolGuid,
281 This->DriverBindingHandle,
314 {
"eng;en", L
"XenIo PCI Driver" },
323XenIoPciGetDriverName (
326 OUT CHAR16 **DriverName
331 This->SupportedLanguages,
334 (BOOLEAN)(This == &gComponentName)
340XenIoPciGetDeviceName (
345 OUT CHAR16 **ControllerName
348 return EFI_UNSUPPORTED;
353 &XenIoPciGetDriverName,
354 &XenIoPciGetDeviceName,
370XenIoPciDeviceEntryPoint (
PACKED struct @89 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_DRIVER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
EFI_STATUS(EFIAPI * EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)(IN EFI_COMPONENT_NAME2_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
EFI_STATUS EFIAPI LookupUnicodeString2(IN CONST CHAR8 *Language, IN CONST CHAR8 *SupportedLanguages, IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable, OUT CHAR16 **UnicodeString, IN BOOLEAN Iso639Language)
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2(IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
STATIC EFI_STATUS EFIAPI XenIoPciDeviceBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE DeviceHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_PCI_IO_PROTOCOL_CONFIG Read