mirror of https://github.com/acidanthera/audk.git
The updating (change the Interrupt Line to 0xFF for unknown setting) is only for x86 based on the PCI spec, so added the compiler option for such code.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2229 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
2da41b57c5
commit
6c31fdb887
|
@ -1,18 +1,18 @@
|
||||||
/*++
|
/*++
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
http://opensource.org/licenses/bsd-license.php
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
Module Name:
|
||||||
|
|
||||||
PciDeviceSupport.c
|
PciDeviceSupport.c
|
||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
This file provides routine to support Pci device node manipulation
|
This file provides routine to support Pci device node manipulation
|
||||||
|
@ -119,7 +119,7 @@ DestroyRootBridge (
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
RootBridge - A pointer to the PCI_IO_DEVICE.
|
RootBridge - A pointer to the PCI_IO_DEVICE.
|
||||||
|
@ -147,7 +147,7 @@ FreePciDevice (
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Destroy a pci device node.
|
Destroy a pci device node.
|
||||||
Also all direct or indirect allocated resource for this node will be freed.
|
Also all direct or indirect allocated resource for this node will be freed.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ DestroyRootBridgeByHandle (
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Destroy all device nodes under the root bridge
|
Destroy all device nodes under the root bridge
|
||||||
specified by Controller.
|
specified by Controller.
|
||||||
The root bridge itself is also included.
|
The root bridge itself is also included.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
@ -283,7 +283,7 @@ RegisterPciDevice (
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
This function registers the PCI IO device. It creates a handle for this PCI IO device
|
This function registers the PCI IO device. It creates a handle for this PCI IO device
|
||||||
(if the handle does not exist), attaches appropriate protocols onto the handle, does
|
(if the handle does not exist), attaches appropriate protocols onto the handle, does
|
||||||
necessary initialization, and sets up parent/child relationship with its bus controller.
|
necessary initialization, and sets up parent/child relationship with its bus controller.
|
||||||
|
|
||||||
|
@ -335,12 +335,17 @@ Returns:
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
PciIoDevice->IsPciExp = TRUE;
|
PciIoDevice->IsPciExp = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Force Interrupt line to "Unknown" or "No Connection"
|
// Force Interrupt line to "Unknown" or "No Connection"
|
||||||
|
// based on the PCI spec, the Interrupt line for x86 should be set as 0xFF for unknown.
|
||||||
//
|
//
|
||||||
PciIo = &(PciIoDevice->PciIo);
|
PciIo = &(PciIoDevice->PciIo);
|
||||||
|
#ifndef MDE_CPU_IPF
|
||||||
Data8 = PCI_INT_LINE_UNKNOWN;
|
Data8 = PCI_INT_LINE_UNKNOWN;
|
||||||
|
#else
|
||||||
|
Data8 = 0;
|
||||||
|
#endif
|
||||||
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x3C, 1, &Data8);
|
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x3C, 1, &Data8);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -436,7 +441,7 @@ RemoveAllPciDeviceOnBridge (
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
This function is used to remove the whole PCI devices from the bridge.
|
This function is used to remove the whole PCI devices from the bridge.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
RootBridgeHandle - An efi handle.
|
RootBridgeHandle - An efi handle.
|
||||||
|
@ -465,7 +470,7 @@ Returns:
|
||||||
if (Temp->Registered) {
|
if (Temp->Registered) {
|
||||||
DeRegisterPciDevice (RootBridgeHandle, Temp->Handle);
|
DeRegisterPciDevice (RootBridgeHandle, Temp->Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Remove this node from the linked list
|
// Remove this node from the linked list
|
||||||
//
|
//
|
||||||
|
@ -491,7 +496,7 @@ DeRegisterPciDevice (
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
This function is used to de-register the PCI device from the EFI,
|
This function is used to de-register the PCI device from the EFI,
|
||||||
That includes un-installing PciIo protocol from the specified PCI
|
That includes un-installing PciIo protocol from the specified PCI
|
||||||
device handle.
|
device handle.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
@ -603,7 +608,7 @@ Returns:
|
||||||
);
|
);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// The Device Driver should disable this device after disconnect
|
// The Device Driver should disable this device after disconnect
|
||||||
// so the Pci Bus driver will not touch this device any more.
|
// so the Pci Bus driver will not touch this device any more.
|
||||||
|
@ -671,7 +676,7 @@ Returns:
|
||||||
|
|
||||||
Node.DevPath = RemainingDevicePath;
|
Node.DevPath = RemainingDevicePath;
|
||||||
|
|
||||||
if (Node.Pci->Device != Temp->DeviceNumber ||
|
if (Node.Pci->Device != Temp->DeviceNumber ||
|
||||||
Node.Pci->Function != Temp->FunctionNumber) {
|
Node.Pci->Function != Temp->FunctionNumber) {
|
||||||
CurrentLink = CurrentLink->ForwardLink;
|
CurrentLink = CurrentLink->ForwardLink;
|
||||||
continue;
|
continue;
|
||||||
|
@ -683,7 +688,7 @@ Returns:
|
||||||
if (!Temp->Allocated) {
|
if (!Temp->Allocated) {
|
||||||
return EFI_NOT_READY;
|
return EFI_NOT_READY;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check if the current node has been registered before
|
// Check if the current node has been registered before
|
||||||
// If it is not, register it
|
// If it is not, register it
|
||||||
|
@ -703,7 +708,7 @@ Returns:
|
||||||
ChildHandleBuffer[*NumberOfChildren] = Temp->Handle;
|
ChildHandleBuffer[*NumberOfChildren] = Temp->Handle;
|
||||||
(*NumberOfChildren)++;
|
(*NumberOfChildren)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the next device path
|
// Get the next device path
|
||||||
//
|
//
|
||||||
|
@ -711,7 +716,7 @@ Returns:
|
||||||
if (EfiIsDevicePathEnd (CurrentDevicePath)) {
|
if (EfiIsDevicePathEnd (CurrentDevicePath)) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// If it is a PPB
|
// If it is a PPB
|
||||||
//
|
//
|
||||||
|
@ -814,7 +819,7 @@ StartPciDevices (
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Start to manage the PCI device according to RemainingDevicePath
|
Start to manage the PCI device according to RemainingDevicePath
|
||||||
If RemainingDevicePath == NULL, the PCI bus driver will start
|
If RemainingDevicePath == NULL, the PCI bus driver will start
|
||||||
to manage all the PCI devices it found previously
|
to manage all the PCI devices it found previously
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
@ -1044,7 +1049,7 @@ PciDeviceExisted (
|
||||||
/*++
|
/*++
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
Bridge - A pointer to the PCI_IO_DEVICE.
|
Bridge - A pointer to the PCI_IO_DEVICE.
|
||||||
|
@ -1093,7 +1098,7 @@ Routine Description:
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
VgaDevice - A pointer to the PCI_IO_DEVICE.
|
VgaDevice - A pointer to the PCI_IO_DEVICE.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
None
|
None
|
||||||
|
@ -1151,7 +1156,7 @@ Returns:
|
||||||
|
|
||||||
Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
|
Temp = PCI_IO_DEVICE_FROM_LINK (CurrentLink);
|
||||||
|
|
||||||
if (IS_PCI_VGA(&Temp->Pci) &&
|
if (IS_PCI_VGA(&Temp->Pci) &&
|
||||||
(Temp->Attributes &
|
(Temp->Attributes &
|
||||||
(EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY |
|
(EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY |
|
||||||
EFI_PCI_IO_ATTRIBUTE_VGA_IO |
|
EFI_PCI_IO_ATTRIBUTE_VGA_IO |
|
||||||
|
@ -1189,7 +1194,7 @@ Arguments:
|
||||||
PciRootBridgeIo - A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
|
PciRootBridgeIo - A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
|
||||||
HpcDevicePath - A pointer to the EFI_DEVICE_PATH_PROTOCL.
|
HpcDevicePath - A pointer to the EFI_DEVICE_PATH_PROTOCL.
|
||||||
PciAddress - A pointer to the pci address.
|
PciAddress - A pointer to the pci address.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|
Loading…
Reference in New Issue