Files
linux-legacy/include/linux
Harvey Harrison 064106a91b kernel: add common infrastructure for unaligned access
Create a linux/unaligned directory similar in spirit to the linux/byteorder
folder to hold generic implementations collected from various arches.

Currently there are five implementations:
1) packed_struct.h: C-struct based, from asm-generic/unaligned.h
2) le_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
3) be_byteshift.h: Open coded byte-swapping, heavily based on asm-arm
4) memmove.h: taken from multiple implementations in tree
5) access_ok.h: taken from x86 and others, unaligned access is ok.

All of the new implementations checks for sizes not equal to 1,2,4,8
and will fail to link.

API additions:

get_unaligned_{le16|le32|le64|be16|be32|be64}(p) which is meant to replace
code of the form:
le16_to_cpu(get_unaligned((__le16 *)p));

put_unaligned_{le16|le32|le64|be16|be32|be64}(val, pointer) which is meant to
replace code of the form:
put_unaligned(cpu_to_le16(val), (__le16 *)p);

The headers that arches should include from their asm/unaligned.h:

access_ok.h : Wrappers of the byteswapping functions in asm/byteorder

Choose a particular implementation for little-endian access:
le_byteshift.h
le_memmove.h (arch must be LE)
le_struct.h (arch must be LE)

Choose a particular implementation for big-endian access:
be_byteshift.h
be_memmove.h (arch must be BE)
be_struct.h (arch must be BE)

After including as needed from the above, include unaligned/generic.h and
define your arch's get/put_unaligned as (for LE):

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:27 -07:00
..
2008-04-29 08:06:00 -07:00
2008-04-29 08:05:59 -07:00
2008-04-29 08:06:01 -07:00
2007-01-30 08:26:45 -08:00
2007-10-17 08:42:52 -07:00
2008-03-04 14:47:06 -08:00
2007-02-09 17:39:36 -05:00
2008-04-28 08:58:30 -07:00
2008-01-28 23:21:18 +01:00
2008-04-28 08:58:35 -07:00
2008-04-29 08:06:00 -07:00
2006-10-02 07:57:12 -07:00
2008-04-28 10:03:31 -07:00
2008-04-17 12:22:31 +02:00
2008-04-29 08:06:25 -07:00
2008-04-29 08:06:03 -07:00
2008-04-29 08:06:02 -07:00
2008-04-29 08:06:15 -07:00
2008-02-06 10:41:01 -08:00
2008-04-29 08:06:01 -07:00
2008-04-29 08:06:17 -07:00
2008-04-29 08:06:17 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2006-11-30 04:40:22 +01:00
2008-04-28 08:58:29 -07:00
2006-08-27 11:01:32 -07:00
2005-04-16 15:20:36 -07:00
2007-05-05 14:15:32 -07:00
2008-02-14 21:13:33 -08:00
2008-04-29 08:06:02 -07:00
2008-04-29 08:06:02 -07:00
2006-10-03 23:01:26 +02:00
2008-04-29 08:05:59 -07:00
2008-04-29 08:06:10 -07:00
2008-04-25 00:25:08 +02:00
2008-04-28 08:58:32 -07:00
2008-01-25 21:08:34 +01:00
2005-04-16 15:20:36 -07:00
2008-04-28 08:58:20 -07:00
2008-04-28 08:58:29 -07:00
2005-04-16 15:20:36 -07:00
2008-04-19 19:44:59 +02:00
2007-05-11 08:29:36 -07:00
2008-04-28 08:58:21 -07:00