From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Mack Date: Thu, 4 Jun 2009 21:23:31 +0200 Subject: [U-Boot] [PATCH 3/3] ARM: add unaligned macros In-Reply-To: <20090604190347.5F003832E416@gemini.denx.de> References: <1244111241-32735-1-git-send-email-daniel@caiaq.de> <1244111241-32735-2-git-send-email-daniel@caiaq.de> <1244111241-32735-3-git-send-email-daniel@caiaq.de> <1244111241-32735-4-git-send-email-daniel@caiaq.de> <20090604174208.GM26688@buzzloop.caiaq.de> <20090604190347.5F003832E416@gemini.denx.de> Message-ID: <20090604192331.GO26688@buzzloop.caiaq.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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