PM: save process frame length
This commit is contained in:
parent
a5a8c57fe7
commit
7763fd67c7
@ -562,7 +562,7 @@ int pstat(int p_nr, struct pstat *bufp, int endpoints)
|
|||||||
bufp->ps_utime = ps_proc[p_ki].p_user_time;
|
bufp->ps_utime = ps_proc[p_ki].p_user_time;
|
||||||
bufp->ps_stime = ps_proc[p_ki].p_sys_time;
|
bufp->ps_stime = ps_proc[p_ki].p_sys_time;
|
||||||
|
|
||||||
bufp->ps_procargs = ps_mproc[p_nr].mp_procargs;
|
bufp->ps_procargs = ps_mproc[p_nr].mp_frame_addr;
|
||||||
|
|
||||||
if (bufp->ps_state == Z_STATE)
|
if (bufp->ps_state == Z_STATE)
|
||||||
bufp->ps_args = "<defunct>";
|
bufp->ps_args = "<defunct>";
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* - take care of setuid and setgid bits
|
* - take care of setuid and setgid bits
|
||||||
* - fix up 'mproc' table
|
* - fix up 'mproc' table
|
||||||
* - tell kernel about EXEC
|
* - tell kernel about EXEC
|
||||||
* - save offset to initial argc (for ps)
|
* - save offset to initial argc (for procfs)
|
||||||
*
|
*
|
||||||
* The entry points into this file are:
|
* The entry points into this file are:
|
||||||
* do_exec: perform the EXEC system call
|
* do_exec: perform the EXEC system call
|
||||||
@ -95,8 +95,9 @@ PUBLIC int do_exec_newmem()
|
|||||||
strncpy(rmp->mp_name, args.progname, PROC_NAME_LEN-1);
|
strncpy(rmp->mp_name, args.progname, PROC_NAME_LEN-1);
|
||||||
rmp->mp_name[PROC_NAME_LEN-1] = '\0';
|
rmp->mp_name[PROC_NAME_LEN-1] = '\0';
|
||||||
|
|
||||||
/* Save offset to initial argc (for ps) */
|
/* Save offset to initial argc (for procfs) */
|
||||||
rmp->mp_procargs = (vir_bytes) stack_top - args.args_bytes;
|
rmp->mp_frame_addr = (vir_bytes) stack_top - args.args_bytes;
|
||||||
|
rmp->mp_frame_len = args.args_bytes;
|
||||||
|
|
||||||
/* Kill process if something goes wrong after this point. */
|
/* Kill process if something goes wrong after this point. */
|
||||||
rmp->mp_flags |= PARTIAL_EXEC;
|
rmp->mp_flags |= PARTIAL_EXEC;
|
||||||
@ -183,7 +184,7 @@ vir_bytes pc;
|
|||||||
check_sig(rmp->mp_pid, sn, FALSE /* ksig */);
|
check_sig(rmp->mp_pid, sn, FALSE /* ksig */);
|
||||||
}
|
}
|
||||||
|
|
||||||
new_sp= (char *)rmp->mp_procargs;
|
new_sp= (char *)rmp->mp_frame_addr;
|
||||||
r= sys_exec(rmp->mp_endpoint, new_sp, rmp->mp_name, pc);
|
r= sys_exec(rmp->mp_endpoint, new_sp, rmp->mp_name, pc);
|
||||||
if (r != OK) panic("sys_exec failed: %d", r);
|
if (r != OK) panic("sys_exec failed: %d", r);
|
||||||
}
|
}
|
||||||
|
@ -50,9 +50,12 @@ EXTERN struct mproc {
|
|||||||
|
|
||||||
unsigned mp_flags; /* flag bits */
|
unsigned mp_flags; /* flag bits */
|
||||||
unsigned mp_trace_flags; /* trace options */
|
unsigned mp_trace_flags; /* trace options */
|
||||||
vir_bytes mp_procargs; /* ptr to proc's initial stack arguments */
|
|
||||||
message mp_reply; /* reply message to be sent to one */
|
message mp_reply; /* reply message to be sent to one */
|
||||||
|
|
||||||
|
/* Process execution frame. Both fields are used by procfs. */
|
||||||
|
vir_bytes mp_frame_addr; /* ptr to proc's initial stack arguments */
|
||||||
|
size_t mp_frame_len; /* size of proc's initial stack arguments */
|
||||||
|
|
||||||
/* Scheduling priority. */
|
/* Scheduling priority. */
|
||||||
signed int mp_nice; /* nice is PRIO_MIN..PRIO_MAX, standard 0. */
|
signed int mp_nice; /* nice is PRIO_MIN..PRIO_MAX, standard 0. */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user