blob: ad3671e4e49aa6e104f3f6e05a1b229c99abd01a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#ifndef PAGING_H
#define PAGING_H
#define PAGING_CR0_BIT 0x80000000
#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
/*
* Configure and enable paging
*/
void paging_enable();
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);
#endif
|