Updated F4 dump at IS to include send masks.

Removed unused constant from fproc.h
Changed signal behaviour at PM (work in progress)
This commit is contained in:
Jorrit Herder 2005-07-26 12:49:35 +00:00
parent 8866b4d0ef
commit 3d0b9140f2
8 changed files with 21 additions and 17 deletions

View file

@ -16,6 +16,7 @@ build: all
all install depend clean:
cd ./pm && $(MAKE) $@
cd ./fs && $(MAKE) $@
cd ./sm && $(MAKE) $@
cd ./is && $(MAKE) $@
cd ./init && $(MAKE) $@
cd ./inet && $(MAKE) $@

View file

@ -30,7 +30,6 @@ EXTERN struct fproc {
#define NOT_REVIVING 0 /* process is not being revived */
#define REVIVING 1 /* process is being revived from suspension */
#define PID_FREE 0 /* process slot free */
#define PID_SERVER (-1) /* process has become a server */
/* Check is process number is acceptable - includes system processes. */
#define isokprocnr(n) ((unsigned)((n)+NR_TASKS) < NR_PROCS + NR_TASKS)

View file

@ -369,7 +369,7 @@ PUBLIC int do_exit()
}
}
/* Truly exiting, or becoming a server? */
/* Mark slot as free. */
fp->fp_pid = PID_FREE;
return(OK);
}

View file

@ -310,6 +310,7 @@ PUBLIC void privileges_dmp()
register struct proc *rp;
static struct proc *oldrp = BEG_PROC_ADDR;
register struct priv *sp;
static char send_mask[NR_SYS_PROCS + 1 + NR_SYS_PROCS/8];
int r, i,j, n = 0;
/* First obtain a fresh copy of the current process and system table. */
@ -322,7 +323,7 @@ PUBLIC void privileges_dmp()
return;
}
printf("\n--nr-id-name--- -flags- -sc-\n");
printf("\n--nr-id-name--- -flags- -sc- -send mask-\n");
for (rp = oldrp; rp < END_PROC_ADDR; rp++) {
if (isemptyp(rp)) continue;
@ -336,11 +337,17 @@ PUBLIC void privileges_dmp()
if (r == -1 && ! (rp->p_rts_flags & SLOT_FREE)) {
sp = &priv[USER_PRIV_ID];
}
printf("(%02u) %-7.7s 0x%02x %02.2u",
printf("(%02u) %-7.7s 0x%02x %02.2u ",
sp->s_id, rp->p_name,
sp->s_flags, sp->s_call_mask
);
printf("\n");
for (i=j=0; i < NR_SYS_PROCS; i++, j++) {
send_mask[j] = get_sys_bit(sp->s_send_mask, i) ? '1' : '0';
if (i % 8 == 7) send_mask[++j] = ' ';
}
send_mask[j] = '\0';
printf(" %s \n", send_mask);
}
if (rp == END_PROC_ADDR) rp = BEG_PROC_ADDR; else printf("--more--\r");
oldrp = rp;

View file

@ -51,6 +51,7 @@ PUBLIC void main(void)
case SYS_EVENT:
sigset = (sigset_t) m_in.NOTIFY_ARG;
if (sigismember(&sigset, SIGTERM)) {
exit(3);
/* nothing to do on shutdown */
}
if (sigismember(&sigset, SIGKSTOP)) {

View file

@ -137,7 +137,6 @@ int exit_status; /* the process' exit status (for parent) */
clock_t t[5];
proc_nr = (int) (rmp - mproc); /* get process slot number */
DEBUG(proc_nr == PRINTER, printf("PM: printer about to die ...\n"));
/* Remember a session leader's process group. */
procgrp = (rmp->mp_pid == mp->mp_procgrp) ? mp->mp_procgrp : 0;
@ -152,7 +151,6 @@ int exit_status; /* the process' exit status (for parent) */
p_mp->mp_child_stime += t[1] + rmp->mp_child_stime; /* add system time */
/* Tell the kernel and FS that the process is no longer runnable. */
DEBUG(proc_nr == PRINTER, printf("PM: telling FS and kernel about xit...\n"));
tell_fs(EXIT, proc_nr, 0, 0); /* file system can free the proc slot */
sys_exit(proc_nr);
@ -173,16 +171,12 @@ int exit_status; /* the process' exit status (for parent) */
pidarg = p_mp->mp_wpid; /* who's being waited for? */
parent_waiting = p_mp->mp_flags & WAITING;
DEBUG(proc_nr == PRINTER, printf("PM: parent waiting %d, for %d...\n", parent_waiting, pidarg));
right_child = /* child meets one of the 3 tests? */
(pidarg == -1 || pidarg == rmp->mp_pid || -pidarg == rmp->mp_procgrp);
if (parent_waiting && right_child) {
DEBUG(proc_nr == PRINTER, printf("PM: parent waiting, release slot...\n"));
cleanup(rmp); /* tell parent and release child slot */
} else {
DEBUG(proc_nr == PRINTER, printf("PM: parent not waiting, zombify ...\n"));
rmp->mp_flags = IN_USE|ZOMBIE; /* parent not waiting, zombify child */
sig_proc(p_mp, SIGCHLD); /* send parent a "child died" signal */
}

View file

@ -200,14 +200,14 @@ PRIVATE void pm_init()
rmp->mp_pid = INIT_PID;
rmp->mp_parent = PM_PROC_NR;
rmp->mp_flags |= IN_USE;
sigemptyset(&rmp->mp_ignore);
rmp->mp_nice = 0;
sigemptyset(&rmp->mp_ignore);
}
else { /* system process */
rmp->mp_pid = get_free_pid();
rmp->mp_parent = INIT_PROC_NR;
rmp->mp_parent = SM_PROC_NR;
rmp->mp_flags |= IN_USE | DONT_SWAP | PRIV_PROC;
sigfillset(&rmp->mp_ignore);
sigfillset(&rmp->mp_ignore);
}
sigemptyset(&rmp->mp_sigmask);
sigemptyset(&rmp->mp_catch);
@ -230,8 +230,10 @@ PRIVATE void pm_init()
}
/* PM is somewhat special. Override some details. */
mproc[PM_PROC_NR].mp_pid = PM_PID;
mproc[PM_PROC_NR].mp_parent = PM_PROC_NR;
sigfillset(&mproc[PM_PROC_NR].mp_ignore); /* guard against signals */
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 */
/* Tell FS that no more system processes follow and synchronize. */
mess.PR_PROC_NR = NONE;

View file

@ -405,7 +405,7 @@ int signo; /* signal to send to process (1 to _NSIG) */
slot = (int) (rmp - mproc);
if ((rmp->mp_flags & (IN_USE | ZOMBIE)) != IN_USE) {
printf("PM: signal %d sent to %s process %d\n",
(rmp->mp_flags & ZOMBIE) ? "zombie" : "dead", signo, slot);
signo, (rmp->mp_flags & ZOMBIE) ? "zombie" : "dead", slot);
panic(__FILE__,"", NO_NUM);
}
if ((rmp->mp_flags & TRACED) && signo != SIGKILL) {