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

Anton Staaf robotboy at google.com
Tue Aug 30 00:49:43 CEST 2011


On Mon, Aug 29, 2011 at 3:03 PM, Scott Wood <scottwood at freescale.com> wrote:
> On 08/29/2011 04:54 PM, Anton Staaf wrote:
>> On Mon, Aug 29, 2011 at 2:23 PM, Scott Wood <scottwood at freescale.com> wrote:
>>> With the version in that patch I get the slightly different "error:
>>> initializer element is not computable at load time".  Seems like whether
>>> you cast the address to (type *) or (void *) determines which error you
>>> get.  This is with GCC 4.5.1 (powerpc) and 4.6.0 (x86).  Maybe it's
>>> arch-dependent, based on available relocation types.
>>>
>>> Also, shouldn't the array be of type "char" rather than "char *"?
>>
>> Yes, you are correct, it should be a char.  That may be the problem.
>
> It didn't make a difference.

Hmm, I haven't played with this code yet, so I can't say for sure.
But it would certainly throw a wrench in the works if Mike's solution
was also unavailable on some platforms.  By chance, you aren't also
adding static here are you?  I could certainly see that that wouldn't
work.

>>> How do you make the declaration static?
>>
>> you can't with this version of the macro.  Are there cases where you
>> need the buffer to be static?
>
> I think you'd want it to be static more often than not.

If the buffer is allocated at file scope, then yes, we would want it
to be static.  But not at function scope.  It would no longer be
allocated on the stack in that case, and that was frowned upon
earlier.

Thanks,
    Anton

> -Scott
>
>


More information about the U-Boot mailing list