summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-08-18 13:06:37 +0200
committerTom Rini <trini@konsulko.com>2015-08-28 12:33:17 -0400
commit4519668b29bb8422ceca8e7ca9a35d5af0afe959 (patch)
treecf6361ac4f48d13dc677978ae8778e63bedba402 /lib
parent285e266b417103378c1cf1e9aea47b34731c45d0 (diff)
downloadu-boot-imx-4519668b29bb8422ceca8e7ca9a35d5af0afe959.zip
u-boot-imx-4519668b29bb8422ceca8e7ca9a35d5af0afe959.tar.gz
u-boot-imx-4519668b29bb8422ceca8e7ca9a35d5af0afe959.tar.bz2
mtd/nand/ubi: assortment of alignment fixes
Various U-Boot adoptions/extensions to MTD/NAND/UBI did not take buffer alignment into account which led to failures of the following form: ERROR: v7_dcache_inval_range - start address is not aligned - 0x1f7f0108 ERROR: v7_dcache_inval_range - stop address is not aligned - 0x1f7f1108 Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Scott Wood <scottwood@freescale.com> [trini: Add __UBOOT__ hunk to lib/zlib/zutil.c due to malloc.h in common.h] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/gzip.c2
-rw-r--r--lib/zlib/zutil.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/gzip.c b/lib/gzip.c
index ff37d4f..cd8e9fe 100644
--- a/lib/gzip.c
+++ b/lib/gzip.c
@@ -25,7 +25,7 @@ static void *zalloc(void *x, unsigned items, unsigned size)
size *= items;
size = (size + ZALLOC_ALIGNMENT - 1) & ~(ZALLOC_ALIGNMENT - 1);
- p = malloc (size);
+ p = malloc_cache_aligned(size);
return (p);
}
diff --git a/lib/zlib/zutil.c b/lib/zlib/zutil.c
index 14f6eb1..173a81d 100644
--- a/lib/zlib/zutil.c
+++ b/lib/zlib/zutil.c
@@ -43,11 +43,13 @@ void z_error (m)
*/
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+#ifndef __UBOOT__
#ifndef STDC
extern voidp malloc OF((uInt size));
extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
#endif
+#endif
voidpf zcalloc(voidpf opaque, unsigned items, unsigned size)
{