Port-sparc archive

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

Re: sparc packages?



Le sam. 4 mars 2023 à 17:38, Romain Dolbeau <romain%dolbeau.org@localhost> a écrit :
> I can see a mutex.h in /usr/src/sys/arch/sparc/include, but it doesn't
> seem to fully define the mutex. I suspect the interesting bit is
> wherever the _atomic_cas_ulong() used in that file is defined, as on
> v7/v8 there is no hardware CAS so it has to be emulated somehow. Is
> that indeed the dodgy bit and if so where is it implemented ?

OK, following up on myself for that:

(a) sys/arch/sparc/include/mutex.h pretends that SPARC has
"__HAVE_SIMPLE_MUTEXES" and defines it and MUTEX_CAS, despite not
having hardware CAS
(b) the CAS implementation seems to be in
common/lib/libc/arch/sparc/atomic/atomic_cas.S, which makes it clear
it uses an interlock (as expected to implement CAS reliably in SMP)
(c) sys/sys/mutex.h makes it clear that 'simple mutex' is only for
architecture with "no interlock required in the MP case"

So it seems the SPARC implementation is non-compliant to the actual
definition of the mutex ?

(d) HP-PA, another architecture without hardware CAS, does not define
__HAVE_SIMPLE_MUTEXES and MUTEX_CAS and instead is a lot more complex
with many macros needed

At first glance it seems to me like SPARC should implement a solution
similar (or perhaps identical) to HP-PA ?

Cordially,

-- 
Romain Dolbeau


Home | Main Index | Thread Index | Old Index