diff options
author | ian <ian@FreeBSD.org> | 2014-07-25 23:12:22 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-07-25 23:12:22 +0000 |
commit | d599f4ba1eb7534933e5371228b5883e9c2c5d9c (patch) | |
tree | c68518e63a02cb96596f0a0b192c6826ab42e17b /lib/libstand/sbrk.c | |
parent | 414a4cb93173e7abba9c0ff6950044c5254370d1 (diff) | |
download | FreeBSD-src-d599f4ba1eb7534933e5371228b5883e9c2c5d9c.zip FreeBSD-src-d599f4ba1eb7534933e5371228b5883e9c2c5d9c.tar.gz |
MFC r261530
Set the malloc alignment to 64 bytes on platforms that use the U-Boot API
device drivers. Recent versions of u-boot run with the MMU enabled, and
require DMA-based I/O to be aligned to cache line boundaries.
Diffstat (limited to 'lib/libstand/sbrk.c')
-rw-r--r-- | lib/libstand/sbrk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libstand/sbrk.c b/lib/libstand/sbrk.c index 93d94e4..471e78e 100644 --- a/lib/libstand/sbrk.c +++ b/lib/libstand/sbrk.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include "stand.h" +#include "zalloc_defs.h" static size_t maxheap, heapsize = 0; static void *heapbase; @@ -40,8 +41,9 @@ static void *heapbase; void setheap(void *base, void *top) { - /* Align start address to 16 bytes for the malloc code. Sigh. */ - heapbase = (void *)(((uintptr_t)base + 15) & ~15); + /* Align start address for the malloc code. Sigh. */ + heapbase = (void *)(((uintptr_t)base + MALLOCALIGN_MASK) & + ~MALLOCALIGN_MASK); maxheap = (char *)top - (char *)heapbase; } |