[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <201010311845.04560.arnd@arndb.de>
Date: Sun, 31 Oct 2010 18:45:04 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Igor Zhbanov <izh1979@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: Why get/put_unaligned are hidden behind #ifdef __KERNEL__ on PowerPC and Microblaze?
On Sunday 31 October 2010, Igor Zhbanov wrote:
> 2010/10/31 Andreas Schwab <schwab@...ux-m68k.org>:
> I think that unaligned memory access interface are stable, so it can
> be safely exported
> to user space. We have some other platform-related exported headers,
> e.g. <asm/byteorder.h>,
> so why not to export <asm/unaligned.h>. Let it be "official" way to
> deal with unaligned data
> in user space too.
There are libraries to deal with stuff like this. The kernel headers
are in no way a portable way to do this and any code that tries to
use them in this way would not even be portable across different
distribution that put the kernel headers in different places or
to architectures that define these functions as extern.
If you need something like get_unaligned, look in places like
http://ccan.ozlabs.org or http://www.gnu.org/software/gnulib/.
You can also use a generic gcc based implementation that uses
attribute((packed)) for unaligned access.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists