diff --git a/stand/kboot/arch/aarch64/syscall_nr.h b/stand/kboot/arch/aarch64/syscall_nr.h index 511d1fa8b2a7..79bf22947e94 100644 --- a/stand/kboot/arch/aarch64/syscall_nr.h +++ b/stand/kboot/arch/aarch64/syscall_nr.h @@ -1,5 +1,6 @@ #define SYS_close 57 #define SYS_dup 23 +#define SYS_exit 93 #define SYS_fstat 80 #define SYS_getdents64 61 #define SYS_getpid 172 diff --git a/stand/kboot/arch/amd64/syscall_nr.h b/stand/kboot/arch/amd64/syscall_nr.h index 71930001c1cf..71469109a55e 100644 --- a/stand/kboot/arch/amd64/syscall_nr.h +++ b/stand/kboot/arch/amd64/syscall_nr.h @@ -1,5 +1,6 @@ #define SYS_close 3 #define SYS_dup 32 +#define SYS_exit 60 #define SYS_getdents64 217 #define SYS_getpid 39 #define SYS_gettimeofday 96 diff --git a/stand/kboot/arch/powerpc64/syscall_nr.h b/stand/kboot/arch/powerpc64/syscall_nr.h index 0702673c7228..7b425e36c517 100644 --- a/stand/kboot/arch/powerpc64/syscall_nr.h +++ b/stand/kboot/arch/powerpc64/syscall_nr.h @@ -1,5 +1,6 @@ #define SYS_close 6 #define SYS_dup 41 +#define SYS_exit 1 #define SYS_fstat 108 #define SYS_getdents64 202 #define SYS_getpid 20 diff --git a/stand/kboot/host_syscall.h b/stand/kboot/host_syscall.h index 9f876952641e..09f5355e520d 100644 --- a/stand/kboot/host_syscall.h +++ b/stand/kboot/host_syscall.h @@ -155,6 +155,7 @@ struct host_dirent64 { */ int host_close(int fd); int host_dup(int fd); +int host_exit(int code); int host_fstat(int fd, struct host_kstat *sb); int host_getdents64(int fd, void *dirp, int count); int host_getpid(void); diff --git a/stand/kboot/host_syscalls.c b/stand/kboot/host_syscalls.c index 52371021f282..8b364083b15c 100644 --- a/stand/kboot/host_syscalls.c +++ b/stand/kboot/host_syscalls.c @@ -19,6 +19,12 @@ host_dup(int fd) return host_syscall(SYS_dup, fd); } +int +host_exit(int code) +{ + return host_syscall(SYS_exit, code); +} + /* Same system call with different names on different Linux architectures due to history */ int host_fstat(int fd, struct host_kstat *sb) diff --git a/stand/kboot/main.c b/stand/kboot/main.c index 83ad0ceb8a18..5d40e2c3b582 100644 --- a/stand/kboot/main.c +++ b/stand/kboot/main.c @@ -303,7 +303,7 @@ main(int argc, const char **argv) void exit(int code) { - while (1); /* XXX: host_exit */ + host_exit(code); __unreachable(); }