[U-Boot] [PATCH 3/3] ARM: add unaligned macros
Daniel Mack
daniel at caiaq.de
Thu Jun 4 21:23:31 CEST 2009
On Thu, Jun 04, 2009 at 09:03:47PM +0200, Wolfgang Denk wrote:
> > +static inline u16 get_unaligned_le16(const void *p)
> > +{
> > + return __get_unaligned_cpu16((const u8 *)p);
> > +}
> > +
> > +static inline u32 get_unaligned_le32(const void *p)
> > +{
> > + return __get_unaligned_cpu32((const u8 *)p);
> > +}
> > +
> > +static inline u64 get_unaligned_le64(const void *p)
> > +{
> > + return __get_unaligned_cpu64((const u8 *)p);
> > +}
>
> Are these 3 really all "u8" pointers, or is this a copy & paste error?
Yes, this is how it came from the Linux kernel and my tests show that
these access methods work well.
> Is there any guarantee that such macros are never used on device
> registers and the like?
Well - how can I guarantee that? Anyway - the functions can be enhanced
later to make them work with different types of memories. For now, they
implement a working set of functions to allow ubifs (and probably other
code as well) to be compiled and ran on ARMs.
Daniel
More information about the U-Boot
mailing list