summaryrefslogtreecommitdiff
path: root/eth-multiplexer/ourdevice.defs
blob: 1b8ac442003a2e0da15511ea4fbfff7fc865e334 (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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# 1 "device.defs"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "device.defs"
# 1 "/usr/local/include/device/device.defs" 1 3
# 39 "/usr/local/include/device/device.defs" 3
subsystem



         device 2800;

# 1 "/usr/local/include/mach/std_types.defs" 1 3
# 33 "/usr/local/include/mach/std_types.defs" 3
type char = MACH_MSG_TYPE_CHAR;
type short = MACH_MSG_TYPE_INTEGER_16;
type int = MACH_MSG_TYPE_INTEGER_32;
type int32 = MACH_MSG_TYPE_INTEGER_32;
type int64 = MACH_MSG_TYPE_INTEGER_64;
type boolean_t = MACH_MSG_TYPE_BOOLEAN;
type unsigned = MACH_MSG_TYPE_INTEGER_32;
type unsigned32 = MACH_MSG_TYPE_INTEGER_32;
type unsigned64 = MACH_MSG_TYPE_INTEGER_64;


# 1 "/usr/local/include/mach/machine/machine_types.defs" 1 3
# 50 "/usr/local/include/mach/machine/machine_types.defs" 3
type natural_t = unsigned32;
# 59 "/usr/local/include/mach/machine/machine_types.defs" 3
type integer_t = int32;
# 45 "/usr/local/include/mach/std_types.defs" 2 3

type kern_return_t = int;

type pointer_t = ^array[] of MACH_MSG_TYPE_BYTE
 ctype: vm_offset_t;


type mach_port_t = MACH_MSG_TYPE_COPY_SEND;
type mach_port_array_t = array[] of mach_port_t;

type mach_port_name_t = MACH_MSG_TYPE_PORT_NAME
 ctype: mach_port_t;
type mach_port_name_array_t = array[] of mach_port_name_t
 ctype: mach_port_array_t;

type mach_port_right_t = natural_t;

type mach_port_type_t = natural_t;
type mach_port_type_array_t = array[] of mach_port_type_t;

type mach_port_urefs_t = natural_t;
type mach_port_delta_t = integer_t;
type mach_port_seqno_t = natural_t;
type mach_port_mscount_t = unsigned;
type mach_port_msgcount_t = unsigned;
type mach_port_rights_t = unsigned;
type mach_msg_id_t = integer_t;
type mach_msg_type_name_t = unsigned;
type mach_msg_type_number_t = natural_t;

type mach_port_move_receive_t = MACH_MSG_TYPE_MOVE_RECEIVE
 ctype: mach_port_t;
type mach_port_copy_send_t = MACH_MSG_TYPE_COPY_SEND
 ctype: mach_port_t;
type mach_port_make_send_t = MACH_MSG_TYPE_MAKE_SEND
 ctype: mach_port_t;
type mach_port_move_send_t = MACH_MSG_TYPE_MOVE_SEND
 ctype: mach_port_t;
type mach_port_make_send_once_t = MACH_MSG_TYPE_MAKE_SEND_ONCE
 ctype: mach_port_t;
type mach_port_move_send_once_t = MACH_MSG_TYPE_MOVE_SEND_ONCE
 ctype: mach_port_t;

type mach_port_receive_t = MACH_MSG_TYPE_PORT_RECEIVE
 ctype: mach_port_t;
type mach_port_send_t = MACH_MSG_TYPE_PORT_SEND
 ctype: mach_port_t;
type mach_port_send_once_t = MACH_MSG_TYPE_PORT_SEND_ONCE
 ctype: mach_port_t;

type mach_port_poly_t = polymorphic
 ctype: mach_port_t;

import <mach/std_types.h>;
# 46 "/usr/local/include/device/device.defs" 2 3
# 1 "/usr/local/include/mach/mach_types.defs" 1 3
# 61 "/usr/local/include/mach/mach_types.defs" 3
type mach_port_status_t = struct[9] of integer_t;

type old_mach_port_status_t = struct[8] of integer_t;

type task_t = mach_port_t
  ctype: mach_port_t





  ;
# 85 "/usr/local/include/mach/mach_types.defs" 3
type thread_t = mach_port_t
  ctype: mach_port_t





  ;

type thread_state_t = array[*:1024] of natural_t;

type task_array_t = ^array[] of task_t;
type thread_array_t = ^array[] of thread_t;

type vm_task_t = mach_port_t
  ctype: mach_port_t




  ;

type ipc_space_t = mach_port_t
  ctype: mach_port_t




  ;

type vm_address_t = natural_t;
type vm_offset_t = natural_t;
type vm_size_t = natural_t;
type vm_prot_t = int;
type vm_inherit_t = int;
type vm_statistics_data_t = struct[13] of integer_t;
type vm_machine_attribute_t = int;
type vm_machine_attribute_val_t = int;

type thread_info_t = array[*:1024] of natural_t;
type thread_basic_info_data_t = struct[11] of integer_t;
type thread_sched_info_data_t = struct[7] of integer_t;

type task_info_t = array[*:1024] of natural_t;
type task_basic_info_data_t = struct[8] of integer_t;
type task_events_info = struct[7] of natural_t;
type task_thread_times_info_data_t = struct[4] of integer_t;


type memory_object_t = mach_port_t
  ctype: mach_port_t



  ;

type memory_object_control_t = mach_port_t
  ctype: mach_port_t



  ;

type memory_object_name_t = mach_port_t
  ctype: mach_port_t




  ;

type memory_object_copy_strategy_t = int;
type memory_object_return_t = int;

type machine_info_data_t = struct[5] of integer_t;
type machine_slot_data_t = struct[8] of integer_t;

type host_t = mach_port_t
  ctype: mach_port_t




  ;

type host_priv_t = mach_port_t
  ctype: mach_port_t



  ;

type host_info_t = array[*:1024] of natural_t;
type host_basic_info_data_t = struct[5] of integer_t;
type host_sched_info_data_t = struct[2] of integer_t;
type host_load_info_data_t = struct[6] of integer_t;


type processor_t = mach_port_t
  ctype: mach_port_t




  ;

type processor_array_t = ^array[] of processor_t;
type processor_info_t = array[*:1024] of natural_t;
type processor_basic_info_data_t = struct[5] of integer_t;


type processor_set_t = mach_port_t
  ctype: mach_port_t





  ;

type processor_set_array_t = ^array[] of processor_set_t;

type processor_set_name_t = mach_port_t
  ctype: mach_port_t





  ;

type processor_set_name_array_t = ^array[] of processor_set_name_t;

type processor_set_info_t = array[*:1024] of natural_t;
type processor_set_basic_info_data_t = struct[5] of integer_t;
type processor_set_sched_info_data_t = struct[2] of integer_t;


type kernel_version_t = (MACH_MSG_TYPE_STRING, 512*8);

type kernel_boot_info_t = (MACH_MSG_TYPE_STRING, 4096*8);

type time_value_t = struct[2] of integer_t;

type emulation_vector_t = ^array[] of vm_offset_t;

type xxx_emulation_vector_t = array[*:1024] of vm_offset_t
     ctype: emulation_vector_t;


type rpc_signature_info_t = array[*:1024] of int;
# 250 "/usr/local/include/mach/mach_types.defs" 3
import <mach/mach_types.h>;
# 47 "/usr/local/include/device/device.defs" 2 3
# 1 "/usr/local/include/device/device_types.defs" 1 3
# 42 "/usr/local/include/device/device_types.defs" 3
type recnum_t = unsigned32;
type dev_mode_t = unsigned32;
type dev_flavor_t = unsigned32;
type dev_name_t = (MACH_MSG_TYPE_STRING_C, 8*128);
type dev_status_t = array[*:1024] of int;
type io_buf_ptr_t = ^array[] of MACH_MSG_TYPE_INTEGER_8;
type io_buf_ptr_inband_t= array[*:128] of char;
type filter_t = short;
type filter_array_t = array[*:128] of filter_t;

type device_t = mach_port_t
  ctype: mach_port_t





  ;

import <device/device_types.h>;
import <device/net_status.h>;
# 48 "/usr/local/include/device/device.defs" 2 3

serverprefix ds_;

type reply_port_t = MACH_MSG_TYPE_MAKE_SEND_ONCE | polymorphic
 ctype: mach_port_t;

routine device_open(
  master_port : mach_port_t;
 sreplyport reply_port : reply_port_t;
  mode : dev_mode_t;
  name : dev_name_t;
 out device : mach_port_send_t
 );

routine device_close(
  device : device_t
 );

routine device_write(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in data : io_buf_ptr_t;
 out bytes_written : int
 );

routine device_write_inband(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in data : io_buf_ptr_inband_t;
 out bytes_written : int
 );

routine device_read(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in bytes_wanted : int;
 out data : io_buf_ptr_t
 );

routine device_read_inband(
  device : device_t;
 sreplyport reply_port : reply_port_t;
 in mode : dev_mode_t;
 in recnum : recnum_t;
 in bytes_wanted : int;
 out data : io_buf_ptr_inband_t
 );


routine xxx_device_set_status(
  device : device_t;
 in flavor : dev_flavor_t;
 in status : dev_status_t, IsLong
 );


routine xxx_device_get_status(
  device : device_t;
 in flavor : dev_flavor_t;
 out status : dev_status_t, IsLong
 );


routine xxx_device_set_filter(
  device : device_t;
 in receive_port : mach_port_send_t;
 in priority : int;
 in filter : filter_array_t, IsLong
 );

routine device_map(
  device : device_t;
 in prot : vm_prot_t;
 in offset : vm_offset_t;
 in size : vm_size_t;
 out pager : memory_object_t;
 in unmap : int
 );

routine device_set_status(
  device : device_t;
 in flavor : dev_flavor_t;
 in status : dev_status_t
 );

routine device_get_status(
  device : device_t;
 in flavor : dev_flavor_t;
 out status : dev_status_t, CountInOut
 );

routine device_set_filter(
  device : device_t;
 in receive_port : mach_port_send_t;
 in priority : int;
 in filter : filter_array_t
 );
# 1 "device.defs" 2