Files
jsix/src/kernel/interrupts.h
Justin C. Miller 62c559043d Pause syscall and int 0xee interrupt syscalls
The syscall/sysret instructions don't swap stacks. This was bad but
passable until syscalls caused the scheduler to run, and scheduling a
task that paused due to interrupt.

Adding a new (hopefully temporary) syscall interrupt `int 0xee` to allow
me to test syscalls without stack issues before I tackle the
syscall/sysret issue.

Also implemented a basic `pause` syscall that causes the calling process
to become unready. Because nothing can wake a process yet, it never
returns.
2018-09-12 20:59:08 -07:00

37 lines
786 B
C

#pragma once
/// \file interrupts.h
/// Free functions and definitions related to interrupt service vectors
#include <stdint.h>
/// Enum of all defined ISR/IRQ vectors
enum class isr : uint8_t
{
#define ISR(i, name) name = i,
#define EISR(i, name) name = i,
#define UISR(i, name) name = i,
#define IRQ(i, q, name) name = i,
#include "interrupt_isrs.inc"
#undef IRQ
#undef UISR
#undef EISR
#undef ISR
_zero = 0
};
/// Helper operator to add an offset to an isr vector
isr operator+(const isr &lhs, int rhs);
extern "C" {
/// Set the CPU interrupt enable flag (sti)
void interrupts_enable();
/// Set the CPU interrupt disable flag (cli)
void interrupts_disable();
}
/// Fill the IDT with our ISRs, and disable the legacy
/// PIC interrupts.
void interrupts_init();