diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-02 18:10:14 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-02 18:10:14 +0100 |
commit | 456fc99e8feac598f7c6f1a3aaa82bf994404e39 (patch) | |
tree | c2aaf5b8225f7873f8189c5606bfe9041a7fa582 /kernel/include | |
parent | 76795abc2f08f180b7a895aaf26e80b971caa81c (diff) | |
download | kogata-456fc99e8feac598f7c6f1a3aaa82bf994404e39.tar.gz kogata-456fc99e8feac598f7c6f1a3aaa82bf994404e39.zip |
Begin implementation of paging
Diffstat (limited to 'kernel/include')
-rw-r--r-- | kernel/include/paging.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kernel/include/paging.h b/kernel/include/paging.h new file mode 100644 index 0000000..5766e65 --- /dev/null +++ b/kernel/include/paging.h @@ -0,0 +1,25 @@ +#pragma once + +#include <sys.h> + +struct page_directory; +typedef struct page_directory pagedir_t; + + +void paging_setup(void* kernel_data_end); + +pagedir_t *get_current_pagedir(); +pagedir_t *get_kernel_pagedir(); + +void switch_pagedir(pagedir_t *pd); + +uint32_t pd_get_frame(pagedir_t *pd, size_t vaddr); // get physical frame for virtual address +int pd_map_page(pagedir_t *pd, + size_t vaddr, uint32_t frame_id, + uint32_t rw); // returns nonzero on error +void pd_unmap_page(pagedir_t *pd, size_t vaddr); // does nothing if page wasn't mapped + +pagedir_t *create_pagedir(); // returns zero on error +void delete_pagedir(pagedir_t *pd); + +/* vim: set ts=4 sw=4 tw=0 noet :*/ |