summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/mutex.h
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-04-20 19:01:14 +0200
committerSubv <subv2112@gmail.com>2018-04-21 04:04:25 +0200
commite81a2080ebf9712231dd29c081141780ffd46cfb (patch)
treeb93d23dde3c3a0e86edeb44a1c1f1e18ac839bd6 /src/core/hle/kernel/mutex.h
parentMerge pull request #367 from lioncash/clamp (diff)
downloadyuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar.gz
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar.bz2
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar.lz
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar.xz
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.tar.zst
yuzu-e81a2080ebf9712231dd29c081141780ffd46cfb.zip
Diffstat (limited to 'src/core/hle/kernel/mutex.h')
-rw-r--r--src/core/hle/kernel/mutex.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h
index 38db21005..310923087 100644
--- a/src/core/hle/kernel/mutex.h
+++ b/src/core/hle/kernel/mutex.h
@@ -77,6 +77,18 @@ public:
/// Sets the has_waiters bit in the guest state.
void SetHasWaiters(bool has_waiters);
+ /// Flag that indicates that a mutex still has threads waiting for it.
+ static constexpr u32 MutexHasWaitersFlag = 0x40000000;
+ /// Mask of the bits in a mutex address value that contain the mutex owner.
+ static constexpr u32 MutexOwnerMask = 0xBFFFFFFF;
+
+ /// Attempts to acquire a mutex at the specified address.
+ static ResultCode TryAcquire(VAddr address, Handle holding_thread_handle,
+ Handle requesting_thread_handle);
+
+ /// Releases the mutex at the specified address.
+ static ResultCode Release(VAddr address);
+
private:
Mutex();
~Mutex() override;