asm-generic/unaligned.h: dynamic default unaligned accesses
PATCH 1/3 asm-generic/unaligned.h: dynamic default unaligned accesses
This is based on the asm-arm/unaligned.h, but made generic so all arches that cannot do unaligned accesses can utilize it.
--- include/asm-generic/unaligned.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 include/asm-generic/unaligned.h
include/asm-generic/unaligned.h new file +23 -0
@@ -0,0 +1,23 @@ +#ifndef _GENERIC_UNALIGNED_H +#define _GENERIC_UNALIGNED_H + +#include <asm/byteorder.h> + +#include <linux/unaligned/le_byteshift.h> +#include <linux/unaligned/be_byteshift.h> +#include <linux/unaligned/generic.h> + +/* +* Select endianness +*/ +#if defined(__LITTLE_ENDIAN) +#define get_unaligned __get_unaligned_le +#define put_unaligned __put_unaligned_le +#elif defined(__BIG_ENDIAN) +#define get_unaligned __get_unaligned_be +#define put_unaligned __put_unaligned_be +#else +#error invalid endian +#endif + +#endif
Signature · 1 line
1.6.6
PATCH 2/3 asm-blackfin/unaligned.h: add for zlib code
The new zlib code wants asm/unaligned.h, so have the Blackfin version pull in the asm-generic/unaligned.h.
--- include/asm-blackfin/unaligned.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 include/asm-blackfin/unaligned.h
include/asm-blackfin/unaligned.h new file +1 -0
@@ -0,0 +1 @@ +#include <asm-generic/unaligned.h>
Signature · 1 line
1.6.6
Wolfgang Denk
AppliedPATCH 2/3 asm-blackfin/unaligned.h: add for zlib code
Dear Mike Frysinger,
Quoted 8 lines · In message <[email protected]> you wrote:
The new zlib code wants
asm/unaligned.h, so have the Blackfin version pull in theasm-generic/unaligned.h.Signed-off-by Mike Frysinger <[email protected]>--- include/asm-blackfin/unaligned.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 include/asm-blackfin/unaligned.h
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "The greatest warriors are the ones who fight for peace." - Holly Near
PATCH 3/3 asm-arm/unaligned.h: switch to asm-generic/unaligned.h
In reply to Mike Frysinger---
note: havent compile tested this, but it should be straight forward ...
include/asm-arm/unaligned.h | 20 +------------------- 1 files changed, 1 insertions(+), 19 deletions(-)
include/asm-arm/unaligned.h +1 -19
@@ -1,19 +1 @@ -#ifndef _ASM_ARM_UNALIGNED_H -#define _ASM_ARM_UNALIGNED_H - -#include <linux/unaligned/le_byteshift.h> -#include <linux/unaligned/be_byteshift.h> -#include <linux/unaligned/generic.h> - -/* -* Select endianness -*/ -#ifndef __ARMEB__ -#define get_unaligned __get_unaligned_le -#define put_unaligned __put_unaligned_le -#else -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be -#endif - -#endif /* _ASM_ARM_UNALIGNED_H */ +#include <asm-generic/unaligned.h>
Signature · 1 line
1.6.6
PATCH 3/3 asm-arm/unaligned.h: switch to asm-generic/unaligned.h
Quoted 3 lines · Mike Frysinger
Signed-off-by Mike Frysinger <[email protected]>---
note: havent compile tested this, but it should be straight forward ...
I have compile tested this.
It is fine.
Was this run tested ?
I see this was imported from the kernel.
Please include the version of the kernel this came from.
Tom
PATCH 3/3 asm-arm/unaligned.h: switch to asm-generic/unaligned.h
Quoted 9 lines · On Saturday 23 January 2010 20:18:04 Tom wrote:
Quoted 3 lines · Mike Frysinger
Signed-off-by Mike Frysinger <[email protected]>---
note: havent compile tested this, but it should be straight forward ...I have compile tested this.
It is fine.Was this run tested ?
if i cant compile. i cant run
Quoted 1 line
I see this was imported from the kernel.
if that's true, that isnt "my problem". i modified files that existed in u- boot already; i did not myself copy directly from the linux kernel. feel free to add any comments/etc... you find appropriate.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100123/027620c9/attachment.pgp
PATCH 3/3 asm-arm/unaligned.h: switch to asm-generic/unaligned.h
Quoted 11 lines · Mike Frysinger
Quoted 8 lines · On Saturday 23 January 2010 20:18:04 Tom wrote:
Quoted 3 lines · Mike Frysinger
Signed-off-by Mike Frysinger <[email protected]>---
note: havent compile tested this, but it should be straight forward ...I have compile tested this.
It is fine.Was this run tested ?
if i cant compile. i cant run
In some case people do a runtime test without doing a full compile test with MAKEALL arm. I was hoping this was the case.
Quoted 7 lines
Quoted 2 lines
I see this was imported from the kernel.
if that's true, that isnt "my problem". i modified files that existed in u- boot already; i did not myself copy directly from the linux kernel. feel free to add any comments/etc... you find appropriate.
-mike
On reviewing 1/3 closer against the linux kernel
diff .../linux-2.6-arm/include/asm-generic/unaligned.h .../u-boot-arm/include/asm-generic/unaligned.h
It looks like the version from the kernel could be used without modifications. It looks very similar to your patch.
This is the commit from the kernel
aafe4dbed0bf6cbdb2e9f03e1d42f8a540d8541d
asm-generic: add generic versions of common headers
These are all kernel internal interfaces that get copied around a lot. In most cases, architectures can provide their own optimized versions, but these generic versions can work as well.
I have tried to use the most common contents of each header to allow existing architectures to migrate easily.
Thanks to Remis for suggesting a number of cleanups.
I would prefer to reuse the kernel source where possible. Tom
PATCH 3/3 asm-arm/unaligned.h: switch to asm-generic/unaligned.h
Quoted 8 lines · On Sunday 24 January 2010 11:07:10 Tom wrote:
Quoted 6 lines · Mike Frysinger
Quoted 1 line · On Saturday 23 January 2010 20:18:04 Tom wrote:
I see this was imported from the kernel.
if that's true, that isnt "my problem". i modified files that existed in u- boot already; i did not myself copy directly from the linux kernel. feel free to add any comments/etc... you find appropriate.
Quoted 7 lines
On reviewing 1/3 closer against the linux kernel
diff
.../linux-2.6-arm/include/asm-generic/unaligned.h.../u-boot-arm/include/asm-generic/unaligned.hIt looks like the version from the kernel could be used without modifications.
the kernel has more headers which u-boot lacks
Quoted 1 line
I would prefer to reuse the kernel source where possible.
if you feel like doing the license review to make sure this is OK, then have at it. i dont which is why i tweaked existing u-boot files.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100124/38b23e47/attachment.pgp
Wolfgang Denk
AppliedPATCH 1/3 asm-generic/unaligned.h: dynamic default unaligned accesses
In reply to Mike FrysingerDear Mike Frysinger,
Quoted 8 lines · In message <[email protected]> you wrote:
This is based on the
asm-arm/unaligned.h, but made generic so all arches that cannot do unaligned accesses can utilize it.Signed-off-by Mike Frysinger <[email protected]>--- include/asm-generic/unaligned.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) create mode 100644 include/asm-generic/unaligned.h
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "You're just jealous." "What, of an overgrown puppy with a single- figure IQ?" - Terry Pratchett, _Moving Pictures_