Renamed mm_exit to pm_exit (requested by Al)
Small cleanup in pm_init.
This commit is contained in:
parent
9d92258e55
commit
ab732a37e8
6 changed files with 16 additions and 23 deletions
|
@ -8,8 +8,8 @@
|
|||
*
|
||||
* The entry points into this file are:
|
||||
* do_fork: perform the FORK system call
|
||||
* do_mm_exit: perform the EXIT system call (by calling mm_exit())
|
||||
* mm_exit: actually do the exiting
|
||||
* do_pm_exit: perform the EXIT system call (by calling pm_exit())
|
||||
* pm_exit: actually do the exiting
|
||||
* do_wait: perform the WAITPID or WAIT system call
|
||||
*/
|
||||
|
||||
|
@ -108,22 +108,22 @@ PUBLIC int do_fork()
|
|||
|
||||
|
||||
/*===========================================================================*
|
||||
* do_mm_exit *
|
||||
* do_pm_exit *
|
||||
*===========================================================================*/
|
||||
PUBLIC int do_mm_exit()
|
||||
PUBLIC int do_pm_exit()
|
||||
{
|
||||
/* Perform the exit(status) system call. The real work is done by mm_exit(),
|
||||
/* Perform the exit(status) system call. The real work is done by pm_exit(),
|
||||
* which is also called when a process is killed by a signal.
|
||||
*/
|
||||
mm_exit(mp, m_in.status);
|
||||
pm_exit(mp, m_in.status);
|
||||
return(SUSPEND); /* can't communicate from beyond the grave */
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================*
|
||||
* mm_exit *
|
||||
* pm_exit *
|
||||
*===========================================================================*/
|
||||
PUBLIC void mm_exit(rmp, exit_status)
|
||||
PUBLIC void pm_exit(rmp, exit_status)
|
||||
register struct mproc *rmp; /* pointer to the process to be terminated */
|
||||
int exit_status; /* the process' exit status (for parent) */
|
||||
{
|
||||
|
|
|
@ -143,8 +143,6 @@ PRIVATE void pm_init()
|
|||
static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT,
|
||||
SIGEMT, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2 };
|
||||
static char ign_sigs[] = { SIGCHLD };
|
||||
static int protected[] = {PM_PROC_NR, FS_PROC_NR, SM_PROC_NR,
|
||||
TTY_PROC_NR, DRVR_PROC_NR, MEM_PROC_NR};
|
||||
register struct mproc *rmp;
|
||||
register char *sig_ptr;
|
||||
phys_clicks total_clicks, minix_clicks, free_clicks;
|
||||
|
@ -197,16 +195,14 @@ PRIVATE void pm_init()
|
|||
/* Set process details found in the image table. */
|
||||
rmp = &mproc[ip->proc_nr];
|
||||
strncpy(rmp->mp_name, ip->proc_name, PROC_NAME_LEN);
|
||||
rmp->mp_parent = SM_PROC_NR;
|
||||
if (ip->proc_nr == INIT_PROC_NR) { /* user process */
|
||||
rmp->mp_pid = INIT_PID;
|
||||
rmp->mp_parent = PM_PROC_NR;
|
||||
rmp->mp_flags |= IN_USE;
|
||||
rmp->mp_nice = 0;
|
||||
sigemptyset(&rmp->mp_ignore);
|
||||
}
|
||||
else { /* system process */
|
||||
rmp->mp_pid = get_free_pid();
|
||||
rmp->mp_parent = SM_PROC_NR;
|
||||
rmp->mp_flags |= IN_USE | DONT_SWAP | PRIV_PROC;
|
||||
sigfillset(&rmp->mp_ignore);
|
||||
}
|
||||
|
@ -235,9 +231,6 @@ PRIVATE void pm_init()
|
|||
/* Override some details. PM is somewhat special. */
|
||||
mproc[PM_PROC_NR].mp_pid = PM_PID; /* magically override pid */
|
||||
mproc[PM_PROC_NR].mp_parent = PM_PROC_NR; /* PM doesn't have parent */
|
||||
for (i=0; i<sizeof(protected)/sizeof(int); i++)
|
||||
sigfillset(&mproc[i].mp_ignore); /* guard against signals */
|
||||
|
||||
|
||||
/* Tell FS that no more system processes follow and synchronize. */
|
||||
mess.PR_PROC_NR = NONE;
|
||||
|
|
|
@ -44,9 +44,9 @@ _PROTOTYPE( struct mproc *find_share, (struct mproc *mp_ign, Ino_t ino,
|
|||
|
||||
/* forkexit.c */
|
||||
_PROTOTYPE( int do_fork, (void) );
|
||||
_PROTOTYPE( int do_mm_exit, (void) );
|
||||
_PROTOTYPE( int do_pm_exit, (void) );
|
||||
_PROTOTYPE( int do_waitpid, (void) );
|
||||
_PROTOTYPE( void mm_exit, (struct mproc *rmp, int exit_status) );
|
||||
_PROTOTYPE( void pm_exit, (struct mproc *rmp, int exit_status) );
|
||||
|
||||
/* getset.c */
|
||||
_PROTOTYPE( int do_getset, (void) );
|
||||
|
|
|
@ -493,7 +493,7 @@ doterminate:
|
|||
tell_fs(CHDIR, slot, FALSE, 0);
|
||||
dump_core(rmp);
|
||||
}
|
||||
mm_exit(rmp, 0); /* terminate process */
|
||||
pm_exit(rmp, 0); /* terminate process */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ char core_name[] = "core"; /* file name where core images are produced */
|
|||
|
||||
_PROTOTYPE (int (*call_vec[NCALLS]), (void) ) = {
|
||||
no_sys, /* 0 = unused */
|
||||
do_mm_exit, /* 1 = exit */
|
||||
do_pm_exit, /* 1 = exit */
|
||||
do_fork, /* 2 = fork */
|
||||
no_sys, /* 3 = read */
|
||||
no_sys, /* 4 = write */
|
||||
|
|
|
@ -54,7 +54,7 @@ PUBLIC int do_trace()
|
|||
*/
|
||||
switch (m_in.request) {
|
||||
case T_EXIT: /* exit */
|
||||
mm_exit(child, (int) m_in.data);
|
||||
pm_exit(child, (int) m_in.data);
|
||||
mp->mp_reply.reply_trace = 0;
|
||||
return(OK);
|
||||
case T_RESUME:
|
||||
|
|
Loading…
Reference in a new issue