OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [librdbg/] [src/] [i386/] [any/] [remdeb_xdr.c] - Blame information for rev 846

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 * Please do not edit this file.
3
 * It was generated using rpcgen.
4
 */
5
 
6
#include "remdeb.h"
7
#define RTEMS_PORT 2071
8
#define RTEMS_BACK_PORT 2073
9
 
10
bool_t
11
xdr_rpc_type (XDR *xdrs, rpc_type *objp)
12
{
13
        register int32_t *buf;
14
 
15
         if (!xdr_enum (xdrs, (enum_t *) objp))
16
                 return FALSE;
17
        return TRUE;
18
}
19
 
20
bool_t
21
xdr_UDP_MSG (XDR *xdrs, UDP_MSG *objp)
22
{
23
        register int32_t *buf;
24
 
25
         if (!xdr_u_char (xdrs, &objp->type))
26
                 return FALSE;
27
         if (!xdr_u_char (xdrs, &objp->msg_num))
28
                 return FALSE;
29
         if (!xdr_u_short (xdrs, &objp->spec))
30
                 return FALSE;
31
         if (!xdr_long (xdrs, &objp->pid))
32
                 return FALSE;
33
         if (!xdr_u_long (xdrs, &objp->context))
34
                 return FALSE;
35
        return TRUE;
36
}
37
/*
38
 * Sun request values for the remote ptrace system call
39
 */
40
 
41
 
42
bool_t
43
xdr_ptracereq (XDR *xdrs, ptracereq *objp)
44
{
45
        register int32_t *buf;
46
 
47
         if (!xdr_enum (xdrs, (enum_t *) objp))
48
                 return FALSE;
49
        return TRUE;
50
}
51
 
52
bool_t
53
xdr_xdr_regs (XDR *xdrs, xdr_regs *objp)
54
{
55
        register int32_t *buf;
56
 
57
        int i;
58
 
59
        if (xdrs->x_op == XDR_ENCODE) {
60
                buf = XDR_INLINE(xdrs, 19  * BYTES_PER_XDR_UNIT);
61
                if (buf == NULL) {
62
                         if (!xdr_vector (xdrs, (char *)objp->tabreg, 19,
63
                                sizeof (u_int), (xdrproc_t) xdr_u_int))
64
                                 return FALSE;
65
                } else {
66
                        {
67
                                register u_int *genp;
68
 
69
                                for (i = 0, genp = objp->tabreg;
70
                                        i < 19; ++i) {
71
                                        IXDR_PUT_U_LONG(buf, *genp++);
72
                                }
73
                        }
74
                }
75
                return TRUE;
76
        } else if (xdrs->x_op == XDR_DECODE) {
77
                buf = XDR_INLINE(xdrs, 19  * BYTES_PER_XDR_UNIT);
78
                if (buf == NULL) {
79
                         if (!xdr_vector (xdrs, (char *)objp->tabreg, 19,
80
                                sizeof (u_int), (xdrproc_t) xdr_u_int))
81
                                 return FALSE;
82
                } else {
83
                        {
84
                                register u_int *genp;
85
 
86
                                for (i = 0, genp = objp->tabreg;
87
                                        i < 19; ++i) {
88
                                        *genp++ = IXDR_GET_U_LONG(buf);
89
                                }
90
                        }
91
                }
92
         return TRUE;
93
        }
94
 
95
         if (!xdr_vector (xdrs, (char *)objp->tabreg, 19,
96
                sizeof (u_int), (xdrproc_t) xdr_u_int))
97
                 return FALSE;
98
        return TRUE;
99
}
100
  /*
101
   * Memory data for read/write text or data. The size is in data. The target
102
   * addr is in the addr field.
103
   * Be careful before modifying because this value goes into internal
104
   * pipes and is allocated on stack too. Pipes and/or the stack could
105
   * become too small if this value gets incremented.
106
   */
107
bool_t xdr_xdr_mem(xdrs, objp)
108
        XDR *xdrs;
109
        struct xdr_mem *objp;
110
{
111
        if (!xdr_u_long(xdrs, &objp->addr)) {
112
                return (FALSE);
113
        }
114
        if (!xdr_u_int(xdrs, &objp->dataNb)) {
115
                return(FALSE);
116
        }
117
        return (xdr_opaque(xdrs, objp->data, objp->dataNb));
118
}
119
 
120
bool_t
121
xdr_break_type (XDR *xdrs, break_type *objp)
122
{
123
        register int32_t *buf;
124
 
125
         if (!xdr_enum (xdrs, (enum_t *) objp))
126
                 return FALSE;
127
        return TRUE;
128
}
129
 
130
bool_t
131
xdr_xdr_break (XDR *xdrs, xdr_break *objp)
132
{
133
        register int32_t *buf;
134
 
135
        int i;
136
 
137
        if (xdrs->x_op == XDR_ENCODE) {
138
                 if (!xdr_u_char (xdrs, &objp->type))
139
                         return FALSE;
140
                 if (!xdr_u_char (xdrs, &objp->thread_spec))
141
                         return FALSE;
142
                buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
143
                if (buf == NULL) {
144
                         if (!xdr_u_short (xdrs, &objp->handle))
145
                                 return FALSE;
146
                         if (!xdr_u_long (xdrs, &objp->ee_loc))
147
                                 return FALSE;
148
                         if (!xdr_u_long (xdrs, &objp->ee_type))
149
                                 return FALSE;
150
                         if (!xdr_u_short (xdrs, &objp->length))
151
                                 return FALSE;
152
 
153
                } else {
154
                IXDR_PUT_U_SHORT(buf, objp->handle);
155
                IXDR_PUT_U_LONG(buf, objp->ee_loc);
156
                IXDR_PUT_U_LONG(buf, objp->ee_type);
157
                IXDR_PUT_U_SHORT(buf, objp->length);
158
                }
159
                 if (!xdr_u_char (xdrs, &objp->pass_count))
160
                         return FALSE;
161
                 if (!xdr_u_char (xdrs, &objp->curr_pass))
162
                         return FALSE;
163
                buf = XDR_INLINE(xdrs, MAX_THRD_BRK  * BYTES_PER_XDR_UNIT);
164
                if (buf == NULL) {
165
                         if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
166
                                sizeof (u_long), (xdrproc_t) xdr_u_long))
167
                                 return FALSE;
168
                } else {
169
                        {
170
                                register u_long *genp;
171
 
172
                                for (i = 0, genp = objp->thread_list;
173
                                        i < MAX_THRD_BRK; ++i) {
174
                                        IXDR_PUT_U_LONG(buf, *genp++);
175
                                }
176
                        }
177
                }
178
                return TRUE;
179
        } else if (xdrs->x_op == XDR_DECODE) {
180
                 if (!xdr_u_char (xdrs, &objp->type))
181
                         return FALSE;
182
                 if (!xdr_u_char (xdrs, &objp->thread_spec))
183
                         return FALSE;
184
                buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
185
                if (buf == NULL) {
186
                         if (!xdr_u_short (xdrs, &objp->handle))
187
                                 return FALSE;
188
                         if (!xdr_u_long (xdrs, &objp->ee_loc))
189
                                 return FALSE;
190
                         if (!xdr_u_long (xdrs, &objp->ee_type))
191
                                 return FALSE;
192
                         if (!xdr_u_short (xdrs, &objp->length))
193
                                 return FALSE;
194
 
195
                } else {
196
                objp->handle = IXDR_GET_U_SHORT(buf);
197
                objp->ee_loc = IXDR_GET_U_LONG(buf);
198
                objp->ee_type = IXDR_GET_U_LONG(buf);
199
                objp->length = IXDR_GET_U_SHORT(buf);
200
                }
201
                 if (!xdr_u_char (xdrs, &objp->pass_count))
202
                         return FALSE;
203
                 if (!xdr_u_char (xdrs, &objp->curr_pass))
204
                         return FALSE;
205
                buf = XDR_INLINE(xdrs, MAX_THRD_BRK  * BYTES_PER_XDR_UNIT);
206
                if (buf == NULL) {
207
                         if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
208
                                sizeof (u_long), (xdrproc_t) xdr_u_long))
209
                                 return FALSE;
210
                } else {
211
                        {
212
                                register u_long *genp;
213
 
214
                                for (i = 0, genp = objp->thread_list;
215
                                        i < MAX_THRD_BRK; ++i) {
216
                                        *genp++ = IXDR_GET_U_LONG(buf);
217
                                }
218
                        }
219
                }
220
         return TRUE;
221
        }
222
 
223
         if (!xdr_u_char (xdrs, &objp->type))
224
                 return FALSE;
225
         if (!xdr_u_char (xdrs, &objp->thread_spec))
226
                 return FALSE;
227
         if (!xdr_u_short (xdrs, &objp->handle))
228
                 return FALSE;
229
         if (!xdr_u_long (xdrs, &objp->ee_loc))
230
                 return FALSE;
231
         if (!xdr_u_long (xdrs, &objp->ee_type))
232
                 return FALSE;
233
         if (!xdr_u_short (xdrs, &objp->length))
234
                 return FALSE;
235
         if (!xdr_u_char (xdrs, &objp->pass_count))
236
                 return FALSE;
237
         if (!xdr_u_char (xdrs, &objp->curr_pass))
238
                 return FALSE;
239
         if (!xdr_vector (xdrs, (char *)objp->thread_list, MAX_THRD_BRK,
240
                sizeof (u_long), (xdrproc_t) xdr_u_long))
241
                 return FALSE;
242
        return TRUE;
243
}
244
 
245
bool_t
246
xdr_thread_name (XDR *xdrs, thread_name *objp)
247
{
248
        register int32_t *buf;
249
 
250
         if (!xdr_string (xdrs, objp, THREADNAMEMAX))
251
                 return FALSE;
252
        return TRUE;
253
}
254
 
255
bool_t
256
xdr_KernThread (XDR *xdrs, KernThread *objp)
257
{
258
        register int32_t *buf;
259
 
260
         if (!xdr_u_int (xdrs, &objp->threadLi))
261
                 return FALSE;
262
        return TRUE;
263
}
264
bool_t xdr_thread_list(xdrs, objp)
265
        XDR *xdrs;
266
        struct thread_list *objp;
267
{
268
        return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread,
269
                        UTHREAD_MAX, sizeof(KernThread), xdr_KernThread));
270
}
271
 
272
bool_t
273
xdr_ptrace_addr_data_in (XDR *xdrs, ptrace_addr_data_in *objp)
274
{
275
        register int32_t *buf;
276
 
277
         if (!xdr_ptracereq (xdrs, &objp->req))
278
                 return FALSE;
279
        switch (objp->req) {
280
        case RPT_SETTHREADREGS:
281
                 if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
282
                         return FALSE;
283
                break;
284
        case RPT_SETREGS:
285
                 if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_in_u.regs))
286
                         return FALSE;
287
                break;
288
        case RPT_PSETTHREADREGS:
289
                 if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_in_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
290
                        sizeof (u_int), (xdrproc_t) xdr_u_int))
291
                         return FALSE;
292
                break;
293
        case RPT_PSETREGS:
294
                 if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_in_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_in_u.pregs.pregs_len, ~0,
295
                        sizeof (u_int), (xdrproc_t) xdr_u_int))
296
                         return FALSE;
297
                break;
298
        case RPT_SETTHREADNAME:
299
                 if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_in_u.name))
300
                         return FALSE;
301
                break;
302
        case RPT_WRITETEXT:
303
                 if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
304
                         return FALSE;
305
                break;
306
        case RPT_WRITEDATA:
307
                 if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_in_u.mem))
308
                         return FALSE;
309
                break;
310
        case RPT_SETBREAK:
311
                 if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_in_u.breakp))
312
                         return FALSE;
313
                break;
314
        default:
315
                 if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_in_u.address))
316
                         return FALSE;
317
                break;
318
        }
319
        return TRUE;
320
}
321
 
322
bool_t
323
xdr_ptrace_addr_data_out (XDR *xdrs, ptrace_addr_data_out *objp)
324
{
325
        register int32_t *buf;
326
 
327
         if (!xdr_ptracereq (xdrs, &objp->req))
328
                 return FALSE;
329
        switch (objp->req) {
330
        case RPT_GETREGS:
331
                 if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
332
                         return FALSE;
333
                break;
334
        case RPT_GETTHREADREGS:
335
                 if (!xdr_xdr_regs (xdrs, &objp->ptrace_addr_data_out_u.regs))
336
                         return FALSE;
337
                break;
338
        case RPT_PGETREGS:
339
                 if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_out_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
340
                        sizeof (u_int), (xdrproc_t) xdr_u_int))
341
                         return FALSE;
342
                break;
343
        case RPT_PGETTHREADREGS:
344
                 if (!xdr_array (xdrs, (char **)&objp->ptrace_addr_data_out_u.pregs.pregs_val, (u_int *) &objp->ptrace_addr_data_out_u.pregs.pregs_len, ~0,
345
                        sizeof (u_int), (xdrproc_t) xdr_u_int))
346
                         return FALSE;
347
                break;
348
        case RPT_THREADLIST:
349
                 if (!xdr_thread_list (xdrs, &objp->ptrace_addr_data_out_u.threads))
350
                         return FALSE;
351
                break;
352
        case RPT_GETTHREADNAME:
353
                 if (!xdr_thread_name (xdrs, &objp->ptrace_addr_data_out_u.name))
354
                         return FALSE;
355
                break;
356
        case RPT_READTEXT:
357
                 if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
358
                         return FALSE;
359
                break;
360
        case RPT_GETNAME:
361
                 if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
362
                         return FALSE;
363
                break;
364
        case RPT_READDATA:
365
                 if (!xdr_xdr_mem (xdrs, &objp->ptrace_addr_data_out_u.mem))
366
                         return FALSE;
367
                break;
368
        case RPT_GETBREAK:
369
                 if (!xdr_xdr_break (xdrs, &objp->ptrace_addr_data_out_u.breakp))
370
                         return FALSE;
371
                break;
372
        default:
373
                 if (!xdr_u_int (xdrs, &objp->ptrace_addr_data_out_u.addr))
374
                         return FALSE;
375
                break;
376
        }
377
        return TRUE;
378
}
379
 
380
bool_t
381
xdr_CHAR_DATA (XDR *xdrs, CHAR_DATA *objp)
382
{
383
        register int32_t *buf;
384
 
385
         if (!xdr_bytes (xdrs, (char **)&objp->CHAR_DATA_val, (u_int *) &objp->CHAR_DATA_len, NET_SAFE))
386
                 return FALSE;
387
        return TRUE;
388
}
389
#ifndef XRY_MAX_CMD_STR
390
#endif  /* REMDEB_H */
391
 
392
bool_t
393
xdr_xry_inst (XDR *xdrs, xry_inst *objp)
394
{
395
        register int32_t *buf;
396
 
397
         if (!xdr_u_char (xdrs, &objp->flags))
398
                 return FALSE;
399
         if (!xdr_u_char (xdrs, &objp->type))
400
                 return FALSE;
401
         if (!xdr_u_char (xdrs, &objp->sub_type))
402
                 return FALSE;
403
         if (!xdr_u_char (xdrs, &objp->res_type))
404
                 return FALSE;
405
         if (!xdr_u_long (xdrs, &objp->value))
406
                 return FALSE;
407
         if (!xdr_u_long (xdrs, &objp->value2))
408
                 return FALSE;
409
        return TRUE;
410
}
411
 
412
bool_t
413
xdr_instance (XDR *xdrs, instance *objp)
414
{
415
        register int32_t *buf;
416
 
417
        int i;
418
         if (!xdr_vector (xdrs, (char *)objp->instances, XRY_MAX_INSTANCES,
419
                sizeof (xry_inst), (xdrproc_t) xdr_xry_inst))
420
                 return FALSE;
421
         if (!xdr_vector (xdrs, (char *)objp->buffer, XRY_MAX_INST_BUFF,
422
                sizeof (u_char), (xdrproc_t) xdr_u_char))
423
                 return FALSE;
424
        return TRUE;
425
}
426
 
427
bool_t
428
xdr_instance_union (XDR *xdrs, instance_union *objp)
429
{
430
        register int32_t *buf;
431
 
432
         if (!xdr_bool (xdrs, &objp->instances))
433
                 return FALSE;
434
        switch (objp->instances) {
435
        case TRUE:
436
                 if (!xdr_instance (xdrs, &objp->instance_union_u.inst))
437
                         return FALSE;
438
                break;
439
        case FALSE:
440
                 if (!xdr_string (xdrs, &objp->instance_union_u.buffer, XRY_MAX_CMD_STR))
441
                         return FALSE;
442
                break;
443
        default:
444
                return FALSE;
445
        }
446
        return TRUE;
447
}
448
 
449
bool_t
450
xdr_one_arg (XDR *xdrs, one_arg *objp)
451
{
452
        register int32_t *buf;
453
 
454
         if (!xdr_string (xdrs, objp, NET_SAFE))
455
                 return FALSE;
456
        return TRUE;
457
}
458
  /* now open_connex() routine which establishes a connection to server */
459
 
460
bool_t
461
xdr_debug_type (XDR *xdrs, debug_type *objp)
462
{
463
        register int32_t *buf;
464
 
465
         if (!xdr_enum (xdrs, (enum_t *) objp))
466
                 return FALSE;
467
        return TRUE;
468
}
469
#define DEBUGGER_IS_GDB 0x2    /* */
470
 
471
bool_t
472
xdr_open_in (XDR *xdrs, open_in *objp)
473
{
474
        register int32_t *buf;
475
 
476
        int i;
477
         if (!xdr_vector (xdrs, (char *)objp->back_port, 16,
478
                sizeof (u_char), (xdrproc_t) xdr_u_char))
479
                 return FALSE;
480
         if (!xdr_u_short (xdrs, &objp->debug_type))
481
                 return FALSE;
482
         if (!xdr_u_short (xdrs, &objp->flags))
483
                 return FALSE;
484
         if (!xdr_vector (xdrs, (char *)objp->destination, 16,
485
                sizeof (u_char), (xdrproc_t) xdr_u_char))
486
                 return FALSE;
487
         if (!xdr_one_arg (xdrs, &objp->user_name))
488
                 return FALSE;
489
        return TRUE;
490
}
491
 
492
bool_t
493
xdr_open_out (XDR *xdrs, open_out *objp)
494
{
495
        register int32_t *buf;
496
 
497
        int i;
498
 
499
        if (xdrs->x_op == XDR_ENCODE) {
500
                buf = XDR_INLINE(xdrs, (2 + ( 4 )) * BYTES_PER_XDR_UNIT);
501
                if (buf == NULL) {
502
                         if (!xdr_u_long (xdrs, &objp->port))
503
                                 return FALSE;
504
                         if (!xdr_vector (xdrs, (char *)objp->pad, 4,
505
                                sizeof (u_int), (xdrproc_t) xdr_u_int))
506
                                 return FALSE;
507
                         if (!xdr_u_int (xdrs, &objp->fp))
508
                                 return FALSE;
509
 
510
                } else {
511
                IXDR_PUT_U_LONG(buf, objp->port);
512
                {
513
                        register u_int *genp;
514
 
515
                        for (i = 0, genp = objp->pad;
516
                                i < 4; ++i) {
517
                                IXDR_PUT_U_LONG(buf, *genp++);
518
                        }
519
                }
520
                IXDR_PUT_U_LONG(buf, objp->fp);
521
                }
522
                 if (!xdr_u_char (xdrs, &objp->cmd_table_num))
523
                         return FALSE;
524
                 if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
525
                         return FALSE;
526
                 if (!xdr_u_short (xdrs, &objp->server_vers))
527
                         return FALSE;
528
                return TRUE;
529
        } else if (xdrs->x_op == XDR_DECODE) {
530
                buf = XDR_INLINE(xdrs, (2 + ( 4 )) * BYTES_PER_XDR_UNIT);
531
                if (buf == NULL) {
532
                         if (!xdr_u_long (xdrs, &objp->port))
533
                                 return FALSE;
534
                         if (!xdr_vector (xdrs, (char *)objp->pad, 4,
535
                                sizeof (u_int), (xdrproc_t) xdr_u_int))
536
                                 return FALSE;
537
                         if (!xdr_u_int (xdrs, &objp->fp))
538
                                 return FALSE;
539
 
540
                } else {
541
                objp->port = IXDR_GET_U_LONG(buf);
542
                {
543
                        register u_int *genp;
544
 
545
                        for (i = 0, genp = objp->pad;
546
                                i < 4; ++i) {
547
                                *genp++ = IXDR_GET_U_LONG(buf);
548
                        }
549
                }
550
                objp->fp = IXDR_GET_U_LONG(buf);
551
                }
552
                 if (!xdr_u_char (xdrs, &objp->cmd_table_num))
553
                         return FALSE;
554
                 if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
555
                         return FALSE;
556
                 if (!xdr_u_short (xdrs, &objp->server_vers))
557
                         return FALSE;
558
         return TRUE;
559
        }
560
 
561
         if (!xdr_u_long (xdrs, &objp->port))
562
                 return FALSE;
563
         if (!xdr_vector (xdrs, (char *)objp->pad, 4,
564
                sizeof (u_int), (xdrproc_t) xdr_u_int))
565
                 return FALSE;
566
         if (!xdr_u_int (xdrs, &objp->fp))
567
                 return FALSE;
568
         if (!xdr_u_char (xdrs, &objp->cmd_table_num))
569
                 return FALSE;
570
         if (!xdr_u_char (xdrs, &objp->cmd_table_vers))
571
                 return FALSE;
572
         if (!xdr_u_short (xdrs, &objp->server_vers))
573
                 return FALSE;
574
        return TRUE;
575
}
576
  /* now close_connex() routine which detaches from server */
577
 
578
bool_t
579
xdr_close_control (XDR *xdrs, close_control *objp)
580
{
581
        register int32_t *buf;
582
 
583
         if (!xdr_enum (xdrs, (enum_t *) objp))
584
                 return FALSE;
585
        return TRUE;
586
}
587
 
588
bool_t
589
xdr_close_in (XDR *xdrs, close_in *objp)
590
{
591
        register int32_t *buf;
592
 
593
         if (!xdr_close_control (xdrs, &objp->control))
594
                 return FALSE;
595
        return TRUE;
596
}
597
  /* now send_signal() routine which sends signals to processes like kill(2) */
598
 
599
bool_t
600
xdr_signal_in (XDR *xdrs, signal_in *objp)
601
{
602
        register int32_t *buf;
603
 
604
         if (!xdr_int (xdrs, &objp->pid))
605
                 return FALSE;
606
         if (!xdr_int (xdrs, &objp->sig))
607
                 return FALSE;
608
        return TRUE;
609
}
610
 
611
bool_t
612
xdr_signal_out (XDR *xdrs, signal_out *objp)
613
{
614
        register int32_t *buf;
615
 
616
         if (!xdr_int (xdrs, &objp->kill_return))
617
                 return FALSE;
618
         if (!xdr_int (xdrs, &objp->errNo))
619
                 return FALSE;
620
        return TRUE;
621
}
622
  /* now wait_info() routine which returns results of polling the wait status
623
        of a process/actor. It may return 0 if running, else pid or -1 */
624
 
625
bool_t
626
xdr_stop_code (XDR *xdrs, stop_code *objp)
627
{
628
        register int32_t *buf;
629
 
630
         if (!xdr_enum (xdrs, (enum_t *) objp))
631
                 return FALSE;
632
        return TRUE;
633
}
634
 
635
bool_t
636
xdr_wait_in (XDR *xdrs, wait_in *objp)
637
{
638
        register int32_t *buf;
639
 
640
         if (!xdr_int (xdrs, &objp->pid))
641
                 return FALSE;
642
        return TRUE;
643
}
644
 
645
bool_t
646
xdr_wait_out (XDR *xdrs, wait_out *objp)
647
{
648
        register int32_t *buf;
649
 
650
 
651
        if (xdrs->x_op == XDR_ENCODE) {
652
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
653
                if (buf == NULL) {
654
                         if (!xdr_int (xdrs, &objp->wait_return))
655
                                 return FALSE;
656
                         if (!xdr_int (xdrs, &objp->errNo))
657
                                 return FALSE;
658
                         if (!xdr_int (xdrs, &objp->status))
659
                                 return FALSE;
660
 
661
                } else {
662
                IXDR_PUT_LONG(buf, objp->wait_return);
663
                IXDR_PUT_LONG(buf, objp->errNo);
664
                IXDR_PUT_LONG(buf, objp->status);
665
                }
666
                 if (!xdr_stop_code (xdrs, &objp->reason))
667
                         return FALSE;
668
                buf = XDR_INLINE(xdrs,5 * BYTES_PER_XDR_UNIT);
669
                if (buf == NULL) {
670
                         if (!xdr_int (xdrs, &objp->handle))
671
                                 return FALSE;
672
                         if (!xdr_u_long (xdrs, &objp->PC))
673
                                 return FALSE;
674
                         if (!xdr_u_long (xdrs, &objp->SP))
675
                                 return FALSE;
676
                         if (!xdr_u_long (xdrs, &objp->FP))
677
                                 return FALSE;
678
                         if (!xdr_u_long (xdrs, &objp->thread))
679
                                 return FALSE;
680
                } else {
681
                        IXDR_PUT_LONG(buf, objp->handle);
682
                        IXDR_PUT_U_LONG(buf, objp->PC);
683
                        IXDR_PUT_U_LONG(buf, objp->SP);
684
                        IXDR_PUT_U_LONG(buf, objp->FP);
685
                        IXDR_PUT_U_LONG(buf, objp->thread);
686
                }
687
                return TRUE;
688
        } else if (xdrs->x_op == XDR_DECODE) {
689
                buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
690
                if (buf == NULL) {
691
                         if (!xdr_int (xdrs, &objp->wait_return))
692
                                 return FALSE;
693
                         if (!xdr_int (xdrs, &objp->errNo))
694
                                 return FALSE;
695
                         if (!xdr_int (xdrs, &objp->status))
696
                                 return FALSE;
697
 
698
                } else {
699
                objp->wait_return = IXDR_GET_LONG(buf);
700
                objp->errNo = IXDR_GET_LONG(buf);
701
                objp->status = IXDR_GET_LONG(buf);
702
                }
703
                 if (!xdr_stop_code (xdrs, &objp->reason))
704
                         return FALSE;
705
                buf = XDR_INLINE(xdrs,5 * BYTES_PER_XDR_UNIT);
706
                if (buf == NULL) {
707
                         if (!xdr_int (xdrs, &objp->handle))
708
                                 return FALSE;
709
                         if (!xdr_u_long (xdrs, &objp->PC))
710
                                 return FALSE;
711
                         if (!xdr_u_long (xdrs, &objp->SP))
712
                                 return FALSE;
713
                         if (!xdr_u_long (xdrs, &objp->FP))
714
                                 return FALSE;
715
                         if (!xdr_u_long (xdrs, &objp->thread))
716
                                 return FALSE;
717
                } else {
718
                        objp->handle = IXDR_GET_LONG(buf);
719
                        objp->PC = IXDR_GET_U_LONG(buf);
720
                        objp->SP = IXDR_GET_U_LONG(buf);
721
                        objp->FP = IXDR_GET_U_LONG(buf);
722
                        objp->thread = IXDR_GET_U_LONG(buf);
723
                }
724
         return TRUE;
725
        }
726
 
727
         if (!xdr_int (xdrs, &objp->wait_return))
728
                 return FALSE;
729
         if (!xdr_int (xdrs, &objp->errNo))
730
                 return FALSE;
731
         if (!xdr_int (xdrs, &objp->status))
732
                 return FALSE;
733
         if (!xdr_stop_code (xdrs, &objp->reason))
734
                 return FALSE;
735
         if (!xdr_int (xdrs, &objp->handle))
736
                 return FALSE;
737
         if (!xdr_u_long (xdrs, &objp->PC))
738
                 return FALSE;
739
         if (!xdr_u_long (xdrs, &objp->SP))
740
                 return FALSE;
741
         if (!xdr_u_long (xdrs, &objp->FP))
742
                 return FALSE;
743
         if (!xdr_u_long (xdrs, &objp->thread))
744
                 return FALSE;
745
        return TRUE;
746
}
747
  /* now ptrace() routine. This matches the Sun UNIX ptrace as well as
748
        some additions */
749
 
750
bool_t
751
xdr_ptrace_in (XDR *xdrs, ptrace_in *objp)
752
{
753
        register int32_t *buf;
754
 
755
         if (!xdr_int (xdrs, &objp->pid))
756
                 return FALSE;
757
         if (!xdr_ptrace_addr_data_in (xdrs, &objp->addr))
758
                 return FALSE;
759
         if (!xdr_u_int (xdrs, &objp->data))
760
                 return FALSE;
761
         if (!xdr_u_int (xdrs, &objp->flags))
762
                 return FALSE;
763
        return TRUE;
764
}
765
 
766
bool_t
767
xdr_ptrace_out (XDR *xdrs, ptrace_out *objp)
768
{
769
        register int32_t *buf;
770
 
771
         if (!xdr_ptrace_addr_data_out (xdrs, &objp->addr))
772
                 return FALSE;
773
         if (!xdr_int (xdrs, &objp->result))
774
                 return FALSE;
775
         if (!xdr_int (xdrs, &objp->errNo))
776
                 return FALSE;
777
        return TRUE;
778
}
779
 
780
bool_t
781
xdr_one_symbol (XDR *xdrs, one_symbol *objp)
782
{
783
        register int32_t *buf;
784
 
785
         if (!xdr_string (xdrs, &objp->symbolName, ~0))
786
                 return FALSE;
787
         if (!xdr_long (xdrs, &objp->symbolValue))
788
                 return FALSE;
789
        return TRUE;
790
}
791
 
792
bool_t
793
xdr_all_symbols (XDR *xdrs, all_symbols *objp)
794
{
795
        register int32_t *buf;
796
 
797
         if (!xdr_array (xdrs, (char **)&objp->all_symbols_val, (u_int *) &objp->all_symbols_len, ~0,
798
                sizeof (one_symbol), (xdrproc_t) xdr_one_symbol))
799
                 return FALSE;
800
        return TRUE;
801
}
802
 
803
bool_t
804
xdr_get_global_symbols_out (XDR *xdrs, get_global_symbols_out *objp)
805
{
806
        register int32_t *buf;
807
 
808
         if (!xdr_all_symbols (xdrs, &objp->symbols))
809
                 return FALSE;
810
        return TRUE;
811
}
812
 
813
bool_t
814
xdr_get_text_data_in (XDR *xdrs, get_text_data_in *objp)
815
{
816
        register int32_t *buf;
817
 
818
         if (!xdr_int (xdrs, &objp->pid))
819
                 return FALSE;
820
         if (!xdr_string (xdrs, &objp->actorName, 16))
821
                 return FALSE;
822
        return TRUE;
823
}
824
 
825
bool_t
826
xdr_get_text_data_out (XDR *xdrs, get_text_data_out *objp)
827
{
828
        register int32_t *buf;
829
 
830
 
831
        if (xdrs->x_op == XDR_ENCODE) {
832
                buf = XDR_INLINE(xdrs,6 * BYTES_PER_XDR_UNIT);
833
                if (buf == NULL) {
834
                         if (!xdr_int (xdrs, &objp->result))
835
                                 return FALSE;
836
                         if (!xdr_int (xdrs, &objp->errNo))
837
                                 return FALSE;
838
                         if (!xdr_u_long (xdrs, &objp->textStart))
839
                                 return FALSE;
840
                         if (!xdr_u_long (xdrs, &objp->textSize))
841
                                 return FALSE;
842
                         if (!xdr_u_long (xdrs, &objp->dataStart))
843
                                 return FALSE;
844
                         if (!xdr_u_long (xdrs, &objp->dataSize))
845
                                 return FALSE;
846
                } else {
847
                        IXDR_PUT_LONG(buf, objp->result);
848
                        IXDR_PUT_LONG(buf, objp->errNo);
849
                        IXDR_PUT_U_LONG(buf, objp->textStart);
850
                        IXDR_PUT_U_LONG(buf, objp->textSize);
851
                        IXDR_PUT_U_LONG(buf, objp->dataStart);
852
                        IXDR_PUT_U_LONG(buf, objp->dataSize);
853
                }
854
                return TRUE;
855
        } else if (xdrs->x_op == XDR_DECODE) {
856
                buf = XDR_INLINE(xdrs,6 * BYTES_PER_XDR_UNIT);
857
                if (buf == NULL) {
858
                         if (!xdr_int (xdrs, &objp->result))
859
                                 return FALSE;
860
                         if (!xdr_int (xdrs, &objp->errNo))
861
                                 return FALSE;
862
                         if (!xdr_u_long (xdrs, &objp->textStart))
863
                                 return FALSE;
864
                         if (!xdr_u_long (xdrs, &objp->textSize))
865
                                 return FALSE;
866
                         if (!xdr_u_long (xdrs, &objp->dataStart))
867
                                 return FALSE;
868
                         if (!xdr_u_long (xdrs, &objp->dataSize))
869
                                 return FALSE;
870
                } else {
871
                        objp->result = IXDR_GET_LONG(buf);
872
                        objp->errNo = IXDR_GET_LONG(buf);
873
                        objp->textStart = IXDR_GET_U_LONG(buf);
874
                        objp->textSize = IXDR_GET_U_LONG(buf);
875
                        objp->dataStart = IXDR_GET_U_LONG(buf);
876
                        objp->dataSize = IXDR_GET_U_LONG(buf);
877
                }
878
         return TRUE;
879
        }
880
 
881
         if (!xdr_int (xdrs, &objp->result))
882
                 return FALSE;
883
         if (!xdr_int (xdrs, &objp->errNo))
884
                 return FALSE;
885
         if (!xdr_u_long (xdrs, &objp->textStart))
886
                 return FALSE;
887
         if (!xdr_u_long (xdrs, &objp->textSize))
888
                 return FALSE;
889
         if (!xdr_u_long (xdrs, &objp->dataStart))
890
                 return FALSE;
891
         if (!xdr_u_long (xdrs, &objp->dataSize))
892
                 return FALSE;
893
        return TRUE;
894
}
895
 
896
bool_t
897
xdr_one_signal (XDR *xdrs, one_signal *objp)
898
{
899
        register int32_t *buf;
900
 
901
         if (!xdr_u_int (xdrs, &objp->number))
902
                 return FALSE;
903
         if (!xdr_string (xdrs, &objp->name, ~0))
904
                 return FALSE;
905
        return TRUE;
906
}
907
 
908
bool_t
909
xdr_all_signals (XDR *xdrs, all_signals *objp)
910
{
911
        register int32_t *buf;
912
 
913
         if (!xdr_array (xdrs, (char **)&objp->all_signals_val, (u_int *) &objp->all_signals_len, ~0,
914
                sizeof (one_signal), (xdrproc_t) xdr_one_signal))
915
                 return FALSE;
916
        return TRUE;
917
}
918
 
919
bool_t
920
xdr_get_signal_names_out (XDR *xdrs, get_signal_names_out *objp)
921
{
922
        register int32_t *buf;
923
 
924
         if (!xdr_all_signals (xdrs, &objp->signals))
925
                 return FALSE;
926
        return TRUE;
927
}
928
  /* now define the actual calls we support */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.