From 6a740c2e70731522766f315739a6d2eb3f95043f Mon Sep 17 00:00:00 2001 From: Daniel Hellstrom Date: Fri, 23 May 2014 08:52:16 -0500 Subject: 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. --- c/src/lib/libcpu/sparc/syscall/syscall.S | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'c/src/lib/libcpu/sparc/syscall') 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 */ -- cgit v1.2.3