summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
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;