ALLOC_CACHE_ALIGN_BUFFER shall be used in functions, which are using
stack allocated buffers for DMA transfers.
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
Changes for v2:
- ./include/cache.h has been removed and replaced with
simpler macro added to ./include/common.h
Changes for v3:
- change char * to char
- defined table size definition
Changes for v4:
- (type*) added for compiler warning fix
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
#define ALIGN(x,a) __ALIGN_MASK((x),(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
+#define ALLOC_CACHE_ALIGN_BUFFER(type, name, size) \
+ char __##name[size + CONFIG_SYS_CACHELINE_SIZE - 1]; \
+ type *name = (type*) ALIGN(((typeof(CONFIG_SYS_CACHELINE_SIZE))\
+ (__##name)), (CONFIG_SYS_CACHELINE_SIZE));
+
/* Pull in stuff for the build system */
#ifdef DO_DEPS_ONLY
# include <environment.h>