Port-alpha archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Alpha and thread-local storage



Hi,

Joerg has worked on TLS.  He claims that the only thing missing
for alpha is that inside cpu_switchto, the process unique
register needs to be written.

Attached is my attempt at cargo-culting this code, but someone
who knows how PAL_wrunique should be called should take a closer
look, and preferably test the change.

Best regards,

- Håvard
Index: alpha/genassym.cf
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/genassym.cf,v
retrieving revision 1.19
diff -u -r1.19 genassym.cf
--- alpha/genassym.cf   15 Dec 2010 01:33:37 -0000      1.19
+++ alpha/genassym.cf   28 Mar 2011 09:10:05 -0000
@@ -162,6 +162,7 @@
 define PCB_CONTEXT             offsetof(struct pcb, pcb_context[0])
 define PCB_ONFAULT             offsetof(struct pcb, pcb_onfault)
 define PCB_ACCESSADDR          offsetof(struct pcb, pcb_accessaddr)
+define PCB_APCB_UNIQUE         offsetof(struct pcb, pcb_hw.apcb_unique)
 
 # Offsets into struct fpstate, for save, restore
 define FPREG_FPR_REGS          offsetof(struct fpreg, fpr_regs[0])
Index: alpha/locore.s
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/locore.s,v
retrieving revision 1.120
diff -u -r1.120 locore.s
--- alpha/locore.s      7 Jul 2010 01:17:49 -0000       1.120
+++ alpha/locore.s      28 Mar 2011 09:10:05 -0000
@@ -697,6 +697,12 @@
        ldq     s0, L_PCB(s2)
 
        /*
+        * Save process unique register.
+        */
+       ldq     a0, PCB_APCB_UNIQUE(s0)
+       call_pal PAL_wrunique
+
+       /*
         * Check for restartable atomic sequences (RAS).
         */
        ldq     a0, L_PROC(s2)                  /* first ras_lookup() arg */


Home | Main Index | Thread Index | Old Index