win-pvdrivers

changeset 621:9c7b7fbacd7f

Windows 7 fix. Interrupt affinity cannot be set to -1 anymore (this is the affinity returned in the resource list). A proper fix that works across multiple Windows OS was implemented. Also, the interrupt level had to be set properly (as outlined in the new Microsoft Windows DDK docs).
author Steve Meisner <steve.meisner@virtualcomputer.com>
date Wed Jul 29 12:43:36 2009 -0400 (2009-07-29)
parents bddc14051767
children f905eb3f0545
files xenpci/xenpci_pdo.c
line diff
     1.1 --- a/xenpci/xenpci_pdo.c	Wed Jul 29 12:11:16 2009 -0400
     1.2 +++ b/xenpci/xenpci_pdo.c	Wed Jul 29 12:43:36 2009 -0400
     1.3 @@ -2065,9 +2065,10 @@ XenPciPdo_EvtDeviceWdmIrpPreprocess_STAR
     1.4          prd->Type = CmResourceTypeInterrupt;
     1.5          prd->ShareDisposition = CmResourceShareShared;
     1.6          prd->Flags = (xpdd->irq_mode == Latched)?CM_RESOURCE_INTERRUPT_LATCHED:CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
     1.7 -        prd->u.Interrupt.Level = xpdd->irq_number;
     1.8 +        prd->u.Interrupt.Level = 0;       // Set group and level to zero (group = upper word)
     1.9 +        prd->u.Interrupt.Level = xpdd->irq_number & 0xffff; // Only set the lower word
    1.10          prd->u.Interrupt.Vector = xpdd->irq_number;
    1.11 -        prd->u.Interrupt.Affinity = (KAFFINITY)-1;
    1.12 +        prd->u.Interrupt.Affinity = KeQueryActiveProcessors();
    1.13          xppdd->irq_number = xpdd->irq_number;
    1.14        }
    1.15        break;
    1.16 @@ -2114,9 +2115,10 @@ XenPciPdo_EvtDeviceWdmIrpPreprocess_STAR
    1.17          prd->Type = CmResourceTypeInterrupt;
    1.18          prd->ShareDisposition = CmResourceShareShared;
    1.19          prd->Flags = (xpdd->irq_mode == Latched)?CM_RESOURCE_INTERRUPT_LATCHED:CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE;
    1.20 -        prd->u.Interrupt.Level = xpdd->irq_level;
    1.21 +        prd->u.Interrupt.Level = 0;       // Set group and level to zero (group = upper word)
    1.22 +        prd->u.Interrupt.Level = xpdd->irq_level & 0xffff; // Only set the lower word
    1.23          prd->u.Interrupt.Vector = xpdd->irq_vector;
    1.24 -        prd->u.Interrupt.Affinity = (KAFFINITY)-1;
    1.25 +        prd->u.Interrupt.Affinity = KeQueryActiveProcessors();
    1.26          xppdd->irq_vector = xpdd->irq_vector;
    1.27          xppdd->irq_level = xpdd->irq_level;
    1.28        }