From 931e17a3caa8b4dbc422cf6051bc07986938a563 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Mon, 11 Dec 2006 00:04:00 +0000 Subject: [PATCH] * spu/exit.c (libgloss_exit): Rename from this .. (_exit): .. to this. Overhaul. (exit): Remove. --- libgloss/spu/exit.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/libgloss/spu/exit.c b/libgloss/spu/exit.c index 669338822..1b639b50e 100644 --- a/libgloss/spu/exit.c +++ b/libgloss/spu/exit.c @@ -27,18 +27,19 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Author: Andreas Neukoetter (ti95neuk@de.ibm.com) */ -void __attribute__ (( destructor )) libgloss_exit( void ) +void _exit(int rc) { - /* we don't need any cleanup on the SPE ... yet */ - /* DEBUG HERE */ + /* Some self modifying code to return 'rc' in the 'stop' insn. */ + asm volatile ( + " ori $3, %0,0\n" + " lqr $4, 1f\n" + " cbd $5, 1f+3($sp)\n" + " shufb $0, %0, $4, $5\n" + " stqr $0, 1f\n" + " sync\n" + "1:\n" + " stop 0x2000\n" + : : "r" (rc) ); } - -void exit( int status ) -{ - /* handle atexit, etc here */ - _exit( status ); -} - -- 2.43.5