mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-03 18:22:22 +00:00
Got decent exception handling
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#ifndef _EXCEPTIONS_H
|
||||
#define _EXCEPTIONS_H
|
||||
|
||||
#include "isr.h"
|
||||
|
||||
#define EXCEPTION_DE 0
|
||||
#define EXCEPTION_BP 3
|
||||
#define EXCEPTION_OF 4
|
||||
#define EXCEPTION_BR 5
|
||||
#define EXCEPTION_UD 6
|
||||
#define EXCEPTION_NM 7
|
||||
#define EXCEPTION_DF 8
|
||||
#define EXCEPTION_GP 13
|
||||
#define EXCEPTION_PF 14
|
||||
#define EXCEPTION_AC 17
|
||||
|
||||
typedef void (*exception_handler_ptr)(struct isr_int_frame* iframe, bool user);
|
||||
|
||||
const extern char* exception_strings[];
|
||||
|
||||
int exception_init(void);
|
||||
void exception_handle(struct isr_int_frame* iframe);
|
||||
|
||||
#endif
|
||||
@@ -9,6 +9,7 @@
|
||||
#define PTE_FLAG_USER (1UL << 2) // User-mode (DPL3) access allowed
|
||||
#define PTE_FLAG_PWT (1UL << 3) // Page write-thru
|
||||
#define PTE_FLAG_NOCACHE (1UL << 4) // Cache disable
|
||||
#define PTE_FLAG_FETCH (1UL << 4) // Fetch
|
||||
#define PTE_FLAG_ACCESSED (1UL << 5) // Indicates whether page was read/written
|
||||
#define PTE_FLAG_DIRTY (1UL << 6) // Indicates whether page was written to (valid for PT only)
|
||||
#define PTE_FLAG_PAT (1UL << 7) // Page Attribute Table (valid for PT only)
|
||||
|
||||
Reference in New Issue
Block a user