Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2605 → Rev 2606

/trunk/uspace/lib/libc/arch/amd64/src/fibril.S
80,7 → 80,7
 
# Set thread local storage
movq OFFSET_TLS(%rdi), %rdi # Set arg1 to TLS addr
movq $1, %r8
movq $1, %rax # SYS_TLS_SET
syscall
 
xorq %rax,%rax # context_restore returns 0
/trunk/uspace/lib/libc/arch/amd64/src/syscall.S
28,13 → 28,30
 
.text
.globl __syscall
 
.global __syscall
## Make a system call.
#
# @param rdi First argument.
# @param rsi Second argument.
# @param rdx Third argument.
# @param rcx Fourth argument.
# @param r8 Fifth argument.
# @param r9 Sixth argument.
# @param 8(%rsp) Syscall number.
#
# @return The return value will be stored in RAX.
#
__syscall:
# rcx gets rewritten on syscall
movq %rcx, %r9
#
# Move the syscall number into RAX.
movslq 8(%rsp), %rax
 
#
# Save RCX, the 4th argument, aside because RCX gets rewritten by the
# SYSCALL instruction.
#
movq %rcx, %r10
syscall
ret
.end __syscall