FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
paging.h
Go to the documentation of this file.
1
11#ifndef PAGING_H
12#define PAGING_H
13
14#include <basics.h>
15#include <userland.h>
16#include <limine.h>
17
18#define PAGE_SIZE 4096ULL
19
20#define PAGE_PRESENT 0x1
21#define PAGE_RW 0x2
22#define PAGE_USER 0x4
23#define PAGE_NX (1ULL << 63)
24
25#define USER_CODE_FLAGS (PAGE_PRESENT | PAGE_USER | PAGE_RW )
26#define USER_DATA_FLAGS (PAGE_PRESENT | PAGE_USER | PAGE_RW | PAGE_NX)
27
28extern struct limine_memmap_response *memmap;
29
37void map_user_page(uint64_t virt, uint64_t phys, uint64_t flags);
38void unmap_user_page(uint64_t virt);
39
45void paging_set_hhdm_offset(uint64_t offset);
46
47uintptr_t allocate_page(void);
48uintptr_t allocate_pages(size_t count);
49uint64_t virtual_to_physical(uint64_t virt);
50uint64_t fast_virt_to_phys(void* v);
51uint64_t virt_to_phys(void* v);
52
53#endif
This is a basic header files with FrostWing specific short forms and basically a good for life header...
void map_user_page(uint64_t virt, uint64_t phys, uint64_t flags)
Function to map userland pages.
void paging_set_hhdm_offset(uint64_t offset)
Sets the HHDM offset used to access physical memory virtually.
The Header file for userland/userspace.