diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-02 16:43:34 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-02 16:43:34 +0100 |
commit | 76795abc2f08f180b7a895aaf26e80b971caa81c (patch) | |
tree | e12017fd5856afb1cdcfd9940dbf4661017dba16 /kernel/include/frame.h | |
parent | c7bcf94b1e70721d0f7bfb5ca383d996559c2559 (diff) | |
download | kogata-76795abc2f08f180b7a895aaf26e80b971caa81c.tar.gz kogata-76795abc2f08f180b7a895aaf26e80b971caa81c.zip |
Add physical page (frame) allocator.
Diffstat (limited to 'kernel/include/frame.h')
-rw-r--r-- | kernel/include/frame.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/include/frame.h b/kernel/include/frame.h new file mode 100644 index 0000000..9ffafb3 --- /dev/null +++ b/kernel/include/frame.h @@ -0,0 +1,14 @@ +#pragma once + +#include <sys.h> + +// frame.h : physical memory allocator + +void frame_init_allocator(size_t total_ram, void** kernel_data_end); + +uint32_t frame_alloc(size_t n); // allocate n consecutive frames (returns 0 on failure) +void frame_free(uint32_t base, size_t n); + +void dbg_print_frame_stats(); + +/* vim: set ts=4 sw=4 tw=0 noet :*/ |