00001
00002
00003
00004
00005
00006 #include<linux/linkage.h>
00007 #include<linux/vmalloc.h>
00008 #include<asm/current.h>
00009 #include<system_data_cells.h>
00010 #include<lckdef.h>
00011 #include<lckctxdef.h>
00012 #include<misc.h>
00013 #include<ssdef.h>
00014 #include<starlet.h>
00015 #include<ipldef.h>
00016 #include<rsbdef.h>
00017 #include<lkbdef.h>
00018 #include<pridef.h>
00019 #include<descrip.h>
00020 #include<cdrpdef.h>
00021 #include <exe_routines.h>
00022 #include<lkidef.h>
00023
00024 extern unsigned long lockidtbl[];
00025
00026 unsigned long lkiscan_id = 0;
00027
00028 int exe_lkiscan_next_id(void ** p, int * id) {
00029 int i;
00030 for(i = lkiscan_id; i < LOCKIDTBL && (lockidtbl[i] & 0xffff0000) == 0; i++) ;
00031 if (i == LOCKIDTBL) {
00032 lkiscan_id=0;
00033 return 0;
00034 }
00035 *p = lockidtbl[i];
00036 lkiscan_id++;
00037 return 1;
00038 }
00039
00040 asmlinkage int exe_getlki(unsigned long efn, unsigned long *lkidadr,void *itmlst, struct _iosb *iosb, void (*astadr)(), long astprm,unsigned long reserved) {
00041 struct item_list_3 * it=itmlst;
00042 struct _lkb * l;
00043 unsigned int id;
00044 int sts = exe_lkiscan_next_id ( &l, &id );
00045 if ( (sts & 1 ) == 0 )
00046 return sts;
00047
00048 while (it->item_code) {
00049 switch (it->item_code) {
00050 #if 0
00051 case LKI__NAMSPACE:
00052 memcpy(it->bufaddr, &l, sizeof(long));
00053 break;
00054 case LKI__RANGE:
00055 memcpy(it->bufaddr, &l->lkb_l_rsb, sizeof(long));
00056 break;
00057 #endif
00058 case LKI__RESNAM:
00059 memcpy(it->bufaddr, &l->lkb_l_rsb->rsb$t_resnam, 12);
00060 break;
00061 case LKI__LKID:
00062 memcpy(it->bufaddr, &id, sizeof(int));
00063 break;
00064 case LKI__PID:
00065 memcpy(it->bufaddr, &l->lkb_l_pid, 4);
00066 break;
00067 case LKI__BLOCKING:
00068 memcpy(it->bufaddr, &l->lkb_l_blkastadr, sizeof(long));
00069 break;
00070 case LKI__LOCKS:
00071 memcpy(it->bufaddr, &l->lkb_w_refcnt, 2);
00072 break;
00073 #if 0
00074 case LKI__BLOCKER_BR:
00075 memcpy(it->bufaddr, &l->lkb_b_rqmode, 1);
00076 break;
00077 case LKI__LOCKS_BR:
00078 memcpy(it->bufaddr, &l->lkb_b_grmode, 1);
00079 break;
00080 case LKI__MSTCSID:
00081 memcpy(it->bufaddr, &l->lkb_b_grmode, 1);
00082 break;
00083 case LKI__SYSTEM:
00084 memcpy(it->bufaddr, &l->lkb_b_rmod, 1);
00085 break;
00086 #endif
00087 #if 0
00088 case LKI__:
00089 memcpy(it->bufaddr, &l->lkb_l_, );
00090 break;
00091 #endif
00092 default:
00093 printk("getlki item_code %x not implemented\n",it->item_code);
00094 break;
00095 }
00096 it++;
00097 }
00098
00099 return sts;
00100 }
00101
00102 asmlinkage int exe_getlkiw(unsigned long efn, unsigned long *lkidadr,void *itmlst, struct _iosb *iosb, void (*astadr)(), long astprm,unsigned long reserved) {
00103 int status=exe_getlki(efn,lkidadr,itmlst,iosb,astadr,astprm,reserved);
00104 printk("\n\nremember to do like qiow\n\n");
00105 if ((status&1)==0) return status;
00106 return exe_synch(efn,iosb);
00107 }
00108
00109 asmlinkage int exe_getlkiw_wrap(struct struct_args * s) {
00110 return exe_getlkiw(s->s1,s->s2,s->s3,s->s4,s->s5,s->s6,s->s7);
00111 }
00112
00113 asmlinkage int exe_getlki_wrap(struct struct_args * s) {
00114 return exe_getlki(s->s1,s->s2,s->s3,s->s4,s->s5,s->s6,s->s7);
00115 }
00116
00117