aboutsummaryrefslogtreecommitdiff
path: root/libc/cpu.c
diff options
context:
space:
mode:
authorMarvin Borner2021-02-27 18:24:38 +0100
committerMarvin Borner2021-02-27 18:24:38 +0100
commit7304e20731980078a7bfe138a20a8d13653fed7b (patch)
treefbfce00a6a8017f842e8a165b563ab15a094eb84 /libc/cpu.c
parent4309322f9d2b3e31421a3cc5399ab1f4368e0652 (diff)
Started basic paging port from skiftOS
Diffstat (limited to 'libc/cpu.c')
-rw-r--r--libc/cpu.c13
1 files changed, 9 insertions, 4 deletions
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));
}