From 9a494b5b0718eafd89e4bb40dda33b0a4f6ee64f Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 13 Dec 2014 13:10:18 +0100 Subject: Remove hard-coded region types. --- kernel/include/region.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'kernel/include') 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 #include -// 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); -- cgit v1.2.3