Hi!
In the module.c there is the section you can read at the bottom of this
mail. I tried the same approach for the inet4.xdd XIF loader function
and it solved my problem with loading the .xif drivers in ARAnyM.
Does anyone have idea why it doesn't work for the module init() function
and all the registers need to be saved?
regards
STanda
#if 0
/*
* this don't work?!
* why need the registers to be preserved?
* all the modules are gcc compiled too ...
*/
static void *
module_init(void *initfunc, struct kerinfo *k)
{
void * _cdecl (*init)(struct kerinfo *);
init = initfunc;
return (*init)(k);
}
#else
static void *
module_init(void *initfunc, struct kerinfo *k)
{
register void *ret __asm__("d0");
__asm__ volatile
(
"moveml d3-d7/a3-a6,sp@-;"
"movl %2,sp@-;"
"movl %1,a0;"
"jsr a0@;"
"addqw #4,sp;"
"moveml sp@+,d3-d7/a3-a6;"
: "=r"(ret) /* outputs */
: "g"(initfunc), "r"(k) /* inputs */
: "d0", "d1", "d2", "a0", "a1", "a2", /* clobbered regs */
"memory"
);
return ret;
}
#endif