PERFORCE change 75366 for review

Jake Burkholder jake at locore.ca
Tue May 10 04:27:46 PDT 2005


John Baldwin wrote:

>
> On Apr 17, 2005, at 6:42 AM, David Xu wrote:
>
>> http://perforce.freebsd.org/chv.cgi?CH=75366
>>
>> Change 75366 by davidxu at davidxu_alona on 2005/04/17 10:42:05
>>
>> Implement cpu_set_user_tls for sparc64.
>>
>> Affected files ...
>>
>> .. 
>> //depot/projects/davidxu_thread/src/sys/sparc64/sparc64/vm_machdep.c#6 
>> edit
>>
>> Differences ...
>>
>> ==== 
>> //depot/projects/davidxu_thread/src/sys/sparc64/sparc64/vm_machdep.c#6 
>> (text+ko) ====
>>
>> @@ -194,6 +194,15 @@
>> td->td_retval[1] = tf->tf_out[1];
>> }
>>
>> +void
>> +cpu_set_user_tls(struct thread *td, void *tls_base, size_t tls_size,
>> + int tls_seg __unused)
>> +{
>> + if (td == curthread)
>> + flushw();
>> + td->td_frame->tf_global[7] = tls_base;
>> +}
>> +
>
>
> I think for at least this one and Alpha you might want a critical 
> section in the curthread case like you do on i386 and amd64 since 
> calling the Alpha PAL and setting tls_base + flushw() are more than 
> one instruction long.
>
Just FWIW, you don't need a flushw when setting the global registers 
since they're not windowed and guaranteed to be reloaded on return to 
user mode.

Jake


More information about the p4-projects mailing list