[U-Boot] [PATCH] FAT: Properly align buffers to allow cache operations

Mike Frysinger vapier at gentoo.org
Tue Apr 10 06:36:06 CEST 2012


On Monday 09 April 2012 02:45:03 Marek Vasut wrote:
> @@ -765,9 +767,6 @@
> 
> -__attribute__ ((__aligned__ (__alignof__ (dir_entry))))
> -__u8 do_fat_read_block[MAX_CLUSTSIZE];
> -
>
> @@ -788,6 +787,7 @@ do_fat_read (const char *filename, void *buffer,
>
>  	int rootdir_size = 0;
>  	int j;
> +	uint8_t do_fat_read_block[MAX_CLUSTSIZE] __attribute__((aligned(32)));

what's going on here exactly ?  the old code had the advantage of being in the 
bss and the linker taking care of the alignment.  this new code has an 
incorrectly hard-coded "32", and puts a 64KiB array onto the *stack*.
-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/20120410/dc01d27d/attachment.pgp>


More information about the U-Boot mailing list