simcall.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #ifndef SIMCALL_INCLUDED
  2. #define SIMCALL_INCLUDED
  3. /*
  4. * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
  5. *
  6. * include/asm-xtensa/xtensa/simcall.h - Simulator call numbers
  7. *
  8. * This file is subject to the terms and conditions of the GNU General
  9. * Public License. See the file "COPYING" in the main directory of
  10. * this archive for more details.
  11. *
  12. * Copyright (C) 2002 Tensilica Inc.
  13. */
  14. /*
  15. * System call like services offered by the simulator host.
  16. * These are modeled after the Linux 2.4 kernel system calls
  17. * for Xtensa processors. However not all system calls and
  18. * not all functionality of a given system call are implemented,
  19. * or necessarily have well defined or equivalent semantics in
  20. * the context of a simulation (as opposed to a Unix kernel).
  21. *
  22. * These services behave largely as if they had been invoked
  23. * as a task in the simulator host's operating system
  24. * (eg. files accessed are those of the simulator host).
  25. * However, these SIMCALLs model a virtual operating system
  26. * so that various definitions, bit assignments etc
  27. * (eg. open mode bits, errno values, etc) are independent
  28. * of the host operating system used to run the simulation.
  29. * Rather these definitions are specific to the Xtensa ISS.
  30. * This way Xtensa ISA code written to use these SIMCALLs
  31. * can (in principle) be simulated on any host.
  32. *
  33. * Up to 6 parameters are passed in registers a3 to a8
  34. * (note the 6th parameter isn't passed on the stack,
  35. * unlike windowed function calling conventions).
  36. * The return value is in a2. A negative value in the
  37. * range -4096 to -1 indicates a negated error code to be
  38. * reported in errno with a return value of -1, otherwise
  39. * the value in a2 is returned as is.
  40. */
  41. /* These #defines need to match what's in Xtensa/OS/vxworks/xtiss/simcalls.c */
  42. #define SYS_nop 0 /* n/a - setup; used to flush register windows */
  43. #define SYS_exit 1 /*x*/
  44. #define SYS_fork 2
  45. #define SYS_read 3 /*x*/
  46. #define SYS_write 4 /*x*/
  47. #define SYS_open 5 /*x*/
  48. #define SYS_close 6 /*x*/
  49. #define SYS_rename 7 /*x 38 - waitpid */
  50. #define SYS_creat 8 /*x*/
  51. #define SYS_link 9 /*x (not implemented on WIN32) */
  52. #define SYS_unlink 10 /*x*/
  53. #define SYS_execv 11 /* n/a - execve */
  54. #define SYS_execve 12 /* 11 - chdir */
  55. #define SYS_pipe 13 /* 42 - time */
  56. #define SYS_stat 14 /* 106 - mknod */
  57. #define SYS_chmod 15
  58. #define SYS_chown 16 /* 202 - lchown */
  59. #define SYS_utime 17 /* 30 - break */
  60. #define SYS_wait 18 /* n/a - oldstat */
  61. #define SYS_lseek 19 /*x*/
  62. #define SYS_getpid 20
  63. #define SYS_isatty 21 /* n/a - mount */
  64. #define SYS_fstat 22 /* 108 - oldumount */
  65. #define SYS_time 23 /* 13 - setuid */
  66. #define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */
  67. #define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */
  68. #define SYS_socket 26
  69. #define SYS_sendto 27
  70. #define SYS_recvfrom 28
  71. #define SYS_select_one 29 /* not compitible select, one file descriptor at the time */
  72. #define SYS_bind 30
  73. #define SYS_ioctl 31
  74. /*
  75. * Other...
  76. */
  77. #define SYS_iss_argc 1000 /* returns value of argc */
  78. #define SYS_iss_argv_size 1001 /* bytes needed for argv & arg strings */
  79. #define SYS_iss_set_argv 1002 /* saves argv & arg strings at given addr */
  80. /*
  81. * SIMCALLs for the ferret memory debugger. All are invoked by
  82. * libferret.a ... ( Xtensa/Target-Libs/ferret )
  83. */
  84. #define SYS_ferret 1010
  85. #define SYS_malloc 1011
  86. #define SYS_free 1012
  87. #define SYS_more_heap 1013
  88. #define SYS_no_heap 1014
  89. /*
  90. * Extra SIMCALLs for GDB:
  91. */
  92. #define SYS_gdb_break -1 /* invoked by XTOS on user exceptions if EPC points
  93. to a break.n/break, regardless of cause! */
  94. #define SYS_xmon_out -2 /* invoked by XMON: ... */
  95. #define SYS_xmon_in -3 /* invoked by XMON: ... */
  96. #define SYS_xmon_flush -4 /* invoked by XMON: ... */
  97. #define SYS_gdb_abort -5 /* invoked by XTOS in _xtos_panic() */
  98. #define SYS_gdb_illegal_inst -6 /* invoked by XTOS for illegal instructions (too deeply) */
  99. #define SYS_xmon_init -7 /* invoked by XMON: ... */
  100. #define SYS_gdb_enter_sktloop -8 /* invoked by XTOS on debug exceptions */
  101. /*
  102. * SIMCALLs for vxWorks xtiss BSP:
  103. */
  104. #define SYS_setup_ppp_pipes -83
  105. #define SYS_log_msg -84
  106. /*
  107. * Test SIMCALLs:
  108. */
  109. #define SYS_test_write_state -100
  110. #define SYS_test_read_state -101
  111. /*
  112. * SYS_select_one specifiers
  113. */
  114. #define XTISS_SELECT_ONE_READ 1
  115. #define XTISS_SELECT_ONE_WRITE 2
  116. #define XTISS_SELECT_ONE_EXCEPT 3
  117. #endif /* !SIMCALL_INCLUDED */