Markus Armbruster | 3622634 | 2016-06-29 10:47:26 +0200 | [diff] [blame] | 1 | #ifndef SPARC_TARGET_SYSCALL_H |
| 2 | #define SPARC_TARGET_SYSCALL_H |
Lluís Vilanova | 460c579 | 2016-02-01 19:38:42 +0100 | [diff] [blame] | 3 | |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 4 | #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) |
bellard | 7a3f194 | 2003-09-30 20:36:07 +0000 | [diff] [blame] | 5 | struct target_pt_regs { |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 6 | abi_ulong u_regs[16]; |
| 7 | abi_ulong tstate; |
| 8 | abi_ulong pc; |
| 9 | abi_ulong npc; |
| 10 | uint32_t y; |
| 11 | uint32_t magic; |
bellard | 7a3f194 | 2003-09-30 20:36:07 +0000 | [diff] [blame] | 12 | }; |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 13 | #else |
| 14 | struct target_pt_regs { |
| 15 | abi_ulong psr; |
| 16 | abi_ulong pc; |
| 17 | abi_ulong npc; |
| 18 | abi_ulong y; |
| 19 | abi_ulong u_regs[16]; |
| 20 | }; |
| 21 | #endif |
bellard | cf720db | 2004-09-13 21:41:39 +0000 | [diff] [blame] | 22 | |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 23 | #ifdef TARGET_SPARC64 |
| 24 | # define UNAME_MACHINE "sparc64" |
| 25 | #else |
| 26 | # define UNAME_MACHINE "sparc" |
| 27 | #endif |
Riku Voipio | cbc14e6 | 2014-02-19 14:50:41 +0200 | [diff] [blame] | 28 | #define UNAME_MINIMUM_RELEASE "2.6.32" |
Peter Maydell | 4ce6243 | 2013-07-16 18:44:57 +0100 | [diff] [blame] | 29 | |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 30 | /* |
| 31 | * SPARC kernels don't define this in their Kconfig, but they have the |
Peter Maydell | 4ce6243 | 2013-07-16 18:44:57 +0100 | [diff] [blame] | 32 | * same ABI as if they did, implemented by sparc-specific code which fishes |
| 33 | * directly in the u_regs() struct for half the parameters in sparc_do_fork() |
| 34 | * and copy_thread(). |
| 35 | */ |
| 36 | #define TARGET_CLONE_BACKWARDS |
Filip Bozuta | 02e5d7d | 2020-08-11 18:45:51 +0200 | [diff] [blame] | 37 | #define TARGET_MCL_CURRENT 0x2000 |
| 38 | #define TARGET_MCL_FUTURE 0x4000 |
| 39 | #define TARGET_MCL_ONFAULT 0x8000 |
Lluís Vilanova | 460c579 | 2016-02-01 19:38:42 +0100 | [diff] [blame] | 40 | |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 41 | /* |
| 42 | * For SPARC SHMLBA is determined at runtime in the kernel, and |
| 43 | * libc has to runtime-detect it using the hwcaps. |
| 44 | * See glibc sysdeps/unix/sysv/linux/sparc/getshmlba. |
Peter Maydell | ee8e761 | 2016-07-11 16:48:11 +0100 | [diff] [blame] | 45 | */ |
| 46 | #define TARGET_FORCE_SHMLBA |
| 47 | |
| 48 | static inline abi_ulong target_shmlba(CPUSPARCState *env) |
| 49 | { |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 50 | #ifdef TARGET_SPARC64 |
| 51 | return MAX(TARGET_PAGE_SIZE, 16 * 1024); |
| 52 | #else |
Igor Mammedov | 576e1c4 | 2017-08-24 18:31:26 +0200 | [diff] [blame] | 53 | if (!(env->def.features & CPU_FEATURE_FLUSH)) { |
Peter Maydell | ee8e761 | 2016-07-11 16:48:11 +0100 | [diff] [blame] | 54 | return 64 * 1024; |
| 55 | } else { |
| 56 | return 256 * 1024; |
| 57 | } |
Richard Henderson | 2f23eec | 2021-04-25 19:53:16 -0700 | [diff] [blame] | 58 | #endif |
Peter Maydell | ee8e761 | 2016-07-11 16:48:11 +0100 | [diff] [blame] | 59 | } |
| 60 | |
Markus Armbruster | 3622634 | 2016-06-29 10:47:26 +0200 | [diff] [blame] | 61 | #endif /* SPARC_TARGET_SYSCALL_H */ |