Is it possible to guarantee long word alignment of a mbuf data.

Paul Whitfield paulw at omnitronics.com.au
Tue Jul 19 07:07:53 UTC 2005


Hi All,

I have a problem while trying to get an Ethernet driver working
for RTEMS.

The Ethernet device I am using (the on-board FEC on the Coldfire
5270) needs the data it is going to transmit to be long word aligned.

Currently code gets the data to be sent using the mtod macro
and indirectly the m_data macro.

i.e.:

      empty->buffer = mtod (m, unsigned char *);

This pointer is not currently long word aligned. Is there any
way in RTEMS to force it to be long word aligned?

I have copied some code from another Ethernet driver
that had a similar issue, (sonic.c) that shuffles
the data in the mbuf, with the end result that the
pointer is long word aligned.

However, I am wondering if there is a more elegant
and efficient way to achieve the same thing?


Regards



Paul

=========================================================================
The information in this e-mail is intended for the addressee only.
Unauthorised use, copying, disclosure or distribution by anyone else
is prohibited. Please let us know immediately if you receive this
e-mail in error. Thank you.
=========================================================================




More information about the users mailing list