summaryrefslogtreecommitdiff
path: root/i386/i386at/model_dep.c
diff options
context:
space:
mode:
authorDamien Zammit <damien@zamaudio.com>2021-04-04 15:08:12 +1000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2021-04-04 16:27:17 +0200
commit214866d58ac2bd1060132b250bf391a495110015 (patch)
treefaa4509549a8d4b580b4b52e00162efd30d3f480 /i386/i386at/model_dep.c
parent71db59f69602e54c33ba707c8e4a7a66f6c9ca0b (diff)
Add ioapic support disabled by default
Use --enable-ncpus=x --enable-apic where x > 1 for SMP+APIC support. Use neither for no SMP and old PIC support. Message-Id: <20210404050812.145483-1-damien@zamaudio.com>
Diffstat (limited to 'i386/i386at/model_dep.c')
-rw-r--r--i386/i386at/model_dep.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 34045dc5..f83d24cb 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -59,7 +59,6 @@
#include <i386/ldt.h>
#include <i386/machspl.h>
#include <i386/mp_desc.h>
-#include <i386/pic.h>
#include <i386/pit.h>
#include <i386/pmap.h>
#include <i386/proc_reg.h>
@@ -75,6 +74,7 @@
#include <i386at/kd.h>
#include <i386at/rtc.h>
#include <i386at/model_dep.h>
+#include <machine/irq.h>
#ifdef MACH_XEN
#include <xen/console.h>
@@ -169,17 +169,20 @@ void machine_init(void)
#ifdef MACH_HYP
hyp_init();
#else /* MACH_HYP */
+
+#if (NCPUS > 1) && defined(APIC)
+ smp_init();
+ ioapic_configure();
+ lapic_enable_timer();
+ unmask_irq(1);
+#endif /* NCPUS > 1 */
+
#ifdef LINUX_DEV
/*
* Initialize Linux drivers.
*/
linux_init();
#endif
-
-#if NCPUS > 1
- smp_init();
-#endif /* NCPUS > 1 */
-
/*
* Find the devices
*/
@@ -356,7 +359,11 @@ i386at_init(void)
* Initialize the PIC prior to any possible call to an spl.
*/
#ifndef MACH_HYP
+# ifdef APIC
+ picdisable();
+# else
picinit();
+# endif
#else /* MACH_HYP */
hyp_intrinit();
#endif /* MACH_HYP */
@@ -678,7 +685,9 @@ timemmap(dev, off, prot)
void
startrtclock(void)
{
+#ifndef APIC
clkstart();
+#endif
}
void