00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <linux/linkage.h>
00012 #include <linux/sched.h>
00013 #include <linux/smp.h>
00014 #include <cebdef.h>
00015 #include <pridef.h>
00016 #include <cpudef.h>
00017 #include <ssdef.h>
00018 #include <system_data_cells.h>
00019 #include <misc_routines.h>
00020 #include <sch_routines.h>
00021
00022 #undef MYDEB_EFC
00023 #define MYDEB_EFC
00024
00025
00026
00027
00028
00029
00030
00031 inline unsigned long * getefcp(struct _pcb * p, unsigned long efn) {
00032 return &p->pcb_l_efcs + ((efn&96)>>5);
00033 }
00034
00035 inline unsigned long * getefc(struct _pcb * p, unsigned long efn) {
00036 unsigned long * retval = &p->pcb_l_efcs + ((efn&96)>>5);
00037 if (efn<64)
00038 return retval;
00039 if (!retval)
00040 return 0;
00041 return &((struct _ceb *)(*retval))->ceb_l_efc;
00042 }
00043
00044 inline unsigned long * getefcno(unsigned long efn) {
00045 return ((efn&96)>>5);
00046 }
00047
00048 #ifdef MYDEB_EFC
00049 extern long efc[], efcc[];
00050 #endif
00051
00052
00053
00054
00055
00056
00057 asmlinkage int exe_clref(unsigned int efn) {
00058 int retval;
00059 struct _pcb * p=ctl_gl_pcb;
00060 #ifdef MYDEB_EFC
00061 {
00062 int pid=p->pcb_l_pid&31;
00063 efc[1024*pid+efcc[pid]]=0x80000000|efn;
00064 efcc[pid]++;
00065 long addr = &efn;
00066 addr-=4;
00067 efc[1024*pid+efcc[pid]]=*(long*)addr;
00068 efcc[pid]++;
00069 if (efcc[pid]>1000)
00070 efcc[pid]=0;
00071 }
00072 #endif
00073 int efncluster=(efn&224)>>5;
00074 unsigned long * clusteraddr;
00075 clusteraddr=getefc(p,efn);
00076 retval=test_and_clear_bit(efn&31,clusteraddr);
00077
00078 if (retval)
00079 return SS__WASSET;
00080 else
00081 return SS__WASCLR;
00082 }
00083
00084
00085
00086
00087
00088
00089
00090 asmlinkage int exe_readef(unsigned int efn, unsigned int *state) {
00091 struct _pcb * p=current;
00092 int efncluster=(efn&224)>>5;
00093 unsigned long * clusteraddr;
00094 clusteraddr=getefc(p,efn);
00095 *state=*clusteraddr;
00096 }
00097
00098
00099
00100
00101
00102
00103 asmlinkage int exe_setef(unsigned int efn) {
00104 struct _pcb * p=current;
00105 return sch_postef(p->pcb$l_pid,PRI$_IOCOM,efn);
00106 }
00107
00108