diff options
author | Marvin Borner | 2021-03-12 17:27:01 +0100 |
---|---|---|
committer | Marvin Borner | 2021-03-12 17:27:01 +0100 |
commit | 0aef683b9d1e08555791426ba12223ed78051353 (patch) | |
tree | 324cbc61b7fb38f648a82041656f5fea48e53856 /libc/cpu.c | |
parent | f1751c121d48f2d8936c72bdc347777d1e7402d9 (diff) |
Boots successfully...
Diffstat (limited to 'libc/cpu.c')
-rw-r--r-- | libc/cpu.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -82,6 +82,13 @@ void cr0_set(u32 cr0) __asm__ volatile("movl %%eax, %%cr0" ::"a"(cr0)); } +u32 cr3_get(void) +{ + u32 cr3; + __asm__ volatile("movl %%cr0, %%eax" : "=a"(cr3)); + return cr3; +} + void cr3_set(u32 cr3) { __asm__ volatile("movl %%eax, %%cr3" ::"a"(cr3)); |