summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/cpu/x86/cr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/cpu/x86/cr.h b/src/include/cpu/x86/cr.h
index 9eb94022f5..5183c77f89 100644
--- a/src/include/cpu/x86/cr.h
+++ b/src/include/cpu/x86/cr.h
@@ -59,6 +59,18 @@ static alwaysinline void write_cr0(CRx_TYPE data)
);
}
+static alwaysinline CRx_TYPE read_cr2(void)
+{
+ CRx_TYPE value;
+ __asm__ __volatile__ (
+ "mov %%cr2, %0"
+ : CRx_RET(value)
+ :
+ : COMPILER_BARRIER
+ );
+ return value;
+}
+
static alwaysinline CRx_TYPE read_cr3(void)
{
CRx_TYPE value;