//
// Created by Fear1ess on 2021/3/31.
//

.global wd_syscall32
.extern wd_set_errno

.type wd_syscall32, %function

wd_syscall32:
    mov     ip, sp
    stmfd   sp!, {r4, r5, r6, r7}
    sub     r0, r0, #0xcd
    mov     r7, r0
    mov     r0, r1
    mov     r1, r2
    mov     r2, r3
    ldmfd   ip, {r3, r4, r5, r6}
    swi     #0
    ldmfd   sp!, {r4, r5, r6, r7}
    cmn     r0, #0x1000
    bxls    lr
    neg     r0, r0
    b       wd_set_errno

