2023-01-23 20:13:57 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-03-08 03:16:51 +02:00
|
|
|
#define DISABLE_INTERRUPTS() asm volatile("cli")
|
|
|
|
#define ENABLE_INTERRUPTS() asm volatile("sti")
|
|
|
|
|
2023-01-23 20:13:57 +02:00
|
|
|
class InterruptController
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~InterruptController() {}
|
|
|
|
|
2023-02-01 21:05:44 +02:00
|
|
|
virtual void eoi(uint8_t) = 0;
|
|
|
|
virtual void enable_irq(uint8_t) = 0;
|
|
|
|
virtual bool is_in_service(uint8_t) = 0;
|
2023-01-23 20:13:57 +02:00
|
|
|
|
2023-02-01 21:05:44 +02:00
|
|
|
static void initialize(bool force_pic);
|
|
|
|
static InterruptController& get();
|
2023-03-08 03:16:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
bool interrupts_enabled();
|