STATUS: 60%

0000 T _signal		compatible
    0052 T _psignal		compatible
    00b6 T _issig		not compatible
    0186 T _stop		compatible
    0216 T _psig		compatible
    02d4 T _fsig		compatible
    031e T _core		not compatible
    0512 T _grow		not compatible
    0640 T _ptrace		not compatible
    075c T _procxmt		compatible
This commit is contained in:
Oliver Lehmann 2008-05-31 00:28:34 +00:00
parent 19229ad211
commit 0096953190
1 changed files with 44 additions and 29 deletions

View File

@ -49,7 +49,7 @@ struct
{ {
int ip_lock; int ip_lock;
int ip_req; int ip_req;
int *ip_addr; saddr_t ip_addr;
int ip_data; int ip_data;
} ipc; } ipc;
@ -120,7 +120,7 @@ issig()
freeproc(q, 0) ; freeproc(q, 0) ;
} }
} else } else
if (u.u_signal[SIGCLD-1]) if (u.u_signal[SIGCLD-1]) /* this is not compatible - r3 gets checked, not rr2 which is what u.u_signal is in */
return(n) ; return(n) ;
} else } else
if((u.u_signal[n-1]&1) == 0 || (p->p_flag&STRC)) if((u.u_signal[n-1]&1) == 0 || (p->p_flag&STRC))
@ -341,7 +341,7 @@ ptrace()
register struct a { register struct a {
int req; int req;
int pid; int pid;
int *addr; saddr_t addr;
int data; int data;
} *uap; } *uap;
@ -363,7 +363,7 @@ ptrace()
sleep((caddr_t)&ipc, IPCPRI); sleep((caddr_t)&ipc, IPCPRI);
ipc.ip_lock = p->p_pid; ipc.ip_lock = p->p_pid;
ipc.ip_data = uap->data; ipc.ip_data = uap->data;
ipc.ip_addr = uap->addr; ipc.ip_addr.l = uap->addr.left&0x7f00;
ipc.ip_req = uap->req; ipc.ip_req = uap->req;
p->p_flag &= ~SWTED; p->p_flag &= ~SWTED;
setrun(p); setrun(p);
@ -376,9 +376,6 @@ ptrace()
wakeup((caddr_t)&ipc); wakeup((caddr_t)&ipc);
} }
/*
int ipcreg[] = {R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, AP, FP, SP, PC};
*/
/* /*
* Code that the child process * Code that the child process
* executes to implement the command * executes to implement the command
@ -389,30 +386,36 @@ procxmt()
register int i; register int i;
register *p; register *p;
register struct text *xp; register struct text *xp;
int foo1, foo2;
if (ipc.ip_lock != u.u_procp->p_pid) if (ipc.ip_lock != u.u_procp->p_pid)
return(0); return(0);
i = ipc.ip_req; i = ipc.ip_req;
ipc.ip_req = 0; ipc.ip_req = 0;
wakeup((caddr_t)&ipc); wakeup((caddr_t)&ipc);
if(!u.u_segmented)
ipc.ip_addr.left = nsseg(ipc.ip_addr.right);
switch (i) { switch (i) {
/* read user I */ /* read user I */
case 1: case 1:
ipc.ip_data = fuiword((caddr_t)ipc.ip_addr); if(!u.u_segmented) {
break; if(fuiword(ipc.ip_addr.right,&ipc.ip_data))
goto error;
break;
}
/* read user D */ /* read user D */
case 2: case 2:
ipc.ip_data = fuword((caddr_t)ipc.ip_addr); if(fuword(ipc.ip_addr.l,&ipc.ip_data))
goto error;
break; break;
/* read u */ /* read u */
case 3: case 3:
i = (int)ipc.ip_addr; i = (int)ipc.ip_addr.right;
if (i<0 || i >= ctob(USIZE)) if (i<0 || i >= ctob(USIZE))
goto error; goto error;
ipc.ip_data = ((physadr)&u)->r[i>>2]; ipc.ip_data = (long)((physadr)&u)->r[i>>1];
break; break;
/* write user I */ /* write user I */
@ -426,33 +429,42 @@ procxmt()
goto error; goto error;
xp->x_iptr->i_flag &= ~ITEXT; xp->x_iptr->i_flag &= ~ITEXT;
} }
chgprot(RW, 0, 0); if(u.u_segmented) {
i = suiword((caddr_t)ipc.ip_addr, 0); if (u.u_sep)
suiword((caddr_t)ipc.ip_addr, ipc.ip_data); ldsdr(hibyte(ipc.ip_addr.l),-1,-1,0);
chgprot(RO, 0, 0); if(suword(ipc.ip_addr.l,ipc.ip_data))
if (i<0) goto error;
goto error; if (u.u_sep)
ldsdr(hibyte(ipc.ip_addr.l),-1,-1,1);
} else {
estabur(u.u_tsize,u.u_dsize,u.u_ssize,0);
if(suiword(ipc.ip_addr.right,ipc.ip_data))
goto error;
estabur(u.u_tsize,u.u_dsize,u.u_ssize,1);
}
if (xp) if (xp)
xp->x_flag |= XWRIT; xp->x_flag |= XWRIT;
break; break;
/* write user D */ /* write user D */
case 5: case 5:
if (suword((caddr_t)ipc.ip_addr, 0) < 0) if (suword((caddr_t)ipc.ip_addr.l, ipc.ip_data))
goto error; goto error;
suword((caddr_t)ipc.ip_addr, ipc.ip_data);
break; break;
/* write u */ /* write u */
case 6: case 6:
i = (int)ipc.ip_addr; i = (int)ipc.ip_addr.right;
p = (int *)&((physadr)&u)->r[i>>2]; p = (int *)&((physadr)&u)->r[i>>1];
for (i=0; i<16; i++) for (i=0; i<15; i++)
if (p == &u.u_state->s_reg[i]) if (p == &u.u_state->s_reg[i])
goto ok; goto ok;
if (p == &u.u_state->s_sp)
goto ok;
if (p == &u.u_state->s_pc)
goto ok;
if (p == &u.u_state->s_ps) { if (p == &u.u_state->s_ps) {
ipc.ip_data |= 0x3c00000; /* modes == user */ ipc.ip_data = (ipc.ip_data&0x00ff)|(u.u_state->s_ps&0xff00);
ipc.ip_data &= ~0x3c20ff00; /* IS, FPD, ... */
goto ok; goto ok;
} }
goto error; goto error;
@ -464,10 +476,13 @@ procxmt()
/* set signal and continue */ /* set signal and continue */
/* one version causes a trace-trap */ /* one version causes a trace-trap */
case 9: case 9:
u.u_state->s_ps |= 0x10/*PS_T*/; u.u_state->s_ps |= TBIT/*PS_T*/;
case 7: case 7:
if ((int)ipc.ip_addr != 1) if ((int)ipc.ip_addr.right != 1) {
u.u_state->s_pc = (int)ipc.ip_addr; if(u.u_segmented)
u.u_state->s_pcseg = (int)ipc.ip_addr.left;
u.u_state->s_pc = (int)ipc.ip_addr.right;
}
u.u_procp->p_sig = 0L; u.u_procp->p_sig = 0L;
if (ipc.ip_data) if (ipc.ip_data)
psignal(u.u_procp, ipc.ip_data); psignal(u.u_procp, ipc.ip_data);