internal static MpProcessorEntry Parse(IoMemory region, int length, ref int offset) { Debug.Assert(length >= offset + Length); Debug.Assert(region.Read8(offset + 0) == EntryType); MpProcessorEntry e = new MpProcessorEntry(); e.LocalApicId = region.Read8(offset + 1); e.LocalApicVersion = region.Read8(offset + 2); e.CpuFlags = region.Read8(offset + 3); e.CpuSignature = region.Read32(offset + 4); e.FeatureFlags = region.Read32(offset + 8); e.DebugPrint(); offset += Length; return(e); }
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; } } }