From 2596f913890dc274949cc1a15a6ffaf409d107b2 Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Tue, 3 Jun 2008 18:13:26 +0000 Subject: [PATCH] STATUS: 73% 0000 T _read compatible 0006 T _write compatible 000c T _rdwr stack assignments are not compatible uses for an adding an other temp. reg. u_base assignment is not correct 01d6 T _open compatible 01fe T _creat compatible 0224 T _copen stack assignments are not compatible 041a T _close compatible 045e T _seek compatible 04ec T _link u_dirp assignment is not correct. 05c2 T _mknod compatible 0660 T _saccess compatible --- WEGA/src/uts/sys/sys2.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/WEGA/src/uts/sys/sys2.c b/WEGA/src/uts/sys/sys2.c index 7e16928..4ff5b65 100644 --- a/WEGA/src/uts/sys/sys2.c +++ b/WEGA/src/uts/sys/sys2.c @@ -54,12 +54,12 @@ register mode; { register struct file *fp; register struct inode *ip; + long j; register struct a { int fdes; char *cbuf; unsigned count; } *uap; - long j; /*FIXME: should be stack+0 is stack+2*/ int type; uap = (struct a *)u.u_ap; @@ -70,18 +70,18 @@ register mode; u.u_error = EBADF; return; } - u.u_base.l = (caddr_t)(((long)uap->cbuf) & 0x7F00FFFF); /* FIXME: this is not 100% compatible */ + u.u_base.l = (caddr_t)(((long)uap->cbuf) & 0x7F00FFFF); /* FIXME: this is not 100% compatible (sys2.s v1.1 Line 151-154) */ u.u_count = uap->count; u.u_segflg = 0; u.u_fmode = fp->f_flag; ip = fp->f_inode; type = ip->i_mode&IFMT; if (type==IFREG || type==IFDIR) { - u.u_offset = fp->f_offset; - if(ip->i_locklist) { - j = u.u_offset + u.u_count; /*FIXME: rr2 is used for adding, rr4 should be used j is used nowhere*/ - if(locked(mode == FREAD?0x100:0,ip,u.u_offset)) - return; + u.u_offset = fp->f_offset; /* FIXME: uses different temp. reg. (sys2.s v1.1 line 172-173 */ + if(ip->i_locklist) { /* FIXME: uses different temp. reg. (sys2.s v1.1 line 174-175 */ + j = u.u_offset + u.u_count; /* FIXME: j should be +0 but is +2 and why is it defined at all? */ + if(locked(mode == FREAD?0x100:0,ip,u.u_offset)) /* probably it should be some variable locked() usess */ + return; /* (sys2.s v1.1 line 147-150) */ } plock(ip); if ((u.u_fmode&FAPPEND) && (mode == FWRITE)) @@ -140,14 +140,14 @@ creat() * Check permissions, allocate an open file structure, * and call the device open routine if any. */ -copen(mode, arg,j) +copen(mode, arg) register mode; -int arg; /*FIXME: this should be stack +4 but is +0*/ +int arg; /*FIXME: this has to be stack +4 (sys2.s v1.1 line 332 */ { register struct inode *ip; register struct file *fp; - long j; /*FIXME: this should be stack +0 but is +4*/ - int i; /*FIXME: this is stack +8*/ + long j; + int i; if ((mode&(FREAD|FWRITE)) == 0) { u.u_error = EINVAL; @@ -158,7 +158,7 @@ int arg; /*FIXME: this should be stack +4 but is +0*/ if (ip == NULL) { if (u.u_error) return; - ip = maknode(arg&07777&(~ISVTX)); + ip = maknode(arg&07777&(~ISVTX)); /*FIXME: see above (sys2.s v.1. line 350 )*/ if (ip == NULL) return; mode &= ~FTRUNC; @@ -179,9 +179,9 @@ int arg; /*FIXME: this should be stack +4 but is +0*/ } } if(ip->i_locklist) { - j=0x4000000; /*FIXME: only usage of j - makes no real sense if its private*/ - if(locked(0,ip,0)){ - iput(ip); + j=0x40000000; /* FIXME: j should be +0 but is +4 and why is it defined at all? */ + if(locked(0,ip,0)){ /* probably it should be some variable locked() usess */ + iput(ip); /* (sys2.s v1.1 line 407) */ return; } } @@ -211,7 +211,7 @@ int arg; /*FIXME: this should be stack +4 but is +0*/ fp->f_flag = mode&FMASK; fp->f_inode = ip; i = u.u_r.r_val1; - if (setjmp(u.u_qsav)) { /* catch half-opens */ + if (save(u.u_qsav)) { /* catch half-opens */ setscr(); if (u.u_error == 0) u.u_error = EINTR; @@ -284,7 +284,7 @@ link() register struct a { char *target; char *linkname; - } *uap; + } *uap; /* FIXME: some var definitions are missing (sys2.c v1.1 line 593, 653, 657)*/ uap = (struct a *)u.u_ap; ip = namei(uchar, 0); @@ -302,7 +302,7 @@ link() */ prele(ip); - u.u_dirp.l = (caddr_t)(((long)uap->linkname) & 0x7F00FFFF); /* FIXME: this is not 100% compatible */ + u.u_dirp.l = (caddr_t)(((long)uap->linkname) & 0x7F00FFFF); /* FIXME: this is not 100% compatible (sys2.c v1.1 line 611-613) */ xp = namei(uchar, 1); if (xp != NULL) {