00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include<linux/linkage.h>
00012 #include<linux/sched.h>
00013 #include<ssdef.h>
00014 #include<tqedef.h>
00015 #include<cpudef.h>
00016 #include<dyndef.h>
00017 #include<system_data_cells.h>
00018 #include <ipl.h>
00019 #include<internals.h>
00020 #include <statedef.h>
00021 #include<linux/vmalloc.h>
00022 #include<linux/smp.h>
00023 #include <linux/slab.h>
00024 #include <exe_routines.h>
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 asmlinkage int exe_setimr (unsigned int efn, signed long long *daytim,
00036 void (*astadr)(long), unsigned
00037 long reqidt, unsigned int flags) {
00038 unsigned long long time;
00039
00040
00041
00042
00043 struct _tqe * t=kmalloc(sizeof(struct _tqe),GFP_KERNEL);
00044 struct _cpu * cpu=smp_gl_cpu_data[smp_processor_id()];
00045 memset(t,0,sizeof(struct _tqe));
00046 t->tqe_b_type=DYN$C_TQE;
00047
00048 exe_clref(efn);
00049
00050
00051 if (flags) t->tqe_b_rqtype=TQE$M_CHK_CPUTIM;
00052 if (!daytim) return SS__ACCVIO;
00053
00054
00055 if (*daytim<0) {
00056 time=exe_gq_systime-*daytim;
00057 } else {
00058 time=*daytim;
00059 }
00060
00061
00062
00063 t->tqe_l_ast=astadr;
00064
00065 t->tqe_l_astprm=reqidt;
00066 t->tqe_q_time=time;
00067 t->tqe_b_rqtype=TQE$C_TMSNGL;
00068 t->tqe_l_pid=ctl$gl_pcb->pcb$l_pid;
00069 t->tqe_b_efn=efn;
00070
00071
00072 exe_instimq(t);
00073 }
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 asmlinkage int exe_schdwk(unsigned int *pidadr, void *prcnam, signed long long * daytim, signed long long * reptim) {
00084 struct _pcb * retpcb, *p;
00085 unsigned long retipid, retepid;
00086
00087 int sts=exe_nampid(current,pidadr,prcnam,&retpcb,&retipid,&retepid);
00088 p=retpcb;
00089
00090 vmsunlock(&SPIN_SCHED,0);
00091
00092 if (!p) return;
00093 {
00094 unsigned long long time;
00095
00096 struct _tqe * t=kmalloc(sizeof(struct _tqe),GFP_KERNEL);
00097 struct _cpu * cpu=smp_gl_cpu_data[smp_processor_id()];
00098 memset(t,0,sizeof(struct _tqe));
00099 t->tqe_b_type=DYN$C_TQE;
00100
00101 if (*daytim<0) {
00102
00103 time=exe_gq_systime-*daytim;
00104
00105 } else {
00106 time=*daytim;
00107 }
00108 t->tqe_l_pid=p->pcb$l_pid;
00109 t->tqe_q_time=time;
00110 if (reptim) t->tqe_q_delta=-(*reptim);
00111 t->tqe_b_rqtype=TQE$C_WKSNGL;
00112 if (reptim) t->tqe_b_rqtype|=TQE$M_REPEAT;
00113
00114
00115
00116 exe_instimq(t);
00117 }
00118
00119 }
00120
00121
00122