Re: [Patch][arm] Enable return code with semi-hosting SYS_EXIT_EXTENDED
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> > 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
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAlvysNAACgkQ9TYGna5E T6DAzg/+P1RZAG1s9cdN1wl9YEwBVKaldKTegfKsSvLx/+uAcN/PqAOcy/n9PeNN wjFnFeMU9XPZbVGtrKIOlYL0sj4MrQnqzFWXKZOcuSzXD1WMyqjsVphlh6hDFv8S MQ8iaWgfPIDxUtp91tTPAMLDsGkhe69rp+ByuRCN2I6GV0RszLnOIk9wQf+UzMqi eCdICjK2MBecjLOrg/LS8kTc3nBhuxtJSkG7QKr+Ka9CMjP8N4HVNSyaq/z8qpAz fZBn0b2h47EcQ7SV6YqxOt/92Nl8uIas+OE57nBGFAl4Ge2Ftu3gUNZrpvFeT6HY Lxwp+o0q3IPcA7taiHb4OGyEuNHF33ZRLS5KyAlfs2Vsum63wSWDY/LsfwJ/yVfx 4V0xSNjKNo1ci60XVDo9G7kHG4mpcPCe9VPo/pwTsyG1u8xqWiNLnNe9076E4qe3 t2wDfyEV7df2U8idmgpT1KACPwrdqY+Y5KP7j5KHK1uMq4I3EKjVW8C/tKF4pOYV rOSTZ/JHPgsZbanhdD94JesOitavX1i8N8+IvmFdvSHd1kP42i7weJmc5/3dRNr9 ceYwEOr5Wx1zaGauK+aOrLb8DsrE6KZ5/ATYOeSf6z/g/uJPee4t6i468Sp3Sbuj D6m2bOisbpLJHRzLkrEkQoe89caprCb9tD3qVwMC7qXSGLyTpzg= =cmsM -----END PGP SIGNATURE-----