This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Redboot and tumb instructions
- From: Mark Salter <msalter at redhat dot com>
- To: kross at elands dot co dot nz
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 14 Apr 2005 09:23:58 -0400
- Subject: Re: [ECOS] Redboot and tumb instructions
- Organization: Red Hat, Inc.
- References: <200504140604.j3E64lsE079766@atmail.net24.net.nz>
On Thu, 2005-04-14 at 18:04 +1200, kross@elands.co.nz wrote:
> Hi People,
>
> I'm porting redboot to my board (based on ARM AT91FR40162 like EB40A). I have
> succeed in installing a feature cut down version onto the board.
>
> The full version gives me:
>
> Error: bad instruction `mrc p15,0,r3,c0,c0,0'
>
> when compiling hal/arm/arch/current/src/arm_stub.c
>
> The section in arm_stub.c at issue is:
>
> // return non-zero for v5 and later
> static int
> v5T_semantics(void)
> {
> unsigned id;
>
> asm volatile ("mrc p15,0,%0,c0,c0,0\n"
> : "=r" (id) : /* no inputs */);
>
> return ((id >> 16) & 0xff) >= 5;
> }
>
> A work-around is to not use ARM thumb interworking. This is ok but are we able to
> use thumb (which should result in smaller code) with redboot?
>
The mrc insn is not available to thumb. I think the easiest way around
this would be to move v5T_semantics() to vectors.S where you can force
it to be an arm function callable by thumb-interworking code. Or, the
startup code can read the register once and store the value in a
variable that the thumb code can get to later.
--Mark
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss