OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/client_osi/osiltype.h
00001 /*
00002  * Copyright (C) 1998, 1989 Transarc Corporation - All rights reserved
00003  *
00004  * (C) COPYRIGHT IBM CORPORATION 1987, 1988
00005  * LICENSED MATERIALS - PROPERTY OF IBM
00006  *
00007  */
00008 
00009 /* Copyright (C) 1994 Cazamar Systems, Inc. */
00010 
00011 #ifndef OPENAFS_WINNT_CLIENT_OSI_OSILTYPE_H
00012 #define OPENAFS_WINNT_CLIENT_OSI_OSILTYPE_H 1
00013 
00014 /* number of dynamic lock types we permit */
00015 #define OSI_NLOCKTYPES          32      /* should be enough */
00016 
00017 /* the set of procedures that we subclass to make a new lock
00018  * implementation.
00019  */
00020 typedef struct osi_lockOps {
00021         void (*ObtainReadProc)(struct osi_rwlock *);
00022         void (*ObtainWriteProc)(struct osi_rwlock *);
00023         void (*ReleaseReadProc)(struct osi_rwlock *);
00024         void (*ReleaseWriteProc)(struct osi_rwlock *);
00025         void (*ObtainMutexProc)(struct osi_mutex *);
00026         void (*ReleaseMutexProc)(struct osi_mutex *);
00027         int (*TryReadProc)(struct osi_rwlock *);
00028         int (*TryWriteProc)(struct osi_rwlock *);
00029         int (*TryMutexProc)(struct osi_mutex *);
00030         void (*SleepRProc)(LONG_PTR, struct osi_rwlock *);
00031         void (*SleepWProc)(LONG_PTR, struct osi_rwlock *);
00032         void (*SleepMProc)(LONG_PTR, struct osi_mutex *);
00033         void (*InitializeMutexProc)(struct osi_mutex *, char *, unsigned short);
00034         void (*InitializeRWLockProc)(struct osi_rwlock *, char *, unsigned short);
00035         void (*FinalizeMutexProc)(struct osi_mutex *);
00036         void (*FinalizeRWLockProc)(struct osi_rwlock *);
00037         void (*ConvertWToRProc)(struct osi_rwlock *);
00038         void (*ConvertRToWProc)(struct osi_rwlock *);
00039         int (*GetRWLockState)(struct osi_rwlock *);
00040         int (*GetMutexState)(struct osi_mutex *);
00041 } osi_lockOps_t;
00042 
00043 /* operation vectors for lock ops */
00044 extern osi_lockOps_t *osi_lockOps[OSI_NLOCKTYPES];
00045 
00046 extern int osi_lockTypeDefault;
00047 
00048 /* external procedures */
00049 void osi_LockTypeAdd(osi_lockOps_t *, char *, int *);
00050 
00051 int osi_LockTypeSetDefault(char *);
00052 
00053 /* bits for GetRWLockInfo and GetMutexInfo return values */
00054 #define OSI_MUTEX_HELD          1               /* mutex is held */
00055 #define OSI_RWLOCK_READHELD     1               /* locked for read */
00056 #define OSI_RWLOCK_WRITEHELD    2               /* locked for write */
00057 
00058 #endif /* OPENAFS_WINNT_CLIENT_OSI_OSILTYPE_H */
 All Data Structures Files Functions Variables