xref: /qemu/linux-user/sparc/target_syscall.h (revision c60be6e3e38cb36dc66129e757ec4b34152232be)
13622634bSMarkus Armbruster #ifndef SPARC_TARGET_SYSCALL_H
23622634bSMarkus Armbruster #define SPARC_TARGET_SYSCALL_H
3460c579fSLluís Vilanova 
4*2f23eec6SRichard Henderson #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
5*2f23eec6SRichard Henderson struct target_pt_regs {
6*2f23eec6SRichard Henderson     abi_ulong u_regs[16];
7*2f23eec6SRichard Henderson     abi_ulong tstate;
8*2f23eec6SRichard Henderson     abi_ulong pc;
9*2f23eec6SRichard Henderson     abi_ulong npc;
10*2f23eec6SRichard Henderson     uint32_t y;
11*2f23eec6SRichard Henderson     uint32_t magic;
12*2f23eec6SRichard Henderson };
13*2f23eec6SRichard Henderson #else
147a3f1944Sbellard struct target_pt_regs {
15992f48a0Sblueswir1     abi_ulong psr;
16992f48a0Sblueswir1     abi_ulong pc;
17992f48a0Sblueswir1     abi_ulong npc;
18992f48a0Sblueswir1     abi_ulong y;
19992f48a0Sblueswir1     abi_ulong u_regs[16];
207a3f1944Sbellard };
21*2f23eec6SRichard Henderson #endif
22cf720db3Sbellard 
23*2f23eec6SRichard Henderson #ifdef TARGET_SPARC64
24*2f23eec6SRichard Henderson # define UNAME_MACHINE "sparc64"
25*2f23eec6SRichard Henderson #else
269a93c152SLaurent Vivier # define UNAME_MACHINE "sparc"
27*2f23eec6SRichard Henderson #endif
28cbc14e6fSRiku Voipio #define UNAME_MINIMUM_RELEASE "2.6.32"
294ce6243dSPeter Maydell 
30*2f23eec6SRichard Henderson /*
31*2f23eec6SRichard Henderson  * SPARC kernels don't define this in their Kconfig, but they have the
324ce6243dSPeter Maydell  * same ABI as if they did, implemented by sparc-specific code which fishes
334ce6243dSPeter Maydell  * directly in the u_regs() struct for half the parameters in sparc_do_fork()
344ce6243dSPeter Maydell  * and copy_thread().
354ce6243dSPeter Maydell  */
364ce6243dSPeter Maydell #define TARGET_CLONE_BACKWARDS
3702e5d7d7SFilip Bozuta #define TARGET_MCL_CURRENT 0x2000
3802e5d7d7SFilip Bozuta #define TARGET_MCL_FUTURE  0x4000
3902e5d7d7SFilip Bozuta #define TARGET_MCL_ONFAULT 0x8000
40460c579fSLluís Vilanova 
41*2f23eec6SRichard Henderson /*
42*2f23eec6SRichard Henderson  * For SPARC SHMLBA is determined at runtime in the kernel, and
43*2f23eec6SRichard Henderson  * libc has to runtime-detect it using the hwcaps.
44*2f23eec6SRichard Henderson  * See glibc sysdeps/unix/sysv/linux/sparc/getshmlba.
45ee8e7614SPeter Maydell  */
46ee8e7614SPeter Maydell #define TARGET_FORCE_SHMLBA
47ee8e7614SPeter Maydell 
target_shmlba(CPUSPARCState * env)48ee8e7614SPeter Maydell static inline abi_ulong target_shmlba(CPUSPARCState *env)
49ee8e7614SPeter Maydell {
50*2f23eec6SRichard Henderson #ifdef TARGET_SPARC64
51*2f23eec6SRichard Henderson     return MAX(TARGET_PAGE_SIZE, 16 * 1024);
52*2f23eec6SRichard Henderson #else
53ee8e7614SPeter Maydell     return 256 * 1024;
54*2f23eec6SRichard Henderson #endif
55ee8e7614SPeter Maydell }
56ee8e7614SPeter Maydell 
573622634bSMarkus Armbruster #endif /* SPARC_TARGET_SYSCALL_H */
58