aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/region.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 18:04:59 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-09 18:04:59 +0100
commitcaf842864bdc0794e387f9580af96ab1036996f4 (patch)
tree92b1e05e5ed79628132e320dcaa84a25eebd0dd7 /src/kernel/core/region.c
parent3b03f1e41558131ca2f83a460f4d2e289cbedac0 (diff)
downloadkogata-caf842864bdc0794e387f9580af96ab1036996f4.tar.gz
kogata-caf842864bdc0794e387f9580af96ab1036996f4.zip
Change semantics of pd_map_page to return true on success, false on error.
Diffstat (limited to 'src/kernel/core/region.c')
-rw-r--r--src/kernel/core/region.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kernel/core/region.c b/src/kernel/core/region.c
index 3127048..c14f129 100644
--- a/src/kernel/core/region.c
+++ b/src/kernel/core/region.c
@@ -293,8 +293,8 @@ void* region_alloc(size_t size, char* type, page_fault_handler_t pf) {
void* descriptor_region = region_alloc_inner(PAGE_SIZE, "Region descriptors", 0, true);
ASSERT(descriptor_region != 0);
- int error = pd_map_page(descriptor_region, frame, 1);
- if (error) {
+ bool map_ok = pd_map_page(descriptor_region, frame, 1);
+ if (!map_ok) {
// this can happen if we weren't able to allocate a frame for
// a new pagetable
frame_free(frame, 1);
@@ -339,8 +339,8 @@ void default_allocator_pf_handler(pagedir_t *pd, struct region_info *r, void* ad
uint32_t f = frame_alloc(1);
if (f == 0) PANIC("Out Of Memory");
- int error = pd_map_page(addr, f, 1);
- if (error) PANIC("Could not map frame (OOM)");
+ bool map_ok = pd_map_page(addr, f, 1);
+ if (!map_ok) PANIC("Could not map frame (OOM)");
}
void region_free_unmap_free(void* ptr) {