next pass of cleaning up micropatch.c

Robert P. J. Day rpjday at mindspring.com
Sat Oct 9 06:46:26 EST 2004


On Fri, 8 Oct 2004, Dan Malek wrote:

>
> On Oct 8, 2004, at 11:45 AM, Robert P. J. Day wrote:
>
>> i'll put the actual code back in, but you might have second thoughts when 
>> we're up to 8 or 10 patches some day. :-)
>
> ... Instead of those macros, I would have written a simple function 
> that takes a microcode patch array, #define'd those hard coded 
> addresses with logical names and passed it into that function.

nice idea, but sadly, doomed to failure.  note that the code to copy 
the patch arrays *requires* you to be able to take the sizeof() those 
arrays to know *exactly* how much to copy.  if you pass the array to a 
function by its address, i'm pretty sure you lose the ability to take 
its sizeof() anymore, isn't that right?

in short, you either need the code or a macro representing the code. 
a function won't help you here.

rday



More information about the Linuxppc-embedded mailing list