blob: 921524fe774983790f9a55afb6611f20b84a04ee [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
15void *_kmalloc(size_t size, bool align, void **phys);
16void *kmalloc(size_t size);
17void *kmalloc_a(size_t size);
18void *kmalloc_ap(size_t size, void **p);
19
swissChilie0a79bb2021-02-22 19:54:48 -080020void init_paging();
swissChili825d46b2021-02-21 10:14:16 -080021
22void page_fault(struct registers *regs);