summaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/proto.h
blob: f9a3376333e560e7b1f7c95367faf3dc556178a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
/*
 *
 *  (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
#ifndef	_prototypes_h
#define _prototypes_h


/*
** boot.c
*/
void init_boot(char *p, short stage);

/*
** disconct.c
*/
void kill_boot(LPB * link);
void disconnected(LPB * link);
short boot_3(LPB * link, PKT * pkt);
short send_3_pkt(LPB * link, PKT * pkt);

/*
** error.c
*/
void du_error(void);

/*
** formpkt.c
*/
ushort sum_it(PKT * pkt);
void form_rup_pkt(RUP * form_rup, PKT * pkt);
void form_poll_pkt(int type, LPB * link, int node);
void form_route_pkt(int type, PKT * pkt, LPB * link);

/*
** idle.c
*/
void idle(Process * idle_p);

/*
** init.c
*/
void general_init(void);
void mem_halt(int error);

/*
** linkinit.c
*/
void initlink(u_short number, LPB * link);
void runlink(LPB * link);

/*
** list.c
*/
PKT *get_free_start(void);
void put_free_start(PKT * pkt);

#ifdef HOST
int can_remove_transmit(PKT ** pkt, PKT * pointer);
#endif

#ifdef RTA
int spl7(void);
int spl0(void);
Q_BUF *get_free_q(void);
PKT *get_free_end(void);
int add_end(PKT * pkt, PHB * phb, int type);
unsigned short free_packets(PHB * phb, int type);
int can_remove_start(PKT ** pkt, PHB * phb, int type);
int can_add_start(PHB * phb, int type);
int can_add_end(PHB * phb, int type);
void put_free_end(PKT * pkt);
int remove_start(PKT ** pkt, PHB * phb, int type);
#endif

/*
** Lrt.c
*/
void lrt(Process * lrt_p, LPB * link);

#ifdef RTA
void set_led_red(LPB * link);
#endif

/*
** ltt.c
*/
void ltt(Process * ltt_p, LPB * link, PHB * phb_ptr[]);
void send_poll(LPB * link);
void request_id(LPB * link);
void send_topology_update(LPB * link);
void send_topology(LPB * link);
void supply_id(LPB * link);

#ifdef RTA
void redirect_queue(LPB * link, ushort flush);
int obtain_rup(int rup_number, PKT ** pkt_address, LPB * link);
#endif

#ifdef TESTING_PERF
int consume_cpu(void);
#endif

/*
** lttwake.c
*/
#ifdef HOST
void ltt_wakeup(Process * ltt_wakeup_p);
#endif

/*
** mapgen.c
*/
void generate_id_map(short mapping, ROUTE_STR route[]);
void gen_map(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
void adjust_ttl(int mapping, int looking_at, int come_from, ROUTE_STR route[], int link, int *ttl);
void init_sys_map(void);

/*
** mmu.c
*/
char *rio_malloc(unsigned int amount);
char *rio_calloc(unsigned int num, unsigned int size);
ERROR rio_mmu_init(uint total_mem);

/*
** partn.c
*/
void partition_tx(struct PHB *phb, u_short tx_size, u_short rx_size, u_short rx_limit);

/*
** poll.c
*/
void tx_poll(Process * tx_poll_p);

/*
** process.c
*/
int get_proc_space(Process ** pd, int **pws, int wssize);

/*
** readrom.c
*/
void read_serial_number(char *buf);

/*
** rio.c
*/
int main(void);

/*
** route.c
*/
void route_update(PKT * pkt, LPB * link);

/*
** rtainit.c
*/
#if defined(RTA)
void rta_init(ushort RtaType);
#endif				/* defined(RTA) */

/*
** rupboot.c
*/
void rup_boot(PKT * pkt, RUP * this_rup, LPB * link);

#ifdef RTA
void kill_your_neighbour(int link_to_kill);
#endif

/*
** rupcmd.c
*/
void rup_command(PKT * pkt, struct RUP *this_rup, LPB * link);

/*
** ruperr.c
*/
void rup_error(PKT * pkt, RUP * this_rup, LPB * link);
void illegal_cmd(PKT * src_pkt);

/*
** ruppoll.c
*/
void rup_poll(PKT * pkt, RUP * this_rup, LPB * link);

/*
** ruppower.c
*/
void rup_power(PKT * pkt, RUP * this_rup, LPB * link);

/*
** ruprm.c
*/
void rup_route_map(PKT * pkt, RUP * this_rup, LPB * link);

/*
** rupstat.c
*/
void rup_status(PKT * pkt, RUP * this_rup, LPB * link);

/*
** rupsync.c
*/
void rup_sync(PKT * pkt);

/*
** rxpkt.c
*/
ERROR rx_pkt(PKT_ptr_ptr pkt_address, LPB * link);

/*
** sendsts.c
*/
void send_status(PKT * requesting_pkt, RUP * this_rup);

/*
** serial.c
*/
void assign_serial(char *ser_in, char *ser_out);
int cmp_serial(char *ser_1, char *ser_2);

/*
** txpkt.c
*/
ERROR tx_pkt(PKT * pkt, LPB * link);
short send_sync(LPB * link);

#endif				/* _prototypes_h */
OpenPOWER on IntegriCloud