diff options
author | Alex Auvolat <alex@adnab.me> | 2015-03-14 16:36:31 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2015-03-14 16:36:31 +0100 |
commit | 3e2a3170501fb02b5b46a342c47d2ba8b1a6e244 (patch) | |
tree | 6cd0a3f3ded016de581e3b3841ab19f1e511dd86 /src/kernel/include | |
parent | 57c5eceb846f3109d017b4e6d4cbd7c507c0d098 (diff) | |
download | kogata-3e2a3170501fb02b5b46a342c47d2ba8b1a6e244.tar.gz kogata-3e2a3170501fb02b5b46a342c47d2ba8b1a6e244.zip |
Factorize region allocator between kernel and user processes (same code was there twice)
Diffstat (limited to 'src/kernel/include')
-rw-r--r-- | src/kernel/include/region.h | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/kernel/include/region.h b/src/kernel/include/region.h index 2593dba..f4562ac 100644 --- a/src/kernel/include/region.h +++ b/src/kernel/include/region.h @@ -1,25 +1,7 @@ #pragma once -// Kernel virtual memory region allocator +#include <region_alloc.h> -// This is entirely thread-safe - -#include <sys.h> -#include <paging.h> - -struct region_info; - -typedef struct region_info { - void* addr; - size_t size; - char* type; -} region_info_t; - -void region_allocator_init(void* kernel_data_end); - -void* region_alloc(size_t size, char* type); // returns 0 on error -region_info_t *find_region(void* addr); -void region_free(void* addr); // some functions for freeing regions and frames // region_free_unmap_free : deletes a region and frees all frames that were mapped in it @@ -27,6 +9,6 @@ void region_free_unmap_free(void* addr); // region_free_unmap : deletes a region and unmaps all frames that were mapped in it, without freeing them void region_free_unmap(void* addr); -void dbg_print_region_info(); +bool alloc_map_single_frame(void* addr); // used by kernel region allocator /* vim: set ts=4 sw=4 tw=0 noet :*/ |