summaryrefslogtreecommitdiff
path: root/x86.h
diff options
context:
space:
mode:
authorrsc <rsc>2009-05-31 00:28:45 +0000
committerrsc <rsc>2009-05-31 00:28:45 +0000
commit19333efb9eb634f17bea41d0cec8ee28c595cce8 (patch)
tree97350b8c0c4a4c0f61d76516f067b32298af37c7 /x86.h
parent0c7f483838c48db05e7ea44232a55135d7c262a0 (diff)
downloadxv6-labs-19333efb9eb634f17bea41d0cec8ee28c595cce8.tar.gz
xv6-labs-19333efb9eb634f17bea41d0cec8ee28c595cce8.tar.bz2
xv6-labs-19333efb9eb634f17bea41d0cec8ee28c595cce8.zip
Some proc cleanup, moving some of copyproc into allocproc.
Also, an experiment: use "thread-local" storage for c and cp instead of the #define macro for curproc[cpu()].
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");