On Mon, May 18, 2020 at 04:26:33PM -0700, Jacob Keller wrote:
> Yep, the current code doing that is incorrect if the platform can't do
> unaligned access.

But only if the pointer is actually not aligned.  The way the buffers
are allocated and the message definitions ensure proper alignment.  In
a few cases we use memcpy when the alignment is not guaranteed.
 
> I'm not sure what actually happens here: will the compiler for such a
> platform produce the right code for reading, or will it simply give up
> on the unaligned pointers?

To my knowledge, most platforms in use today can handle unaligned
access up to the native word size.

The old Xscale machines could not perform an unaligned 2 byte
de-reference correctly.  The result would be wrong values in the
destination CPU registers.

Thanks,
Richard


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to