00001
00002
00003
00004
00005
00006 #include<linux/linkage.h>
00007 #include<linux/sched.h>
00008 #include<phddef.h>
00009 #include<system_data_cells.h>
00010 #include<va_rangedef.h>
00011 #include<wsldef.h>
00012
00013 int mm_in_range(struct _va_range *inadr, void *address) {
00014 address=((unsigned long)address)&0xfffffe00;
00015 if (address>=inadr->va_range_ps_start_va && address<=inadr->va_range$ps_end_va) return 1;
00016 else
00017 return 0;
00018 }
00019
00020 int mm_common_lock(struct _va_range *inadr,int mask,int set) {
00021 struct _pcb * p=ctl_gl_pcb;
00022 struct _wsl * wsl=p->pcb_l_phd->phd$l_wslist;
00023 int i;
00024 if (set) {
00025 for(i=0;i<512;i++)
00026 if (mm_in_range(inadr,wsl[i].wsl_pq_va)) wsl[i].wsl$pq_va=(unsigned long)wsl[i].wsl$pq_va|mask;
00027 } else {
00028 for(i=0;i<512;i++)
00029 if (mm_in_range(inadr,wsl[i].wsl_pq_va)) wsl[i].wsl$pq_va=(unsigned long)wsl[i].wsl$pq_va&~mask;
00030 }
00031 return 1;
00032 }
00033
00034 asmlinkage int exe_lkwset(struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode) {
00035 return mm_common_lock(inadr, WSL_M_WSLOCK, 1);
00036 }
00037
00038 asmlinkage int exe_lckpag(struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode) {
00039 return mm_common_lock(inadr, WSL_M_PFNLOCK, 1);
00040 }
00041
00042 asmlinkage int exe_ulwset(struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode) {
00043 return mm_common_lock(inadr, WSL_M_WSLOCK, 0);
00044 }
00045
00046 asmlinkage int exe_ulkpag(struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode) {
00047 return mm_common_lock(inadr, WSL_M_PFNLOCK, 0);
00048 }
00049