[U-Boot] [PATCH] mmc:dcache: Cache line size aligned internal MMC buffers

Mike Frysinger vapier at gentoo.org
Wed Aug 24 05:00:59 CEST 2011


On Tuesday, August 23, 2011 18:42:46 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > Why cannot we define a macro that declares a (sufficiently sized)
> > > buffer on the stack and provides and a pointer to a (correctly
> > > aligned) address in this buffer?
> > 
> > isnt that what i already posted and you NAK-ed ? :)
> > 
> > DMA_DECLARE_BUFFER(...)
> 
> I just NAKed this specific implementation.

well, it's hard to come up with a "good" one without knowing the parameters to 
work within ;).  i'm not stuck on any particular implementation, i just want 
the helper to be simple to use and hard to screw up.

the trouble with doing something like:
	char foo[func_to_do_round(size)];
is that "size" is not in # of bytes but is number of elements.  so the point 
of my (i dont deny) complicated cpp logic was so that the internal 
implementation took on more of the work leaving the user (which we all know 
can easily mess things up) with a very simple macro:
	DMA_DECLARE_BUFFER(<buffer type>, <variable name>, <num elements>);
-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/20110823/efdc04dd/attachment.pgp 


More information about the U-Boot mailing list