xref: /qemu/linux-user/sparc/target_syscall.h (revision 5db05230)
1 #ifndef SPARC_TARGET_SYSCALL_H
2 #define SPARC_TARGET_SYSCALL_H
3 
4 #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
5 struct target_pt_regs {
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;
12 };
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
22 
23 #ifdef TARGET_SPARC64
24 # define UNAME_MACHINE "sparc64"
25 #else
26 # define UNAME_MACHINE "sparc"
27 #endif
28 #define UNAME_MINIMUM_RELEASE "2.6.32"
29 
30 /*
31  * SPARC kernels don't define this in their Kconfig, but they have the
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
37 #define TARGET_MCL_CURRENT 0x2000
38 #define TARGET_MCL_FUTURE  0x4000
39 #define TARGET_MCL_ONFAULT 0x8000
40 
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.
45  */
46 #define TARGET_FORCE_SHMLBA
47 
48 static inline abi_ulong target_shmlba(CPUSPARCState *env)
49 {
50 #ifdef TARGET_SPARC64
51     return MAX(TARGET_PAGE_SIZE, 16 * 1024);
52 #else
53     return 256 * 1024;
54 #endif
55 }
56 
57 #endif /* SPARC_TARGET_SYSCALL_H */
58