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

Eric Norum norume at aps.anl.gov
Tue Jul 19 13:26:04 UTC 2005


Have a look at the trick I used for the ColdFire 5282.  I use the  
space normally used to hold a pointer to the mbuf as a one to three  
byte buffer.  No extra mbufs required, no shuffling of data within an  
mbuf.

It would be great if you or someone else could take the 5282 driver  
and make a generic version which would work across all ColdFire  
hardware.  I've run out of time for ColdFire BSP development,  
unfortunately....

On Jul 19, 2005, at 2:07 AM, Paul Whitfield wrote:

> 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?

-- 
Eric Norum <norume at aps.anl.gov>
Advanced Photon Source
Argonne National Laboratory
(630) 252-4793





More information about the users mailing list