summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-04-20 00:58:37 +0000
committerAda Christine <adachristine18@gmail.com>2021-04-20 00:58:37 +0000
commit73c73b2a8c9c3a6332942a1146fd18d74616e5b2 (patch)
treef908538659eb9b9bf6465f0ee930b064f7dc5531 /kernel
parent5fb68ad14bbd110c967e26ff4aad7b7e8aadd28f (diff)
panic on unhandled fault in anonymous space
Diffstat (limited to 'kernel')
-rw-r--r--kernel/memory.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/memory.c b/kernel/memory.c
index fcd0f1f..9d44be5 100644
--- a/kernel/memory.c
+++ b/kernel/memory.c
@@ -453,7 +453,12 @@ static struct memory_space *get_memory_space(void *address)
int anonymous_page_handler(uint32_t code, void *address)
{
- (void)code;
+ if (code & PAGE_PR)
+ {
+ // there's no reason a protection violation should happen
+ // in anonymous space
+ panic(UNHANDLED_FAULT);
+ }
kputs("anonymous fault\n");
// kernel page mappings are built different
if (address >= (void *)&k_virt_base)