diff options
author | Alex Auvolat <alex@adnab.me> | 2015-03-09 17:27:27 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2015-03-09 17:27:27 +0100 |
commit | 00ea1bdfe3d0758dc42942c5994664c51badf2f8 (patch) | |
tree | 8f1ea691be085f303a56de8977b186545481a292 /src/kernel/user/process.c | |
parent | 3341e7a3a184b5bea17f0f678b40bc51c92d72a4 (diff) | |
download | kogata-00ea1bdfe3d0758dc42942c5994664c51badf2f8.tar.gz kogata-00ea1bdfe3d0758dc42942c5994664c51badf2f8.zip |
Remove kernel region pf handlers ; fix forget-to-zero-out bug.
Diffstat (limited to 'src/kernel/user/process.c')
-rw-r--r-- | src/kernel/user/process.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/kernel/user/process.c b/src/kernel/user/process.c index d8f1eed..4d79327 100644 --- a/src/kernel/user/process.c +++ b/src/kernel/user/process.c @@ -682,8 +682,14 @@ void proc_usermem_pf(void* p, registers_t *regs, void* addr) { current_process_exit(PS_FAILURE, (addr < (void*)PAGE_SIZE ? FAIL_ZEROPTR : FAIL_SEGFAULT)); } - bool pr = ((regs->err_code & PF_PRESENT_BIT) != 0); - ASSERT(!pr); + bool pr = (regs->err_code & PF_PRESENT_BIT) != 0; + if (pr) { + uint32_t frame = pd_get_entry(addr); + dbg_printf("UPF 0x%p %s present %d 0x%p\n", + addr, (wr ? "write" : "read"), + frame >> PTE_FRAME_SHIFT, frame); + PANIC("Unexpected fault on present page."); + } addr = (void*)((uint32_t)addr & PAGE_MASK); |