[PATCH] bsps/sparc: Fix BSS initialization

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 14 08:31:19 UTC 2014


On 2014-05-14 09:37, Daniel Hellstrom wrote:
> Hello Sebastian,
>
> I think the patch is correct, however I would rather see that you use g4
> instead of g2 to increment, that way you don't need the move either.

Ok, see follow up patch.

>
> Looking in the area of the code that you patch, it seems as if this code hasn't
> been run. I have a TODO since long to go over this code, however the main usage
> of the RTEMS is to run it from RAM. As I understand RTEMS on LEON is never run
> from ROM, which I would like to fix some day.
>
> Looking at the code above:
>
> copy_data:
>          ldd   [ %g2 ], %g5
>          std   %g5 , [ %g3 ]             ! copy this double word
>          add   %g3, 8, %g3               ! bump the destination pointer
>          add   %g2, 8, %g2               ! bump the source pointer
>          cmp   %g3, %g4                  ! Is the pointer past the end of dest?
>          bl    copy_data
>          nop
>
>
> It does a LDD and STD to/from non-double registers, which should cause
> illegal-instruction trap to happen. %g5 can not be used together with LDD or STD.

Its good that you found this.  The register number must be even.  I introduced 
this bug with this commit:

http://git.rtems.org/rtems/commit/?id=7c0bd74c87b141454ae17ee1cfeeba42dc4b0df2

I will fix it.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list