From: Russ Cox Date: Wed, 2 Sep 2009 14:41:08 +0000 (-0700) Subject: Fix TLS for PIC systems X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=57ae146362df2350737e5194ca81d925b9466124;p=cs3210-lab1.git Fix TLS for PIC systems --- diff --git a/proc.c b/proc.c index 6829b46..91a5801 100644 --- a/proc.c +++ b/proc.c @@ -75,6 +75,7 @@ ksegment(void) loadfsgs(SEG_KCPU << 3); // Initialize cpu-local variables. + c->tlsstruct = &c->tlsstruct; cpu = c; proc = 0; } diff --git a/proc.h b/proc.h index c099dbf..10760f8 100644 --- a/proc.h +++ b/proc.h @@ -59,6 +59,7 @@ struct cpu { int ncli; // Depth of pushcli nesting. int intena; // Were interrupts enabled before pushcli? void *tls[2]; + void *tlsstruct; }; extern struct cpu cpus[NCPU];