cmhg call_generic_veneer
Colin (478) 2433 posts |
I’ll use devicefs as an example. When writing a device driver you register a driver entry function with devicefs which is called by devicefs from a procedure call standard which passes all the arguments in registers. This is different to the procedure call standard used by C so you can’t just register a C function. To solve this problem cmhg provides generic-veneers which convert the callers call standard to the C call standard. So far so good. Now if I rewrote devicefs in C, a device which registers with my module will register a function which expects the arguments to be in registers and so can’t be called from C. So in order to call the function you need to add an assembler function, something like
I’d like to see this function automatically generated by cmhg instead of everyone trying to work out how to implement it and having to resort to assembler. It would standardise the way to implement a virtual interface module in C. You know it makes sense :-) can I have a copy when you’re done. |