Re: Why get/put_unaligned are hidden behind #ifdef __KERNEL__ onPowerPC and Microblaze?

From: Igor Zhbanov
Date: Sun Oct 31 2010 - 12:10:45 EST


2010/10/31 Andreas Schwab <schwab@xxxxxxxxxxxxxx>:
>
> Since <asm/unaligned.h> is not an exported header the point is moot.

And why not to export <asm/unaligned.h>? I think it will be useful to
have unified mechanism
for unaligned memory access in users pace. There are numerous
libraries that deal
with binary file formats with unaligned structure fields. Also there
are some network
protocols with unaligned fields of packets.

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/