xref: /qemu/linux-user/sparc/target_syscall.h (revision 5f25b383)
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
14460c579fSLluís Vilanova struct target_pt_regs {
15460c579fSLluís Vilanova     abi_ulong psr;
16460c579fSLluís Vilanova     abi_ulong pc;
17460c579fSLluís Vilanova     abi_ulong npc;
18460c579fSLluís Vilanova     abi_ulong y;
19460c579fSLluís Vilanova     abi_ulong u_regs[16];
20460c579fSLluís Vilanova };
21*2f23eec6SRichard Henderson #endif
22460c579fSLluís Vilanova 
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
28460c579fSLluís Vilanova #define UNAME_MINIMUM_RELEASE "2.6.32"
29460c579fSLluís Vilanova 
30*2f23eec6SRichard Henderson /*
31*2f23eec6SRichard Henderson  * SPARC kernels don't define this in their Kconfig, but they have the
32460c579fSLluís Vilanova  * same ABI as if they did, implemented by sparc-specific code which fishes
33460c579fSLluís Vilanova  * directly in the u_regs() struct for half the parameters in sparc_do_fork()
34460c579fSLluís Vilanova  * and copy_thread().
35460c579fSLluís Vilanova  */
36460c579fSLluís Vilanova #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