summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@x40.(none)>2009-09-02 10:07:59 -0700
committerRuss Cox <rsc@x40.(none)>2009-09-02 10:07:59 -0700
commit7e0cc8e36ea91d0299f375f3b3476ab58ab71dde (patch)
tree0b02d5f1c1708ffeeb26ae84a4545cbc9a4c4265 /proc.c
parent374362c55c7e1268ce6c52b029458ef22144c114 (diff)
downloadxv6-labs-7e0cc8e36ea91d0299f375f3b3476ab58ab71dde.tar.gz
xv6-labs-7e0cc8e36ea91d0299f375f3b3476ab58ab71dde.tar.bz2
xv6-labs-7e0cc8e36ea91d0299f375f3b3476ab58ab71dde.zip
another attempt at cpu-local variables.
this time do it ourselves instead of piggybacking on TLS. add -fno-pic to Makefile; pic code breaks our fake TLS.
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/proc.c b/proc.c
index e83e0f7..73cad6d 100644
--- a/proc.c
+++ b/proc.c
@@ -70,12 +70,11 @@ ksegment(void)
c = &cpus[cpunum()];
c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0x100000 + 64*1024-1, 0);
c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
- c->gdt[SEG_KCPU] = SEG(STA_W, &c->tlsstruct, 0xffffffff, 0);
+ c->gdt[SEG_KCPU] = SEG(STA_W, &c->cpu, 8, 0);
lgdt(c->gdt, sizeof(c->gdt));
loadfsgs(SEG_KCPU << 3);
// Initialize cpu-local storage.
- c->tlsstruct = &c->tlsstruct;
asm volatile(""); // Do not let gcc reorder across this line.
cpu = c;
proc = 0;