Renamed mm_exit to pm_exit (requested by Al)

Small cleanup in pm_init.
This commit is contained in:
Jorrit Herder 2005-08-10 09:37:54 +00:00
parent 9d92258e55
commit ab732a37e8
6 changed files with 16 additions and 23 deletions

View file

@ -8,8 +8,8 @@
* *
* The entry points into this file are: * The entry points into this file are:
* do_fork: perform the FORK system call * do_fork: perform the FORK system call
* do_mm_exit: perform the EXIT system call (by calling mm_exit()) * do_pm_exit: perform the EXIT system call (by calling pm_exit())
* mm_exit: actually do the exiting * pm_exit: actually do the exiting
* do_wait: perform the WAITPID or WAIT system call * 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. * 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 */ 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 */ register struct mproc *rmp; /* pointer to the process to be terminated */
int exit_status; /* the process' exit status (for parent) */ int exit_status; /* the process' exit status (for parent) */
{ {

View file

@ -143,8 +143,6 @@ PRIVATE void pm_init()
static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT, static char core_sigs[] = { SIGQUIT, SIGILL, SIGTRAP, SIGABRT,
SIGEMT, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2 }; SIGEMT, SIGFPE, SIGUSR1, SIGSEGV, SIGUSR2 };
static char ign_sigs[] = { SIGCHLD }; 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 struct mproc *rmp;
register char *sig_ptr; register char *sig_ptr;
phys_clicks total_clicks, minix_clicks, free_clicks; phys_clicks total_clicks, minix_clicks, free_clicks;
@ -197,16 +195,14 @@ PRIVATE void pm_init()
/* Set process details found in the image table. */ /* Set process details found in the image table. */
rmp = &mproc[ip->proc_nr]; rmp = &mproc[ip->proc_nr];
strncpy(rmp->mp_name, ip->proc_name, PROC_NAME_LEN); 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 */ if (ip->proc_nr == INIT_PROC_NR) { /* user process */
rmp->mp_pid = INIT_PID; rmp->mp_pid = INIT_PID;
rmp->mp_parent = PM_PROC_NR;
rmp->mp_flags |= IN_USE; rmp->mp_flags |= IN_USE;
rmp->mp_nice = 0;
sigemptyset(&rmp->mp_ignore); sigemptyset(&rmp->mp_ignore);
} }
else { /* system process */ else { /* system process */
rmp->mp_pid = get_free_pid(); rmp->mp_pid = get_free_pid();
rmp->mp_parent = SM_PROC_NR;
rmp->mp_flags |= IN_USE | DONT_SWAP | PRIV_PROC; rmp->mp_flags |= IN_USE | DONT_SWAP | PRIV_PROC;
sigfillset(&rmp->mp_ignore); sigfillset(&rmp->mp_ignore);
} }
@ -235,9 +231,6 @@ PRIVATE void pm_init()
/* Override some details. PM is somewhat special. */ /* Override some details. PM is somewhat special. */
mproc[PM_PROC_NR].mp_pid = PM_PID; /* magically override pid */ 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 */ 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. */ /* Tell FS that no more system processes follow and synchronize. */
mess.PR_PROC_NR = NONE; mess.PR_PROC_NR = NONE;

View file

@ -44,9 +44,9 @@ _PROTOTYPE( struct mproc *find_share, (struct mproc *mp_ign, Ino_t ino,
/* forkexit.c */ /* forkexit.c */
_PROTOTYPE( int do_fork, (void) ); _PROTOTYPE( int do_fork, (void) );
_PROTOTYPE( int do_mm_exit, (void) ); _PROTOTYPE( int do_pm_exit, (void) );
_PROTOTYPE( int do_waitpid, (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 */ /* getset.c */
_PROTOTYPE( int do_getset, (void) ); _PROTOTYPE( int do_getset, (void) );

View file

@ -493,7 +493,7 @@ doterminate:
tell_fs(CHDIR, slot, FALSE, 0); tell_fs(CHDIR, slot, FALSE, 0);
dump_core(rmp); dump_core(rmp);
} }
mm_exit(rmp, 0); /* terminate process */ pm_exit(rmp, 0); /* terminate process */
} }

View file

@ -15,7 +15,7 @@ char core_name[] = "core"; /* file name where core images are produced */
_PROTOTYPE (int (*call_vec[NCALLS]), (void) ) = { _PROTOTYPE (int (*call_vec[NCALLS]), (void) ) = {
no_sys, /* 0 = unused */ no_sys, /* 0 = unused */
do_mm_exit, /* 1 = exit */ do_pm_exit, /* 1 = exit */
do_fork, /* 2 = fork */ do_fork, /* 2 = fork */
no_sys, /* 3 = read */ no_sys, /* 3 = read */
no_sys, /* 4 = write */ no_sys, /* 4 = write */

View file

@ -54,7 +54,7 @@ PUBLIC int do_trace()
*/ */
switch (m_in.request) { switch (m_in.request) {
case T_EXIT: /* exit */ case T_EXIT: /* exit */
mm_exit(child, (int) m_in.data); pm_exit(child, (int) m_in.data);
mp->mp_reply.reply_trace = 0; mp->mp_reply.reply_trace = 0;
return(OK); return(OK);
case T_RESUME: case T_RESUME: