From 0aef683b9d1e08555791426ba12223ed78051353 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 12 Mar 2021 17:27:01 +0100 Subject: Boots successfully... --- libc/cpu.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libc/cpu.c') diff --git a/libc/cpu.c b/libc/cpu.c index cb9aa49..8ca4d27 100644 --- a/libc/cpu.c +++ b/libc/cpu.c @@ -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)); -- cgit v1.2.3