first commit of extra ptrace code for fault injection
This commit is contained in:
parent
62cb625f1b
commit
c5efbf71c0
1 changed files with 27 additions and 0 deletions
|
@ -45,6 +45,7 @@ register message *m_ptr;
|
||||||
long tr_data = m_ptr->CTL_DATA;
|
long tr_data = m_ptr->CTL_DATA;
|
||||||
int tr_request = m_ptr->CTL_REQUEST;
|
int tr_request = m_ptr->CTL_REQUEST;
|
||||||
int tr_proc_nr_e = m_ptr->CTL_ENDPT, tr_proc_nr;
|
int tr_proc_nr_e = m_ptr->CTL_ENDPT, tr_proc_nr;
|
||||||
|
unsigned char ub;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(!isokendpt(tr_proc_nr_e, &tr_proc_nr)) return(EINVAL);
|
if(!isokendpt(tr_proc_nr_e, &tr_proc_nr)) return(EINVAL);
|
||||||
|
@ -137,6 +138,32 @@ register message *m_ptr;
|
||||||
m_ptr->CTL_DATA = 0;
|
m_ptr->CTL_DATA = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_READB_INS: /* get value from instruction space */
|
||||||
|
if (rp->p_memmap[T].mem_len != 0) {
|
||||||
|
if ((dst = umap_local(rp, T, tr_addr, 1)) == 0) return(EFAULT);
|
||||||
|
phys_copy(dst, vir2phys(&ub), (phys_bytes) 1);
|
||||||
|
m_ptr->CTL_DATA = ub;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dst = umap_local(rp, D, tr_addr, 1)) == 0) return(EFAULT);
|
||||||
|
phys_copy(dst, vir2phys(&ub), (phys_bytes) 1);
|
||||||
|
m_ptr->CTL_DATA = ub;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case T_WRITEB_INS: /* set value in instruction space */
|
||||||
|
if (rp->p_memmap[T].mem_len != 0) {
|
||||||
|
if ((dst = umap_local(rp, T, tr_addr, 1)) == 0) return(EFAULT);
|
||||||
|
phys_copy(vir2phys(&tr_data), dst, (phys_bytes) 1);
|
||||||
|
m_ptr->CTL_DATA = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((dst = umap_local(rp, D, tr_addr, 1)) == 0) return(EFAULT);
|
||||||
|
phys_copy(vir2phys(&tr_data), dst, (phys_bytes) 1);
|
||||||
|
m_ptr->CTL_DATA = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return(EIO);
|
return(EIO);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue