Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / unix / sysv / linux / aarch64 / syscall.S
blob3d4444a4e3ddfa45c4fd31ce86f3bb6573b70171
1 /* Copyright (C) 2005-2015 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
5    The GNU C Library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public License as
7    published by the Free Software Foundation; either version 2.1 of the
8    License, or (at your option) any later version.
10    The GNU C Library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Lesser General Public License for more details.
15    You should have received a copy of the GNU Lesser General Public
16    License along with the GNU C Library; if not, see
17    <http://www.gnu.org/licenses/>.  */
19 #include <sysdep.h>
21 /* syscall (int nr, ...)
23    AArch64 system calls take between 0 and 7 arguments. On entry here nr
24    is in w0 and any other system call arguments are in register x1..x7.
26    For kernel entry we need to move the system call nr to x8 then
27    load the remaining arguments to register. */
29 ENTRY (syscall)
30         uxtw    x8, w0
31         mov     x0, x1
32         mov     x1, x2
33         mov     x2, x3
34         mov     x3, x4
35         mov     x4, x5
36         mov     x5, x6
37         mov     x6, x7
38         svc     0x0
39         cmn     x0, #4095
40         b.cs    1f
41         RET
43         b       SYSCALL_ERROR
44 PSEUDO_END (syscall)