Turn IPC warning messages off by default

(because inet deadlocks are normal and will confuse our users).
This commit is contained in:
Ben Gras 2005-10-18 16:13:12 +00:00
parent 742f18a87c
commit 2bf8bfe126
3 changed files with 27 additions and 0 deletions

View file

@ -18,6 +18,17 @@
#define TIMING_CATEGORIES 20
#define TIMING_NAME 10
/* Enable prints such as
* . send/receive failed due to deadlock or dead source or dead destination
* . trap not allowed
* . bogus message pointer
* . kernel call number not allowed by this process
*
* Of course the call still fails, but nothing is printed if these warnings
* are disabled.
*/
#define DEBUG_ENABLE_IPC_WARNINGS 0
/* Definition of the data structure to store lock() timing data. */
struct lock_timingdata {
char names[TIMING_NAME];

View file

@ -111,21 +111,27 @@ message *m_ptr; /* pointer to message in the caller's space */
if (! (priv(caller_ptr)->s_trap_mask & (1 << function)) ||
(iskerneln(src_dst) && function != SENDREC
&& function != RECEIVE)) {
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("sys_call: trap %d not allowed, caller %d, src_dst %d\n",
function, proc_nr(caller_ptr), src_dst);
#endif
return(ECALLDENIED); /* trap denied by mask or kernel */
}
/* Require a valid source and/ or destination process, unless echoing. */
if (src_dst != ANY && function != ECHO) {
if (! isokprocn(src_dst)) {
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("sys_call: invalid src_dst, src_dst %d, caller %d\n",
src_dst, proc_nr(caller_ptr));
#endif
return(EBADSRCDST); /* invalid process number */
}
if (isemptyn(src_dst)) {
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("sys_call: dead src_dst; trap %d, from %d, to %d\n",
function, proc_nr(caller_ptr), src_dst);
#endif
return(EDEADSRCDST);
}
}
@ -141,8 +147,10 @@ message *m_ptr; /* pointer to message in the caller's space */
if (vlo < caller_ptr->p_memmap[D].mem_vir || vlo > vhi ||
vhi >= caller_ptr->p_memmap[S].mem_vir +
caller_ptr->p_memmap[S].mem_len) {
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("sys_call: invalid message pointer, trap %d, caller %d\n",
function, proc_nr(caller_ptr));
#endif
return(EFAULT); /* invalid message pointer */
}
}
@ -152,8 +160,10 @@ message *m_ptr; /* pointer to message in the caller's space */
*/
if (function & CHECK_DST) {
if (! get_sys_bit(priv(caller_ptr)->s_ipc_to, nr_to_id(src_dst))) {
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("sys_call: ipc mask denied trap %d from %d to %d\n",
function, proc_nr(caller_ptr), src_dst);
#endif
return(ECALLDENIED); /* call denied by ipc mask */
}
}
@ -161,8 +171,10 @@ message *m_ptr; /* pointer to message in the caller's space */
/* Check for a possible deadlock for blocking SEND(REC) and RECEIVE. */
if (function & CHECK_DEADLOCK) {
if (group_size = deadlock(function, caller_ptr, src_dst)) {
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("sys_call: trap %d from %d to %d deadlocked, group size %d\n",
function, proc_nr(caller_ptr), src_dst, group_size);
#endif
return(ELOCKED);
}
}

View file

@ -77,10 +77,14 @@ PUBLIC void sys_task()
/* See if the caller made a valid request and try to handle it. */
if (! (priv(caller_ptr)->s_call_mask & (1<<call_nr)) &&
m.m_type != SYS_IOPENABLE ) {
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("SYSTEM: request %d from %d denied.\n", call_nr,m.m_source);
#endif
result = ECALLDENIED; /* illegal message type */
} else if (call_nr >= NR_SYS_CALLS) { /* check call number */
#if DEBUG_ENABLE_IPC_WARNINGS
kprintf("SYSTEM: illegal request %d from %d.\n", call_nr,m.m_source);
#endif
result = EBADREQUEST; /* illegal message type */
}
else {