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
This commit is contained in:
2013-09-13 20:12:22 +02:00
parent 5d04b92e06
commit cfd3379bb1
29 changed files with 608 additions and 485 deletions

View File

@@ -1,18 +1,17 @@
#include "syslib.h"
int sys_exec(proc_ep, ptr, prog_name, initpc)
endpoint_t proc_ep; /* process that did exec */
char *ptr; /* new stack pointer */
char *prog_name; /* name of the new program */
vir_bytes initpc;
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;
message m;
m.PR_ENDPT = proc_ep;
m.PR_STACK_PTR = ptr;
m.PR_NAME_PTR = prog_name;
m.PR_IP_PTR = (char *)initpc;
return(_kernel_call(SYS_EXEC, &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);
}