summaryrefslogtreecommitdiff
path: root/kernel/apic.h
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-10 19:08:04 +0200
committerMiguel <m.i@gmx.at>2018-09-10 19:08:04 +0200
commitee2ec6abbcfb6de48a8f5594e05ba0a837216fa8 (patch)
tree6173e5182459529ac5dc3fbb59b30fd37c5ee4ab /kernel/apic.h
parent65f5cca027af81e77b3e06da658b6d13f1861a03 (diff)
apic et al.
Diffstat (limited to 'kernel/apic.h')
-rw-r--r--kernel/apic.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/kernel/apic.h b/kernel/apic.h
new file mode 100644
index 0000000..f2252ed
--- /dev/null
+++ b/kernel/apic.h
@@ -0,0 +1,42 @@
+/**
+ * @file
+ * Advanced Programmable Interrupt Controller
+ * ==========================================
+ *
+ * The APIC consists of one (or more) IO-APIC and one LAPIC (Local APIC)
+ * for each core. Currently we only support he most usual setup with a single
+ * IO-APIC. Call apic_init() once, providing an acpi_information structure,
+ * before using the other functions.
+ */
+
+#include <stdint.h>
+#include "acpi.h"
+
+/** run this before anything else */
+void apic_init(acpi_information *info);
+
+/** setup io apic */
+void ioapic_config();
+
+/** get local apic id */
+uint32_t apic_id();
+
+/** send end-of-interrupt to local apic
+ * It seems we need this for hardware interrupts and IPIs as well
+ */
+void apic_eoi();
+
+/** send inter processor interrupt to destination and number */
+void apic_ipi(uint8_t dest, uint8_t number);
+
+/** enable local apic */
+void apic_enable();
+
+/** set ticks per second for timer interrupt*/
+void apic_init_timer(uint32_t ticks_per_second);
+
+/** startup other cpu
+ * @dest destination apic
+ * @addy entrypoint (example 0x7->0x7000 etc..)
+ * */
+void apic_sipi(uint32_t dest,uint32_t addy);