acadia-newlib/libgloss/arm
Matthew Malcomson 6dbd190111 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.
2018-11-19 13:46:19 +01:00
..
cpu-init
Makefile.in
_exit.c Enable return code with semi-hosting SYS_EXIT_EXTENDED 2018-11-19 13:46:19 +01:00
_kill.c Enable return code with semi-hosting SYS_EXIT_EXTENDED 2018-11-19 13:46:19 +01:00
aclocal.m4
arm.h
coff-iq80310.specs
coff-pid.specs
coff-rdimon-v2m.specs
coff-rdimon.specs
coff-rdpmon.specs
coff-redboot.ld
coff-redboot.specs
configure
configure.in
crt0.S
elf-aprofile-validation-v2m.specs
elf-aprofile-validation.specs
elf-aprofile-ve-v2m.specs
elf-aprofile-ve.specs
elf-iq80310.specs
elf-linux.specs
elf-nano.specs
elf-pid.specs
elf-rdimon-v2m.specs
elf-rdimon.specs
elf-rdpmon.specs
elf-redboot.ld
elf-redboot.specs
ftruncate.c
libcfunc.c
linux-crt0.c
linux-syscall.h
linux-syscalls0.S
linux-syscalls1.c
redboot-crt0.S
redboot-syscalls.c
swi.h
syscall.h
syscalls.c
trap.S
truncate.c