summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/apicreg.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/include/apicreg.h')
-rw-r--r--sys/i386/include/apicreg.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/i386/include/apicreg.h b/sys/i386/include/apicreg.h
index be9de4f..3d84792 100644
--- a/sys/i386/include/apicreg.h
+++ b/sys/i386/include/apicreg.h
@@ -463,4 +463,28 @@ typedef struct IOAPIC ioapic_t;
#define IOART_INTVEC 0x000000ff /* R/W: INTerrupt vector field */
+#ifdef LOCORE
+
+#ifdef SMP
+
+/*
+ * Protects the IO APIC and apic_imen as a critical region.
+ */
+#define IMASK_LOCK MTX_LOCK_SPIN(_imen_mtx, 0)
+#define IMASK_UNLOCK MTX_UNLOCK_SPIN(_imen_mtx)
+
+#else /* SMP */
+
+#define IMASK_LOCK /* NOP */
+#define IMASK_UNLOCK /* NOP */
+
+#endif /* SMP */
+
+#else /* LOCORE */
+
+/* global data in mp_machdep.c */
+extern struct mtx imen_mtx;
+
+#endif /* LOCORE */
+
#endif /* _MACHINE_APIC_H_ */
OpenPOWER on IntegriCloud