mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:03:00 +00:00
If we have a PCI device, try to keep the IRQ assigned by the BIOS instead of forcing 0x9
svn path=/trunk/; revision=17861
This commit is contained in:
parent
184ae2cb27
commit
cff40b3061
1 changed files with 54 additions and 7 deletions
|
@ -1110,14 +1110,61 @@ IopAssignDeviceResources(
|
||||||
}
|
}
|
||||||
case CmResourceTypeInterrupt:
|
case CmResourceTypeInterrupt:
|
||||||
{
|
{
|
||||||
|
INTERFACE_TYPE BusType;
|
||||||
|
ULONG SlotNumber;
|
||||||
|
ULONG ret;
|
||||||
|
UCHAR Irq;
|
||||||
|
|
||||||
DescriptorRaw->u.Interrupt.Level = 0;
|
DescriptorRaw->u.Interrupt.Level = 0;
|
||||||
/* FIXME: if IRQ 9 is in the possible range, use it.
|
DescriptorRaw->u.Interrupt.Vector = ResourceDescriptor->u.Interrupt.MinimumVector;
|
||||||
* This should be a PCI device */
|
/* FIXME: HACK: if we have a PCI device, we try
|
||||||
if (ResourceDescriptor->u.Interrupt.MinimumVector <= 9
|
* to keep the IRQ assigned by the BIOS */
|
||||||
&& ResourceDescriptor->u.Interrupt.MaximumVector >= 9)
|
if (NT_SUCCESS(IoGetDeviceProperty(
|
||||||
DescriptorRaw->u.Interrupt.Vector = 9;
|
DeviceNode->PhysicalDeviceObject,
|
||||||
else
|
DevicePropertyLegacyBusType,
|
||||||
DescriptorRaw->u.Interrupt.Vector = ResourceDescriptor->u.Interrupt.MinimumVector;
|
sizeof(INTERFACE_TYPE),
|
||||||
|
&BusType,
|
||||||
|
&ret)) && BusType == PCIBus)
|
||||||
|
{
|
||||||
|
/* We have a PCI bus */
|
||||||
|
if (NT_SUCCESS(IoGetDeviceProperty(
|
||||||
|
DeviceNode->PhysicalDeviceObject,
|
||||||
|
DevicePropertyAddress,
|
||||||
|
sizeof(ULONG),
|
||||||
|
&SlotNumber,
|
||||||
|
&ret)) && SlotNumber > 0)
|
||||||
|
{
|
||||||
|
/* We have a good slot number */
|
||||||
|
ret = HalGetBusDataByOffset(PCIConfiguration,
|
||||||
|
DeviceNode->ResourceRequirements->BusNumber,
|
||||||
|
SlotNumber,
|
||||||
|
&Irq,
|
||||||
|
0x3c /* PCI_INTERRUPT_LINE */,
|
||||||
|
sizeof(UCHAR));
|
||||||
|
if (ret != 0 && ret != 2
|
||||||
|
&& ResourceDescriptor->u.Interrupt.MinimumVector <= Irq
|
||||||
|
&& ResourceDescriptor->u.Interrupt.MaximumVector >= Irq)
|
||||||
|
{
|
||||||
|
/* The device already has an assigned IRQ */
|
||||||
|
DescriptorRaw->u.Interrupt.Vector = Irq;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPRINT1("Trying to assign IRQ 0x%lx to %wZ\n",
|
||||||
|
DescriptorRaw->u.Interrupt.Vector,
|
||||||
|
&DeviceNode->InstancePath);
|
||||||
|
Irq = (UCHAR)DescriptorRaw->u.Interrupt.Vector;
|
||||||
|
ret = HalSetBusDataByOffset(PCIConfiguration,
|
||||||
|
DeviceNode->ResourceRequirements->BusNumber,
|
||||||
|
SlotNumber,
|
||||||
|
&Irq,
|
||||||
|
0x3c /* PCI_INTERRUPT_LINE */,
|
||||||
|
sizeof(UCHAR));
|
||||||
|
if (ret == 0 || ret == 2)
|
||||||
|
KEBUGCHECK(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DescriptorTranslated->u.Interrupt.Level = 0;
|
DescriptorTranslated->u.Interrupt.Level = 0;
|
||||||
DescriptorTranslated->u.Interrupt.Vector = HalGetInterruptVector(
|
DescriptorTranslated->u.Interrupt.Vector = HalGetInterruptVector(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue