
Hi Martin,
On 3 December 2014 at 07:39, Simon Glass sjg@chromium.org wrote:
Hi Martin,
On 1 December 2014 at 00:16, Martin Dorwig dorwig@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,
- to declare the members of the struct
- to initialize the structmember pointers
- to call the functions in stubs.c
Signed-off-by: Martin Dorwig dorwig@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