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:
Matheus
2022-07-29 09:37:09 -03:00
parent f508798638
commit a316d054f5
7 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
typedef struct{
gdt_t gdt;
ist_t ist;
arch_regserror *laststate;
arch_regs *laststate;
vmm_context *context;
} cls_t;
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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
+1 -5
View File
@@ -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
+4
View File
@@ -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
+3 -3
View File
@@ -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);
+1 -1
View File
@@ -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);