Aligned operations mismatch

Amaan Cheval amaan.cheval at gmail.com
Thu Aug 23 05:30:05 UTC 2018


On Wed, Aug 22, 2018 at 8:20 PM Mikhail Svetkin
<mikhail.svetkin at gmail.com> wrote:
>
> Hi all,
>
> I have found a problem with assembler code generation in network stack on ARM processor (aligment fault).
>
> I am using:
> arm-rtems5-gcc (GCC) 7.2.0 20170814 (RTEMS 5, RSB a6d011e028a0776cedf0823940eb882e917a44e5, Newlib 2.5.0.20170922)
>
> The compiler generates invalid instruction 'ldmia' here (https://git.rtems.org/rtems/tree/cpukit/libnetworking/netinet/udp_usrreq.c#n160).
>
> The instruction does not support unaligned accesses.
>
> Also i have found the bug fix in FreeBSD repository (https://github.com/freebsd/freebsd/commit/6cc0e8d2a0b583db5707f811d4ebfbe1ad05e628)
>
> I tried their solution and it works.
>

Do you mean you changed the alignment to 2 in RTEMS'
cpukit/libnetworking/netinet/ip.h:85?
https://git.rtems.org/rtems/tree/cpukit/libnetworking/netinet/ip.h#n85

If yes, and if you could confirm it worked / tests passed, feel free
to submit a patch: https://devel.rtems.org/wiki/Developer/Contributing

If not, a ticket with all the information is highly appreciated too!

P.S. - I believe this is a part of the "old" networking stack for
RTEMS - the "new" stack uses rtems-libbsd, which already includes the
FreeBSD patch you mentioned:
https://github.com/RTEMS/rtems-libbsd/blob/master/freebsd/sys/netinet/ip.h#L70

Perhaps someone can shed some light on when the old stack can be used
vs. the new one, and how - I haven't seen much documentation on it.
Patch fixes for the old stack should likely still be accepted while
there are still BSPs using it.

> Should I create a ticket for that?
>
> Best regards,
> Mikhail
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list