This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
h8300 _exit
- From: DJ Delorie <dj at redhat dot com>
- To: kazu at cs dot umass dot edu, newlib at sourceware dot org
- Cc: dj at redhat dot com
- Date: Tue, 14 Mar 2006 23:40:24 -0500
- Subject: h8300 _exit
After the noted patch, it seems that _exit() ignores the argument
passed to it; assuming that the return code is in R0 (it's normally on
the stack). Am I missing something, or has this really gone unnoticed
for two years? Also, the .S version can't compensate for gcc's
-mquickcall, which changes the argument passing convention.
2004-03-11 Kazu Hirata <kazu@cs.umass.edu>
* libc/sys/h8300hms/Makefile.am (lib_a_SOURCES): Replace
_exit.c with _exit.S.
* libc/sys/h8300hms/Makefile.in: Regenerate.
* libc/sys/h8300hms/_exit.c: Remove.
* libc/sys/h8300hms/_exit.S: New.
#include "setarch.h"
/* `sleep' is passed an argument in r0 that indicates the reason
the program is exiting. The format of r0 is defined in
devo/include/wait.h. */
/* extern void _exit (int rc); */
.section .text
.align 2
.global __exit
__exit:
mov.w #0xdead,r1
mov.w #0xbeef,r2
mov.b r0l,r0h
sub.b r0l,r0l
sleep