00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include <ssdef.h>
00012 #include <starlet.h>
00013 #include <iosbdef.h>
00014 #include <exe_routines.h>
00015 #include <misc_routines.h>
00016
00017 #include<linux/linkage.h>
00018 #include<asm/unistd.h>
00019 #include "../../starlet/src/sysdep.h"
00020
00021
00022
00023
00024
00025
00026
00027 int exe_synch(unsigned int efn, struct _iosb *iosb) {
00028 if (!iosb) {
00029 sys_waitfr(efn);
00030 return SS__NORMAL;
00031 }
00032 if (iosb->iosb_w_status) {
00033 return SS__NORMAL;
00034 }
00035 again:
00036 sys_waitfr(efn);
00037 if (iosb->iosb_w_status & 0xff)
00038 return iosb->iosb_w_status;
00039 exe_clref(efn);
00040 goto again;
00041 }
00042
00043
00044
00045
00046
00047 int exe_clrast(void) {
00048 return cmod_astexit();
00049 #if 0
00050 printk("this does not work yet (how to implement?), and is strongly discouraged in real VMS too\n");
00051 #endif
00052 }
00053
00054 extern asmlinkage int exe_qio(unsigned int efn, unsigned short int chan,unsigned int func, struct _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6);
00055 extern asmlinkage int exe_qiow(unsigned int efn, unsigned short int chan,unsigned int func, struct _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6);
00056
00057 #ifdef __x86_64__
00058 void __set_errno(){}
00059 #endif
00060
00061 #ifdef __x86_64__
00062 static int syscall_struct() {}
00063 #endif
00064
00065 #if (defined __i386__) || (defined __x86_64__)
00066 int sys_qio(unsigned int efn, unsigned short int chan,unsigned int func, struct _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6) {
00067 struct struct_qio s;
00068 s.efn=efn;
00069 s.chan=chan;
00070 s.func=func;
00071 s.iosb=iosb;
00072 s.astadr=astadr;
00073 s.astprm=astprm;
00074 s.p1=p1;
00075 s.p2=p2;
00076 s.p3=p3;
00077 s.p4=p4;
00078 s.p5=p5;
00079 s.p6=p6;
00080
00081 #ifdef __x86_64__
00082 syscall_struct();
00083 #endif
00084 return INLINE_SYSCALL(_qio,1,&s);
00085 }
00086
00087 int sys_qiow(unsigned int efn, unsigned short int chan,unsigned int func, struct _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6) {
00088 struct struct_qio s;
00089 s.efn=efn;
00090 s.chan=chan;
00091 s.func=func;
00092 s.iosb=iosb;
00093 s.astadr=astadr;
00094 s.astprm=astprm;
00095 s.p1=p1;
00096 s.p2=p2;
00097 s.p3=p3;
00098 s.p4=p4;
00099 s.p5=p5;
00100 s.p6=p6;
00101
00102 #ifdef __x86_64__
00103 syscall_struct();
00104 #endif
00105 return INLINE_SYSCALL(_qiow,1,&s);
00106 }
00107
00108 int sys_waitfr(unsigned int efn) {
00109 return INLINE_SYSCALL(_waitfr,1,efn);
00110 }
00111
00112 int sys_hiber(void) {
00113 return INLINE_SYSCALL(_hiber,0);
00114 }
00115
00116 int sys_dclast(void (*astadr)(__unknown_params), unsigned long astprm, unsigned int acmode) {
00117 return INLINE_SYSCALL(_dclast,3,astadr,astprm,acmode);
00118 }
00119
00120 int sys_setast(char enbflg) {
00121 return INLINE_SYSCALL(_setast,1,((unsigned long)enbflg));
00122 }
00123
00124 int sys_dassgn(unsigned short int chan) {
00125 return INLINE_SYSCALL(_dassgn,1,chan);
00126 }
00127
00128 int sys_clrast() {
00129 return INLINE_SYSCALL(_clrast,0);
00130 }
00131
00132 int sys_assign(void *devnam, unsigned short int *chan,unsigned int acmode, void *mbxnam,int flags) {
00133 return INLINE_SYSCALL(_assign,5,devnam,chan,acmode,mbxnam,flags);
00134 }
00135
00136 int sys_trnlnm (unsigned int *attr, void *tabnam, void
00137 *lognam, unsigned char *acmode, void *itmlst) {
00138 return INLINE_SYSCALL(_trnlnm,5,attr,tabnam,lognam,acmode,itmlst);
00139 }
00140
00141 int sys_cmkrnl(int (*routin)(), unsigned int *arglst) {
00142 return INLINE_SYSCALL(_cmkrnl,2,routin,arglst);
00143 }
00144
00145 int sys_enq (unsigned int efn, unsigned int lkmode, struct _lksb *lksb, unsigned int flags, void *resnam, unsigned int parid, void (*astadr)(), unsigned long astprm, void (*blkastadr)(), unsigned int acmode, unsigned int rsdm_id) {
00146 struct struct_args s;
00147 s.s1=efn;
00148 s.s2=lkmode;
00149 s.s3=lksb;
00150 s.s4=flags;
00151 s.s5=resnam;
00152 s.s6=parid;
00153 s.s7=astadr;
00154 s.s8=astprm;
00155 s.s9=blkastadr;
00156 s.s10=acmode;
00157 s.s11=rsdm_id;
00158
00159 #ifdef __x86_64__
00160 syscall_struct();
00161 #endif
00162 return INLINE_SYSCALL(_enq,1,&s);
00163 }
00164
00165 int sys_enqw (unsigned int efn, unsigned int lkmode, struct _lksb *lksb, unsigned int flags, void *resnam, unsigned int parid, void (*astadr)(), unsigned long astprm, void (*blkastadr)(), unsigned int acmode, unsigned int rsdm_id) {
00166 struct struct_args s;
00167 s.s1=efn;
00168 s.s2=lkmode;
00169 s.s3=lksb;
00170 s.s4=flags;
00171 s.s5=resnam;
00172 s.s6=parid;
00173 s.s7=astadr;
00174 s.s8=astprm;
00175 s.s9=blkastadr;
00176 s.s10=acmode;
00177 s.s11=rsdm_id;
00178
00179 #ifdef __x86_64__
00180 syscall_struct();
00181 #endif
00182 return INLINE_SYSCALL(_enqw,1,&s);
00183 }
00184
00185 int sys_deq(unsigned int lkid, void *valblk, unsigned int acmode, unsigned int flags) {
00186 return INLINE_SYSCALL(_deq,4,lkid,valblk,acmode,flags);
00187 }
00188 #endif
00189
00190 #ifdef __arch_um__
00191 int sys_qio(unsigned int efn, unsigned short int chan,unsigned int func, struct
00192 _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6) {
00193 int sts;
00194 struct struct_qio s;
00195 s.efn=efn;
00196 s.chan=chan;
00197 s.func=func;
00198 s.iosb=iosb;
00199 s.astadr=astadr;
00200 s.astprm=astprm;
00201 s.p1=p1;
00202 s.p2=p2;
00203 s.p3=p3;
00204 s.p4=p4;
00205 s.p5=p5;
00206 s.p6=p6;
00207
00208
00209 pushpsl();
00210 sts=exe_qio(efn,chan,func,iosb,astadr,astprm,p1,p2,p3,p4,p5,p6);
00211 myrei();
00212 return sts;
00213 }
00214
00215 int sys_qiow(unsigned int efn, unsigned short int chan,unsigned int func, struct
00216 _iosb *iosb, void(*astadr)(__unknown_params), long astprm, void*p1, long p2, long p3, long p4, long p5, long p6) {
00217 int sts;
00218 struct struct_qio s;
00219 s.efn=efn;
00220 s.chan=chan;
00221 s.func=func;
00222 s.iosb=iosb;
00223 s.astadr=astadr;
00224 s.astprm=astprm;
00225 s.p1=p1;
00226 s.p2=p2;
00227 s.p3=p3;
00228 s.p4=p4;
00229 s.p5=p5;
00230 s.p6=p6;
00231
00232
00233 pushpsl();
00234 sts=exe_qiow(efn,chan,func,iosb,astadr,astprm,p1,p2,p3,p4,p5,p6);
00235 myrei();
00236 return sts;
00237 }
00238
00239 int sys_waitfr(unsigned int efn) {
00240 int sts;
00241 pushpsl();
00242 sts=exe_waitfr(efn);
00243 myrei();
00244 return sts;
00245 }
00246
00247 int sys_hiber(void) {
00248 int sts;
00249 pushpsl();
00250 sts=exe_hiber();
00251 myrei();
00252 return sts;
00253 }
00254
00255 int sys_dclast(void (*astadr)(__unknown_params), unsigned long astprm, unsigned int acmode) {
00256 int sts;
00257 pushpsl();
00258 sts=exe_dclast(astadr,astprm,acmode);
00259 myrei();
00260 return sts;
00261 }
00262 #endif
00263
00264
00265
00266 asmlinkage void exe_cmkrnl_not(int (*routine)(),int * args) {
00267
00268
00269
00270
00271
00272 }
00273
00274 asmlinkage void exe_cmexec_not(int (*routine)(),int * args) {
00275
00276
00277
00278
00279
00280 }
00281
00282