diff options
Diffstat (limited to 'kernel/include/region.h')
-rw-r--r-- | kernel/include/region.h | 14 |
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); |