Date: Wed, 5 Feb 2014 13:51:56 -0700 From: Warner Losh <imp@bsdimp.com> To: John Baldwin <jhb@freebsd.org> Cc: Ian Lepore <ian@freebsd.org>, freebsd-arch@freebsd.org Subject: Re: Malloc alignment in libstand / loader(8) Message-ID: <0AB67017-D232-40CF-A8F2-382F5A5A92B1@bsdimp.com> In-Reply-To: <2882663.sRzekugaiD@ralph.baldwin.cx> References: <1391576134.1196.21.camel@revolution.hippie.lan> <2882663.sRzekugaiD@ralph.baldwin.cx>
next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 5, 2014, at 6:29 AM, John Baldwin wrote: > On Tuesday, February 04, 2014 09:55:34 PM Ian Lepore wrote: >> On newer ARM chips, the device drivers used by loader(8) require that >> I/O buffers be aligned on cache line sized boundaries. The drivers = are >> part of u-boot which serves as a sort of load-time bios. >>=20 >> Attached is a patch that sets the malloc alignment in libstand to 64 >> bytes when compiled on ARM, and leaves it at 16 bytes for all other >> platforms. If there are no objections I'd like to commit this soon. >>=20 >> I've tested this on ARM, but have no way to test it on other = platforms. >> The changes should be a no-op on other platforms. >=20 > I think this looks fine, but perhaps use CTASSERT() instead of rolling = your=20 > own? (I would say to use _Static_assert(), but I don't think that = works with=20 > our old GCC) I'd enable it for mips and powerpc, the other two platforms that have = uboot callback support. Other than that, the change looks good to me. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0AB67017-D232-40CF-A8F2-382F5A5A92B1>