From: Arnd Bergmann <arnd@arndb.de>
To: Igor Zhbanov <izh1979@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why get/put_unaligned are hidden behind #ifdef __KERNEL__ on PowerPC and Microblaze?
Date: Sun, 31 Oct 2010 18:45:04 +0100 [thread overview]
Message-ID: <201010311845.04560.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTimGUUhYgSQ6dCBtyaY5s1JQOqewU2RA78t4p8_6@mail.gmail.com>
On Sunday 31 October 2010, Igor Zhbanov wrote:
> 2010/10/31 Andreas Schwab <schwab@linux-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
prev parent reply other threads:[~2010-10-31 17:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-31 15:13 Why get/put_unaligned are hidden behind #ifdef __KERNEL__ on PowerPC and Microblaze? Igor Zhbanov
2010-10-31 15:27 ` Andreas Schwab
2010-10-31 16:10 ` Igor Zhbanov
2010-10-31 17:45 ` Arnd Bergmann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201010311845.04560.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=izh1979@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.