2 * Copyright (C) 2020 Embecosm Limited
3 * SPDX-License-Identifier: BSD-2-Clause
5 #include <machine/syscall.h>
6 #include "semihost_syscall.h"
8 #define ADP_Stopped_ApplicationExit 0x20026
10 /* Exit a program without cleaning up files. */
12 _exit (int exit_status
)
14 #if __riscv_xlen == 32
15 syscall_errno (SEMIHOST_exit
, (long *) ADP_Stopped_ApplicationExit
);
17 /* The semihosting exit operation only allows 64-bit targets to report the
19 long data_block
[] = {ADP_Stopped_ApplicationExit
, exit_status
};
20 syscall_errno (SEMIHOST_exit
, data_block
);