diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-05 15:06:17 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-05 15:06:17 +0100 |
commit | 274765f7daa3cc1094f9f26196fcf2b9a5289ee2 (patch) | |
tree | 974b59905b942ded566c5f9c2d512472646288fc /kernel/include/region.h | |
parent | 902eea7a56b38c20bbdca414e58fc6c3f4393025 (diff) | |
download | kogata-274765f7daa3cc1094f9f26196fcf2b9a5289ee2.tar.gz kogata-274765f7daa3cc1094f9f26196fcf2b9a5289ee2.zip |
Corrections :
- replace size_t by void* in many places
- correct bug in region freeing code
Diffstat (limited to 'kernel/include/region.h')
-rw-r--r-- | kernel/include/region.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/include/region.h b/kernel/include/region.h index 1628370..bc26bfe 100644 --- a/kernel/include/region.h +++ b/kernel/include/region.h @@ -15,18 +15,19 @@ #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, size_t addr); +typedef void (*page_fault_handler_t)(pagedir_t *pd, struct region_info *r, void* addr); typedef struct region_info { - size_t addr, size; + void* addr; + size_t size; uint32_t type; page_fault_handler_t pf; } region_info_t; void region_allocator_init(void* kernel_data_end); -size_t region_alloc(size_t size, uint32_t type, page_fault_handler_t pf); // returns 0 on error -region_info_t *find_region(size_t addr); -void region_free(size_t addr); +void* region_alloc(size_t size, uint32_t type, page_fault_handler_t pf); // returns 0 on error +region_info_t *find_region(void* addr); +void region_free(void* addr); void dbg_print_region_stats(); |