| 1 | /* |
| 2 | * ARM AArch64 specific CPU for bsd-user |
| 3 | * |
| 4 | * Copyright (c) 2015 Stacey D. Son |
| 5 | * |
| 6 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | */ |
| 8 | #ifndef BSD_USER_AARCH64_TARGET_SYSCALL_H |
| 9 | #define BSD_USER_AARCH64_TARGET_SYSCALL_H |
| 10 | |
| 11 | /* |
| 12 | * The aarch64 registers are named: |
| 13 | * |
| 14 | * x0 through x30 - for 64-bit-wide access (same registers) |
| 15 | * Register '31' is one of two registers depending on the instruction context: |
| 16 | * For instructions dealing with the stack, it is the stack pointer, named rsp |
| 17 | * For all other instructions, it is a "zero" register, which returns 0 when |
| 18 | * read and discards data when written - named rzr (xzr, wzr) |
| 19 | * |
| 20 | * Usage during syscall/function call: |
| 21 | * r0-r7 are used for arguments and return values |
| 22 | * For syscalls, the syscall number is in r8 |
| 23 | * r9-r15 are for temporary values (may get trampled) |
| 24 | * r16-r18 are used for intra-procedure-call and platform values (avoid) |
| 25 | * The called routine is expected to preserve r19-r28 |
| 26 | * r29 and r30 are used as the frame register and link register (avoid) |
| 27 | * See the ARM Procedure Call Reference for details. |
| 28 | */ |
| 29 | struct target_pt_regs { |
| 30 | uint64_t regs[31]; |
| 31 | uint64_t sp; |
| 32 | uint64_t pc; |
| 33 | uint64_t pstate; |
| 34 | }; |
| 35 | |
| 36 | #define TARGET_HW_MACHINE "arm64" |
| 37 | #define TARGET_HW_MACHINE_ARCH "aarch64" |
| 38 | |
| 39 | #endif /* BSD_USER_AARCH64_TARGET_SYSCALL_H */ |