diff options
| author | bunnei <bunneidev@gmail.com> | 2014-12-14 22:03:28 -0500 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2014-12-14 22:03:28 -0500 |
| commit | 17b4d6747a0185c30a5d7c5b90872a6daa3dbe99 (patch) | |
| tree | 096e29ba94d07ce7d390580f71f1893997cd1ec2 /src/core/hle/kernel/semaphore.h | |
| parent | 2cac148ff3415ba9b0b1aac8bd17a52e039f0ce9 (diff) | |
| parent | 1051795c329345ac6e08ac1d19024f56568b762d (diff) | |
Merge pull request #246 from Subv/cbranch_1
SVC: Implemented Semaphores
Diffstat (limited to 'src/core/hle/kernel/semaphore.h')
| -rw-r--r-- | src/core/hle/kernel/semaphore.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/core/hle/kernel/semaphore.h b/src/core/hle/kernel/semaphore.h new file mode 100644 index 000000000..f0075fdb8 --- /dev/null +++ b/src/core/hle/kernel/semaphore.h @@ -0,0 +1,32 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" + +#include "core/hle/kernel/kernel.h" + +namespace Kernel { + +/** + * Creates a semaphore. + * @param handle Pointer to the handle of the newly created object + * @param initial_count Number of slots reserved for other threads + * @param max_count Maximum number of slots the semaphore can have + * @param name Optional name of semaphore + * @return ResultCode of the error + */ +ResultCode CreateSemaphore(Handle* handle, u32 initial_count, u32 max_count, const std::string& name = "Unknown"); + +/** + * Releases a certain number of slots from a semaphore. + * @param count The number of free slots the semaphore had before this call + * @param handle The handle of the semaphore to release + * @param release_count The number of slots to release + * @return ResultCode of the error + */ +ResultCode ReleaseSemaphore(s32* count, Handle handle, s32 release_count); + +} // namespace |
