proto.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. /*
  2. *
  3. * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. #ifndef _prototypes_h
  20. #define _prototypes_h
  21. /*
  22. ** boot.c
  23. */
  24. void init_boot(char *p, short stage);
  25. /*
  26. ** disconct.c
  27. */
  28. void kill_boot(LPB * link);
  29. void disconnected(LPB * link);
  30. short boot_3(LPB * link, PKT * pkt);
  31. short send_3_pkt(LPB * link, PKT * pkt);
  32. /*
  33. ** error.c
  34. */
  35. void du_error(void);
  36. /*
  37. ** formpkt.c
  38. */
  39. ushort sum_it(PKT * pkt);
  40. void form_rup_pkt(RUP * form_rup, PKT * pkt);
  41. void form_poll_pkt(int type, LPB * link, int node);
  42. void form_route_pkt(int type, PKT * pkt, LPB * link);
  43. /*
  44. ** idle.c
  45. */
  46. void idle(Process * idle_p);
  47. /*
  48. ** init.c
  49. */
  50. void general_init(void);
  51. void mem_halt(int error);
  52. /*
  53. ** linkinit.c
  54. */
  55. void initlink(u_short number, LPB * link);
  56. void runlink(LPB * link);
  57. /*
  58. ** list.c
  59. */
  60. PKT *get_free_start(void);
  61. void put_free_start(PKT * pkt);
  62. #ifdef HOST
  63. int can_remove_transmit(PKT ** pkt, PKT * pointer);
  64. #endif
  65. #ifdef RTA
  66. int spl7(void);
  67. int spl0(void);
  68. Q_BUF *get_free_q(void);
  69. PKT *get_free_end(void);
  70. int add_end(PKT * pkt, PHB * phb, int type);
  71. unsigned short free_packets(PHB * phb, int type);
  72. int can_remove_start(PKT ** pkt, PHB * phb, int type);
  73. int can_add_start(PHB * phb, int type);
  74. int can_add_end(PHB * phb, int type);
  75. void put_free_end(PKT * pkt);
  76. int remove_start(PKT ** pkt, PHB * phb, int type);
  77. #endif
  78. /*
  79. ** Lrt.c
  80. */
  81. void lrt(Process * lrt_p, LPB * link);
  82. #ifdef RTA
  83. void set_led_red(LPB * link);
  84. #endif
  85. /*
  86. ** ltt.c
  87. */
  88. void ltt(Process * ltt_p, LPB * link, PHB * phb_ptr[]);
  89. void send_poll(LPB * link);
  90. void request_id(LPB * link);
  91. void send_topology_update(LPB * link);
  92. void send_topology(LPB * link);
  93. void supply_id(LPB * link);
  94. #ifdef RTA
  95. void redirect_queue(LPB * link, ushort flush);
  96. int obtain_rup(int rup_number, PKT ** pkt_address, LPB * link);
  97. #endif
  98. #ifdef TESTING_PERF
  99. int consume_cpu(void);
  100. #endif
  101. /*
  102. ** lttwake.c
  103. */
  104. #ifdef HOST
  105. void ltt_wakeup(Process * ltt_wakeup_p);
  106. #endif
  107. /*
  108. ** mapgen.c
  109. */
  110. void generate_id_map(short mapping, ROUTE_STR route[]);
  111. void gen_map(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
  112. void adjust_ttl(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
  113. void init_sys_map(void);
  114. /*
  115. ** mmu.c
  116. */
  117. char *rio_malloc(unsigned int amount);
  118. char *rio_calloc(unsigned int num, unsigned int size);
  119. ERROR rio_mmu_init(uint total_mem);
  120. /*
  121. ** partn.c
  122. */
  123. void partition_tx(struct PHB *phb, u_short tx_size, u_short rx_size, u_short rx_limit);
  124. /*
  125. ** poll.c
  126. */
  127. void tx_poll(Process * tx_poll_p);
  128. /*
  129. ** process.c
  130. */
  131. int get_proc_space(Process ** pd, int **pws, int wssize);
  132. /*
  133. ** readrom.c
  134. */
  135. void read_serial_number(char *buf);
  136. /*
  137. ** rio.c
  138. */
  139. int main(void);
  140. /*
  141. ** route.c
  142. */
  143. void route_update(PKT * pkt, LPB * link);
  144. /*
  145. ** rtainit.c
  146. */
  147. #if defined(RTA)
  148. void rta_init(ushort RtaType);
  149. #endif /* defined(RTA) */
  150. /*
  151. ** rupboot.c
  152. */
  153. void rup_boot(PKT * pkt, RUP * this_rup, LPB * link);
  154. #ifdef RTA
  155. void kill_your_neighbour(int link_to_kill);
  156. #endif
  157. /*
  158. ** rupcmd.c
  159. */
  160. void rup_command(PKT * pkt, struct RUP *this_rup, LPB * link);
  161. /*
  162. ** ruperr.c
  163. */
  164. void rup_error(PKT * pkt, RUP * this_rup, LPB * link);
  165. void illegal_cmd(PKT * src_pkt);
  166. /*
  167. ** ruppoll.c
  168. */
  169. void rup_poll(PKT * pkt, RUP * this_rup, LPB * link);
  170. /*
  171. ** ruppower.c
  172. */
  173. void rup_power(PKT * pkt, RUP * this_rup, LPB * link);
  174. /*
  175. ** ruprm.c
  176. */
  177. void rup_route_map(PKT * pkt, RUP * this_rup, LPB * link);
  178. /*
  179. ** rupstat.c
  180. */
  181. void rup_status(PKT * pkt, RUP * this_rup, LPB * link);
  182. /*
  183. ** rupsync.c
  184. */
  185. void rup_sync(PKT * pkt);
  186. /*
  187. ** rxpkt.c
  188. */
  189. ERROR rx_pkt(PKT_ptr_ptr pkt_address, LPB * link);
  190. /*
  191. ** sendsts.c
  192. */
  193. void send_status(PKT * requesting_pkt, RUP * this_rup);
  194. /*
  195. ** serial.c
  196. */
  197. void assign_serial(char *ser_in, char *ser_out);
  198. int cmp_serial(char *ser_1, char *ser_2);
  199. /*
  200. ** txpkt.c
  201. */
  202. ERROR tx_pkt(PKT * pkt, LPB * link);
  203. short send_sync(LPB * link);
  204. #endif /* _prototypes_h */