Ejemplo n.º 1
0
        internal static MpIoApicEntry Parse(IoMemory region,
                                            int length,
                                            ref int offset)
        {
            Debug.Assert(length >= offset + Length);
            Debug.Assert(region.Read8(offset + 0) == EntryType);

            MpIoApicEntry e = new MpIoApicEntry();

            e.Id          = region.Read8(offset + 1);
            e.Version     = region.Read8(offset + 2);
            e.Flags       = region.Read8(offset + 3);
            e.BaseAddress = region.Read32(offset + 4);
            e.DebugPrint();
            offset += Length;
            return(e);
        }
Ejemplo n.º 2
0
        internal static void Parse(IoMemory region,
                                   int length,
                                   uint entryCount)
        {
            int offset = 0;

            for (int i = 0; i < entryCount; i++)
            {
                switch (region.Read8(offset))
                {
                case MpProcessorEntry.EntryType:
                    ProcessorEntries.Add(
                        MpProcessorEntry.Parse(region, length, ref offset)
                        );
                    break;

                case MpBusEntry.EntryType:
                    BusEntries.Add(
                        MpBusEntry.Parse(region, length, ref offset)
                        );
                    break;

                case MpIoApicEntry.EntryType:
                    IoApicEntries.Add(
                        MpIoApicEntry.Parse(region, length, ref offset)
                        );
                    break;

                case MpInterruptEntry.IoEntryType:
                    IoInterruptEntries.Add(
                        MpInterruptEntry.Parse(region, length, ref offset)
                        );
                    break;

                case MpInterruptEntry.LocalEntryType:
                    LocalInterruptEntries.Add(
                        MpInterruptEntry.Parse(region, length, ref offset)
                        );
                    break;
                }
            }
        }