2019-02-09 12:52:45 -06:00
|
|
|
#ifndef PAGING_H
|
|
|
|
#define PAGING_H
|
|
|
|
|
2020-07-22 19:26:55 -05:00
|
|
|
#include "arch_consts.h"
|
2020-07-22 19:35:23 -05:00
|
|
|
#include <stdint.h>
|
2019-02-09 12:52:45 -06:00
|
|
|
|
2019-03-11 09:32:55 -05:00
|
|
|
void map_pages(void* virt_addr_ptr,void* phys_addr_ptr,int num_pages,char usr,char wr);
|
2020-07-20 09:51:30 -05:00
|
|
|
int new_kstack();
|
2019-05-28 16:05:51 -05:00
|
|
|
void unmap_pages(void* start_virt,uint32_t num_pages);
|
2019-03-11 09:32:55 -05:00
|
|
|
void* alloc_pages(int num_pages);
|
|
|
|
void alloc_pages_virt(int num_pages,void* addr);
|
2019-02-09 13:05:13 -06:00
|
|
|
void paging_init();
|
2019-05-05 13:14:14 -05:00
|
|
|
void* paging_new_address_space();
|
2020-07-22 19:26:55 -05:00
|
|
|
void load_address_space(void* cr3);
|
2019-05-04 10:42:17 -05:00
|
|
|
void* virt_to_phys(void* virt_addr);
|
2019-09-22 08:25:08 -05:00
|
|
|
void* find_free_pages(int num_pages);
|
2020-07-20 09:51:30 -05:00
|
|
|
void* find_free_pages_wstart(int num_pages,int start_page);
|
2020-07-22 19:26:55 -05:00
|
|
|
void load_smap(void* cr3);
|
2019-10-20 09:44:33 -05:00
|
|
|
char make_protector(int page);
|
2020-07-22 19:26:55 -05:00
|
|
|
char is_in_protector(void* addr);
|
|
|
|
void* get_cr3();
|
2019-05-04 10:52:38 -05:00
|
|
|
|
2019-02-09 12:52:45 -06:00
|
|
|
#endif
|