aboutsummaryrefslogtreecommitdiff
path: root/kernel/include/region.h
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2014-12-13 13:10:18 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2014-12-13 13:10:18 +0100
commit9a494b5b0718eafd89e4bb40dda33b0a4f6ee64f (patch)
tree8c8c70651e74298091c3181d9bdd57a76b0de9bf /kernel/include/region.h
parentd24b3806edddbfff587f1cf91a64338e0fadd48f (diff)
downloadkogata-9a494b5b0718eafd89e4bb40dda33b0a4f6ee64f.tar.gz
kogata-9a494b5b0718eafd89e4bb40dda33b0a4f6ee64f.zip
Remove hard-coded region types.
Diffstat (limited to 'kernel/include/region.h')
-rw-r--r--kernel/include/region.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/kernel/include/region.h b/kernel/include/region.h
index d7a47c4..1fef582 100644
--- a/kernel/include/region.h
+++ b/kernel/include/region.h
@@ -7,29 +7,19 @@
#include <sys.h>
#include <paging.h>
-// Region types
-#define REGION_T_KERNEL_BASE 0x00000001 // base kernel code & data
-#define REGION_T_DESCRIPTORS 0x00000002 // contains more region descriptors
-#define REGION_T_CORE_HEAP 0x00000100 // used for the core kernel heap
-#define REGION_T_KPROC_HEAP 0x00000200 // used for a kernel process' heap
-#define REGION_T_KPROC_STACK 0x00000400 // used for a kernel process' heap
-#define REGION_T_PROC_KSTACK 0x00000800 // used for a process' kernel heap
-#define REGION_T_CACHE 0x00001000 // used for cache
-#define REGION_T_HW 0x00002000 // used for hardware access
-
struct region_info;
typedef void (*page_fault_handler_t)(pagedir_t *pd, struct region_info *r, void* addr);
typedef struct region_info {
void* addr;
size_t size;
- uint32_t type;
+ char* type;
page_fault_handler_t pf;
} region_info_t;
void region_allocator_init(void* kernel_data_end);
-void* region_alloc(size_t size, uint32_t type, page_fault_handler_t pf); // returns 0 on error
+void* region_alloc(size_t size, char* type, page_fault_handler_t pf); // returns 0 on error
region_info_t *find_region(void* addr);
void region_free(void* addr);