diff options
author | Russ Cox <rsc@x40.(none)> | 2009-09-02 10:07:59 -0700 |
---|---|---|
committer | Russ Cox <rsc@x40.(none)> | 2009-09-02 10:07:59 -0700 |
commit | 7e0cc8e36ea91d0299f375f3b3476ab58ab71dde (patch) | |
tree | 0b02d5f1c1708ffeeb26ae84a4545cbc9a4c4265 /proc.c | |
parent | 374362c55c7e1268ce6c52b029458ef22144c114 (diff) | |
download | xv6-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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; |