internal static IoApic [] CreateIOApics() { // Prefer to get the list of IoApics from the MADT Madt madt = AcpiTables.GetMadt(); if (madt != null) { ArrayList alist = madt.GetIoApics(); if (alist.Count > 0) { IoApic [] apics = new IoApic[alist.Count]; for (int i = 0; i < alist.Count; i++) { // Have to convert from a ...Hal.Acpi.IoApic into a Hal.IoApic: Microsoft.Singularity.Hal.Acpi.IoApic sourceEntry = (Microsoft.Singularity.Hal.Acpi.IoApic)alist[i]; IoApic destEntry = new IoApic(sourceEntry.Address, sourceEntry.InterruptBase); destEntry.SetId(sourceEntry.Id); apics[i] = destEntry; } DebugStub.Print("Created IoApics from MADT table\n"); return(apics); } } DebugStub.Print("Created IoApics from MpResources table table\n"); // Otherwise, create from Mp tables return(CreateFromMpResources()); }
private void InitializeProcessorCount() { Madt madt = AcpiTables.GetMadt(); if (madt != null) { processorCount = madt.GetLocalApics().Count; } else if (MpResources.ProcessorEntries != null) { processorCount = MpResources.ProcessorEntries.Count; } else { processorCount = 1; } // // Platform.ThePlatform.CpuRealCount was setup by // the boot loader and should be the same that we read here. // DebugStub.Assert(Platform.ThePlatform.CpuRealCount == processorCount); }