summaryrefslogtreecommitdiff
path: root/sys/include/arch/amd64
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-13 21:20:53 -0400
committerIan Moffett <ian@osmora.org>2024-03-13 21:24:19 -0400
commit73a209c0f7e350d819ce4b98374d4f2b83f7300d (patch)
treec0cd32038fd4a9a3c1d36f86804d4a298c2e565a /sys/include/arch/amd64
parent10e2fc7e3c6a924923664cf2919393b7f7b37326 (diff)
kernel/amd64: cpu: Add fxsave/fxrstor helpers
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include/arch/amd64')
-rw-r--r--sys/include/arch/amd64/cpu.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/include/arch/amd64/cpu.h b/sys/include/arch/amd64/cpu.h
index 1968569..ee9bad7 100644
--- a/sys/include/arch/amd64/cpu.h
+++ b/sys/include/arch/amd64/cpu.h
@@ -138,6 +138,18 @@ amd64_write_cr4(uint64_t val)
__ASMV("mov %0, %%cr4" :: "r" (val) : "memory");
}
+static inline void
+amd64_fxsave(void *area)
+{
+ __ASMV("fxsave (%0)" :: "r" (area) : "memory");
+}
+
+static inline void
+amd64_fxrstor(void *area)
+{
+ __ASMV("fxrstor (%0)" :: "r" (area) : "memory");
+}
+
struct cpu_info *amd64_this_cpu(void);
#endif /* !_AMD64_CPU_H_ */