tanya/arch/x64/linux/syscall.S

66 lines
1.1 KiB
ArmAsm
Raw Normal View History

2017-09-08 19:52:17 +02:00
/*
The kernel uses the following registers:
%rdi, %rsi, %rdx, %r8, %r9, %r10
The number of the syscall is passed in %rax.
A syscall clobbers:
%rax, %rcx, %r11
The returned value is placed in %rax.
*/
.text
2018-09-01 09:56:44 +02:00
// 1 parameter.
.globl _D5tanya3sys5linux7syscallQiFNbNillZl
.type _D5tanya3sys5linux7syscallQiFNbNillZl, @function
2017-09-08 19:52:17 +02:00
2018-09-01 09:56:44 +02:00
_D5tanya3sys5linux7syscallQiFNbNillZl:
2017-09-08 19:52:17 +02:00
movq %rsi, %rax // Syscall number.
syscall
ret
2018-04-22 08:07:20 +02:00
// 2 parameters.
.globl _D5tanya3sys5linux7syscallQiFNbNilllZl
.type _D5tanya3sys5linux7syscallQiFNbNilllZl, @function
2017-09-08 19:52:17 +02:00
_D5tanya3sys5linux7syscallQiFNbNilllZl:
2018-04-22 08:07:20 +02:00
movq %rdx, %rax
2017-09-08 19:52:17 +02:00
syscall
ret
// 3 parameters.
.globl _D5tanya3sys5linux7syscallQiFNbNillllZl
.type _D5tanya3sys5linux7syscallQiFNbNillllZl, @function
_D5tanya3sys5linux7syscallQiFNbNillllZl:
movq %rcx, %rax
syscall
ret
2018-04-22 08:07:20 +02:00
// 6 parameters.
.globl _D5tanya3sys5linux7syscallQiFNbNilllllllZl
.type _D5tanya3sys5linux7syscallQiFNbNilllllllZl, @function
2017-09-08 19:52:17 +02:00
_D5tanya3sys5linux7syscallQiFNbNilllllllZl:
2018-04-22 08:07:20 +02:00
pushq %rbp
movq %rsp, %rbp
2017-09-08 19:52:17 +02:00
2018-04-22 08:07:20 +02:00
movq 16(%rbp), %rax
2017-09-08 19:52:17 +02:00
2018-04-22 08:07:20 +02:00
mov %rcx, %r10
2017-09-08 19:52:17 +02:00
syscall
2018-04-22 08:07:20 +02:00
leave
2017-09-08 19:52:17 +02:00
ret