mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 21:58:20 +00:00
Fix a few issues
Panics in a few ISRs did not include registers. Removed a dot in panic string. Fixed an issue that would cause the system to page fault inside the vmm_dealwithrequest() function.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include <kernel/vmm.h>
|
||||
|
||||
void isr_general(arch_regs *reg){
|
||||
_panic("Unhandled interrupt", 0);
|
||||
_panic("Unhandled interrupt", reg);
|
||||
asm("hlt");
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ void isr_except(arch_regs *reg){
|
||||
void isr_pagefault(arch_regs *reg){
|
||||
|
||||
if(!vmm_dealwithrequest(reg->cr2))
|
||||
_panic("Page fault!\n", 0);
|
||||
_panic("Page fault!", reg);
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ static void tracestack(uint64_t** addr){
|
||||
|
||||
__attribute((noreturn)) void _panic(char* reason, arch_regs *reg){
|
||||
|
||||
printf("PANIC: %s.\n", reason);
|
||||
printf("PANIC: %s\n", reason);
|
||||
|
||||
if(reg){
|
||||
printf("Register dump:\nRAX: %p RBX: %p RCX: %p RDX: %p R8: %p R9: %p R10: %p R11: %p R12: %p R13: %p R14: %p R15: %p RDI: %p RSP: %p RBP: %p DS: %p ES: %p FS: %p GS: %p CR2: %p ERR: %p RIP: %p CS: %p RFLAGS: %p SS: %p\n",
|
||||
|
||||
+4
-1
@@ -439,12 +439,15 @@ bool vmm_map(void* paddr, void* vaddr, size_t pagec, size_t mmuflags){
|
||||
bool vmm_dealwithrequest(void* addr){
|
||||
|
||||
int* lock;
|
||||
vmm_mapping** start;
|
||||
vmm_mapping** start = NULL;
|
||||
|
||||
getcontextinfo(addr, &lock, &start);
|
||||
|
||||
if(!start) return false;
|
||||
|
||||
spinlock_acquire(lock);
|
||||
|
||||
|
||||
bool status;
|
||||
vmm_mapping* map = findmappingfromaddr(*start, addr);
|
||||
void* paddr;
|
||||
|
||||
Reference in New Issue
Block a user