com.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /* System calls. */
  2. #define SEND 1 /* function code for sending messages */
  3. #define RECEIVE 2 /* function code for receiving messages */
  4. #define BOTH 3 /* function code for SEND + RECEIVE */
  5. #define ANY (NR_PROCS+100) /* receive(ANY, buf) accepts from any source */
  6. /* Task numbers, function codes and reply codes. */
  7. #define TTY -NR_TASKS /* terminal I/O class */
  8. # define TTY_READ 3 /* fcn code for reading from tty */
  9. # define TTY_WRITE 4 /* fcn code for writing to tty */
  10. # define TTY_IOCTL 5 /* fcn code for ioctl */
  11. # define TTY_SETPGRP 6 /* fcn code for setpgrp */
  12. # define TTY_OPEN 7 /* fcn code for opening tty */
  13. # define TTY_CLOSE 8 /* fcn code for closing tty */
  14. # define SUSPEND -998 /* used in interrupts when tty has no data */
  15. #ifdef AM_KERNEL
  16. #define AMOEBA
  17. #endif
  18. #ifdef AMOEBA
  19. /* There are AM_NTASK copies of the amoeba kernel task.
  20. * If you change AM_NTASKS be sure to adjust kernel/table.c and fs/table.c
  21. */
  22. #define AM_NTASKS 4 /* number of kernel tasks of this class */
  23. #define AMINT_CLASS (TTY+1) /* Amoeba event handler */
  24. #define AMOEBA_CLASS (AMINT_CLASS+AM_NTASKS) /* transaction handlers */
  25. # define ETHER_ARRIV 1 /* fcn code for packet arrival */
  26. # define AM_TRANS 2 /* amoeba transaction */
  27. # define AM_GETREQ 3 /* amoeba getrequest */
  28. # define AM_PUTREP 4 /* amoeba putrep */
  29. # define AM_REVIVE 6 /* used by kernel task to revive luser task */
  30. # define AM_TIMEOUT 8 /* used to talk to clock task */
  31. # define AM_PUTSIG 9 /* when the luser hits the DEL ! */
  32. # define AM_TASK_DIED 10 /* sent if task died during a transaction */
  33. #else /* if AMOEBA not defined */
  34. #define AMOEBA_CLASS TTY
  35. #endif /* AMOEBA */
  36. /*
  37. * New class definitions should go here and should be defined relative
  38. * to AMOEBA_CLASS (ie. as AMOEBA_CLASS+n, for the nth task added).
  39. */
  40. #define IDLE (AMOEBA_CLASS+1) /* task to run when there's nothing to run */
  41. #define PRINTER -7 /* printer I/O class */
  42. /* The printer uses the same commands as TTY. */
  43. #define WINCHESTER -6 /* winchester (hard) disk class */
  44. #define FLOPPY -5 /* floppy disk class */
  45. # define DISK_READ 3 /* fcn code to DISK (must equal TTY_READ) */
  46. # define DISK_WRITE 4 /* fcn code to DISK (must equal TTY_WRITE) */
  47. # define DISK_IOCTL 5 /* fcn code for setting up RAM disk */
  48. # define SCATTERED_IO 6 /* fcn code for multiple reads/writes */
  49. # define OPTIONAL_IO 16 /* modifier to DISK_* codes within vector */
  50. #define MEM -4 /* /dev/ram, /dev/(k)mem and /dev/null class */
  51. # define RAM_DEV 0 /* minor device for /dev/ram */
  52. # define MEM_DEV 1 /* minor device for /dev/mem */
  53. # define KMEM_DEV 2 /* minor device for /dev/kmem */
  54. # define NULL_DEV 3 /* minor device for /dev/null */
  55. #if (CHIP == INTEL)
  56. # define PORT_DEV 4 /* minor device for /dev/port */
  57. #endif
  58. #define CLOCK -3 /* clock class */
  59. # define SET_ALARM 1 /* fcn code to CLOCK, set up alarm */
  60. # define GET_TIME 3 /* fcn code to CLOCK, get real time */
  61. # define SET_TIME 4 /* fcn code to CLOCK, set real time */
  62. # define REAL_TIME 1 /* reply from CLOCK: here is real time */
  63. #define SYSTASK -2 /* internal functions */
  64. # define SYS_XIT 1 /* fcn code for sys_xit(parent, proc) */
  65. # define SYS_GETSP 2 /* fcn code for sys_sp(proc, &new_sp) */
  66. # define SYS_SIG 3 /* fcn code for sys_sig(proc, sig) */
  67. # define SYS_FORK 4 /* fcn code for sys_fork(parent, child) */
  68. # define SYS_NEWMAP 5 /* fcn code for sys_newmap(procno, map_ptr) */
  69. # define SYS_COPY 6 /* fcn code for sys_copy(ptr) */
  70. # define SYS_EXEC 7 /* fcn code for sys_exec(procno, new_sp) */
  71. # define SYS_TIMES 8 /* fcn code for sys_times(procno, bufptr) */
  72. # define SYS_ABORT 9 /* fcn code for sys_abort() */
  73. # define SYS_FRESH 10 /* fcn code for sys_fresh() (Atari only) */
  74. # define SYS_KILL 11 /* fcn code for sys_kill(proc, sig) */
  75. # define SYS_GBOOT 12 /* fcn code for sys_gboot(procno, bootptr) */
  76. # define SYS_UMAP 13 /* fcn code for sys_umap(procno, etc) */
  77. # define SYS_MEM 14 /* fcn code for sys_mem() */
  78. # define SYS_TRACE 15 /* fcn code for sys_trace(req,pid,addr,data) */
  79. #define HARDWARE -1 /* used as source on interrupt generated msgs*/
  80. /* Names of message fields for messages to CLOCK task. */
  81. #define DELTA_TICKS m6_l1 /* alarm interval in clock ticks */
  82. #define FUNC_TO_CALL m6_f1 /* pointer to function to call */
  83. #define NEW_TIME m6_l1 /* value to set clock to (SET_TIME) */
  84. #define CLOCK_PROC_NR m6_i1 /* which proc (or task) wants the alarm? */
  85. #define SECONDS_LEFT m6_l1 /* how many seconds were remaining */
  86. /* Names of message fields used for messages to block and character tasks. */
  87. #define DEVICE m2_i1 /* major-minor device */
  88. #define PROC_NR m2_i2 /* which (proc) wants I/O? */
  89. #define COUNT m2_i3 /* how many bytes to transfer */
  90. #define POSITION m2_l1 /* file offset */
  91. #define ADDRESS m2_p1 /* core buffer address */
  92. /* Names of message fields for messages to TTY task. */
  93. #define TTY_LINE m2_i1 /* message parameter: terminal line */
  94. #define TTY_REQUEST m2_i3 /* message parameter: ioctl request code */
  95. #define TTY_SPEK m2_l1 /* message parameter: ioctl speed, erasing */
  96. #define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */
  97. #define TTY_PGRP m2_i3 /* message parameter: process group */
  98. /* Names of messages fields used in reply messages from tasks. */
  99. #define REP_PROC_NR m2_i1 /* # of proc on whose behalf I/O was done */
  100. #define REP_STATUS m2_i2 /* bytes transferred or error number */
  101. /* Names of fields for copy message to SYSTASK. */
  102. #define SRC_SPACE m5_c1 /* T or D space (stack is also D) */
  103. #define SRC_PROC_NR m5_i1 /* process to copy from */
  104. #define SRC_BUFFER m5_l1 /* virtual address where data come from */
  105. #define DST_SPACE m5_c2 /* T or D space (stack is also D) */
  106. #define DST_PROC_NR m5_i2 /* process to copy to */
  107. #define DST_BUFFER m5_l2 /* virtual address where data go to */
  108. #define COPY_BYTES m5_l3 /* number of bytes to copy */
  109. /* Field names for accounting, SYSTASK and miscellaneous. */
  110. #define USER_TIME m4_l1 /* user time consumed by process */
  111. #define SYSTEM_TIME m4_l2 /* system time consumed by process */
  112. #define CHILD_UTIME m4_l3 /* user time consumed by process' children */
  113. #define CHILD_STIME m4_l4 /* sys time consumed by process' children */
  114. #define PROC1 m1_i1 /* indicates a process */
  115. #define PROC2 m1_i2 /* indicates a process */
  116. #define PID m1_i3 /* process id passed from MM to kernel */
  117. #define STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
  118. #define PR m6_i1 /* process number for sys_sig */
  119. #define SIGNUM m6_i2 /* signal number for sys_sig */
  120. #define FUNC m6_f1 /* function pointer for sys_sig */
  121. #define MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */
  122. #define CANCEL 0 /* general request to force a task to cancel */
  123. #define SIG_MAP m1_i2 /* used by kernel for passing signal bit map */
  124. #ifdef AMOEBA
  125. /* Names of message fields for amoeba tasks */
  126. #define AM_OP m2_i1 /* one of the above operators */
  127. #define AM_PROC_NR m2_i2 /* process # of proc doing operation */
  128. #define AM_COUNT m2_i3 /* size of buffer for operation */
  129. #define AM_ADDRESS m2_p1 /* address of buffer for operation */
  130. /* For communication between MM and AMOEBA_CLASS kernel tasks */
  131. #define AM_STATUS m2_i3 /* same use as REP_STATUS but for amoeba */
  132. #define AM_FREE_IT m2_l1 /* 1=not a getreq, 0=is a getreq */
  133. /* Special for passing a physical address from the ethernet driver */
  134. #define AM_PADDR m2_l1 /* to the transaction layer */
  135. #endif /* AMOEBA */
  136. #define HARD_INT 2 /* fcn code for all hardware interrupts */