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

Mike Frysinger vapier at gentoo.org
Wed Aug 24 18:20:37 CEST 2011


On Wednesday, August 24, 2011 09:25:53 Wolfgang Denk wrote:
> Lukasz Majewski wrote:
> > 3. Mike's DMA_DECLARE_BUFFER(<buffer type>, <variable name>,
> > <size in bytes>)
> > solution looks OK for me, at least for the stack allocated data (e.g.
> > ext_csd).
> > However this proposed implementation has been NAK'ed by Wolfgang.
> > 
> > I'm curious how this macro should look like? Is it only matter of code
> > reordering or other approach shall be found?
> 
> I think I'd like to see a macro that can be used like this:
> 
> 	void *dma_buffer_pointer = DMA_BUFFER(size_in_bytes);

as Anton highlighted, i'm not sure this is possible.  DMA_BUFFER() would have 
to be defined with ({...}), and any storage declared in there is in new scope, 
so as soon as you exit that scope, any storage declared is invalid for use 
outside of it.  the only thing that is good for is producing a single value 
(i.e. an "int" or "char" or a pointer etc..., but not storage).

if a person who knows more about gcc internals in this regard could comment, 
that'd be great :).
-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/20110824/2acfba37/attachment.pgp 


More information about the U-Boot mailing list