which devices?
ARM v5 had only very primitive atomic operations,
which makes it difficult to support efficient synchronization.
we are trying to understand whether we should bother to
support ARM v5 or just assume ARM v>=6.
thanks.
russ
Are you aware that the Linux kernel puts a compare-and-set and a barrier
routine at a known location that is appropriate for the current
architecture? It would need a wrapper, since the calling convention is
different. I was going to look into doing it at some point, since
up-coming SMP ARM devices are going to need some additional memory
barriers to be able to do proper synchronization.
David
I'm using ARMv7 (Cortex-A8) devices (Nokia N900, Beagleboard rev. C4, Open
Pandora). I'd like to see cgo support for this arch ... :)
Thanks,
Andrea
--
Andrea Fazzi @ alcacoop.it
Read my blog at http://freecella.blogspot.com
Follow me on http://twitter.com/remogatto
I have many fielded devices that are "armv5tejl" that I'd love to keep
the ability to run Go, although our next gen boxes are "armv6l".
-joe
Yeah, vaguely. But it wouldn't help on non-Linux systems.
What does this compare-and-set look like on ARM v5 though?
My understanding is that v5 only had an atomic swap, which
is not enough to implement compare-and-set. If there's some
more powerful instruction I am unaware of on v5, that would
solve the problem nicely. :-)
For our own purposes we can (and do) use swap to implement a tiny
spin lock and then simulate compare-and-set inside the spin lock, but
that isn't a viable strategy if you're coordinating with outside code
that doesn't know about it.
Russ
>> Are you aware that the Linux kernel puts a compare-and-set and a barrier
>> routine at a known location that is appropriate for the current
>> architecture? It would need a wrapper, since the calling convention is
>> different. I was going to look into doing it at some point, since
>> up-coming SMP ARM devices are going to need some additional memory
>> barriers to be able to do proper synchronization.
>
> Yeah, vaguely. But it wouldn't help on non-Linux systems.
>
> What does this compare-and-set look like on ARM v5 though?
> My understanding is that v5 only had an atomic swap, which
> is not enough to implement compare-and-set. If there's some
> more powerful instruction I am unaware of on v5, that would
> solve the problem nicely. :-)
They implement it as a regular load and store, and the scheduler checks
if the PC is in between and backs it up on return back to the code.
It's actually the only way to do a compare and exchange on ARM v5.
Also, the compare-and-exchange does the proper memory barrier.
There's actually three routines, a memory barrier, the
compare-and-exchange, and a call to get the tls.
The comments state that userspace is free to do these operations itself,
but doesn't recommend it if that is the only reason for the code to be
specific to that CPU.
I suspect that other platforms on ARM have some way of handling the
compare and exchange on ARMv5, if they support it.
David
Thanks,
-Skip
Russ
For what Andrea said (sorry I missed it) I have an ARM v7 on the Nokia N900Where does it say the v of the ARM and what it stands for?
I've been trying to figure out if any of the ARMs I use nowadays are
v5. I'm almost certain none of my current ARMs -- marvell, TI, etc. --
are v5. I believe, for example, that sheeva and guru plugs are much >
v5, since they are the same as the openrd I have.
One source of confusion I note in this thread is the distinction
between 5{g,l} and the ARM version 5. Unless I misread I've seen at
least one message indicating such confusion ... i.e. people identify
ARM v5 with the 5g compiler.
So, my recommendation FWIW is not to worry about v5 but instead make
the modern arms work wonderfully well -- and, of course, get
cross-compilation back in the picture :-)
thanks
ron
The only effect of the $GOARM variable now is that
if you set it to a value < 6, 5l will assume the -F flag
and arrange to use the software floating point routines.
So if your ARM has hardware floating point, do nothing.
If it needs software floating point, export GOARM=5 or
invoke 5l with the -F flag.
Russ
http://www.marvell.com/products/processors/embedded/kirkwood/HW_88F6281_OpenSource.pdf