Port-arm archive

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

Re: Which ARM architectures need support? (was Re: Restructuring trapframe)

On Sep 20, 2013, at 4:29 PM, Dennis Ferguson 
<dennis.c.ferguson%gmail.com@localhost> wrote:

> On 20 Sep, 2013, at 03:26 , Matt Thomas <matt%3am-software.com@localhost> 
> wrote:
>> It depends.  If a kernel can be compiled for both pre-armv6 and armv6+
>> then it needs to share a common trapframe.  Otherwise they could be
>> different and let the compiler deal with the differences.  One alternative
>> is to only use the new trapframe for armv6 and later and default to the
>> older trapframe for any kernel that incorporates pre-armv6.
> On a tangentially related topic, I noticed other bits of the instruction
> set which vary with the architecture version.  In particular, umull
> needs to avoid having its results overwrite its source registers for
> pre-armv6 CPUs, the clz instruction didn't exist prior to armv5 and
> strd exists on ARMv5TE and later CPUs but not ARMv5T and earlier.
> Does NetBSD code need to be written to run on armv4 CPUs?  And, if I
> cared enough to want to do it, is there a way to conditionally compile for
> the version of the architecture the system is being built for, in the
> kernel and for applications, or does the code just need to be written
> for the lowest common denominator?

using the -mcpu= or -march will do the right thing for C and C++.

For assembly, we have some macros to help.

RET expand to mov pc, lr or bx lr 

Note that earm defaults to armv5te so we get clz, blx reg, ldrd/strd,
and a few others.

It's one reason we have earmv{4,5,6,7}{,hf}{,eb}
If you want earm for shark/cats/netwinder/etc use earmv4 and 
the non-armv4 instructions will be avoided.

Home | Main Index | Thread Index | Old Index