minix/lib/libsys/sys_exec.c
Lionel Sambuc cfd3379bb1 Removing CSU patches
* Removed startup code patches in lib/csu regarding kernel to userland
   ABI.

 * Aligned stack layout on NetBSD stack layout.

 * Generate valid stack pointers instead of offsets by taking into account
   _minix_kerninfo->kinfo->user_sp.

 * Refactored stack generation, by moving part of execve in two
   functions {minix_stack_params(), minix_stack_fill()} and using them
   in execve(), rs and vm.

 * Changed load offset of rtld (ld.so) to:
      execi.args.stack_high - execi.args.stack_size - 0xa00000
   which is 10MB below the main executable stack.

Change-Id: I839daf3de43321cded44105634102d419cb36cec
2014-02-18 11:25:02 +01:00

18 lines
363 B
C

#include "syslib.h"
int sys_exec(endpoint_t proc_ep, char *stack_ptr, char *progname,
vir_bytes pc, vir_bytes ps_str)
{
/* A process has exec'd. Tell the kernel. */
message m;
m.PR_ENDPT = proc_ep;
m.PR_STACK_PTR = stack_ptr;
m.PR_NAME_PTR = progname;
m.PR_IP_PTR = (char *)pc;
m.PR_PS_STR_PTR = (char *)ps_str;
return _kernel_call(SYS_EXEC, &m);
}