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
|
/* xdr_ptrace.c - xdr routines for remote ptrace calls */
/* Copyright 1984,1985,1986,1987,1988,1989 Wind River Systems, Inc. */
/* extern char copyright_wind_river[]; static char *copyright=copyright_wind_river;*/
/*
modification history
--------------------
01a,05jun90,llk extracted from xdr_ptrace.h, version 01c.
*/
#include <vxWorks.h>
#include <rpc/rpc.h>
#include <xdr_ptrace.h>
#define MAX_LEN 32000
/********************************************************************
*
* xdr_regs_ptr -
*
* xdr routine to get regs* branch of discriminated union ptrace_info
*
*/
LOCAL bool_t xdr_regs_ptr(xdrs,objp)
XDR *xdrs;
struct regs **objp;
{
return (xdr_pointer(xdrs, (char **) objp, sizeof(struct regs), xdr_regs));
} /* xdr_regs_ptr */
/********************************************************************
*
* xdr_fp_status_ptr -
*
* xdr routine for fp_status * branch of discrimanated union
*
*/
LOCAL bool_t xdr_fp_status_ptr(xdrs,objp)
XDR *xdrs;
struct fp_status **objp;
{
return(xdr_pointer(xdrs, (char **) objp, sizeof(struct fp_status),
xdr_fp_status));
} /* xdr_fp_status_ptr */
#ifndef I80960
/********************************************************************
*
* xdr_fpa_regs_ptr -
*
* xdr routine for fpa_regs* branch of ptrace_info
*
*/
LOCAL bool_t xdr_fpa_regs_ptr(xdrs,objp)
XDR *xdrs;
struct fpa_regs **objp;
{
if (! xdr_pointer(xdrs, (char **) objp, sizeof(struct fpa_regs),
xdr_fpa_regs))
return(FALSE);
else
return(TRUE);
} /* xdr_fpa_regs_ptr */
#endif
/********************************************************************
*
* xdr_c_bytes_ptr -
*
* xdr routine for counted bytes branch of ptrace_info
*
*/
LOCAL bool_t xdr_c_bytes_ptr(xdrs,objp)
XDR *xdrs;
C_bytes **objp;
{
return(xdr_pointer(xdrs, (char **) objp, sizeof(C_bytes), xdr_c_bytes));
} /* xdr_c_bytes_ptr */
/********************************************************************
*
* xdr_ptrace_info -
*
* xdr routine for discriminated union ptrace_info
*
*/
bool_t xdr_ptrace_info(xdrs,objp)
XDR *xdrs;
Ptrace_info *objp;
{
static struct xdr_discrim choices[] =
{
{ (int) REGS, xdr_regs_ptr },
{ (int) FPREGS, xdr_fp_status_ptr },
#ifndef I80960
{ (int) FPAREGS, xdr_fpa_regs_ptr },
#endif
{ (int) DATA, xdr_c_bytes_ptr },
{ __dontcare__, NULL }
};
return(xdr_union(xdrs, (enum_t *) &objp->ttype,
(char *) &objp->more_data, choices, xdr_void));
} /* xdr_ptrace_info */
/********************************************************************
*
* xdr_rptrace -
*
* xdr routine for remote ptrace data into server
*
*/
bool_t xdr_rptrace(xdrs,objp)
XDR *xdrs;
Rptrace *objp;
{
if (! xdr_int(xdrs, &objp->pid))
return(FALSE);
if (! xdr_int(xdrs, &objp->data))
return(FALSE);
if (! xdr_int(xdrs, &objp->addr))
return(FALSE);
if (! xdr_ptrace_info(xdrs, &objp->info))
return(FALSE);
return(TRUE);
} /* xdr_rptrace */
/********************************************************************
*
* xdr_ptrace_return -
*
* xdr routine for remote ptrace data returned by server
*
*/
bool_t xdr_ptrace_return(xdrs, objp)
XDR *xdrs;
Ptrace_return *objp;
{
if (! xdr_int(xdrs, &objp->status))
return(FALSE);
if (! xdr_int(xdrs, &objp->errno))
return(FALSE);
if (! xdr_ptrace_info(xdrs, &objp->info))
return(FALSE);
return(TRUE);
} /* xdr_ptrace_return */
/********************************************************************
*
* xdr_c_bytes -
*
* xdr routine for counted bytes
*
*/
bool_t xdr_c_bytes(xdrs,objp)
XDR *xdrs;
C_bytes *objp;
{
return(xdr_bytes(xdrs, &objp->bytes, (u_int *) &objp->len, MAX_LEN));
} /* xdr_c_bytes */
|