Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2006-12-11 03:04:00 +0300
committerBen Elliston <bje@gnu.org>2006-12-11 03:04:00 +0300
commit931e17a3caa8b4dbc422cf6051bc07986938a563 (patch)
tree2521980b7dccede7121cddbd68d070bda52c0297 /libgloss/spu/exit.c
parent1ad5a4066d06da999dc32b6d28822722bc0d2cd0 (diff)
* spu/exit.c (libgloss_exit): Rename from this ..
(_exit): .. to this. Overhaul. (exit): Remove.
Diffstat (limited to 'libgloss/spu/exit.c')
-rw-r--r--libgloss/spu/exit.c23
1 files 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 );
-}
-