Message type for SYS_EXEC

Change-Id: I349e28b8bb3705386f04e4860cffc6ed74a5532f
This commit is contained in:
2014-05-26 12:03:25 +02:00
parent cc0c1fbd75
commit 886c867c38
7 changed files with 34 additions and 25 deletions

View File

@@ -2,10 +2,11 @@
* m_type: SYS_EXEC
*
* The parameters for this kernel call are:
* m1_i1: PR_ENDPT (process that did exec call)
* m1_p1: PR_STACK_PTR (new stack pointer)
* m1_p2: PR_NAME_PTR (pointer to program name)
* m1_p3: PR_IP_PTR (new instruction pointer)
* m_lsys_krn_sys_exec.endpt (process that did exec call)
* m_lsys_krn_sys_exec.stack (new stack pointer)
* m_lsys_krn_sys_exec.name (pointer to program name)
* m_lsys_krn_sys_exec.ip (new instruction pointer)
* m_lsys_krn_sys_exec.ps_str (struct ps_strings *)
*/
#include "kernel/system.h"
#include <string.h>
@@ -23,7 +24,7 @@ int do_exec(struct proc * caller, message * m_ptr)
int proc_nr;
char name[PROC_NAME_LEN];
if(!isokendpt(m_ptr->PR_ENDPT, &proc_nr))
if(!isokendpt(m_ptr->m_lsys_krn_sys_exec.endpt, &proc_nr))
return EINVAL;
rp = proc_addr(proc_nr);
@@ -33,7 +34,7 @@ int do_exec(struct proc * caller, message * m_ptr)
}
/* Save command name for debugging, ps(1) output, etc. */
if(data_copy(caller->p_endpoint, (vir_bytes) m_ptr->PR_NAME_PTR,
if(data_copy(caller->p_endpoint, m_ptr->m_lsys_krn_sys_exec.name,
KERNEL, (vir_bytes) name,
(phys_bytes) sizeof(name) - 1) != OK)
strncpy(name, "<unset>", PROC_NAME_LEN);
@@ -41,8 +42,10 @@ int do_exec(struct proc * caller, message * m_ptr)
name[sizeof(name)-1] = '\0';
/* Set process state. */
arch_proc_init(rp, (u32_t) m_ptr->PR_IP_PTR, (u32_t) m_ptr->PR_STACK_PTR,
(u32_t) m_ptr->PR_PS_STR_PTR, name);
arch_proc_init(rp,
(u32_t) m_ptr->m_lsys_krn_sys_exec.ip,
(u32_t) m_ptr->m_lsys_krn_sys_exec.stack,
(u32_t) m_ptr->m_lsys_krn_sys_exec.ps_str, name);
/* No reply to EXEC call */
RTS_UNSET(rp, RTS_RECEIVING);
@@ -55,4 +58,3 @@ int do_exec(struct proc * caller, message * m_ptr)
return(OK);
}
#endif /* USE_EXEC */