]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added svcReleaseSemaphore and svcCreateSemaphore.
authorSubv <subv2112@gmail.com>
Thu, 4 Dec 2014 17:04:59 +0000 (12:04 -0500)
committerSubv <subv2112@gmail.com>
Fri, 5 Dec 2014 19:57:51 +0000 (14:57 -0500)
Tested.

libctru/include/3ds/svc.h
libctru/source/svc.s

index d498d45aafc9acfc7edc85a50329e03af0f5b577..733db1a3929142572e1b1838b54d2d2494433358 100644 (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);
index 2f2eb0e75529d85a41bbc7116c778d4f9fc80a10..3fac109e2ca986e8514038c93f8fe6bc6ffe02c8 100644 (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
\ No newline at end of file