SPARC: add syscall 1 (exit) function entry point

The exit SPARC system call doesn't have a function entry
point like the others do. This is probably why people use
TA 0x0 instruction directly for shutting down the system.
This commit is contained in:
Daniel Hellstrom
2014-05-23 08:52:16 -05:00
committed by Joel Sherrill
parent 434e7f7bee
commit 6a740c2e70
2 changed files with 38 additions and 0 deletions

View File

@@ -29,6 +29,10 @@
* l1 = pc
* l2 = npc
* g1 = system call id
*
* System Call 1 (exit):
* g2 = additional exit code 1
* g3 = additional exit code 2
*/
PUBLIC(syscall)
@@ -70,4 +74,13 @@ SYM(sparc_enable_interrupts):
retl
ta 0
PUBLIC(sparc_syscall_exit)
SYM(sparc_syscall_exit):
mov SYS_exit, %g1
mov %o0, %g2 ! Additional exit code 1
mov %o1, %g3 ! Additional exit code 2
ta 0
/* end of file */