[MODERN FEATURES] Enable APIC

This commit is contained in:
2017-01-24 22:19:23 +01:00
parent 56d5fea388
commit 8bd9b0ef16
4 changed files with 82 additions and 0 deletions

11
kernel/include/apic.h Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
#include <stdint.h>
void apic_init();
void apic_interrupt(uint8_t destination, uint8_t level, uint8_t type, uint8_t vector);
void apic_ack();
#define APIC_INT_LEVEL_ASSERT 0x1
#define APIC_INT_LEVEL_DEASSERT 0x0
#define APIC_INT_TYPE_FIXED 0x0
#define APIC_INT_TYPE_INIT 0x5
#define APIC_INT_TYPE_STARTUP 0x6

View File

@@ -58,6 +58,14 @@
#define INT_IRQ22 0x36
#define INT_IRQ23 0x37
#define INT_APIC_TIMER 0x40
#define INT_APIC_THERMAL 0x41
#define INT_APIC_PERF 0x42
#define INT_APIC_LINT0 0x43
#define INT_APIC_LINT1 0x44
#define INT_APIC_ERROR 0x45
#define INT_APIC_SPUR 0xFF
#ifndef __ASSEMBLER__
#include <stdint.h>