aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/region.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-03-02 18:16:15 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-03-02 18:16:15 +0100
commitceb687b02964197133fd2236cdbc74bf3948d034 (patch)
treeb34b7aeec70990978c2562aa2d7b00202a223926 /src/kernel/core/region.c
parentb68881abc4c50bbc8ee9e81b4e18b0ea011b83b7 (diff)
downloadkogata-ceb687b02964197133fd2236cdbc74bf3948d034.tar.gz
kogata-ceb687b02964197133fd2236cdbc74bf3948d034.zip
No lazy allocation of kernel memory. Placeholder for pmem freeing routine.
Diffstat (limited to 'src/kernel/core/region.c')
-rw-r--r--src/kernel/core/region.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/kernel/core/region.c b/src/kernel/core/region.c
index c2c00a9..d22a98f 100644
--- a/src/kernel/core/region.c
+++ b/src/kernel/core/region.c
@@ -333,14 +333,14 @@ region_info_t *find_region(void* addr) {
// HELPER FUNCTIONS : SIMPLE PF HANDLERS ; FREEING FUNCTIONS //
// ========================================================= //
-void default_allocator_pf_handler(pagedir_t *pd, struct region_info *r, void* addr) {
- ASSERT(pd_get_frame(addr) == 0); // if error is of another type (RO, protected), we don't do anyting
-
- uint32_t f = frame_alloc(1);
- if (f == 0) PANIC("Out Of Memory");
+void pf_handler_unexpected(pagedir_t *pd, struct region_info *r, void* addr) {
+ dbg_printf("Unexpected page fault at 0x%p\n", addr);
+ PANIC("Unexpected page fault");
+}
- bool map_ok = pd_map_page(addr, f, 1);
- if (!map_ok) PANIC("Could not map frame (OOM)");
+void pf_handler_stackoverflow(pagedir_t *pd, struct region_info *r, void* addr) {
+ dbg_printf("Kernel stack overflow at 0x%p\n", addr);
+ PANIC("Kernel stack overflow");
}
void region_free_unmap_free(void* ptr) {