1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00

Reorder code

This commit is contained in:
Alex Kotov 2021-12-19 01:26:49 +05:00
parent a90279cb8b
commit b1cd004fe8
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 7 additions and 7 deletions

View file

@ -5,6 +5,12 @@
#include <kernaux/libc.h>
#include <kernaux/stdlib.h>
void paging_load(struct Paging *const paging)
{
uint32_t page_dir_phys = (uint32_t)&paging->page_dir;
kernaux_arch_i386_write_cr3(page_dir_phys);
}
void paging_enable()
{
uint32_t cr0 = kernaux_arch_i386_read_cr0();
@ -35,12 +41,6 @@ void paging_enable()
kernaux_arch_i386_write_cr4(cr4);
}
void paging_load(struct Paging *const paging)
{
uint32_t page_dir_phys = (uint32_t)&paging->page_dir;
kernaux_arch_i386_write_cr3(page_dir_phys);
}
void paging_clear(struct Paging *const paging)
{
memset(&paging->page_dir, 0, sizeof(paging->page_dir));

View file

@ -21,8 +21,8 @@ __attribute__((packed))
__attribute__((aligned((PAGE_DIR_ALIGN))))
;
void paging_enable();
void paging_load(struct Paging *paging);
void paging_enable();
void paging_clear(struct Paging *paging);
void paging_identity(struct Paging *paging);