From 7e0cc8e36ea91d0299f375f3b3476ab58ab71dde Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 2 Sep 2009 10:07:59 -0700 Subject: 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. --- proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'proc.c') 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; -- cgit v1.2.3