Showing changes from revision #4 to #5:
Added | Removed | Changed
Entry | |
---|---|
R12 | Workspace pointer |
Other registers: Undefined | |
User mode, IRQs+FIQs enabled |
This is called in USER mode whenever OS_Exit or OS_ExitAndDie is called. It should restore all handlers to their previous values and then call OS_Exit to pass to the previous handler. However, care must be taken to ensure R0-R2 are valid when calling OS_Exit, as the OS will typically have corrupted them prior to calling the exit handler. If it’s desirable to pass through the original return code, that can be read via Sys$ReturnCode, as it will have been stored prior to the exit handler being invoked.
R13 may be undefined, either avoid the use of R13 in the handler or provide your own stack space.
The exit handler will not be invoked if an error is generated due to the return code being out of range (instead, you can expect the Error Handler to be invoked)