Пример #1
0
        internal void ConfigurePciInterrupt(IoApic ioApic, MpInterruptEntry e)
        {
            byte vector = IrqToInterrupt(e.ApicLine);

            IoBits iobits = (e.PolarityType == Polarity.ActiveHigh) ?
                            IoBits.IntPolActiveHigh : IoBits.IntPolActiveLow;

            iobits |= (e.TriggerType == Trigger.Edge) ?
                      IoBits.TriggerModeEdge : IoBits.TriggerModeLevel;
            iobits |= IoBits.DstPhysical;
            iobits |= IoBits.DelModFixed;
            iobits |= IoBits.IrqMask;
            RedirectionEntry r = new RedirectionEntry(this.Id, iobits, vector);

            ioApic.SetRedirectionEntry(e.ApicLine, ref r);

#if PRINT_IO_APICS
            DebugStub.Print("Added PCI interrupt for apic 0x{0:x}: Line 0x{1:x} => 0x{2:x}\n",
                            __arglist(ioApic.GetId(), e.ApicLine, vector));
#endif
        }