From 3e2a3170501fb02b5b46a342c47d2ba8b1a6e244 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 14 Mar 2015 16:36:31 +0100 Subject: Factorize region allocator between kernel and user processes (same code was there twice) --- src/kernel/include/region.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/kernel/include') 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 -// This is entirely thread-safe - -#include -#include - -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 :*/ -- cgit v1.2.3