Kernel: fix sys_trace

Change-Id: I44bdd3b1d79bf751923581b75c3d44f011d2a5e0
This commit is contained in:
David van Moolenbroek 2014-08-30 19:10:12 +00:00
parent 5f5dcc545f
commit 502b6bda83

View file

@ -94,19 +94,20 @@ int do_trace(struct proc * caller, message * m_ptr)
case T_GETINS: /* return value from instruction space */ case T_GETINS: /* return value from instruction space */
COPYFROMPROC(tr_addr, (vir_bytes) &tr_data, sizeof(long)); COPYFROMPROC(tr_addr, (vir_bytes) &tr_data, sizeof(long));
m_ptr->m_lsys_krn_sys_trace.data = tr_data; m_ptr->m_krn_lsys_sys_trace.data = tr_data;
break; break;
case T_GETDATA: /* return value from data space */ case T_GETDATA: /* return value from data space */
COPYFROMPROC(tr_addr, (vir_bytes) &tr_data, sizeof(long)); COPYFROMPROC(tr_addr, (vir_bytes) &tr_data, sizeof(long));
m_ptr->m_lsys_krn_sys_trace.data= tr_data; m_ptr->m_krn_lsys_sys_trace.data= tr_data;
break; break;
case T_GETUSER: /* return value from process table */ case T_GETUSER: /* return value from process table */
if ((tr_addr & (sizeof(long) - 1)) != 0) return(EFAULT); if ((tr_addr & (sizeof(long) - 1)) != 0) return(EFAULT);
if (tr_addr <= sizeof(struct proc) - sizeof(long)) { if (tr_addr <= sizeof(struct proc) - sizeof(long)) {
m_ptr->m_lsys_krn_sys_trace.data = *(long *) ((char *) rp + (int) tr_addr); m_ptr->m_krn_lsys_sys_trace.data =
*(long *) ((char *) rp + (int) tr_addr);
break; break;
} }
@ -118,7 +119,8 @@ int do_trace(struct proc * caller, message * m_ptr)
if (tr_addr > sizeof(struct priv) - sizeof(long)) return(EFAULT); if (tr_addr > sizeof(struct priv) - sizeof(long)) return(EFAULT);
m_ptr->m_lsys_krn_sys_trace.data = *(long *) ((char *) rp->p_priv + (int) tr_addr); m_ptr->m_krn_lsys_sys_trace.data =
*(long *) ((char *) rp->p_priv + (int) tr_addr);
break; break;
case T_SETINS: /* set value in instruction space */ case T_SETINS: /* set value in instruction space */