summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/sparc/syscall/syscall.S
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-05-23 08:52:16 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-05-23 09:14:15 -0500
commit6a740c2e70731522766f315739a6d2eb3f95043f (patch)
tree50fb435a3e846dcbd652e32e06a620cedbddf31e /c/src/lib/libcpu/sparc/syscall/syscall.S
parentSPARC: syscall code clean-up and minor optimizations (diff)
downloadrtems-6a740c2e70731522766f315739a6d2eb3f95043f.tar.bz2
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.
Diffstat (limited to 'c/src/lib/libcpu/sparc/syscall/syscall.S')
-rw-r--r--c/src/lib/libcpu/sparc/syscall/syscall.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/c/src/lib/libcpu/sparc/syscall/syscall.S b/c/src/lib/libcpu/sparc/syscall/syscall.S
index 2d53ebeae1..a0a860c912 100644
--- a/c/src/lib/libcpu/sparc/syscall/syscall.S
+++ b/c/src/lib/libcpu/sparc/syscall/syscall.S
@@ -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 */