blob: 8128d43214115ad5a32f2a6bc61a48391288c61d [file] [log] [blame]
swissChili825d46b2021-02-21 10:14:16 -08001#pragma once
2
3#include "kint.h"
4#include "registers.h"
5
swissChilie0a79bb2021-02-22 19:54:48 -08006#define VIRT_TO_PHYS(virt) ((uint)(virt) - 0xC0000000)
7#define PHYS_TO_VIRT(phys) ((uint)(phys) + 0xC0000000)
8#define KERNEL_VIRTUAL_BASE 0xC0000000
9#define KERNEL_PAGE_NUMBER (KERNEL_VIRTUAL_BASE >> 22)
10
swissChili825d46b2021-02-21 10:14:16 -080011/* defined in switch_table.s */
12extern uint load_page_directory(uint table_address);
13extern void enable_paging();
14
swissChilie0a79bb2021-02-22 19:54:48 -080015void init_paging();
swissChili825d46b2021-02-21 10:14:16 -080016
swissChilie4f01992021-02-25 15:38:12 -080017void alloc_frame(uint *page_table_entry, bool user, bool writable);
18void alloc_kernel_page(uint *page);
swissChili825d46b2021-02-21 10:14:16 -080019void page_fault(struct registers *regs);