summaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64/asm.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-06-20 20:35:38 -0400
committerIan Moffett <ian@osmora.org>2024-06-20 20:37:07 -0400
commitf290314f286b70a8f59becedd5f789c21f675b5d (patch)
tree6e57e88ab2cf9580116a7ddcf68d505266380aee /sys/include/arch/amd64/asm.h
parentd8ba24147205e083a00ee76933cf047a8f8f5727 (diff)
kernel/amd64: intr: Add splraise/splx support
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64/asm.h')
-rw-r--r--sys/include/arch/amd64/asm.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/asm.h b/sys/include/arch/amd64/asm.h
index d7334fe..e85dd87 100644
--- a/sys/include/arch/amd64/asm.h
+++ b/sys/include/arch/amd64/asm.h
@@ -85,6 +85,20 @@ amd64_write_cr0(uint64_t val)
}
static inline uint64_t
+amd64_read_cr8(void)
+{
+ uint64_t cr8;
+ __ASMV("mov %%cr8, %0" : "=r" (cr8) :: "memory");
+ return cr8;
+}
+
+static inline void
+amd64_write_cr8(uint64_t val)
+{
+ __ASMV("mov %0, %%cr8" :: "r" (val) : "memory");
+}
+
+static inline uint64_t
amd64_read_cr4(void)
{
uint64_t cr4;