diff options
author | Marvin Borner | 2021-02-27 18:24:38 +0100 |
---|---|---|
committer | Marvin Borner | 2021-02-27 18:24:38 +0100 |
commit | 7304e20731980078a7bfe138a20a8d13653fed7b (patch) | |
tree | fbfce00a6a8017f842e8a165b563ab15a094eb84 /libc/cpu.c | |
parent | 4309322f9d2b3e31421a3cc5399ab1f4368e0652 (diff) |
Started basic paging port from skiftOS
Diffstat (limited to 'libc/cpu.c')
-rw-r--r-- | libc/cpu.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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)); } |