00001
00002
00003
00004
00005
00006
00007
00008 #include<linux/linkage.h>
00009 #include<linux/sched.h>
00010 #include<linux/slab.h>
00011 #include<asm/pgalloc.h>
00012 #include<asm/mmu_context.h>
00013 #include<internals.h>
00014 #include<ipldef.h>
00015 #include<mmg_functions.h>
00016 #include<mmg_routines.h>
00017 #include<rdedef.h>
00018 #include<ssdef.h>
00019 #include<system_data_cells.h>
00020 #include<va_rangedef.h>
00021 #include<vmspte.h>
00022
00023 int mmg_pteref_64 (void * va, struct _rde *rde, void ** va_pte);
00024
00025 int mmg_setprtpag (int acmode, void * va, struct _pcb * p, signed int pagedirection, struct _rde * rde, unsigned long newpte) {
00026 step1:
00027 {}
00028 long * pte;
00029 int sts = mmg_pteref_64 (va, rde, &pte);
00030 if ((sts&1) == 0)
00031 return sts;
00032 if (pte == 0) {
00033 vmsunlock (&SPIN_MMG, -1);
00034 return SS__NOSUCHPAG;
00035 }
00036
00037 struct _mypte * mypte = pte;
00038 struct _mypte * newptep = &newpte;
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 if ((*(unsigned long *)pte)&1) goto valid;
00056
00057 if ((*(unsigned long *)pte)&_PAGE_TYP1) {
00058 if ((*(unsigned long *)pte)&_PAGE_TYP0) {
00059 if (mypte->pte_v_wrt && newptep->pte$v_wrt == 0)
00060 goto step5;
00061
00062
00063 } else {
00064 }
00065 }
00066
00067 if (!((*(unsigned long *)pte)&_PAGE_TYP1)) {
00068 if (!((*(unsigned long *)pte)&_PAGE_TYP0)) {
00069 if ((*(unsigned long *)pte)&0xffffffff) {
00070 if (newptep->pte_v_wrt == 0) {
00071 vmsunlock (&SPIN_MMG, IPL__ASTDEL);
00072 *(long *)pte&=1;
00073 goto step1;
00074 }
00075 } else {
00076 if (newptep->pte_v_wrt == 0) {
00077 vmsunlock (&SPIN_MMG, IPL__ASTDEL);
00078 *(long *)pte&=1;
00079 goto step1;
00080 } else
00081 goto step5;
00082 }
00083 } else {
00084 }
00085 }
00086
00087 goto step5;
00088
00089 valid:
00090
00091
00092
00093 if ((*(unsigned long *)pte)&_PAGE_TYP1) {
00094 if ((*(unsigned long *)pte)&_PAGE_TYP0) {
00095 } else {
00096 }
00097 }
00098
00099 if (!((*(unsigned long *)pte)&_PAGE_TYP1)) {
00100 if (!((*(unsigned long *)pte)&_PAGE_TYP0)) {
00101 if ((*(unsigned long *)pte)&0xffffffff) {
00102 } else {
00103 }
00104 } else {
00105 }
00106 }
00107
00108 step5:
00109 {}
00110
00111 struct _pcb * pcb = p;
00112 long page = va;
00113 *(long *)pte = newpte;
00114 flush_tlb_range(pcb->mm, page, page + PAGE_SIZE);
00115
00116 vmsunlock (&SPIN_MMG, IPL__ASTDEL);
00117
00118 return SS__NORMAL;
00119 }
00120
00121 asmlinkage int exe_setprt (struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode, unsigned int prot, unsigned char *prvprt) {
00122
00123
00124
00125
00126 int ipl = getipl();
00127 setipl(IPL__ASTDEL);
00128 struct _rde * rde = mmg_lookup_rde_va (inadr->va_range$ps_start_va, ctl$gl_pcb->pcb$l_phd, LOOKUP_RDE_EXACT, IPL$_ASTDEL);
00129 void * first=inadr->va_range_ps_start_va;
00130 void * last=inadr->va_range_ps_end_va;
00131 struct _pcb * p=ctl_gl_pcb;
00132 unsigned long numpages=(last-first)/PAGE_SIZE;
00133 int ret = mmg_credel(acmode, first, last, mmg$setprtpag, inadr, retadr, acmode, p, numpages);
00134 if (ret == SS__PAGTYPVIO)
00135 ret = SS__NOPRIV;
00136 if (ret == SS__NOSUCHPAG)
00137 ret = SS__ACCVIO;
00138 setipl(ipl);
00139 return ret;
00140 }
00141
00142 asmlinkage int exe_fault_page(void) {
00143
00144 }
00145
00146