IOS_USB:101001CC MOV R1, #0
IOS_USB:101001D0 MOV R2, #3
IOS_USB:101001D4 LDR R0, =aUsb ; "USB"
IOS_USB:101001D8 BL sub_1012CE60
IOS_USB:101001DC ; ---------------------------------------------------------------------------
IOS_USB:101001DC LDR R2, =dword_10145000
IOS_USB:101001E0 MOV R1, #0x300000
IOS_USB:101001E4 STR R0, [R2]
IOS_USB:101001E8 LDR R0, =dword_10146060
IOS_USB:101001EC BL SysCall_0x24_IOS_USB ; int IOS_CreateLocalProcessHeap(void *ptr, int size)
IOS_USB:101001EC ; Create a new local process heap of size bytes
IOS_USB:101001EC ; Returns -> The heap ID or error (negative value)
IOS_USB:101001F0 ; ---------------------------------------------------------------------------
IOS_USB:101001F0 CMP R0, #0
IOS_USB:101001F4 BLT loc_1010027C
IOS_USB:101001F8 MOV R0, #0x20000
IOS_USB:101001FC BL SysCall_0x25_IOS_USB ; int IOS_CreateCrossProcessHeap(int size)
IOS_USB:101001FC ; Create a new cross process heap of size bytes
IOS_USB:101001FC ; Returns -> The heap ID or error (negative value)
IOS_USB:10100200 ; ---------------------------------------------------------------------------
IOS_USB:10100200 CMP R0, #0
IOS_USB:10100204 BLT loc_1010027C
IOS_USB:10100208 BL sub_1012E8BC
IOS_USB:1010020C LDR R0, =dword_10146010
IOS_USB:10100210 MOV R1, #0x10
IOS_USB:10100214 BL SysCall_0x0C_IOS_USB ; int IOS_CreateMessageQueue(u32 *ptr, u32 n_msgs)
IOS_USB:10100214 ; Create a queue at ptr, for n_msgs messages
IOS_USB:10100214 ; Returns -> The queue ID
IOS_USB:10100218 ; ---------------------------------------------------------------------------
IOS_USB:10100218 LDR R3, =dword_10146050
IOS_USB:1010021C CMP R0, #0
IOS_USB:10100220 STR R0, [R3]
IOS_USB:10100224 BLT loc_10100274
IOS_USB:10100228 MOV R1, R0
IOS_USB:1010022C LDR R0, =aDevUsbproc1 ; "/dev/usbproc1"
IOS_USB:10100230 BL sub_1012C618
IOS_USB:10100234 ; ---------------------------------------------------------------------------
IOS_USB:10100234 CMP R0, #0
IOS_USB:10100238 BLT loc_10100248
IOS_USB:1010023C LDR R0, =aDevUsbproc1 ; "/dev/usbproc1"
IOS_USB:10100240 MOV R1, #0x3E8
IOS_USB:10100244 BL SysCall_0x2D_IOS_USB ; int device_associate(const char* device, int internal_id)
IOS_USB:10100244 ; Associates a device to the specified internal IOS ID.
IOS_USB:10100244 ; This ID appears to correspond to the cos.xml permissions groupid?
; This syscall isn't used with devices that don't require any permissions(and are PowerPC-accessible) it seems.
; It appears when this ID isn't listed in the cos.xml groupids at all, the device is ARM-only.
IOS_USB:10100244 ; Returns -> 0 on success
IOS_USB:10100248 ; ---------------------------------------------------------------------------
IOS_USB:10100248
IOS_USB:10100248 loc_10100248 ; CODE XREF: IOS_USB:10100238j
IOS_USB:10100248 LDR R5, =dword_10146050
IOS_USB:1010024C LDR R0, =aDevUsbproc2 ; "/dev/usbproc2"
IOS_USB:10100250 LDR R1, [R5]
IOS_USB:10100254 BL sub_1012C618
IOS_USB:10100258 ; ---------------------------------------------------------------------------
IOS_USB:10100258 CMP R0, #0
IOS_USB:1010025C BLT loc_10100274
IOS_USB:10100260 LDR R0, =aDevUsbproc2 ; "/dev/usbproc2"
IOS_USB:10100264 MOV R1, #0x3E8
IOS_USB:10100268 BL SysCall_0x2D_IOS_USB ; int device_associate(const char* device, int internal_id)
IOS_USB:10100268 ; Associates a device to the specified internal IOS ID.
IOS_USB:10100268 ; This ID appears to correspond to the cos.xml permissions groupid? This syscall isn't used with devices that don't require any permissions(and are PowerPC-accessible) it seems. It appears when this ID isn't listed in the cos.xml groupids at all, the device is ARM-only.
IOS_USB:10100268 ; Returns -> 0 on success
IOS_USB:1010026C ; ---------------------------------------------------------------------------
IOS_USB:1010026C CMP R0, #0
IOS_USB:10100270 BEQ loc_1010056C
IOS_USB:10100274
IOS_USB:10100274 loc_10100274 ; CODE XREF: IOS_USB:10100224j
IOS_USB:10100274 ; IOS_USB:1010025Cj ...
IOS_USB:10100274 BL SysCall_0x03_IOS_USB ; int get_tid()
IOS_USB:10100274 ; Get the current thread's ID
IOS_USB:10100274 ; Returns -> Current threadid
IOS_USB:10100278 ; ---------------------------------------------------------------------------
IOS_USB:10100278 BL SysCall_0x08_IOS_USB ; int thread_suspend(int threadid)
IOS_USB:10100278 ; Suspend the specified thread
IOS_USB:10100278 ; Returns -> 0 on success
IOS_USB:1010027C ; ---------------------------------------------------------------------------
IOS_USB:1010027C
IOS_USB:1010027C loc_1010027C ; CODE XREF: IOS_USB:101001F4j
IOS_USB:1010027C ; IOS_USB:10100204j
IOS_USB:1010027C ADD SP, SP, #0x170
IOS_USB:10100280 LDMFD SP!, {R4-R11,PC}
IOS_USB:10100284 ; ---------------------------------------------------------------------------
IOS_USB:10100284
IOS_USB:10100284 loc_10100284 ; CODE XREF: IOS_USB:101005B4j
IOS_USB:10100284 CMP R2, #0xD
IOS_USB:10100288 BEQ loc_10100720
IOS_USB:1010028C CMP R2, #0x100
IOS_USB:10100290 BNE loc_101005C8
IOS_USB:10100294 LDR R0, =dword_10145020
IOS_USB:10100298 LDR R3, [R0]
IOS_USB:1010029C CMP R3, #0
IOS_USB:101002A0 BLT loc_1010056C
IOS_USB:101002A4 LDR R0, =0xCAFE
IOS_USB:101002A8 MOV R1, #0xC600
IOS_USB:101002AC MOV R2, #0x40
IOS_USB:101002B0 BL SysCall_0x28_IOS_USB ; void* heap_alloc_aligned(int heapid, u32 size, u32 align)
IOS_USB:101002B0 ; Allocate size bytes from the specified heap with the requested alignment
IOS_USB:101002B0 ; Returns -> Pointer to aligned memory
IOS_USB:101002B4 ; ---------------------------------------------------------------------------
IOS_USB:101002B4 SUBS R9, R0, #0
IOS_USB:101002B8 MOVEQ R6, R9
IOS_USB:101002BC MOVEQ R5, #0xFFFFFFEA
IOS_USB:101002C0 BEQ loc_10100534
IOS_USB:101002C4 LDR R0, =0xCAFE
IOS_USB:101002C8 MOV R1, #0xC600
IOS_USB:101002CC MOV R2, #0x40
IOS_USB:101002D0 BL SysCall_0x28_IOS_USB ; void* heap_alloc_aligned(int heapid, u32 size, u32 align)
IOS_USB:101002D0 ; Allocate size bytes from the specified heap with the requested alignment
IOS_USB:101002D0 ; Returns -> Pointer to aligned memory
IOS_USB:101002D4 ; ---------------------------------------------------------------------------