Add variants of _swi and _swix that take a va_list
These are typically useful for wrapper functions that want to do something
before and/or after a SWI call, and which therefore need to pass a pointer
to their own variadic arguments into the guts of _swi
or _swix
.
The pairs of functions _swi
and _vswi
, and _swix
and _vswix
, are almost
identical, differing only in argument marshalling and restoring the stack
pointer afterwards. I considered altering the implementation to set up a
stack frame on entry, so that all four functions could exit using the same
function tail that used the frame pointer to restore the stack pointer.
However, that would impose a penalty on all existing users of _swi
and _swix
.
So instead, I'm using repetitive assembly to build both variants from the
same source code.
There being only two additional entries, I didn't think it was worth introducing a whole new library chunk. Instead, I've tacked them onto the end of chunk 2 (the basic clib functions).
Note that this means that any applications that use these new entries will need to take responsibility for RMEnsuring this version of the SharedCLibrary module and softloading a newer one if necessary.
One thing I'm undecided on: in order to declare the prototypes for _vswi
and _vswix
, I've changed "swis.h"
to include <stdarg.h>
. Should it do like <stdio.h>
and define its own compatible, but differently named type instead of va_list
?