mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
Move malloc_cache_aligned() to its own header
At present malloc.h is included everywhere since it recently was added to
common.h in this commit:
4519668
mtd/nand/ubi: assortment of alignment fixes
This seems wasteful and unnecessary. We have been trying to trim down
common.h and put separate functions into separate header files and that
change goes in the opposite direction.
Move malloc_cache_aligned() to a new header so that this can be avoided.
The header would perhaps be better named as alignmem.h but it needs to be
included after common.h and people might be confused by this. With the name
memalign.h it fits nicely after malloc() in most cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
This commit is contained in:
parent
9b6aa00dbc
commit
6e295186c7
8 changed files with 36 additions and 11 deletions
|
@ -1060,15 +1060,6 @@ int cpu_release(int nr, int argc, char * const argv[]);
|
|||
#define DEFINE_CACHE_ALIGN_BUFFER(type, name, size) \
|
||||
DEFINE_ALIGN_BUFFER(type, name, size, ARCH_DMA_MINALIGN)
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#include <malloc.h>
|
||||
|
||||
static inline void *malloc_cache_aligned(size_t size)
|
||||
{
|
||||
return memalign(ARCH_DMA_MINALIGN, ALIGN(size, ARCH_DMA_MINALIGN));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* check_member() - Check the offset of a structure member
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue