summaryrefslogtreecommitdiffstats
path: root/pcilib/locking.h
diff options
context:
space:
mode:
authorzilio nicolas <nicolas.zilio@kit.edu>2015-07-10 10:52:06 +0200
committerzilio nicolas <nicolas.zilio@kit.edu>2015-07-10 10:52:06 +0200
commitedd5ccf24c146915ee475bd223e2ad695520a241 (patch)
treec856296a36226405050a467e22c9bd59fce6e4de /pcilib/locking.h
parentfe821c4f1b85d2a2d358da098f85327d41212dc3 (diff)
downloadpcitool-edd5ccf24c146915ee475bd223e2ad695520a241.tar.gz
pcitool-edd5ccf24c146915ee475bd223e2ad695520a241.tar.bz2
pcitool-edd5ccf24c146915ee475bd223e2ad695520a241.tar.xz
pcitool-edd5ccf24c146915ee475bd223e2ad695520a241.zip
last modification+comments update
Diffstat (limited to 'pcilib/locking.h')
-rw-r--r--pcilib/locking.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/pcilib/locking.h b/pcilib/locking.h
index f7570f6..3727380 100644
--- a/pcilib/locking.h
+++ b/pcilib/locking.h
@@ -16,8 +16,10 @@
/**size of one lock, determine so the size of the protocol_name in the way locks are registered. 40 bytes are necessary for the mutex structure, so we have a protocol name of length LOCK_SIZE-40*/
#define PCILIB_LOCK_SIZE 128
+/** number of locks per page of kernel memory*/
#define PCILIB_LOCKS_PER_PAGE PCILIB_KMEM_PAGE_SIZE/PCILIB_LOCK_SIZE
+/** number of pages allocated for locks in kernel memory*/
#define PCILIB_NUMBER_OF_LOCK_PAGES (PCILIB_MAX_NUMBER_LOCKS*PCILIB_LOCK_SIZE)/PCILIB_KMEM_PAGE_SIZE
@@ -38,7 +40,10 @@ void pcilib_clean_all_locks(pcilib_t* ctx);
*/
int pcilib_init_locking(pcilib_t* ctx, ...);
-
+/**
+ * this function destroys all locks and then free the kernel memory allocated for them before
+ * @param[in] ctx the pcilib_t running
+ */
void pcilib_free_all_locks(pcilib_t* ctx);
#endif /* _LOCK_GLOBAL_ */