From 876bc538e44b94677c844bf8368143f0277f9765 Mon Sep 17 00:00:00 2001 From: wntrmute Date: Sun, 16 May 2010 11:17:43 +0000 Subject: [PATCH] add overridable locking functions git-svn-id: https://devkitpro.svn.sourceforge.net/svnroot/devkitpro/trunk/libfat@4101 258c5a1a-4f63-435d-9564-e8f6d34ab52c --- source/lock.c | 29 +++++++++++++++++++++++++++++ source/lock.h | 23 ++++------------------- 2 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 source/lock.c diff --git a/source/lock.c b/source/lock.c new file mode 100644 index 0000000..59c3444 --- /dev/null +++ b/source/lock.c @@ -0,0 +1,29 @@ +#include "common.h" + +#ifndef USE_LWP_LOCK + +#ifndef mutex_t +typedef int mutex_t; +#endif + +void __attribute__ ((weak)) _FAT_lock_init(mutex_t *mutex) +{ + return; +} + +void __attribute__ ((weak)) _FAT_lock_deinit(mutex_t *mutex) +{ + return; +} + +void __attribute__ ((weak)) _FAT_lock(mutex_t *mutex) +{ + return; +} + +void __attribute__ ((weak)) _FAT_unlock(mutex_t *mutex) +{ + return; +} + +#endif // USE_LWP_LOCK diff --git a/source/lock.h b/source/lock.h index a93194c..de5723a 100644 --- a/source/lock.h +++ b/source/lock.h @@ -60,25 +60,10 @@ static inline void _FAT_unlock(mutex_t *mutex) typedef int mutex_t; #endif -static inline void _FAT_lock_init(mutex_t *mutex) -{ - return; -} - -static inline void _FAT_lock_deinit(mutex_t *mutex) -{ - return; -} - -static inline void _FAT_lock(mutex_t *mutex) -{ - return; -} - -static inline void _FAT_unlock(mutex_t *mutex) -{ - return; -} +void _FAT_lock_init(mutex_t *mutex); +void _FAT_lock_deinit(mutex_t *mutex); +void _FAT_lock(mutex_t *mutex); +void _FAT_unlock(mutex_t *mutex); #endif // USE_LWP_LOCK -- 2.11.4.GIT