Added svcReleaseSemaphore and svcCreateSemaphore.

Tested.
This commit is contained in:
Subv 2014-12-04 12:04:59 -05:00
parent 6a195608aa
commit a85c6edfaa
2 changed files with 20 additions and 0 deletions

View File

@ -62,6 +62,8 @@ void svcSleepThread(s64 ns);
s32 svcSetThreadPriority(Handle thread, s32 prio);
s32 svcCreateMutex(Handle* mutex, bool initially_locked);
s32 svcReleaseMutex(Handle handle);
s32 svcCreateSemaphore(Handle* semaphore, s32 initial_count, s32 max_count);
s32 svcReleaseSemaphore(s32* count, Handle semaphore, s32 release_count);
s32 svcCreateEvent(Handle* event, u8 reset_type);
s32 svcSignalEvent(Handle handle);
s32 svcClearEvent(Handle handle);

View File

@ -264,3 +264,21 @@ svcOutputDebugString:
ldr r2, [sp], #4
str r1, [r2]
bx lr
.global svcCreateSemaphore
.type svcCreateSemaphore, %function
svcCreateSemaphore:
push {r0}
svc 0x15
pop {r3}
str r1, [r3]
bx lr
.global svcReleaseSemaphore
.type svcReleaseSemaphore, %function
svcReleaseSemaphore:
push {r0}
svc 0x16
pop {r3}
str r1, [r3]
bx lr