target_syscall.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef TILEGX_TARGET_SYSCALL_H
  2. #define TILEGX_TARGET_SYSCALL_H
  3. #define UNAME_MACHINE "tilegx"
  4. #define UNAME_MINIMUM_RELEASE "3.19"
  5. #define MMAP_SHIFT TARGET_PAGE_BITS
  6. #define TILEGX_IS_ERRNO(ret) \
  7. ((ret) > 0xfffffffffffff000ULL) /* errno is 0 -- 4096 */
  8. typedef uint64_t tilegx_reg_t;
  9. struct target_pt_regs {
  10. union {
  11. /* Saved main processor registers; 56..63 are special. */
  12. tilegx_reg_t regs[56];
  13. struct {
  14. tilegx_reg_t __regs[53];
  15. tilegx_reg_t tp; /* aliases regs[TREG_TP] */
  16. tilegx_reg_t sp; /* aliases regs[TREG_SP] */
  17. tilegx_reg_t lr; /* aliases regs[TREG_LR] */
  18. };
  19. };
  20. /* Saved special registers. */
  21. tilegx_reg_t pc; /* stored in EX_CONTEXT_K_0 */
  22. tilegx_reg_t ex1; /* stored in EX_CONTEXT_K_1 (PL and ICS bit) */
  23. tilegx_reg_t faultnum; /* fault number (INT_SWINT_1 for syscall) */
  24. tilegx_reg_t orig_r0; /* r0 at syscall entry, else zero */
  25. tilegx_reg_t flags; /* flags (see below) */
  26. tilegx_reg_t cmpexch; /* value of CMPEXCH_VALUE SPR at interrupt */
  27. tilegx_reg_t pad[2];
  28. };
  29. #define TARGET_MCL_CURRENT 1
  30. #define TARGET_MCL_FUTURE 2
  31. #define TARGET_MCL_ONFAULT 4
  32. /* For faultnum */
  33. #define TARGET_INT_SWINT_1 14
  34. #endif