diff --git a/source/lock.h b/source/lock.h index 304761d..8b205fd 100644 --- a/source/lock.h +++ b/source/lock.h @@ -51,6 +51,43 @@ static inline void _NTFS_unlock(mutex_t *mutex) { LWP_MutexUnlock(*mutex); } +/* //not working. +#elif defined(__wiiu__) +#ifndef mutex_t +typedef int mutex_t; +#endif + +#define OS_MUTEX_SIZE 44 + +extern void (* OSInitMutex)(void* mutex); +extern void (* OSLockMutex)(void* mutex); +extern void (* OSUnlockMutex)(void* mutex); +extern void (* OSFatal)(const char *msg); + +static inline void _NTFS_lock_init(mutex_t *mutex,int unkwn){ + void* new_mutex = malloc(OS_MUTEX_SIZE); + if(new_mutex == NULL){ + OSFatal("_NTFS_lock_init malloc fail"); + } + + *mutex = (mutex_t) new_mutex; + OSInitMutex(new_mutex); +} + +static inline void _NTFS_lock_deinit(mutex_t *mutex){ + free((void*)(*mutex)); + *mutex = 0; +} + +static inline void _NTFS_lock(mutex_t *mutex) +{ + OSLockMutex((void*)*mutex); +} + +static inline void _NTFS_unlock(mutex_t *mutex) +{ + OSUnlockMutex((void*)*mutex); +}*/ #else diff --git a/source/ntfsinternal.h b/source/ntfsinternal.h index a8debd4..5de7add 100644 --- a/source/ntfsinternal.h +++ b/source/ntfsinternal.h @@ -152,13 +152,13 @@ typedef struct _ntfs_vd { /* Lock volume */ static inline void ntfsLock (ntfs_vd *vd) { - _NTFS_lock((mutex_t *)vd->lock); + _NTFS_lock((mutex_t *)&vd->lock); } /* Unlock volume */ static inline void ntfsUnlock (ntfs_vd *vd) { - _NTFS_unlock((mutex_t *)vd->lock); + _NTFS_unlock((mutex_t *)&vd->lock); } /* Gekko device related routines */