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

34 lines
1.0 KiB
C
Raw Normal View History

2019-06-15 13:42:30 +02:00
// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
2019-06-18 22:56:41 +02:00
#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
2019-06-15 13:42:30 +02:00
enum
{
E_SHT, // Shutdown instruction
E_UDF, // Undefined behavior
2019-06-18 22:56:41 +02:00
E_ILL, // Ill-formed instruction
E_ACC, // Invalid memory access
2019-06-15 13:42:30 +02:00
E_SYS, // Supervisor only
2019-06-18 22:56:41 +02:00
E_DBF, // Double fault
E_IMP, // Not implemented
2019-06-15 13:42:30 +02:00
E_ALI, // Alignment error
2019-06-21 19:38:31 +02:00
E_BRK, // Ctrl+C or similar
2019-07-09 19:51:03 +02:00
E_OVF, // INTO instruction
2019-07-17 20:26:03 +02:00
E_DIV, // Division by zero
2019-06-15 13:42:30 +02:00
NEXCPTS
};
2019-06-16 12:48:30 +02:00
extern int dying;
2019-06-21 22:19:55 +02:00
extern jmp_buf exc_jmp_buf;
2019-06-16 12:48:30 +02:00
2019-06-18 22:56:41 +02:00
void main_loop(void) __attribute__((__noreturn__));
2019-06-15 13:42:30 +02:00
void _except(ctx_t *, int, char *, ...) __attribute__((__noreturn__));