2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00
criu/arch/arm/syscall-common.S
Alexander Kartashov 8fa8ca9feb arm: added ARM-specific files modelled after arch/x86
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-01-22 22:53:24 +04:00

53 lines
1010 B
ArmAsm

#include "asm/linkage.h"
.macro mov_r7 imm
mov %r7, #\imm
.endm
// Call the kernel
.macro do_sys opcode
movw %r7, #\opcode
svc #0
.endm
// a syscall with 0-4 arguments
.macro syscall0 name, opcode
ENTRY(\name)
push { %r7 }
do_sys \opcode
pop { %r7 }
bx %lr
END(\name)
.endm
// a syscall with 5 arguments
.macro syscall5 name, opcode
ENTRY(\name)
push { %r4, %r7 }
ldr %r4, [%sp, #8]
do_sys \opcode
pop { %r4, %r7 }
bx %lr
END(\name)
.endm
// a syscall with 6 arguments
.macro syscall6 name, opcode
ENTRY(\name)
push { %r4, %r5, %r7 }
ldr %r4, [%sp, #12]
ldr %r5, [%sp, #16]
do_sys \opcode
pop { %r4, %r5, %r7 }
bx %lr
END(\name)
.endm