citra-emu/citra — pull request #246 by Subv (2014-12-04 00:23:11+00:00)
Title: [RFC] SVC: Implemented svcCreateSemaphore

ToDo: Implement svcReleaseSemaphore
Result ReleaseSemaphore(s32* count, Handle semaphore, s32 releaseCount)

* Some testing against hardware needed

This is not finished and hasn't been tested on real hardware yet, mainly because I'm rusty in my ARM asm.
The way I see it, the waiting threads should be notified (ResumeThreadFromWait) once svcReleaseSemaphore is called, however does svcReleaseSemaphore allow you to release all the held entries in a single call even if they were not all acquired by the current thread?
The count parameter in svcReleaseSemaphore probably returns the remaining number of held entries in the semaphore, needs verification though