2021-04-11 20:53:06 +02:00
|
|
|
#ifndef PAGING_H
|
|
|
|
#define PAGING_H
|
|
|
|
|
|
|
|
#define PAGING_CR0_BIT 0x80000000
|
2021-04-13 15:31:45 +02:00
|
|
|
#define PAGING_PAGE_SIZE 4096
|
|
|
|
#define PAGING_MAX_PAGES 2048
|
|
|
|
#if PAGING_MAX_PAGES%1024>0
|
|
|
|
#define PAGING_MAX_DIR_ENTRY PAGING_MAX_PAGES/1024+1
|
|
|
|
#else
|
|
|
|
#define PAGING_MAX_DIR_ENTRY PAGING_MAX_PAGES/1024
|
|
|
|
#endif
|
2021-04-11 20:53:06 +02:00
|
|
|
|
2021-04-12 10:13:21 +02:00
|
|
|
/*
|
|
|
|
* Configure and enable paging
|
|
|
|
*/
|
2021-04-11 20:53:06 +02:00
|
|
|
void paging_enable();
|
|
|
|
|
2021-04-13 15:31:45 +02:00
|
|
|
char* paging_allocate_next_page();
|
|
|
|
void paging_set_usage(int addr,char state);
|
|
|
|
/**
|
|
|
|
* Create a new page directory containing
|
|
|
|
* p pages.
|
|
|
|
*/
|
|
|
|
char *paging_allocate(int p);
|
|
|
|
void paging_dump(int min,int max);
|
2021-04-11 20:53:06 +02:00
|
|
|
#endif
|