This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]