Re: + kernel-add-common-infrastructure-for-unaligned-access.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2008-04-14 at 15:14 -0700, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> 
> 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.

This seems like overkill to me. Can't we just use the packed struct
version? GCC should then to the right thing for all architectures.

> 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);

And couldn't these be macros rather than relying on a boatload of
infrastructure?

-- 
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux