#include "../h/local.h" #ifdef SCCS_ID static char SCCS_ID [] = "@(#)ureg.c 3.1 14:36:50 - 81/11/07 "; #endif SCCS_ID #include "../h/param.h" #include "../h/systm.h" #include "../h/dir.h" #include "../h/user.h" #include "../h/proc.h" #include "../h/text.h" #include "../h/seg.h" /* * Load the user hardware segmentation * registers from the software prototype. * The software registers must have * been setup prior by estabur. */ sureg() { register *up; register struct seg *rp; register a, t; register struct text *tp; t = a = (u.u_procp->p_addr) << SEGASL; if ((tp=u.u_procp->p_textp) != NULL) t = (tp->x_caddr)<= &u.u_uisa[0]) (--rp)->seg_hste = (*up + (*up&TX? t: (*up&ABS? 0: a))) & ~(TX|ABS); } /* * Set up software prototype segmentation * registers to implement the 3 pseudo * text,data,stack segment sizes passed * as arguments. * The argument sep specifies if the * text and data+stack segments are to * be separated (meaningless on Interdata). * The last argument determines whether the text * segment is read-write or read-only. */ estabur(nt, nd, ns, sep, xrw) unsigned nt, nd, ns; { register a, *ap, *dp; if(sep) goto err; else if(ctos(nt)+ctos(nd)+ctos(ns) > (NUSEGS-1)) goto err; if(nt+nd+ns+USIZE > maxmem) goto err; a = 0; ap = &u.u_uisa[0]; while(nt >= SEGFULL) { *ap++ = (a<= SEGFULL) { *ap++ = (a<= SEGFULL) { *ap++ = (a<