Hi all.

I'd like to take a stab at reimplementing the WindowManager module using C/C++, in particular to make further development easier and while most of its SWIs behave "function-like", i.e. return (directly) to their caller, a few do not, in particular those having to do with creating new tasks and switching between them, such as Wimp_StartTask and Wimp_Poll.

With CMunge, you define a C/C++ function to be called when a SWI is called, and when you return from the function, it returns from the SWI, as well.

However, in the case of Wimp_StartTask, the transfer of control is something like this:

(Current task) -> Wimp_StartTask ("e.g. *SomeWimpTask) (This probably pages out the "Current task" from &8000, sets up &8000 with the amount of money specified in the "Next" slot, and issues the command, *SomeWimpTask) -> SomeWimpTask -> OS_Exit/Wimp_Poll -> Set up original task context and return from Wimp_StartTask.

This doesn't look like a function call to me... :)

Does anyone have any ideas of how one might implement such SWIs, without having to do them in ARM assembly, in order to store the return address, set up context for the new task, etc.?

Regards,

Terje


_______________________________________________
GCCSDK mailing list [email protected]
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

Reply via email to