various kernel printing fixes
. remove some call cycles by low-level functions invoking printf(); e.g. send_sig() gets a return value that the caller should check . reason: very-early-phase printf() would trigger a printf() causing infinite recursion -> GPF . move serial initialization a little earlier so DEBUG_EXTRA works for serial earlier (e.g. its first instance, for "cstart") . closes tracker item 583: System Fails to Complete Startup with Verbose 2 and 3 Boot Parameters, reported by Stephen Hatton / pikpik.
This commit is contained in:
parent
36db008cb5
commit
1e399dd8bd
|
@ -551,7 +551,8 @@ static void vm_suspend(struct proc *caller, const struct proc *target,
|
|||
|
||||
/* Connect caller on vmrequest wait queue. */
|
||||
if(!(caller->p_vmrequest.nextrequestor = vmrequest))
|
||||
send_sig(VM_PROC_NR, SIGKMEM);
|
||||
if(OK != send_sig(VM_PROC_NR, SIGKMEM))
|
||||
panic("send_sig failed");
|
||||
vmrequest = caller;
|
||||
}
|
||||
|
||||
|
|
|
@ -1779,25 +1779,11 @@ const int fatalflag;
|
|||
* succeed.
|
||||
*/
|
||||
*p = _ENDPOINT_P(e);
|
||||
if(!isokprocn(*p)) {
|
||||
#if DEBUG_ENABLE_IPC_WARNINGS
|
||||
printf("kernel:%s:%d: bad endpoint %d: proc %d out of range\n",
|
||||
file, line, e, *p);
|
||||
#endif
|
||||
} else if(isemptyn(*p)) {
|
||||
#if 0
|
||||
printf("kernel:%s:%d: bad endpoint %d: proc %d empty\n", file, line, e, *p);
|
||||
#endif
|
||||
} else if(proc_addr(*p)->p_endpoint != e) {
|
||||
#if DEBUG_ENABLE_IPC_WARNINGS
|
||||
printf("kernel:%s:%d: bad endpoint %d: proc %d has ept %d (generation %d vs. %d)\n", file, line,
|
||||
e, *p, proc_addr(*p)->p_endpoint,
|
||||
_ENDPOINT_G(e), _ENDPOINT_G(proc_addr(*p)->p_endpoint));
|
||||
#endif
|
||||
} else ok = 1;
|
||||
if(!ok && fatalflag) {
|
||||
ok = 0;
|
||||
if(isokprocn(*p) && !isemptyn(*p) && proc_addr(*p)->p_endpoint == e)
|
||||
ok = 1;
|
||||
if(!ok && fatalflag)
|
||||
panic("invalid endpoint: %d", e);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ int get_priv(register struct proc *rc, int proc_type);
|
|||
void set_sendto_bit(const struct proc *rc, int id);
|
||||
void unset_sendto_bit(const struct proc *rc, int id);
|
||||
void fill_sendto_mask(const struct proc *rc, sys_map_t *map);
|
||||
void send_sig(endpoint_t proc_nr, int sig_nr);
|
||||
int send_sig(endpoint_t proc_nr, int sig_nr);
|
||||
void cause_sig(proc_nr_t proc_nr, int sig_nr);
|
||||
void sig_delay_done(struct proc *rp);
|
||||
void kernel_call(message *m_user, struct proc * caller);
|
||||
|
|
|
@ -56,6 +56,17 @@ void cstart(
|
|||
system_hz = DEFAULT_HZ;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
/* Intitialize serial debugging */
|
||||
value = env_get(SERVARNAME);
|
||||
if(value && atoi(value) == 0) {
|
||||
do_serial_debug=1;
|
||||
|
||||
value = env_get(SERBAUDVARNAME);
|
||||
if (value) serial_debug_baud = atoi(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
DEBUGEXTRA(("cstart\n"));
|
||||
|
||||
/* Record miscellaneous information for user-space servers. */
|
||||
|
@ -72,17 +83,6 @@ void cstart(
|
|||
for(h = 0; h < _LOAD_HISTORY; h++)
|
||||
kloadinfo.proc_load_history[h] = 0;
|
||||
|
||||
#ifdef DEBUG_SERIAL
|
||||
/* Intitialize serial debugging */
|
||||
value = env_get(SERVARNAME);
|
||||
if(value && atoi(value) == 0) {
|
||||
do_serial_debug=1;
|
||||
|
||||
value = env_get(SERBAUDVARNAME);
|
||||
if (value) serial_debug_baud = atoi(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_APIC
|
||||
value = env_get("no_apic");
|
||||
if(value)
|
||||
|
|
|
@ -360,7 +360,7 @@ void fill_sendto_mask(const struct proc *rp, sys_map_t *map)
|
|||
/*===========================================================================*
|
||||
* send_sig *
|
||||
*===========================================================================*/
|
||||
void send_sig(endpoint_t ep, int sig_nr)
|
||||
int send_sig(endpoint_t ep, int sig_nr)
|
||||
{
|
||||
/* Notify a system process about a signal. This is straightforward. Simply
|
||||
* set the signal that is to be delivered in the pending signals map and
|
||||
|
@ -370,11 +370,13 @@ void send_sig(endpoint_t ep, int sig_nr)
|
|||
int proc_nr;
|
||||
|
||||
if(!isokendpt(ep, &proc_nr) || isemptyn(proc_nr))
|
||||
panic("send_sig to empty process: %d", ep);
|
||||
return EINVAL;
|
||||
|
||||
rp = proc_addr(proc_nr);
|
||||
sigaddset(&priv(rp)->s_sig_pending, sig_nr);
|
||||
mini_notify(proc_addr(SYSTEM), rp->p_endpoint);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
|
@ -425,7 +427,8 @@ int sig_nr; /* signal to be sent */
|
|||
rp->p_endpoint, sig_nr);
|
||||
}
|
||||
sigaddset(&priv(rp)->s_sig_pending, sig_nr);
|
||||
send_sig(rp->p_endpoint, SIGKSIGSM);
|
||||
if(OK != send_sig(rp->p_endpoint, SIGKSIGSM))
|
||||
panic("send_sig failed");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -434,7 +437,8 @@ int sig_nr; /* signal to be sent */
|
|||
sigaddset(&rp->p_pending, sig_nr);
|
||||
if (! (RTS_ISSET(rp, RTS_SIGNALED))) { /* other pending */
|
||||
RTS_SET(rp, RTS_SIGNALED | RTS_SIG_PENDING);
|
||||
send_sig(sig_mgr, SIGKSIG);
|
||||
if(OK != send_sig(sig_mgr, SIGKSIG))
|
||||
panic("send_sig failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,8 @@ int map_invoke_vm(struct proc * caller,
|
|||
|
||||
/* Connect caller on vmrequest wait queue. */
|
||||
if(!(caller->p_vmrequest.nextrequestor = vmrequest))
|
||||
send_sig(VM_PROC_NR, SIGKMEM);
|
||||
if(OK != send_sig(VM_PROC_NR, SIGKMEM))
|
||||
panic("send_sig failed");
|
||||
vmrequest = caller;
|
||||
|
||||
return OK;
|
||||
|
|
Loading…
Reference in a new issue