trace fix contributed by Joren l'Ami
This commit is contained in:
parent
dc9a1bc30c
commit
b560a36b20
1 changed files with 14 additions and 4 deletions
|
@ -49,22 +49,32 @@ register message *m_ptr;
|
||||||
|
|
||||||
#define COPYTOPROC(seg, addr, myaddr, length) { \
|
#define COPYTOPROC(seg, addr, myaddr, length) { \
|
||||||
struct vir_addr fromaddr, toaddr; \
|
struct vir_addr fromaddr, toaddr; \
|
||||||
|
int r; \
|
||||||
fromaddr.proc_nr_e = SYSTEM; \
|
fromaddr.proc_nr_e = SYSTEM; \
|
||||||
toaddr.proc_nr_e = tr_proc_nr_e; \
|
toaddr.proc_nr_e = tr_proc_nr_e; \
|
||||||
fromaddr.offset = (myaddr); \
|
fromaddr.offset = (myaddr); \
|
||||||
toaddr.offset = (addr); \
|
toaddr.offset = (addr); \
|
||||||
fromaddr.segment = D; \
|
fromaddr.segment = D; \
|
||||||
toaddr.segment = (seg); \
|
toaddr.segment = (seg); \
|
||||||
|
if((r=virtual_copy_vmcheck(&fromaddr, &toaddr, length)) != OK) { \
|
||||||
|
printf("Can't copy in sys_trace: %d\n", r);\
|
||||||
|
return r;\
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define COPYFROMPROC(seg, addr, myaddr, length) { \
|
#define COPYFROMPROC(seg, addr, myaddr, length) { \
|
||||||
struct vir_addr fromaddr, toaddr; \
|
struct vir_addr fromaddr, toaddr; \
|
||||||
|
int r; \
|
||||||
fromaddr.proc_nr_e = tr_proc_nr_e; \
|
fromaddr.proc_nr_e = tr_proc_nr_e; \
|
||||||
toaddr.proc_nr_e = SYSTEM; \
|
toaddr.proc_nr_e = SYSTEM; \
|
||||||
fromaddr.offset = (addr); \
|
fromaddr.offset = (addr); \
|
||||||
toaddr.offset = (myaddr); \
|
toaddr.offset = (myaddr); \
|
||||||
fromaddr.segment = (seg); \
|
fromaddr.segment = (seg); \
|
||||||
toaddr.segment = D; \
|
toaddr.segment = D; \
|
||||||
|
if((r=virtual_copy_vmcheck(&fromaddr, &toaddr, length)) != OK) { \
|
||||||
|
printf("Can't copy in sys_trace: %d\n", r);\
|
||||||
|
return r;\
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isokendpt(tr_proc_nr_e, &tr_proc_nr)) return(EINVAL);
|
if(!isokendpt(tr_proc_nr_e, &tr_proc_nr)) return(EINVAL);
|
||||||
|
@ -80,14 +90,14 @@ register message *m_ptr;
|
||||||
|
|
||||||
case T_GETINS: /* return value from instruction space */
|
case T_GETINS: /* return value from instruction space */
|
||||||
if (rp->p_memmap[T].mem_len != 0) {
|
if (rp->p_memmap[T].mem_len != 0) {
|
||||||
COPYTOPROC(T, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
COPYFROMPROC(T, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
||||||
m_ptr->CTL_DATA = tr_data;
|
m_ptr->CTL_DATA = tr_data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Text space is actually data space - fall through. */
|
/* Text space is actually data space - fall through. */
|
||||||
|
|
||||||
case T_GETDATA: /* return value from data space */
|
case T_GETDATA: /* return value from data space */
|
||||||
COPYTOPROC(D, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
COPYFROMPROC(D, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
||||||
m_ptr->CTL_DATA= tr_data;
|
m_ptr->CTL_DATA= tr_data;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -100,14 +110,14 @@ register message *m_ptr;
|
||||||
|
|
||||||
case T_SETINS: /* set value in instruction space */
|
case T_SETINS: /* set value in instruction space */
|
||||||
if (rp->p_memmap[T].mem_len != 0) {
|
if (rp->p_memmap[T].mem_len != 0) {
|
||||||
COPYFROMPROC(T, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
COPYTOPROC(T, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
||||||
m_ptr->CTL_DATA = 0;
|
m_ptr->CTL_DATA = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Text space is actually data space - fall through. */
|
/* Text space is actually data space - fall through. */
|
||||||
|
|
||||||
case T_SETDATA: /* set value in data space */
|
case T_SETDATA: /* set value in data space */
|
||||||
COPYFROMPROC(D, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
COPYTOPROC(D, tr_addr, (vir_bytes) &tr_data, sizeof(long));
|
||||||
m_ptr->CTL_DATA = 0;
|
m_ptr->CTL_DATA = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue