]> Chaos Git - corbenik/ctrulib.git/commitdiff
Added svcCreateAddressArbiter() and svcArbitrateAddress()
authormtheall <pigman46@gmail.com>
Thu, 20 Nov 2014 21:33:21 +0000 (15:33 -0600)
committermtheall <pigman46@gmail.com>
Thu, 20 Nov 2014 21:33:21 +0000 (15:33 -0600)
libctru/include/3ds/svc.h
libctru/source/svc.s

index 6e3ff60ce68edb4957768d501a4987fca01bdee7..0a023e25c9fc466af0d6999d26f79a7c18b4d309 100644 (file)
@@ -34,6 +34,14 @@ typedef struct {
     u32 flags;
 } PageInfo;
 
+typedef enum {
+       ARBITER_FREE           =0,
+       ARBITER_ACQUIRE        =1,
+       ARBITER_KERNEL2        =2,
+       ARBITER_ACQUIRE_TIMEOUT=3,
+       ARBITER_KERNEL4        =4,
+} ArbitrationType;
+
 
 u32* getThreadCommandBuffer(void);
 
@@ -55,6 +63,8 @@ s32  svcClearTimer(Handle timer);
 s32  svcCreateMemoryBlock(Handle* memblock, u32 addr, u32 size, MemPerm my_perm, MemPerm other_perm);
 s32  svcMapMemoryBlock(Handle memblock, u32 addr, MemPerm my_perm, MemPerm other_perm);
 s32  svcUnmapMemoryBlock(Handle memblock, u32 addr);
+s32  svcCreateAddressArbiter(Handle *arbiter);
+s32  svcArbitrateAddress(Handle arbiter, u32 addr, ArbitrationType type, s32 value, s64 nanoseconds);
 s32  svcWaitSynchronization(Handle handle, s64 nanoseconds);
 s32  svcWaitSynchronizationN(s32* out, Handle* handles, s32 handles_num, bool wait_all, s64 nanoseconds);
 s32  svcCloseHandle(Handle handle);
index 6dbddddd02394d60c46df7e7b83b188c28448fca..f918369956f06d32ee36c762f98a6844b97a2f0b 100644 (file)
@@ -153,6 +153,24 @@ svcUnmapMemoryBlock:
        svc 0x20
        bx lr
 
+.global svcCreateAddressArbiter
+.type svcCreateAddressArbiter, %function
+svcCreateAddressArbiter:
+       svc 0x21
+       bx lr
+
+.global svcArbitrateAddress
+.type svcArbitrateAddress, %function
+svcArbitrateAddress:
+       push {r4,r5}
+       add sp, #8
+       ldr r5, [sp]
+       ldr r4, [sp, #4]
+       sub sp, #8
+       svc 0x22
+       pop {r4,r5}
+       bx lr
+
 .global svcCloseHandle
 .type svcCloseHandle, %function
 svcCloseHandle: