Fixed all troubles reported at shutdown.
No more illegal FS calls by dead processes.
}
dname= pci_dev_name(vid, did);
+#if VERBOSE
if (!dname)
dname= "unknown device";
printf("%s: %s (%04x/%04x) at %s\n",
fp->fxp_name, dname, vid, did, pci_slot_name(devind));
+#endif
pci_reserve(devind);
bar= pci_attr_r32(devind, PCI_BAR_2) & 0xffffffe0;
case FXP_REV_82551_2: str= "82551(2)"; break; /* 0x10 */
}
+#if VERBOSE
if (str)
printf("%s: device revision: %s\n", fp->fxp_name, str);
else
printf("%s: unknown revision: 0x%x\n", fp->fxp_name, rev);
+#endif
if (fp->fxp_type == FT_UNKNOWN)
{
fp->fxp_conf_bytes[20]= CCB20_PFCL | CCB20_RES1;
fp->fxp_conf_bytes[21]= CCB21_RES21;
+#if VERBOSE
for (i= 0; i<CC_BYTES_NR; i++)
printf("%d: %0x, ", i, fp->fxp_conf_bytes[i]);
printf("\n");
+#endif
mwi= 0; /* Do we want "Memory Write and Invalidate"? */
ext_stat1= 0; /* Do we want extended statistical counters? */
panic("FXP","fxp_conf_hw: bad device type", fp->fxp_type);
}
+#if VERBOSE
for (i= 0; i<CC_BYTES_NR; i++)
printf("%d: %0x, ", i, fp->fxp_conf_bytes[i]);
printf("\n");
+#endif
}
#if 0
if (i != 0 && i != 6) env_panic(eakey); /* It's all or nothing */
-#else
- printf("not checking for env_panic\n");
#endif
if (i == 0)
if (!(ias.ias_status & CBL_F_OK))
panic("FXP","fxp_confaddr: CU command failed", NO_NUM);
+#if VERBOSE
printf("%s: hardware ethernet address: ", fp->fxp_name);
for (i= 0; i<6; i++)
{
i < 5 ? ":" : "");
}
printf("\n");
+#endif
}
/*===========================================================================*
fp->fxp_link_up= link_up;
if (!link_up)
{
+#if VERBOSE
printf("%s: link down\n", fp->fxp_name);
+#endif
return;
}
model= ((mii_id2 & MII_PL_MODEL_MASK) >> MII_PL_MODEL_SHIFT);
rev= (mii_id2 & MII_PL_REV_MASK);
+#if VERBOSE
printf("OUI 0x%06lx, Model 0x%02x, Revision 0x%x\n", oui, model, rev);
+#endif
if (mii_ctrl & (MII_CTRL_LB|MII_CTRL_PD|MII_CTRL_ISO))
{
fxp_outb(port, CSR_EEPROM, 0); /* Disable EEPROM */
micro_delay(EECS_DELAY);
+#if VERBOSE
printf("%s EEPROM address length: %d\n",
fp->fxp_name, fp->fxp_ee_addrlen);
+#endif
}
fxp_timers->tmr_exp_time < fxp_next_timeout)
{
fxp_next_timeout= fxp_timers->tmr_exp_time;
+#if VERBOSE
printf("fxp_set_timer: calling sys_setalarm for %d (now+%d)\n",
fxp_next_timeout, fxp_next_timeout-now);
+#endif
r= sys_setalarm(fxp_next_timeout, 1);
if (r != OK)
panic("FXP","unable to set synchronous alarm", r);
Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
*/
+#define VERBOSE 0 /* display output during intialization */
+
/* Revisions in PCI_REV */
#define FXP_REV_82557A 0x01
#define FXP_REV_82557B 0x02
printf("FS, warning illegal %d system call by %d\n", call_nr, who);
} else if (fp->fp_pid == PID_FREE) {
error = ENOSYS;
- printf("FS, bad process, who = %d, call_nr = %d\n", who, call_nr);
+ printf("FS, bad process, who = %d, call_nr = %d, slot1 = %d\n", who, call_nr, m_in.slot1);
+
} else {
error = (*call_vec[call_nr])();
}
clck_tick(&mq->mq_mess);
mq_free(mq);
}
+ else if (mq->mq_mess.m_type == SYS_SIG)
+ {
+ /* signaled */
+ /* probably SIGTERM */
+ }
#endif
else
{
total_clicks = minix_clicks + free_clicks;
printf(" total %u KB,", click_to_round_k(total_clicks));
printf(" system %u KB,", click_to_round_k(minix_clicks));
- printf(" available %u KB.\n", click_to_round_k(free_clicks));
+ printf(" free %u KB.\n", click_to_round_k(free_clicks));
}
return(EINVAL);
}
- tell_fs(REBOOT,0,0,0); /* tell FS to prepare for shutdown */
check_sig(-1, SIGKILL); /* kill all processes except init */
+ tell_fs(REBOOT,0,0,0); /* tell FS to prepare for shutdown */
/* Ask the kernel to abort. All system services, including the PM, will
* get a HARD_STOP notification. Await the notification in the main loop.
req = m_in.svrctl_req;
ptr = (vir_bytes) m_in.svrctl_argp;
- /* Is the request for the kernel? Forward it, except for SYSGETENV. */
- if (((req >> 8) & 0xFF) == 'S') {
-
- /* Binary compatibility check. */
- if (req == SYSGETENV) {
- printf("SYSGETENV by %d (fix!)\n", who);
- req = MMGETPARAM;
- }
- else
-
- /* Simply forward call to the SYSTEM task. */
- return(sys_svrctl(who, req, mp->mp_effuid == SUPER_USER, ptr));
- }
+ /* Is the request indeed for the MM? */
+ if (((req >> 8) & 0xFF) != 'M') return(EINVAL);
/* Control operations local to the PM. */
switch(req) {
return OK;
}
- case MMSIGNON: {
-#if DEAD_CODE
- /* A user process becomes a task. Simulate an exit by
- * releasing a waiting parent and disinheriting children.
- */
- struct mproc *rmp;
- pid_t pidarg;
-
- if (mp->mp_effuid != SUPER_USER) return(EPERM);
-
- rmp = &mproc[mp->mp_parent];
- tell_fs(EXIT, who, 0, 0);
-
- pidarg = rmp->mp_wpid;
- if ((rmp->mp_flags & WAITING) && (pidarg == -1
- || pidarg == mp->mp_pid || -pidarg == mp->mp_procgrp))
- {
- /* Wake up the parent. */
- rmp->mp_reply.reply_res2 = 0;
- setreply(mp->mp_parent, mp->mp_pid);
- rmp->mp_flags &= ~WAITING;
- }
-
- /* Disinherit children. */
- for (rmp = &mproc[0]; rmp < &mproc[NR_PROCS]; rmp++) {
- if ((rmp->mp_flags & IN_USE) && rmp->mp_parent == who) {
- rmp->mp_parent = INIT_PROC_NR;
- }
- }
-#endif
- return(OK); }
#if ENABLE_SWAP
case MMSWAPON: {
&& mp->mp_effuid != rmp->mp_realuid
&& mp->mp_realuid != rmp->mp_effuid
&& mp->mp_effuid != rmp->mp_effuid) {
- DEBUG(m_in.pid == 11, printf("PM: check_sig, EPERM\n"));
error_code = EPERM;
continue;
}
* signal may be caught, blocked, ignored, or cause process
* termination, possibly with core dump.
*/
- DEBUG(m_in.pid == 11, printf("PM: calling sig_proc with signo %d\n", signo));
sig_proc(rmp, signo);
if (proc_id > 0) break; /* only one process being signaled */
dev_style = STYLE_DEV;
if ((s=mapdriver(child_proc_nr, major_nr, dev_style)) < 0) {
+#if VERBOSE
printf("SM: '%s %s', major %d, pid %d, proc_nr %d",
command, arg_buf, major_nr, child_pid, child_proc_nr);
+#endif
report("SM", "couldn't map driver", errno);
}
}
if ((s = _taskcall(SYSTEM, SYS_PRIVCTL, &m)) < 0) /* set privileges */
report("SM", "_taskcall to SYSTEM failed", s); /* to let child run */
-#if DEAD_CODE
+#if VERBOSE
printf("SM: started '%s %s', major %d, pid %d, proc_nr %d",
command, arg_buf, major_nr, child_pid, child_proc_nr);
#endif
pid_t exit_pid;
int exit_status;
+#if VERBOSE
printf("SM: got SIGCHLD signal, doing wait to get exited child.\n");
+#endif
/* See which child exited and what the exit status is. This is done in a
* loop because multiple childs may have exited, all reported by one
*/
while ( (exit_pid = waitpid(-1, &exit_status, WNOHANG)) != 0 ) {
+#if VERBOSE
printf("SM: pid %d,", exit_pid);
if (WIFSIGNALED(exit_status)) {
printf("killed, signal number %d\n", WTERMSIG(exit_status));
} else if (WIFEXITED(exit_status)) {
printf("normal exit, status %d\n", WEXITSTATUS(exit_status));
}
+#endif
+
}
return(OK);
}
#define _SYSTEM 1 /* get OK and negative error codes */
#define _MINIX 1 /* tell headers to include MINIX stuff */
+#define VERBOSE 0 /* display diagnostics */
+
#include <ansi.h>
#include <sys/types.h>
#include <limits.h>