From: Tomas Hruby Date: Wed, 3 Feb 2010 18:17:01 +0000 (+0000) Subject: Removed useless global variable sys_call_code X-Git-Tag: v3.1.7~315 X-Git-Url: http://zhaoyanbai.com/repos/nsupdate.html?a=commitdiff_plain;h=8f82633fa2d62c27ef60a7467ba9c59f006c7111;p=minix.git Removed useless global variable sys_call_code - we have to same information in the message (m_ptr) where needed --- diff --git a/kernel/glo.h b/kernel/glo.h index a473aa65e..cac8fba72 100644 --- a/kernel/glo.h +++ b/kernel/glo.h @@ -42,7 +42,6 @@ EXTERN u32_t system_hz; /* HZ value */ EXTERN reg_t mon_ss, mon_sp; /* boot monitor stack */ EXTERN int mon_return; /* true if we can return to monitor */ EXTERN int do_serial_debug; -EXTERN int sys_call_code; /* kernel call number in SYSTEM */ EXTERN time_t boottime; EXTERN char params_buffer[512]; /* boot monitor parameters */ EXTERN int minix_panicing; diff --git a/kernel/system.c b/kernel/system.c index 4f064a192..b1a49f2d7 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -91,8 +91,7 @@ PUBLIC void sys_task() minix_panic("receive() failed", r); } - sys_call_code = (unsigned) m.m_type; - call_nr = sys_call_code - KERNEL_CALL; + call_nr = m.m_type - KERNEL_CALL; who_e = m.m_source; okendpt(who_e, &who_p); caller_ptr = proc_addr(who_p); diff --git a/kernel/system/do_safecopy.c b/kernel/system/do_safecopy.c index 93fcabd50..ff39c51a3 100644 --- a/kernel/system/do_safecopy.c +++ b/kernel/system/do_safecopy.c @@ -337,15 +337,15 @@ PUBLIC int do_safecopy(struct proc * caller, message * m_ptr) static int access, src_seg, dst_seg; /* Set src and dst parameters. */ - if(sys_call_code == SYS_SAFECOPYFROM) { + if(m_ptr->m_type == SYS_SAFECOPYFROM) { src_seg = D; dst_seg = m_ptr->SCP_SEG; access = CPF_READ; - } else if(sys_call_code == SYS_SAFECOPYTO) { + } else if(m_ptr->m_type == SYS_SAFECOPYTO) { src_seg = m_ptr->SCP_SEG; dst_seg = D; access = CPF_WRITE; - } else minix_panic("Impossible system call nr. ", sys_call_code); + } else minix_panic("Impossible system call nr. ", m_ptr->m_type); return safecopy(caller, m_ptr->SCP_FROM_TO, caller->p_endpoint, m_ptr->SCP_GID, src_seg, dst_seg, m_ptr->SCP_BYTES,