diff options
author | Yuriy Kolerov <ykolerov@synopsys.com> | 2024-08-20 15:10:42 +0300 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2024-08-20 18:24:00 -0400 |
commit | 03f4e346f42dad88cf1742c277b1832ad217133b (patch) | |
tree | 13d03413596cf60c31d9cea0e473268b238fa2b3 | |
parent | eef062451f3ac371c6496d9cf802d8fef05a3d13 (diff) | |
download | newlib-03f4e346f42dad88cf1742c277b1832ad217133b.zip newlib-03f4e346f42dad88cf1742c277b1832ad217133b.tar.gz newlib-03f4e346f42dad88cf1742c277b1832ad217133b.tar.bz2 |
arc: libgloss: Use exit code in _exit_halt for nSIM
nSIM simulator supports exit codes. However, it's necessary
to pass an exit code to _exit_halt, otherwise it's undefined.
Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
-rw-r--r-- | libgloss/arc/nsim-syscalls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libgloss/arc/nsim-syscalls.c b/libgloss/arc/nsim-syscalls.c index 80747e9..807f95c 100644 --- a/libgloss/arc/nsim-syscalls.c +++ b/libgloss/arc/nsim-syscalls.c @@ -100,7 +100,7 @@ _open (const char * pathname, int flags, int mode) } /* Should be provided by crt0.S. */ -extern void __attribute__((noreturn, long_call)) _exit_halt (); +extern void __attribute__((noreturn, long_call)) _exit_halt (int ret); void __attribute__((noreturn)) @@ -109,7 +109,7 @@ _exit (int ret) /* Doing an "exit" system call would work on nSIM with hostlink, but call to _exit_halt, which will do a CPU halt is more universal and will work in many other cases as well, including an FPGA/SoC. */ - _exit_halt (); + _exit_halt (ret); } /* This is a copy of newlib/libc/posix/_isatty.c. It is needed because nSIM |