summaryrefslogtreecommitdiff
path: root/x86.h
diff options
context:
space:
mode:
Diffstat (limited to 'x86.h')
-rw-r--r--x86.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/x86.h b/x86.h
index 80d7487..ecb5d2a 100644
--- a/x86.h
+++ b/x86.h
@@ -104,6 +104,12 @@ xchg(volatile uint *addr, uint newval)
}
static inline void
+setgs(ushort gs)
+{
+ asm volatile("movw %0, %%gs" : : "r" (gs));
+}
+
+static inline void
cli(void)
{
asm volatile("cli");