2020-10-14 12:07:29 +02:00
|
|
|
#ifdef __SUPPORT_VHEX_KERNEL
|
2020-11-03 15:15:01 +01:00
|
|
|
#include <fxlibc/asm/unistd.h>
|
2020-10-14 11:45:08 +02:00
|
|
|
.text
|
|
|
|
.global _fork_execve
|
|
|
|
.type _fork_execve, @function
|
|
|
|
|
|
|
|
|
|
|
|
.align 2
|
|
|
|
/*
|
|
|
|
** pid_t fork_execve(const char *pathname, char **argv, char **envp);
|
|
|
|
** Custom syscall used to create a new process based on the new command passed
|
|
|
|
** using the `argv` and `envp` parametter. This sycall is equivalent of fork()
|
|
|
|
** and execve() combined.
|
|
|
|
**
|
|
|
|
** This custom syscall exist because the Vhex kernel doesn't have access to the
|
|
|
|
** MMU, so we cannot ensure that the memory requested by the potential new
|
|
|
|
** process is enough when execve() is involved by the user.
|
|
|
|
*/
|
|
|
|
_fork_execve:
|
|
|
|
trapa #__NR_fork_execve
|
|
|
|
rts
|
|
|
|
nop
|
|
|
|
.end
|
|
|
|
#endif
|