2017-11-04 14:31:24 +00:00
|
|
|
#ifndef KERNELMQ_INCLUDED_PAGING
|
|
|
|
#define KERNELMQ_INCLUDED_PAGING 1
|
|
|
|
|
2020-12-01 19:11:28 +00:00
|
|
|
#include "config.h"
|
2017-11-09 16:00:36 +00:00
|
|
|
#include "info.h"
|
2017-11-04 14:31:24 +00:00
|
|
|
|
2020-12-01 19:11:28 +00:00
|
|
|
#define PAGE_DIR_ALIGN 4096
|
|
|
|
|
|
|
|
#define PAGE_DIR_ADDR(base) ((base) >> 12)
|
|
|
|
|
|
|
|
struct PageDir_Entry {
|
|
|
|
unsigned int present : 1;
|
|
|
|
unsigned int writable : 1;
|
|
|
|
unsigned int user : 1;
|
|
|
|
unsigned int write_through : 1;
|
|
|
|
unsigned int cache_disabled : 1;
|
|
|
|
unsigned int accessed : 1;
|
|
|
|
unsigned int always_0 : 1;
|
|
|
|
unsigned int page_size : 1;
|
|
|
|
unsigned int ignored : 1;
|
|
|
|
unsigned int unused : 3;
|
|
|
|
unsigned int addr : 20;
|
|
|
|
}
|
|
|
|
__attribute__((packed));
|
|
|
|
|
|
|
|
typedef struct PageDir_Entry PageDir[PAGE_DIR_LENGTH] __attribute__((aligned((PAGE_DIR_ALIGN))));
|
|
|
|
|
2017-11-04 14:59:01 +00:00
|
|
|
void paging_enable();
|
|
|
|
|
2017-11-04 14:31:24 +00:00
|
|
|
void paging_clear();
|
2017-11-05 05:56:53 +00:00
|
|
|
void paging_identity();
|
2017-11-04 14:31:24 +00:00
|
|
|
int paging_mapkernel(const struct KernelMQ_Info *kinfo);
|
2017-11-04 14:43:07 +00:00
|
|
|
unsigned long paging_load();
|
2017-11-04 14:31:24 +00:00
|
|
|
|
|
|
|
#endif
|