From e591f182a8dc49461e24fee78ce7dc7f864812cb Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Wed, 28 May 2008 20:00:34 +0000 Subject: [PATCH] STATUS: 33% 0000 T _sureg compatible 00e8 T _estabur functional compatible: uses different temp. reg. 01ae T _sestabur not compatible 0296 T _segureg functional compatible: uses different temp. reg. 0438 T _ldsdr compatible 0548 T _prmmu not existent --- WEGA/src/uts/sys/ureg.c | 56 +++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/WEGA/src/uts/sys/ureg.c b/WEGA/src/uts/sys/ureg.c index 0be184f..dd23ccc 100644 --- a/WEGA/src/uts/sys/ureg.c +++ b/WEGA/src/uts/sys/ureg.c @@ -95,29 +95,34 @@ register unsigned nt, nd, ns; return(0); } +/*FIXME: The function works from the functional point of view, but in the original + * object the stkseg stuff at the beginning shows that at least one int is + * used - which cannot be, because if stakseg is an int the work with stackseg + * is no longer compatible - same goes with nd. but if for example stakseg is + * declared as int, nt, ns and sep are assigned correctly so that r12 get used + * otherwise r3 gets used instead of r12 + */ sestabur(nt, nd, ns, sep) -register unsigned nt; +register unsigned nt, ns, sep; char nd; -register unsigned ns; -register unsigned sep; { - int stakseg; + char stakseg; if(nt > 256) { u.u_error = ENOMEM; return(-1); } - stakseg = nd&LONGMASK; + stakseg = nd&STAK; - if(sep > 128) { + if(ns > 128) { u.u_error = ENOEXEC; return(-1); } if(stakseg == u.u_stakseg) { u.u_segmts[NUSEGS-1].sg_limit = (!nt?0:-nt+256); - u.u_segmts[NUSEGS-1].sg_attr = (!nt?32:-nt+20); + u.u_segmts[NUSEGS-1].sg_attr = (!nt?20:32); return(0); } @@ -148,7 +153,7 @@ segureg() caddr = 0; for(i=0;isg_base = sbase; + + if(slimit != 0xffff) + segmnt->sg_limit = ((segno == u.u_stakseg)?0x100-slimit:slimit-1); + + if(sattr != 0xffff) + segmnt->sg_attr = sattr; + + loadsd(segno<0x40?mmud:mmus,segno,segmnt); } prmmu()