summaryrefslogtreecommitdiff
path: root/x86.h
diff options
context:
space:
mode:
Diffstat (limited to 'x86.h')
-rw-r--r--x86.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/x86.h b/x86.h
index 5a59cc2..828d5bc 100644
--- a/x86.h
+++ b/x86.h
@@ -96,6 +96,30 @@ loadgs(ushort v)
asm volatile("movw %0, %%gs" : : "r" (v));
}
+static inline void
+loadfs(ushort v)
+{
+ __asm volatile("movw %0, %%fs" : : "r" (v));
+}
+
+static inline void
+loades(ushort v)
+{
+ __asm volatile("movw %0, %%es" : : "r" (v));
+}
+
+static inline void
+loadds(ushort v)
+{
+ __asm volatile("movw %0, %%ds" : : "r" (v));
+}
+
+static inline void
+loadss(ushort v)
+{
+ __asm volatile("movw %0, %%ss" : : "r" (v));
+}
+
static inline uint
rebp(void)
{