<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/asm-generic/unaligned.h, branch v4.9.293</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.293</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.293'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-05-08T08:22:23Z</updated>
<entry>
<title>asm-generic: allow generic unaligned access if the arch supports it</title>
<updated>2014-05-08T08:22:23Z</updated>
<author>
<name>Ard Biesheuvel</name>
<email>ard.biesheuvel@linaro.org</email>
</author>
<published>2014-05-01T15:49:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0567f5facbdf04806a37ef521dd0893159fde715'/>
<id>urn:sha1:0567f5facbdf04806a37ef521dd0893159fde715</id>
<content type='text'>
Switch the default unaligned access method to 'hardware implemented'
if HAVE_EFFICIENT_UNALIGNED_ACCESS is set.

Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>asm-generic: add generic versions of common headers</title>
<updated>2009-06-11T19:02:37Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2009-05-13T22:56:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=aafe4dbed0bf6cbdb2e9f03e1d42f8a540d8541d'/>
<id>urn:sha1:aafe4dbed0bf6cbdb2e9f03e1d42f8a540d8541d</id>
<content type='text'>
These are all kernel internal interfaces that get copied
around a lot. In most cases, architectures can provide
their own optimized versions, but these generic versions
can work as well.

I have tried to use the most common contents of each
header to allow existing architectures to migrate easily.

Thanks to Remis for suggesting a number of cleanups.

Signed-off-by: Remis Lima Baima &lt;remis.developer@googlemail.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>kernel: Move arches to use common unaligned access</title>
<updated>2008-04-29T15:06:27Z</updated>
<author>
<name>Harvey Harrison</name>
<email>harvey.harrison@gmail.com</email>
</author>
<published>2008-04-29T08:03:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6510d41954dc6a9c8b1dbca7eaca0f23195ca727'/>
<id>urn:sha1:6510d41954dc6a9c8b1dbca7eaca0f23195ca727</id>
<content type='text'>
Unaligned access is ok for the following arches:
cris, m68k, mn10300, powerpc, s390, x86

Arches that use the memmove implementation for native endian, and
the byteshifting for the opposite endianness.
h8300, m32r, xtensa

Packed struct for native endian, byteshifting for other endian:
alpha, blackfin, ia64, parisc, sparc, sparc64, mips, sh

m86knommu is generic_be for Coldfire, otherwise unaligned access is ok.

frv, arm chooses endianness based on compiler settings, uses the byteshifting
versions.  Remove the unaligned trap handler from frv as it is now unused.

v850 is le, uses the byteshifting versions for both be and le.

Remove the now unused asm-generic implementation.

Signed-off-by: Harvey Harrison &lt;harvey.harrison@gmail.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: &lt;linux-arch@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>use __val in __get_unaligned</title>
<updated>2007-07-31T22:39:42Z</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2007-07-31T07:39:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=937472b00b666ecbf1464502f857ec63b024af72'/>
<id>urn:sha1:937472b00b666ecbf1464502f857ec63b024af72</id>
<content type='text'>
Use "__val" rather than "val" in the __get_unaligned macro in
asm-generic/unaligned.h.  This way gcc wont warn if you happen to also name
something in the same scope "val".

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>saner typechecking in generic unaligned.h</title>
<updated>2007-07-17T18:01:07Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ftp.linux.org.uk</email>
</author>
<published>2007-07-17T07:49:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d37c6e1b67e8d7f3c5fceba491dcb09a15cb7772'/>
<id>urn:sha1:d37c6e1b67e8d7f3c5fceba491dcb09a15cb7772</id>
<content type='text'>
Verify that types would match for assignment (under sizeof, so we are safe from
side effects or any code actually getting generated), then explicitly cast
everywhere to the fixed-sized types.  Kills a bunch of bogus warnings about
constants being truncated (gcc, sparse), finds a pile of endianness problems
hidden by old noise (sparse).

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] __get_unaligned() gcc-4 fix</title>
<updated>2006-03-08T22:14:00Z</updated>
<author>
<name>Atsushi Nemoto</name>
<email>anemo@mba.ocn.ne.jp</email>
</author>
<published>2006-03-08T05:55:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=707ced0d718e89b52b13aa55a64653083e792cca'/>
<id>urn:sha1:707ced0d718e89b52b13aa55a64653083e792cca</id>
<content type='text'>
If the 'ptr' is a const, this code cause "assignment of read-only variable"
error on gcc 4.x.

Use __u64 instead of __typeof__(*(ptr)) for temporary variable to get
rid of errors on gcc 4.x.

Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] optimise 64bit unaligned access on 32bit kernel</title>
<updated>2005-09-07T23:57:36Z</updated>
<author>
<name>Ralf Baechle</name>
<email>ralf@linux-mips.org</email>
</author>
<published>2005-09-06T22:17:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=eed74dfcd48101d259012ac08d29061eea500249'/>
<id>urn:sha1:eed74dfcd48101d259012ac08d29061eea500249</id>
<content type='text'>
I've rewriten Atushi's fix for the 64-bit put_unaligned on 32-bit systems
bug to generate more efficient code.

This case has buzilla URL http://bugzilla.kernel.org/show_bug.cgi?id=5138.

Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] __get_unaligned() turned into macro</title>
<updated>2005-04-24T19:28:35Z</updated>
<author>
<name>Al Viro</name>
<email>viro@www.linux.org.uk</email>
</author>
<published>2005-04-24T19:28:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3106dbcd914d8dac4b89f52d8d51ec93526cbb95'/>
<id>urn:sha1:3106dbcd914d8dac4b89f52d8d51ec93526cbb95</id>
<content type='text'>
Turns __get_unaligned() and __put_unaligned into macros.  That is
definitely safe; leaving them as inlines breaks on e.g.  alpha [try to
build ncpfs there and you'll get unresolved symbols since we end up
getting __get_unaligned() not inlined]. 

Signed-off-by: Al Viro &lt;viro@parcelfarce.linux.theplanet.co.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[ARCH]: Consolidate portable unaligned.h implementations.</title>
<updated>2005-03-17T05:54:31Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@sunset.davemloft.net</email>
</author>
<published>2005-03-17T05:54:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d7eaa5a419a2de23bcc1c8d0e6c66a70742752c0'/>
<id>urn:sha1:d7eaa5a419a2de23bcc1c8d0e6c66a70742752c0</id>
<content type='text'>
Several architectures do their asm/unaligned.h support support by
simply casting the pointer to a packed strcuture, then deref'ing that
pointer.  This forces gcc to assume the object is not aligned
properly.

This technique originated in Richard Henderson's
asm-alpha/unaligned.h, IA64 uses the same technique as well.

This works well on RISC systems for two reasons:

1) On systems like Alpha, MIPS, et al. which have special
   "load unaligned" instructions, GCC knows to emit them
   for code like this.

2) Even on systems without explicit unaligned load/store instruction
   support, the code emitted (basically, byte loads with shifts and
   ors) is about the same as what you get when emitting a memmove()
   call and you don't need the local stack slot.

I was going to thus move asm-sparc64/unaligned.h over to such a
scheme, but then I noticed that nobody actually includes the current
memmove() based asm-generic/unaligned.h code.  So why not put the
portable packed structure implementation into asm-generic/unaligned.h
and then make asm-{alpha,ia64,sparc64}/unaligned.h simply include that?

I only had to make minor modifications to the alpha header when placing
it into the generic area.  In particular I had to convert some explicit
"unsigned long", "unsigned int" et al. into the arch-agnostic "u64" "u32"
etc.  so that even 32-bit platforms could use this.

Come to think of it I'll make sparc32 use this as well.

I looked at all the other platform unaligned.h headers:

I386/X86_64: can do unaligned loads directly
ARM: is trying to be incredibly clever, and open codes the shifts and
     ors.  I think it would be better if it used something similar to
     the packed structure technique.
CRIS: like x86, can do unaligned stuff directly.
FRV: needs help doing unaligned stuff, it probably also could use the
     packed structure stuff.
H8300: needs help, could use this new asm-generic/unaligned.h header
M32R: likewise
M68K: can do unaligned access directly.
MIPS: appears to be a copy of the original alpha/ia64 unaligned.h
      header, so I converted it to use the new asm-generic/unaligned.h
      too
PARISC: is just a copy of asm-sparc/unaligned.h, so I converted it
        over to use asm-generic/unaligned.h too
PPC/PPC64: can do unaligned access directly in big-endian mode which
           is what the Linux kernel runs in
S390: can do it directly as well
SH/SH64: just has the memmove() code ala asm-sparc/unaligned.h, I
         converted it to use asm-generic/unaligned.h
V850: has some clever code just like ARM, so I didn't touch it.

So this is the patch I came up with.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>Import changeset</title>
<updated>2002-02-05T01:40:40Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@athlon.transmeta.com</email>
</author>
<published>2002-02-05T01:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7a2deb32924142696b8174cdf9b38cd72a11fc96'/>
<id>urn:sha1:7a2deb32924142696b8174cdf9b38cd72a11fc96</id>
<content type='text'>
</content>
</entry>
</feed>
