target_syscall.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef SPARC_TARGET_SYSCALL_H
  2. #define SPARC_TARGET_SYSCALL_H
  3. #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
  4. struct target_pt_regs {
  5. abi_ulong u_regs[16];
  6. abi_ulong tstate;
  7. abi_ulong pc;
  8. abi_ulong npc;
  9. uint32_t y;
  10. uint32_t magic;
  11. };
  12. #else
  13. struct target_pt_regs {
  14. abi_ulong psr;
  15. abi_ulong pc;
  16. abi_ulong npc;
  17. abi_ulong y;
  18. abi_ulong u_regs[16];
  19. };
  20. #endif
  21. #ifdef TARGET_SPARC64
  22. # define UNAME_MACHINE "sparc64"
  23. #else
  24. # define UNAME_MACHINE "sparc"
  25. #endif
  26. #define UNAME_MINIMUM_RELEASE "2.6.32"
  27. /*
  28. * SPARC kernels don't define this in their Kconfig, but they have the
  29. * same ABI as if they did, implemented by sparc-specific code which fishes
  30. * directly in the u_regs() struct for half the parameters in sparc_do_fork()
  31. * and copy_thread().
  32. */
  33. #define TARGET_CLONE_BACKWARDS
  34. #define TARGET_MCL_CURRENT 0x2000
  35. #define TARGET_MCL_FUTURE 0x4000
  36. #define TARGET_MCL_ONFAULT 0x8000
  37. /*
  38. * For SPARC SHMLBA is determined at runtime in the kernel, and
  39. * libc has to runtime-detect it using the hwcaps.
  40. * See glibc sysdeps/unix/sysv/linux/sparc/getshmlba.
  41. */
  42. #define TARGET_FORCE_SHMLBA
  43. static inline abi_ulong target_shmlba(CPUSPARCState *env)
  44. {
  45. #ifdef TARGET_SPARC64
  46. return MAX(TARGET_PAGE_SIZE, 16 * 1024);
  47. #else
  48. return 256 * 1024;
  49. #endif
  50. }
  51. #endif /* SPARC_TARGET_SYSCALL_H */