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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot