Contains code and definitons for Paging.
More...
#include <basics.h>
#include <userland.h>
#include <limine.h>
Go to the source code of this file.
|
| void | map_user_page (uint64_t virt, uint64_t phys, uint64_t flags) |
| | Function to map userland pages.
|
|
void | unmap_user_page (uint64_t virt) |
| void | paging_set_hhdm_offset (uint64_t offset) |
| | Sets the HHDM offset used to access physical memory virtually.
|
|
uintptr_t | allocate_page (void) |
|
uintptr_t | allocate_pages (size_t count) |
|
uint64_t | virtual_to_physical (uint64_t virt) |
|
uint64_t | fast_virt_to_phys (void *v) |
|
uint64_t | virt_to_phys (void *v) |
Contains code and definitons for Paging.
- Author
- Pradosh (prado.nosp@m.shga.nosp@m.me@gm.nosp@m.ail..nosp@m.com)
- Version
- 0.1
- Date
- 2023-12-17
- Copyright
- Copyright (c) Pradosh 2023
Definition in file paging.h.
◆ PAGE_NX
| #define PAGE_NX (1ULL << 63) |
◆ PAGE_PRESENT
◆ PAGE_RW
◆ PAGE_SIZE
| #define PAGE_SIZE 4096ULL |
◆ PAGE_USER
◆ USER_CODE_FLAGS
| #define USER_CODE_FLAGS (PAGE_PRESENT | PAGE_USER | PAGE_RW ) |
◆ USER_DATA_FLAGS
| #define USER_DATA_FLAGS (PAGE_PRESENT | PAGE_USER | PAGE_RW | PAGE_NX) |
◆ map_user_page()
| void map_user_page |
( |
uint64_t | virt, |
|
|
uint64_t | phys, |
|
|
uint64_t | flags ) |
Function to map userland pages.
- Parameters
-
| virt | Virtual memory address of user |
| phys | Physical memory address of kernel's user code. |
| flags | Permissions |
◆ paging_set_hhdm_offset()
| void paging_set_hhdm_offset |
( |
uint64_t | offset | ) |
|
Sets the HHDM offset used to access physical memory virtually.
- Parameters
-
| offset | HHDM offset provided by Limine. |