diff options
author | Matthew Malcomson <matthew.malcomson@arm.com> | 2018-11-16 14:45:48 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2018-11-19 15:46:19 +0300 |
commit | 6dbd190111ce4e871af70e9b13b495b7465185af (patch) | |
tree | 95a9542b0e893be691a9e3b30472a268275409a7 /newlib/libc | |
parent | df7824d1a465473a1901f67e26fd1485756cb446 (diff) |
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.
Diffstat (limited to 'newlib/libc')
0 files changed, 0 insertions, 0 deletions