Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
r58459 r58466 43 43 { 44 44 return EfiLibInstallDriverBindingComponentName2 ( 45 ImageHandle, 46 SystemTable, 45 ImageHandle, 46 SystemTable, 47 47 &gPcatIsaAcpiDriverBinding, 48 48 ImageHandle, … … 55 55 ControllerDriver Protocol Method 56 56 57 @param This Driver Binding protocol instance pointer. 57 @param This Driver Binding protocol instance pointer. 58 58 @param Controller Handle of device to test. 59 59 @param RemainingDevicePath Optional parameter use to pick a specific child … … 81 81 // 82 82 // Get PciIo protocol instance 83 // 83 // 84 84 Status = gBS->OpenProtocol ( 85 Controller, 86 &gEfiPciIoProtocolGuid, 85 Controller, 86 &gEfiPciIoProtocolGuid, 87 87 (VOID**)&PciIo, 88 88 This->DriverBindingHandle, … … 98 98 EfiPciIoWidthUint32, 99 99 0, 100 sizeof(Pci) / sizeof(UINT32), 100 sizeof(Pci) / sizeof(UINT32), 101 101 &Pci); 102 102 … … 110 110 if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA) { 111 111 Status = EFI_SUCCESS; 112 } 112 } 113 113 114 114 // 115 115 // See if this is an Intel PCI to ISA bridge in Positive Decode Mode 116 116 // 117 if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE && 117 if (Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA_PDECODE && 118 118 Pci.Hdr.VendorId == 0x8086 ) { 119 119 // 120 // See if this is on Function #0 to avoid false positives on 121 // PCI_CLASS_BRIDGE_OTHER that has the same value as 120 // See if this is on Function #0 to avoid false positives on 121 // PCI_CLASS_BRIDGE_OTHER that has the same value as 122 122 // PCI_CLASS_BRIDGE_ISA_PDECODE 123 123 // 124 124 Status = PciIo->GetLocation ( 125 PciIo, 126 &SegmentNumber, 127 &BusNumber, 128 &DeviceNumber, 125 PciIo, 126 &SegmentNumber, 127 &BusNumber, 128 &DeviceNumber, 129 129 &FunctionNumber 130 130 ); … … 135 135 } 136 136 } 137 } 137 } 138 138 } 139 139 } 140 140 141 141 gBS->CloseProtocol ( 142 Controller, 143 &gEfiPciIoProtocolGuid, 144 This->DriverBindingHandle, 145 Controller 142 Controller, 143 &gEfiPciIoProtocolGuid, 144 This->DriverBindingHandle, 145 Controller 146 146 ); 147 147 148 148 return Status; 149 149 } … … 183 183 PciIo = NULL; 184 184 Status = gBS->OpenProtocol ( 185 Controller, 186 &gEfiPciIoProtocolGuid, 185 Controller, 186 &gEfiPciIoProtocolGuid, 187 187 (VOID**)&PciIo, 188 This->DriverBindingHandle, 189 Controller, 190 EFI_OPEN_PROTOCOL_BY_DRIVER 188 This->DriverBindingHandle, 189 Controller, 190 EFI_OPEN_PROTOCOL_BY_DRIVER 191 191 ); 192 192 if (EFI_ERROR (Status)) { … … 211 211 Status = EFI_UNSUPPORTED; 212 212 goto Done; 213 } 213 } 214 214 215 215 Enabled = TRUE; 216 216 Status = PciIo->Attributes ( 217 PciIo, 218 EfiPciIoAttributeOperationEnable, 219 EFI_PCI_DEVICE_ENABLE | Supports | EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO, 220 NULL 217 PciIo, 218 EfiPciIoAttributeOperationEnable, 219 EFI_PCI_DEVICE_ENABLE | Supports | EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO, 220 NULL 221 221 ); 222 222 if (EFI_ERROR (Status)) { 223 223 goto Done; 224 224 } 225 225 226 226 // 227 227 // Allocate memory for the PCAT ISA ACPI Device structure … … 248 248 // 249 249 InitializePcatIsaAcpiDeviceList (); 250 250 251 251 // 252 252 // IsaAcpi interface … … 260 260 (PcatIsaAcpiDev->IsaAcpi).InitDevice = IsaInitDevice; 261 261 (PcatIsaAcpiDev->IsaAcpi).InterfaceInit = IsaInterfaceInit; 262 262 263 263 // 264 264 // Install the ISA ACPI Protocol interface … … 274 274 if (PciIo != NULL && Enabled) { 275 275 PciIo->Attributes ( 276 PciIo, 277 EfiPciIoAttributeOperationDisable, 276 PciIo, 277 EfiPciIoAttributeOperationDisable, 278 278 EFI_PCI_DEVICE_ENABLE | Supports | EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO, 279 NULL 279 NULL 280 280 ); 281 281 } 282 282 gBS->CloseProtocol ( 283 Controller, 284 &gEfiPciIoProtocolGuid, 285 This->DriverBindingHandle, 283 Controller, 284 &gEfiPciIoProtocolGuid, 285 This->DriverBindingHandle, 286 286 Controller 287 287 ); … … 291 291 return Status; 292 292 } 293 293 294 294 return EFI_SUCCESS; 295 295 } … … 323 323 PCAT_ISA_ACPI_DEV *PcatIsaAcpiDev; 324 324 UINT64 Supports; 325 325 326 326 // 327 327 // Get the ISA ACPI Protocol Interface 328 // 328 // 329 329 Status = gBS->OpenProtocol ( 330 Controller, 331 &gEfiIsaAcpiProtocolGuid, 330 Controller, 331 &gEfiIsaAcpiProtocolGuid, 332 332 (VOID**)&IsaAcpi, 333 This->DriverBindingHandle, 334 Controller, 333 This->DriverBindingHandle, 334 Controller, 335 335 EFI_OPEN_PROTOCOL_GET_PROTOCOL 336 336 ); … … 360 360 361 361 PcatIsaAcpiDev->PciIo->Attributes ( 362 PcatIsaAcpiDev->PciIo, 363 EfiPciIoAttributeOperationDisable, 362 PcatIsaAcpiDev->PciIo, 363 EfiPciIoAttributeOperationDisable, 364 364 EFI_PCI_DEVICE_ENABLE | Supports | EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO, 365 NULL 365 NULL 366 366 ); 367 367 368 368 // 369 369 // Uninstall protocol interface: EFI_ISA_ACPI_PROTOCOL … … 378 378 379 379 gBS->CloseProtocol ( 380 Controller, 381 &gEfiPciIoProtocolGuid, 382 This->DriverBindingHandle, 380 Controller, 381 &gEfiPciIoProtocolGuid, 382 This->DriverBindingHandle, 383 383 Controller 384 384 ); 385 385 386 386 gBS->FreePool (PcatIsaAcpiDev); 387 387 388 388 return EFI_SUCCESS; 389 389 }
Note:
See TracChangeset
for help on using the changeset viewer.