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:
parent
8866b4d0ef
commit
3d0b9140f2
8 changed files with 21 additions and 17 deletions
|
@ -16,6 +16,7 @@ build: all
|
||||||
all install depend clean:
|
all install depend clean:
|
||||||
cd ./pm && $(MAKE) $@
|
cd ./pm && $(MAKE) $@
|
||||||
cd ./fs && $(MAKE) $@
|
cd ./fs && $(MAKE) $@
|
||||||
|
cd ./sm && $(MAKE) $@
|
||||||
cd ./is && $(MAKE) $@
|
cd ./is && $(MAKE) $@
|
||||||
cd ./init && $(MAKE) $@
|
cd ./init && $(MAKE) $@
|
||||||
cd ./inet && $(MAKE) $@
|
cd ./inet && $(MAKE) $@
|
||||||
|
|
|
@ -30,7 +30,6 @@ EXTERN struct fproc {
|
||||||
#define NOT_REVIVING 0 /* process is not being revived */
|
#define NOT_REVIVING 0 /* process is not being revived */
|
||||||
#define REVIVING 1 /* process is being revived from suspension */
|
#define REVIVING 1 /* process is being revived from suspension */
|
||||||
#define PID_FREE 0 /* process slot free */
|
#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. */
|
/* Check is process number is acceptable - includes system processes. */
|
||||||
#define isokprocnr(n) ((unsigned)((n)+NR_TASKS) < NR_PROCS + NR_TASKS)
|
#define isokprocnr(n) ((unsigned)((n)+NR_TASKS) < NR_PROCS + NR_TASKS)
|
||||||
|
|
|
@ -369,7 +369,7 @@ PUBLIC int do_exit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Truly exiting, or becoming a server? */
|
/* Mark slot as free. */
|
||||||
fp->fp_pid = PID_FREE;
|
fp->fp_pid = PID_FREE;
|
||||||
return(OK);
|
return(OK);
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,6 +310,7 @@ PUBLIC void privileges_dmp()
|
||||||
register struct proc *rp;
|
register struct proc *rp;
|
||||||
static struct proc *oldrp = BEG_PROC_ADDR;
|
static struct proc *oldrp = BEG_PROC_ADDR;
|
||||||
register struct priv *sp;
|
register struct priv *sp;
|
||||||
|
static char send_mask[NR_SYS_PROCS + 1 + NR_SYS_PROCS/8];
|
||||||
int r, i,j, n = 0;
|
int r, i,j, n = 0;
|
||||||
|
|
||||||
/* First obtain a fresh copy of the current process and system table. */
|
/* First obtain a fresh copy of the current process and system table. */
|
||||||
|
@ -322,7 +323,7 @@ PUBLIC void privileges_dmp()
|
||||||
return;
|
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++) {
|
for (rp = oldrp; rp < END_PROC_ADDR; rp++) {
|
||||||
if (isemptyp(rp)) continue;
|
if (isemptyp(rp)) continue;
|
||||||
|
@ -336,11 +337,17 @@ PUBLIC void privileges_dmp()
|
||||||
if (r == -1 && ! (rp->p_rts_flags & SLOT_FREE)) {
|
if (r == -1 && ! (rp->p_rts_flags & SLOT_FREE)) {
|
||||||
sp = &priv[USER_PRIV_ID];
|
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_id, rp->p_name,
|
||||||
sp->s_flags, sp->s_call_mask
|
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");
|
if (rp == END_PROC_ADDR) rp = BEG_PROC_ADDR; else printf("--more--\r");
|
||||||
oldrp = rp;
|
oldrp = rp;
|
||||||
|
|
|
@ -51,6 +51,7 @@ PUBLIC void main(void)
|
||||||
case SYS_EVENT:
|
case SYS_EVENT:
|
||||||
sigset = (sigset_t) m_in.NOTIFY_ARG;
|
sigset = (sigset_t) m_in.NOTIFY_ARG;
|
||||||
if (sigismember(&sigset, SIGTERM)) {
|
if (sigismember(&sigset, SIGTERM)) {
|
||||||
|
exit(3);
|
||||||
/* nothing to do on shutdown */
|
/* nothing to do on shutdown */
|
||||||
}
|
}
|
||||||
if (sigismember(&sigset, SIGKSTOP)) {
|
if (sigismember(&sigset, SIGKSTOP)) {
|
||||||
|
|
|
@ -137,7 +137,6 @@ int exit_status; /* the process' exit status (for parent) */
|
||||||
clock_t t[5];
|
clock_t t[5];
|
||||||
|
|
||||||
proc_nr = (int) (rmp - mproc); /* get process slot number */
|
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. */
|
/* Remember a session leader's process group. */
|
||||||
procgrp = (rmp->mp_pid == mp->mp_procgrp) ? mp->mp_procgrp : 0;
|
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 */
|
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. */
|
/* 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 */
|
tell_fs(EXIT, proc_nr, 0, 0); /* file system can free the proc slot */
|
||||||
sys_exit(proc_nr);
|
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? */
|
pidarg = p_mp->mp_wpid; /* who's being waited for? */
|
||||||
parent_waiting = p_mp->mp_flags & WAITING;
|
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? */
|
right_child = /* child meets one of the 3 tests? */
|
||||||
(pidarg == -1 || pidarg == rmp->mp_pid || -pidarg == rmp->mp_procgrp);
|
(pidarg == -1 || pidarg == rmp->mp_pid || -pidarg == rmp->mp_procgrp);
|
||||||
|
|
||||||
if (parent_waiting && right_child) {
|
if (parent_waiting && right_child) {
|
||||||
DEBUG(proc_nr == PRINTER, printf("PM: parent waiting, release slot...\n"));
|
|
||||||
cleanup(rmp); /* tell parent and release child slot */
|
cleanup(rmp); /* tell parent and release child slot */
|
||||||
} else {
|
} else {
|
||||||
DEBUG(proc_nr == PRINTER, printf("PM: parent not waiting, zombify ...\n"));
|
|
||||||
rmp->mp_flags = IN_USE|ZOMBIE; /* parent not waiting, zombify child */
|
rmp->mp_flags = IN_USE|ZOMBIE; /* parent not waiting, zombify child */
|
||||||
sig_proc(p_mp, SIGCHLD); /* send parent a "child died" signal */
|
sig_proc(p_mp, SIGCHLD); /* send parent a "child died" signal */
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,14 +200,14 @@ PRIVATE void pm_init()
|
||||||
rmp->mp_pid = INIT_PID;
|
rmp->mp_pid = INIT_PID;
|
||||||
rmp->mp_parent = PM_PROC_NR;
|
rmp->mp_parent = PM_PROC_NR;
|
||||||
rmp->mp_flags |= IN_USE;
|
rmp->mp_flags |= IN_USE;
|
||||||
sigemptyset(&rmp->mp_ignore);
|
|
||||||
rmp->mp_nice = 0;
|
rmp->mp_nice = 0;
|
||||||
|
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 = INIT_PROC_NR;
|
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);
|
||||||
}
|
}
|
||||||
sigemptyset(&rmp->mp_sigmask);
|
sigemptyset(&rmp->mp_sigmask);
|
||||||
sigemptyset(&rmp->mp_catch);
|
sigemptyset(&rmp->mp_catch);
|
||||||
|
@ -230,8 +230,10 @@ PRIVATE void pm_init()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PM is somewhat special. Override some details. */
|
/* PM is somewhat special. Override some details. */
|
||||||
mproc[PM_PROC_NR].mp_pid = PM_PID;
|
sigfillset(&mproc[PM_PROC_NR].mp_ignore); /* guard against signals */
|
||||||
mproc[PM_PROC_NR].mp_parent = PM_PROC_NR;
|
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. */
|
/* Tell FS that no more system processes follow and synchronize. */
|
||||||
mess.PR_PROC_NR = NONE;
|
mess.PR_PROC_NR = NONE;
|
||||||
|
|
|
@ -405,7 +405,7 @@ int signo; /* signal to send to process (1 to _NSIG) */
|
||||||
slot = (int) (rmp - mproc);
|
slot = (int) (rmp - mproc);
|
||||||
if ((rmp->mp_flags & (IN_USE | ZOMBIE)) != IN_USE) {
|
if ((rmp->mp_flags & (IN_USE | ZOMBIE)) != IN_USE) {
|
||||||
printf("PM: signal %d sent to %s process %d\n",
|
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);
|
panic(__FILE__,"", NO_NUM);
|
||||||
}
|
}
|
||||||
if ((rmp->mp_flags & TRACED) && signo != SIGKILL) {
|
if ((rmp->mp_flags & TRACED) && signo != SIGKILL) {
|
||||||
|
|
Loading…
Reference in a new issue