From 6ea486a6df01b53b8b908fa49ce22f72a8ea47b2 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 5 Jun 2006 19:45:08 +0000 Subject: 2006-06-05 Shaun Jackman configure.host (newlib_cflags) [arm, thumb, xscale]: Remove -DABORT_PROVIDED flag. * newlib/libc/sys/arm/syscalls.c (kill, exit): Sync with libgloss. * newlib/libc/sys/arm/libcfunc.c (abort): Ditto. --- newlib/libc/sys/arm/libcfunc.c | 11 ----------- newlib/libc/sys/arm/syscalls.c | 39 ++++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 28 deletions(-) (limited to 'newlib/libc') diff --git a/newlib/libc/sys/arm/libcfunc.c b/newlib/libc/sys/arm/libcfunc.c index 3bf0a56f4..9fa9cb4b8 100644 --- a/newlib/libc/sys/arm/libcfunc.c +++ b/newlib/libc/sys/arm/libcfunc.c @@ -23,17 +23,6 @@ do_AngelSWI (int reason, void * arg) #endif /* ARM_RDI_MONITOR */ -void -abort (void) -{ -#ifdef ARM_RDI_MONITOR - do_AngelSWI (AngelSWI_Reason_ReportException, - (void *) ADP_Stopped_RunTimeError); -#else - asm ("mov r0,#17\nswi %a0" :: "i" (SWI_Exit)); -#endif -} - void alarm (void) { diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c index 529309930..ad25b95f7 100644 --- a/newlib/libc/sys/arm/syscalls.c +++ b/newlib/libc/sys/arm/syscalls.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "swi.h" @@ -433,30 +434,34 @@ _close (int file) return wrap (_swiclose (file)); } -void -_exit (int n) +int +_kill (int pid, int sig) { - /* FIXME: return code is thrown away. */ - + (void)pid; (void)sig; #ifdef ARM_RDI_MONITOR - do_AngelSWI (AngelSWI_Reason_ReportException, - (void *) ADP_Stopped_ApplicationExit); + /* Note: The pid argument is thrown away. */ + switch (sig) { + case SIGABRT: + return do_AngelSWI (AngelSWI_Reason_ReportException, + (void *) ADP_Stopped_RunTimeError); + default: + return do_AngelSWI (AngelSWI_Reason_ReportException, + (void *) ADP_Stopped_ApplicationExit); + } #else asm ("swi %a0" :: "i" (SWI_Exit)); #endif - n = n; } -int -_kill (int n, int m) -{ -#ifdef ARM_RDI_MONITOR - return do_AngelSWI (AngelSWI_Reason_ReportException, - (void *) ADP_Stopped_ApplicationExit); -#else - asm ("swi %a0" :: "i" (SWI_Exit)); -#endif - n = n; m = m; +void +_exit (int status) +{ + /* There is only one SWI for both _exit and _kill. For _exit, call + the SWI with the second argument set to -1, an invalid value for + signum, so that the SWI handler can distinguish the two calls. + Note: The RDI implementation of _kill throws away both its + arguments. */ + _kill(status, -1); } int -- cgit v1.2.3