00001 #include<ipl.h>
00002 #include<spldef.h>
00003
00004 #undef VMSLOCK_DEBUG
00005 #define VMSLOCK_DEBUG
00006
00007 #ifdef VMSLOCK_DEBUG
00008 extern long locki;
00009 extern long locks[1024];
00010 #endif
00011
00012 void qhead_init(void * l);
00013
00014 inline int smp_acquire(struct _spl * spl);
00015 inline int smp_restore(struct _spl * spl);
00016
00017
00018
00019
00020
00021
00022
00023
00024 static int inline vmslock(struct _spl * lockname,signed int lockipl) {
00025 int savipl=getipl();
00026 if (lockipl>=0 && lockipl<=31) setipl(lockipl);
00027 smp_acquire(lockname);
00028 #ifdef VMSLOCK_DEBUG
00029 long x;
00030 long get_eip(long);
00031 locks[locki++]=get_eip(0);
00032 locks[locki++]=lockname;
00033 locks[locki++]=((long)&lockname)&0xfffff000;
00034 locks[locki++]=0;
00035 if (locki>1000)locki=0;
00036 #endif
00037 return savipl;
00038 }
00039
00040
00041
00042
00043
00044
00045
00046
00047 static void inline vmsunlock(struct _spl * lockname,signed int lockipl) {
00048 smp_restore(lockname);
00049 if (lockipl>=0 && lockipl<=31) setipl(lockipl);
00050 #ifdef VMSLOCK_DEBUG
00051 long x;
00052 long get_eip(long);
00053 locks[locki++]=get_eip(0);
00054 locks[locki++]=lockname;
00055 locks[locki++]=((long)&lockname)&0xfffff000;
00056 locks[locki++]=1;
00057 if (locki>1000)locki=0;
00058 #endif
00059 }
00060
00061