From 7304e20731980078a7bfe138a20a8d13653fed7b Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 27 Feb 2021 18:24:38 +0100 Subject: Started basic paging port from skiftOS --- libc/cpu.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libc/cpu.c') diff --git a/libc/cpu.c b/libc/cpu.c index 08e742c..b74ed57 100644 --- a/libc/cpu.c +++ b/libc/cpu.c @@ -70,26 +70,31 @@ void cpu_print(void) printf("CPU vendor: %s\n", cpu_string(buf)); } -static u32 cr0_get(void) +u32 cr0_get(void) { u32 cr0; __asm__ volatile("movl %%cr0, %%eax" : "=a"(cr0)); return cr0; } -static void cr0_set(u32 cr0) +void cr0_set(u32 cr0) { __asm__ volatile("movl %%eax, %%cr0" ::"a"(cr0)); } -static u32 cr4_get(void) +void cr3_set(u32 cr3) +{ + __asm__ volatile("movl %%eax, %%cr3" ::"a"(cr3)); +} + +u32 cr4_get(void) { u32 cr4; __asm__ volatile("movl %%cr4, %%eax" : "=a"(cr4)); return cr4; } -static void cr4_set(u32 cr4) +void cr4_set(u32 cr4) { __asm__ volatile("movl %%eax, %%cr4" ::"a"(cr4)); } -- cgit v1.2.3