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]

Re: [Patch][newlib][arm] Enable return code with semi-hosting SYS_EXIT_EXTENDED


On Nov 19 11:47, Matthew Malcomson wrote:
> On 19/11/18 11:24, Corinna Vinschen wrote:
> > On Nov 16 18:48, Matthew Malcomson wrote:
> >> The _exit function currently passes -1 as a "sig" to the _kill function as an
> >> invalid signal number so that _kill can distinguish between an abort and a
> >> standard exit.
> > Thanks for the patch, but it doesn't apply.  Can you please resend the
> > patch as attachment in `git format-patch' format?
> >
> >
> > Thanks,
> > Corinna
> >
> Apologies, `git format-patch' file attached.
> Cheers,
> Matthew

> From 752398d1015b7c5c7e12c326cc9e6b0cc0f4ed01 Mon Sep 17 00:00:00 2001
> From: Matthew Malcomson <matthew.malcomson@arm.com>
> Date: Fri, 16 Nov 2018 11:45:48 +0000
> Subject: [PATCH] [newlib][arm] Enable return code with semi-hosting
>  SYS_EXIT_EXTENDED
> 
> The _exit function currently passes -1 as a "sig" to the _kill function as an
> invalid signal number so that _kill can distinguish between an abort and a
> standard exit.
> 
> For boards using the SYS_EXIT_EXTENDED semi-hosting operation to return a
> status code, this means that the "status" paramter to _exit is ignored and the
> return code is always -1.
> https://developer.arm.com/docs/100863/latest/semihosting-operations/sys_exit_extended-0x20
> 
> This patch puts shared code between _kill and _exit into a new function
> _kill_shared that takes the semi-hosting "reason" to use (if semi-hosting is
> available) as an argument.
> 
> For semi-hosting _kill_shared provides that "reason".
> 
> Without the "sig" argument being used to distinguish between a normal and
> abnormal exit, the _exit function can provide the return code to be used if the
> SYS_EXIT_EXTENDED operation is available.
> 
> Hence the exit code can be returned.
> ---
>  libgloss/arm/_exit.c | 15 ++++++++-------
>  libgloss/arm/_kill.c | 27 ++++++++++++---------------
>  2 files changed, 20 insertions(+), 22 deletions(-)

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


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