STATUS: 67%

0000 T _exec		compatible
    0010 T _exece		99% compatible - uses a different temp. reg.
    0618 T _getxfile		not compatible
    0fe8 T _setregs		compatible
    1164 T _rexit		compatible
    118c T _exit		99% compatible - uses a different temp. reg.
    1374 T _wait		compatible
    1428 T _freeproc		compatible
    14a2 T _fork		compatible
This commit is contained in:
Oliver Lehmann 2008-06-01 21:04:57 +00:00
parent eaa9282a1d
commit 247acf554d
1 changed files with 22 additions and 22 deletions

View File

@ -59,7 +59,7 @@ exece()
register struct buf *bp; register struct buf *bp;
register struct execa *uap; register struct execa *uap;
int ne; int ne;
register long bno; register int bno;
unsigned ap; unsigned ap;
char b; char b;
saddr_t c, stkv; saddr_t c, stkv;
@ -90,7 +90,7 @@ bad: u.u_error = EACCES;
if (((!u.u_segmented) && (long)uap->argp & 0x0ffffL) || if (((!u.u_segmented) && (long)uap->argp & 0x0ffffL) ||
(u.u_segmented && uap->argp)){ (u.u_segmented && uap->argp)){
if (u.u_segmented){ if (u.u_segmented){
if (fuword(uap->argp, &c.left) || if (fuword((caddr_t)uap->argp, &c.left) || /*FIXME: uses different temp regs here */
(fuword((long)uap->argp+2, &c.right))) (fuword((long)uap->argp+2, &c.right)))
goto bad; goto bad;
(long)uap->argp += 4; (long)uap->argp += 4;
@ -101,30 +101,30 @@ bad: u.u_error = EACCES;
} }
} }
if ((!u.u_segmented && c.right == NULL && ((long)uap->envp & 0xffffL) != NULL) || if ((!u.u_segmented && c.right == NULL && ((long)uap->envp & 0xffffL) != NULL) ||
(u.u_segmented && (c.l == 0L) && (uap->envp != 0L))){ ( u.u_segmented && !c.l && uap->envp )){ /*FIXME: uses different temp regs here */
uap->argp = 0; uap->argp = NULL; /*FIXME: uses different temp regs here */
/* b24 */ if (u.u_segmented){ if (u.u_segmented){
if ((fuword(uap->envp, &c.left)) || if ((fuword(uap->envp, &c.left)) ||
(fuword((long)uap->envp+2, &c.right))) (fuword((long)uap->envp+2, &c.right)))
goto bad; goto bad;
/* 27 */ if (!c.l) if (!c.l)
break; break;
(long)uap->envp += 2; (long)uap->envp += 2;
} else { } else {
/* 28 */ if (fuword(uap->envp, &c.right)) if (fuword(uap->envp, &c.right))
goto bad; goto bad;
if (c.right != 0L) if (c.right == 0L)
break; break;
c.left = nsseg(c.right); c.left = nsseg(c.right);
} }
(long)uap->envp += 2; (long)uap->envp += 2;
ne++; ne++;
} }
/* 30 */ if ((u.u_segmented || c.right != 0L) && if ((u.u_segmented || c.right != 0L) &&
(!u.u_segmented || c.l != 0)){ (!u.u_segmented || c.l != 0)){
nc1++; nc1++;
do { do {
/* 34 */ if (nc >= 0x13ff) if (nc >= NCARGS-1)
u.u_error = E2BIG; u.u_error = E2BIG;
if (fubyte (c.l++, &b)) if (fubyte (c.l++, &b))
u.u_error = EFAULT; u.u_error = EFAULT;
@ -133,7 +133,7 @@ bad: u.u_error = EACCES;
if ((nc & 0x1ff) == 0){ if ((nc & 0x1ff) == 0){
if (bp) if (bp)
bawrite(bp); bawrite(bp);
bp = getblk(swapdev, (daddr_t)(bno+swplo+(nc>>BSHIFT))); bp = getblk(swapdev, (daddr_t)(swplo+bno+(nc>>BSHIFT)));
cp = bp->b_un.b_addr; cp = bp->b_un.b_addr;
} }
nc++; nc++;
@ -142,7 +142,7 @@ bad: u.u_error = EACCES;
} else } else
break; break;
} }
/*40*/ if (bp) if (bp)
bawrite(bp); bawrite(bp);
bp = 0; bp = 0;
nc = (nc + NBPW -1) & ~(NBPW -1); nc = (nc + NBPW -1) & ~(NBPW -1);
@ -153,23 +153,23 @@ bad: u.u_error = EACCES;
} }
ap = -nc - NBPW; ap = -nc - NBPW;
c.left = u.u_stakseg << 8; c.left = u.u_stakseg << 8;
/*45*/ if (u.u_segmented) if (u.u_segmented)
c.right = ap - nc1*2*NBPW - 3*2*NBPW; c.right = ap - nc1*2*NBPW - 3*2*NBPW;
else else
c.right = ap - nc1*NBPW - 3*NBPW; c.right = ap - nc1*NBPW - 3*NBPW;
u.u_state->s_sp = c.right; u.u_state->s_sp = c.right;
/*46*/ if (suword(c.l, nc1 - ne)) if (suword(c.l, nc1 - ne))
goto bad; goto bad;
nc = 0; nc = 0;
while (1){ while (1){
/* b57 */ if (u.u_segmented){ if (u.u_segmented){
c.right += 2; c.right += 2;
/* b58 */ if (nc1 == ne){ if (nc1 == ne){
if (suword(c.l, 0) || suword(c.l+2, 0)) if (suword(c.l, 0) || suword(c.l+2, 0))
goto bad; goto bad;
c.right += 4; c.right += 4;
} }
/* b61 */ if (--nc1 >= 0){ if (--nc1 >= 0){
if (suword(c.l, u.u_stakseg<<8) || suword(c.l+2, ap)) if (suword(c.l, u.u_stakseg<<8) || suword(c.l+2, ap))
goto bad; goto bad;
c.right += 2; c.right += 2;
@ -182,17 +182,17 @@ bad: u.u_error = EACCES;
goto bad; goto bad;
c.right += 2; c.right += 2;
} }
/* b54 */ if (--nc1 >= 0){ if (--nc1 >= 0){
if (suword(c.l, ap)) if (suword(c.l, ap))
goto bad; goto bad;
} else } else
break; break;
} }
while (1){ while (1){
/* b49 */ if ((nc & 0x1ff) == 0){ if ((nc & 0x1ff) == 0){
if (bp) if (bp)
brelse(bp); brelse(bp);
bp = bread(swapdev, (daddr_t)bno+swplo+(nc>>BSHIFT)); bp = bread(swapdev, (daddr_t)(swplo+bno+(nc>>BSHIFT)));
cp = bp->b_un.b_addr; cp = bp->b_un.b_addr;
} }
stkv.left = u.u_stakseg<<8; stkv.left = u.u_stakseg<<8;
@ -200,7 +200,7 @@ bad: u.u_error = EACCES;
if (subyte(stkv.l, (b = *cp++))) if (subyte(stkv.l, (b = *cp++)))
goto bad; goto bad;
nc++; nc++;
/* b56 */ if (b & 0xff) if (b & 0xff)
continue; continue;
else else
break; break;
@ -208,7 +208,7 @@ bad: u.u_error = EACCES;
} }
if (suword(c.l, 0)) if (suword(c.l, 0))
goto bad; goto bad;
if (u.u_error) if (u.u_segmented)
if (suword(c.l+2, 0)) if (suword(c.l+2, 0))
goto bad; goto bad;
stkv.left = u.u_stakseg<<8; stkv.left = u.u_stakseg<<8;