Пример #1
0
        public static void PrintApic(IoApic ioApic)
        {
            DebugStub.Print("Io Apic\n");
            DebugStub.Print("  Id: {0:x2} Version: {1:x4} ArbitrationId: {2:x2}\n",
                            __arglist(
                                ioApic.GetId(),
                                ioApic.GetVersion(),
                                ioApic.GetArbitrationId()));

            for (uint i = 0; i < ioApic.RedirectionEntryCount; i++)
            {
                RedirectionEntry e  = ioApic.GetRedirectionEntry(i);
                IoBits           ib = (IoBits)((int)e.IoBits & ~(int)IoBits.DelModMask);

                DebugStub.Print("  IoRedTbl[{0:x2}]" +
                                "Dst: {1:x2} IntVec: {2:x2} Control: {3} {4} {5} {6} {7} {8}" +
                                "Delivery Mode ",
                                __arglist(
                                    i,
                                    e.Destination,
                                    e.InterruptVector,
                                    ((ib & IoBits.DstLogical) != 0) ? "Logical" : "Physical",
                                    ((ib & IoBits.IrqMask) != 0) ? "Masked" : "Unmasked",
                                    ((ib & IoBits.TriggerModeMask) != 0) ? "Level" : "Edge",
                                    ((ib & IoBits.RemoteIRR) != 0) ? "Accept" : "Recv",
                                    ((ib & IoBits.IntPolMask) != 0) ? "Hi active" : "Lo active",
                                    ((ib & IoBits.DeliveryStatus) != 0) ? "Pending" : "Idle"));
                DescribeModMask(e.IoBits);
            }
        }
Пример #2
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
        }