STATUS: 17%
0000 T _sureg compatible
00e8 T _estabur not existent
01ae T _sestabur not existent
0296 T _segureg not existent
0438 T _ldsdr not existent
0548 T _prmmu not existent
This commit is contained in:
parent
87841b3908
commit
1162549bf7
|
|
@ -1,11 +1,36 @@
|
||||||
#include "sys/plexus.h"
|
/******************************************************************************
|
||||||
#include "sys/param.h"
|
*******************************************************************************
|
||||||
#include "sys/systm.h"
|
|
||||||
#include "sys/dir.h"
|
W E G A - Quelle
|
||||||
#include "sys/user.h"
|
|
||||||
#include "sys/proc.h"
|
KERN 3.2 Modul: ureg.c
|
||||||
#include "sys/text.h"
|
|
||||||
#include "sys/seg.h"
|
|
||||||
|
Bearbeiter: O. Lehmann
|
||||||
|
Datum: 25.05.08
|
||||||
|
Version: 1.0
|
||||||
|
|
||||||
|
*******************************************************************************
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
char uregwstr[] = @[$]ureg.c Rev : 4.1 08/27/83 12:01:05";
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
#include <sys/sysinfo.h>
|
||||||
|
#include <sys/systm.h>
|
||||||
|
#include <sys/file.h>
|
||||||
|
#include <sys/inode.h>
|
||||||
|
#include <sys/dir.h>
|
||||||
|
#include <sys/mmu.h>
|
||||||
|
#include <sys/buf.h>
|
||||||
|
#include <sys/conf.h>
|
||||||
|
#include <sys/proc.h>
|
||||||
|
#include <sys/s.out.h>
|
||||||
|
#include <sys/user.h>
|
||||||
|
|
||||||
|
extern int mmut; /* STACK MMU */
|
||||||
|
extern int mmud; /* DATA MMU */
|
||||||
|
extern int mmus; /* CODE MMU */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load the user hardware segmentation
|
* Load the user hardware segmentation
|
||||||
|
|
@ -15,36 +40,27 @@
|
||||||
*/
|
*/
|
||||||
sureg()
|
sureg()
|
||||||
{
|
{
|
||||||
int taddr, daddr;
|
register struct segd *segmnt;
|
||||||
register i, c;
|
register struct text *textp;
|
||||||
struct text *tp;
|
|
||||||
int maptemp[NUMLOGPAGE];
|
|
||||||
|
|
||||||
taddr = daddr = u.u_procp->p_addr;
|
if(u.u_segmented || inb(SCR)&0x0004)
|
||||||
if ((tp=u.u_procp->p_textp) != NULL)
|
panic("sureg: user is segmented");
|
||||||
taddr = tp->x_caddr;
|
|
||||||
|
|
||||||
for (i = 0; i < NUMLOGPAGE; i++) {
|
u.u_segmts[USEG].sg_base = u.u_procp->p_addr+10;
|
||||||
c = u.u_uisa[i];
|
u.u_segmts[NUSEGS-1].sg_base = (u.u_segmts[USEG].sg_limit + u.u_segmts[USEG].sg_base + 1)
|
||||||
if ((c & B_IP) == 0)
|
- u.u_segmts[NUSEGS-1].sg_limit;
|
||||||
if (c & B_EX)
|
textp = u.u_procp->p_textp;
|
||||||
c += taddr;
|
if(textp) {
|
||||||
else
|
u.u_nsucode.sg_base = textp->x_caddr;
|
||||||
c += daddr;
|
segmnt = &u.u_nsucode;
|
||||||
maptemp[i] = c;
|
} else {
|
||||||
|
segmnt = &u.u_segmts[USEG];
|
||||||
}
|
}
|
||||||
copymout(maptemp, P_MUI0, NUMLOGPAGE << 1);
|
loadsd(mmut,USEG,segmnt);
|
||||||
|
loadsd(mmud,USEG,&u.u_segmts[USEG]);
|
||||||
for (i = 0; i < NUMLOGPAGE; i++) {
|
loadsd(mmus,USEG,&u.u_segmts[NUSEGS-1]);
|
||||||
c = u.u_uisa[i + NUMLOGPAGE];
|
u.u_break = u.u_segmts[USEG].sg_limit + 1;
|
||||||
if ((c & B_IP) == 0)
|
outb(0xffd1,u.u_break);
|
||||||
if (c & B_EX)
|
|
||||||
c += taddr;
|
|
||||||
else
|
|
||||||
c += daddr;
|
|
||||||
maptemp[i] = c;
|
|
||||||
}
|
|
||||||
copymout(maptemp, P_MUD0, NUMLOGPAGE << 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -61,47 +77,20 @@ sureg()
|
||||||
estabur(nt, nd, ns, sep, xrw)
|
estabur(nt, nd, ns, sep, xrw)
|
||||||
unsigned nt, nd, ns;
|
unsigned nt, nd, ns;
|
||||||
{
|
{
|
||||||
register a, *ap, i;
|
|
||||||
|
|
||||||
if (checkur(nt, nd, ns, sep))
|
|
||||||
return(-1);
|
|
||||||
a = 0;
|
|
||||||
ap = &u.u_uisa[0];
|
|
||||||
for (i = 0; i < nt; i++)
|
|
||||||
*ap++ = a++ | B_EX | (xrw == RO ? B_RO : 0);
|
|
||||||
if (sep)
|
|
||||||
for (i = 0; i < (NUMLOGPAGE - nt); i++)
|
|
||||||
*ap++ = B_IP | B_RO;
|
|
||||||
a = USIZE;
|
|
||||||
for (i = 0; i < nd; i++)
|
|
||||||
*ap++ = a++;
|
|
||||||
for (i = 0; i < (NUMLOGPAGE - nd - ns - ((!sep) ? nt : 0)); i++)
|
|
||||||
*ap++ = B_IP | B_RO;
|
|
||||||
for (i = 0; i < ns; i++)
|
|
||||||
*ap++ = a++;
|
|
||||||
if (!sep) {
|
|
||||||
ap = &u.u_uisa[0];
|
|
||||||
for (i = 0; i < NUMLOGPAGE; i++)
|
|
||||||
ap[i + NUMLOGPAGE] = ap[i];
|
|
||||||
}
|
|
||||||
sureg();
|
|
||||||
return(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkur(nt, nd, ns, sep)
|
sestabur()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
segureg()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ldsdr()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
prmmu()
|
||||||
{
|
{
|
||||||
if(sep) {
|
|
||||||
if(ctos(nt) > NUMLOGPAGE || ctos(nd)+ctos(ns) > NUMLOGPAGE)
|
|
||||||
goto err;
|
|
||||||
} else {
|
|
||||||
if(ctos(nt)+ctos(nd)+ctos(ns) > NUMLOGPAGE)
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
if(nt+nd+ns+USIZE > maxmem)
|
|
||||||
goto err;
|
|
||||||
return(0);
|
|
||||||
|
|
||||||
err:
|
|
||||||
u.u_error = ENOMEM;
|
|
||||||
return(-1);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue