1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
kvisc/vm/pc/except.h
2019-07-17 20:26:03 +02:00

34 lines
1.0 KiB
C

// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#define IDT_SLOTS 1024
extern ulong **rfs;
extern size_t rfs_current_idx;
extern ulong idt[IDT_SLOTS];
extern bool idt_masked[IDT_SLOTS]; // delibarately masked by software
extern bool idt_handling[IDT_SLOTS]; // a handler is already running
enum
{
E_SHT, // Shutdown instruction
E_UDF, // Undefined behavior
E_ILL, // Ill-formed instruction
E_ACC, // Invalid memory access
E_SYS, // Supervisor only
E_DBF, // Double fault
E_IMP, // Not implemented
E_ALI, // Alignment error
E_BRK, // Ctrl+C or similar
E_OVF, // INTO instruction
E_DIV, // Division by zero
NEXCPTS
};
extern int dying;
extern jmp_buf exc_jmp_buf;
void main_loop(void) __attribute__((__noreturn__));
void _except(ctx_t *, int, char *, ...) __attribute__((__noreturn__));