From 6ea486a6df01b53b8b908fa49ce22f72a8ea47b2 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 5 Jun 2006 19:45:08 +0000 Subject: [PATCH] 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/ChangeLog | 7 +++++++ newlib/configure.host | 14 ++++++------- newlib/libc/sys/arm/libcfunc.c | 11 ---------- newlib/libc/sys/arm/syscalls.c | 37 +++++++++++++++++++--------------- 4 files changed, 35 insertions(+), 34 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index ab231a5ee..2f14a929e 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,10 @@ +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. + 2006-06-05 Jeff Johnston * Makefile.am (AM_MAKEFLAGS): Pass CCASFLAGS. diff --git a/newlib/configure.host b/newlib/configure.host index 216e228a6..8fd0bb9ea 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -510,11 +510,11 @@ case "${host}" in ;; arm-*-pe) syscall_dir=syscalls - newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY" ;; arm-*-*) syscall_dir=syscalls - newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY" # If newlib is supplying syscalls, select which debug protocol is being used. # ARM_RDP_MONITOR selects the Demon monitor. # ARM_RDI_MONITOR selects the Angel monitor. @@ -553,7 +553,7 @@ case "${host}" in ;; ep9312-*-*) syscall_dir=syscalls - newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY" if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR" fi @@ -660,16 +660,16 @@ case "${host}" in ;; strongarm-*-*) syscall_dir=syscalls - newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY" ;; thumb-*-pe) syscall_dir=syscalls - newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY" # Don't use the debugging protocols just yet. ;; thumb-*-*) syscall_dir=syscalls - newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY" # If newlib is supplying syscalls, select which debug protocol is being used. # ARM_RDP_MONITOR selects the Demon monitor. # ARM_RDI_MONITOR selects the Angel monitor. @@ -700,7 +700,7 @@ case "${host}" in ;; xscale-*-*) syscall_dir=syscalls - newlib_cflags="${newlib_cflags} -DABORT_PROVIDED -DHAVE_GETTIMEOFDAY" + newlib_cflags="${newlib_cflags} -DHAVE_GETTIMEOFDAY" newlib_cflags="${newlib_cflags} -DHAVE_SYSTEM -DHAVE_RENAME" if [ "x${newlib_may_supply_syscalls}" = "xyes" ] ; then newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR" 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) +void +_exit (int status) { -#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; + /* 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