syscall.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copied from libgloss */
  2. /* General use syscall.h file.
  3. The more ports that use this file, the simpler sim/common/nltvals.def
  4. remains. */
  5. #ifndef LIBGLOSS_SYSCALL_H
  6. #define LIBGLOSS_SYSCALL_H
  7. /* Note: This file may be included by assembler source. */
  8. /* These should be as small as possible to allow a port to use a trap type
  9. instruction, which the system call # as the trap (the d10v for instance
  10. supports traps 0..31). An alternative would be to define one trap for doing
  11. system calls, and put the system call number in a register that is not used
  12. for the normal calling sequence (so that you don't have to shift down the
  13. arguments to add the system call number). Obviously, if these system call
  14. numbers are ever changed, all of the simulators and potentially user code
  15. will need to be updated. */
  16. /* There is no current need for the following: SYS_execv, SYS_creat, SYS_wait,
  17. etc. etc. Don't add them. */
  18. /* These are required by the ANSI C part of newlib (excluding system() of
  19. course). */
  20. #define SYS_exit 1
  21. #define SYS_open 2
  22. #define SYS_close 3
  23. #define SYS_read 4
  24. #define SYS_write 5
  25. #define SYS_lseek 6
  26. #define SYS_unlink 7
  27. #define SYS_getpid 8
  28. #define SYS_kill 9
  29. #define SYS_fstat 10
  30. /*#define SYS_sbrk 11 - not currently a system call, but reserved. */
  31. /* ARGV support. */
  32. #define SYS_argvlen 12
  33. #define SYS_argv 13
  34. /* These are extras added for one reason or another. */
  35. #define SYS_chdir 14
  36. #define SYS_stat 15
  37. #define SYS_chmod 16
  38. #define SYS_utime 17
  39. #define SYS_time 18
  40. #define SYS_gettimeofday 19
  41. #define SYS_times 20
  42. #define SYS_link 21
  43. #endif