LONG new_stack;
Super() inquires and modifies the current CPU mode. | |
Opcode | 32 (0x0020) |
Availability | All GEMDOS versions. |
Parameters |
stack can take the following values:
|
Binding |
pea new_stack,-(sp) move.w #$0020,-(sp) trap #1 addq.l #6,sp |
Return Value | In SUP_INQ mode, the current state of the processor (-1 if supervisor, 0 if user), otherwize the old supervisor stack pointer. |
Comments |
When being in supervisor, calling Super with a new_stack not being SUP_INQ will make the process go back in user mode. The supervisor stack pointer is copied into the user stack pointer, and the supervisor stack pointer is then set to new_stack, except if new_stack was NULL, because it would mean that you want the system stack pointer to be NULL, which is very dangerous. When this happens, the stack pointers remain unchanged and the SIGSYS signal (12) is raised. Also, if you are in SECURELEVEL > 1, you must have root privileges to get into supervisor mode. If you don't have them and call Super(), the SIGSYS signal (12) will be raised. |
See Also | Supexec() |