[U-Boot] [PATCH v3] Export redesign
Simon Glass
sjg at chromium.org
Sun Dec 7 22:30:27 CET 2014
Hi Martin,
On 3 December 2014 at 07:39, Simon Glass <sjg at chromium.org> wrote:
> Hi Martin,
>
> On 1 December 2014 at 00:16, Martin Dorwig <dorwig at tetronik.com> wrote:
>> this is an atempt to make the export of functions typesafe.
>> I replaced the jumptable void ** by a struct (jt_funcs) with function pointers.
>> The EXPORT_FUNC macro now has 3 fixed parameters and one
>> variadic parameter
>> The first is the name of the exported function,
>> the rest of the parameters are used to format a functionpointer
>> in the jumptable,
>>
>> the EXPORT_FUNC macros are expanded three times,
>> 1. to declare the members of the struct
>> 2. to initialize the structmember pointers
>> 3. to call the functions in stubs.c
>>
>> Signed-off-by: Martin Dorwig <dorwig at tetronik.com>
>> ---
>>
>> Changes in v3:
>
> If no one beats me to it, I should get to testing this by early next week.
>
> Regards,
> Simon
Just one minor problem. I think you need forward declaration of
'struct spi_slave' at the top of exports.h. Without that I get a build
error on boards with SPI.
I tested this on ARM as well and it seems to work well. In fact I
could not get the old standalone program to work before your changes.
So maybe you have fixed something?
Regards,
Simon
More information about the U-Boot
mailing list