2 * ARM AArch64 specific CPU for bsd-user
4 * Copyright (c) 2015 Stacey D. Son <sson at Freebsd>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef BSD_USER_AARCH64_TARGET_SYSCALL_H
21 #define BSD_USER_AARCH64_TARGET_SYSCALL_H
24 * The aarch64 registers are named:
26 * x0 through x30 - for 64-bit-wide access (same registers)
27 * Register '31' is one of two registers depending on the instruction context:
28 * For instructions dealing with the stack, it is the stack pointer, named rsp
29 * For all other instructions, it is a "zero" register, which returns 0 when
30 * read and discards data when written - named rzr (xzr, wzr)
32 * Usage during syscall/function call:
33 * r0-r7 are used for arguments and return values
34 * For syscalls, the syscall number is in r8
35 * r9-r15 are for temporary values (may get trampled)
36 * r16-r18 are used for intra-procedure-call and platform values (avoid)
37 * The called routine is expected to preserve r19-r28
38 * r29 and r30 are used as the frame register and link register (avoid)
39 * See the ARM Procedure Call Reference for details.
41 struct target_pt_regs
{
48 #define TARGET_HW_MACHINE "arm64"
49 #define TARGET_HW_MACHINE_ARCH "aarch64"
51 #endif /* BSD_USER_AARCH64_TARGET_SYSCALL_H */