[U-Boot] [PATCH 1/2] common.h: Introduce DEFINE_CACHE_ALIGN_BUFFER
Mike Frysinger
vapier at gentoo.org
Fri Jul 20 06:01:18 CEST 2012
On Saturday 07 July 2012 23:08:14 Marek Vasut wrote:
> +/*
> + * DEFINE_CACHE_ALIGN_BUFFER() is similar to ALLOC_CACHE_ALIGN_BUFFER, but it's
> + * purpose is to allow allocating aligned buffers outside of function scope.
> + * Usage of this macro shall be avoided or used with extreme care!
> + */
> +#define DEFINE_CACHE_ALIGN_BUFFER(type, name, size) \
> + static char __##name[roundup(size * sizeof(type), ARCH_DMA_MINALIGN)] \
> + __aligned(ARCH_DMA_MINALIGN); \
> + \
> + static type *name = (type *)__##name;
how is this any different from doing:
static __u8 foo[1234] __aligned(ARCH_DMA_MINALIGN);
-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/20120720/017e9eec/attachment.pgp>
More information about the U-Boot
mailing list