Move string functions/utils from HAL to std/string
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#include "proc/proc.h"
|
||||
#include "kprintf.h"
|
||||
#include "spinlock/spinlock.h"
|
||||
#include "std/string.h"
|
||||
|
||||
uint64_t KERNEL_CR3 = 0;
|
||||
SpinLock spinlock;
|
||||
@ -41,7 +42,7 @@ uint64_t *hal_vmm_nexttable(uint64_t *table, uint64_t ent, bool alloc) {
|
||||
|
||||
uint8_t *newphys = pmm_alloc(1);
|
||||
phys = (uint64_t)newphys;
|
||||
hal_memset(VIRT(phys), 0, HAL_PAGE_SIZE);
|
||||
memset(VIRT(phys), 0, HAL_PAGE_SIZE);
|
||||
table[ent] = phys | HAL_PG_USER | HAL_PG_RW | HAL_PG_PRESENT;
|
||||
}
|
||||
return (uint64_t *)((uint8_t *)VIRT(phys));
|
||||
@ -112,7 +113,7 @@ void hal_vmm_map_kern(uint64_t targetcr3) {
|
||||
uint64_t hal_vmm_userproc_pml4_phys(void) {
|
||||
uint8_t *cr3phys = pmm_alloc(1);
|
||||
uint64_t phys = (uint64_t)cr3phys;
|
||||
hal_memset(VIRT(phys), 0, HAL_PAGE_SIZE);
|
||||
memset(VIRT(phys), 0, HAL_PAGE_SIZE);
|
||||
|
||||
uint64_t *kcr3 = (uint64_t *)VIRT(KERNEL_CR3);
|
||||
uint64_t *pml4 = (uint64_t *)VIRT(phys);
|
||||
|
||||
Reference in New Issue
Block a user