mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 13:48:21 +00:00
Unify the arch_regs structs
I was doing something stupid and keeping a separate version for the cpu registers. oh well, I fixed it now
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
typedef struct{
|
||||
gdt_t gdt;
|
||||
ist_t ist;
|
||||
arch_regserror *laststate;
|
||||
arch_regs *laststate;
|
||||
vmm_context *context;
|
||||
} cls_t;
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#include <arch/regs.h>
|
||||
|
||||
extern void asmisr_general(arch_regsnoerror*);
|
||||
extern void asmisr_except(arch_regserror*);
|
||||
extern void asmisr_pagefault(arch_regserror*);
|
||||
extern void asmisr_general(arch_regs*);
|
||||
extern void asmisr_except(arch_regs*);
|
||||
extern void asmisr_pagefault(arch_regs*);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
#include <arch/regs.h>
|
||||
|
||||
__attribute__((noreturn)) void _panic(char *reason, arch_regserror *reg);
|
||||
__attribute__((noreturn)) void _panic(char *reason, arch_regs *reg);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
|
||||
typedef struct{
|
||||
uint64_t cr2,gs,fs,es,ds,rax,rbx,rcx,rdx,r8,r9,r10,r11,r12,r13,r14,r15,rdi,rsi,rbp,error,rip,cs,rflags,rsp,ss;
|
||||
} arch_regserror;
|
||||
|
||||
typedef struct{
|
||||
uint64_t cr2,gs,fs,es,ds,rax,rbx,rcx,rdx,r8,r9,r10,r11,r12,r13,r14,r15,rdi,rsi,rbp,rip,cs,rflags,rsp,ss;
|
||||
} arch_regsnoerror;
|
||||
} arch_regs;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -83,6 +83,8 @@ section .text
|
||||
|
||||
global %1
|
||||
%1:
|
||||
|
||||
push qword 0 ; error code for regs struct
|
||||
|
||||
pushregs
|
||||
|
||||
@@ -93,6 +95,8 @@ section .text
|
||||
call %2
|
||||
|
||||
popregs
|
||||
|
||||
add rsp,8 ; remove error code
|
||||
|
||||
iretq
|
||||
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
#include <arch/panic.h>
|
||||
#include <kernel/vmm.h>
|
||||
|
||||
void isr_general(arch_regsnoerror *reg){
|
||||
void isr_general(arch_regs *reg){
|
||||
_panic("Unhandled interrupt", 0);
|
||||
asm("hlt");
|
||||
}
|
||||
|
||||
void isr_except(arch_regserror *reg){
|
||||
void isr_except(arch_regs *reg){
|
||||
_panic("CPU Exception", reg);
|
||||
asm("hlt;");
|
||||
}
|
||||
|
||||
void isr_pagefault(arch_regserror *reg){
|
||||
void isr_pagefault(arch_regs *reg){
|
||||
|
||||
if(!vmm_dealwithrequest(reg->cr2))
|
||||
_panic("Page fault!\n", 0);
|
||||
|
||||
@@ -18,7 +18,7 @@ static void tracestack(uint64_t** addr){
|
||||
}
|
||||
}
|
||||
|
||||
__attribute((noreturn)) void _panic(char* reason, arch_regserror *reg){
|
||||
__attribute((noreturn)) void _panic(char* reason, arch_regs *reg){
|
||||
|
||||
printf("PANIC: %s.\n", reason);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user