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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [vx-share/] [xdr_rdb.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/* xdr_rdb.c  - xdr routines for Remote Debug interface to VxWorks  */
2
 
3
/* Copyright 1992, 1993 Free Software Foundation, Inc.
4
 
5
   This code was donated by Wind River Systems, Inc. */
6
 
7
/*
8
modification history
9
--------------------
10
01a,21mar90,llk  created using modification 01d of xdr_dbx.c.
11
*/
12
 
13
/*
14
DESCRIPTION
15
This module contains the eXternal Data Representation (XDR) routines
16
for the RDB interface for VxWorks.
17
*/
18
 
19
#include "defs.h"
20
#include "vxWorks.h"
21
#include <rpc/rpc.h>
22
#include "xdr_rdb.h"
23
 
24
/* forward declarations */
25
 
26
bool_t
27
xdr_arg_type(xdrs, objp)
28
        XDR *xdrs;
29
        arg_type *objp;
30
{
31
        if (!xdr_enum(xdrs, (enum_t *)objp)) {
32
                return (FALSE);
33
        }
34
        return (TRUE);
35
}
36
 
37
bool_t
38
xdr_arg_value(xdrs, objp)
39
        XDR *xdrs;
40
        arg_value *objp;
41
{
42
        if (!xdr_arg_type(xdrs, &objp->type)) {
43
                return (FALSE);
44
        }
45
        switch (objp->type) {
46
        case T_BYTE:
47
                if (!xdr_char(xdrs, &objp->arg_value_u.v_byte)) {
48
                        return (FALSE);
49
                }
50
                break;
51
        case T_WORD:
52
                if (!xdr_short(xdrs, &objp->arg_value_u.v_word)) {
53
                        return (FALSE);
54
                }
55
                break;
56
        case T_INT:
57
                if (!xdr_int(xdrs, &objp->arg_value_u.v_int)) {
58
                        return (FALSE);
59
                }
60
                break;
61
        case T_FLOAT:
62
                if (!xdr_float(xdrs, &objp->arg_value_u.v_fp)) {
63
                        return (FALSE);
64
                }
65
                break;
66
        case T_DOUBLE:
67
                if (!xdr_double(xdrs, &objp->arg_value_u.v_dp)) {
68
                        return (FALSE);
69
                }
70
                break;
71
        case T_UNKNOWN:
72
                break;
73
        }
74
        return (TRUE);
75
}
76
 
77
bool_t
78
xdr_func_call(xdrs, objp)
79
        XDR *xdrs;
80
        func_call *objp;
81
{
82
        if (!xdr_int(xdrs, &objp->func_addr)) {
83
                return (FALSE);
84
        }
85
        if (!xdr_array(xdrs, (char **)&objp->args.args_val, (u_int *)&objp->args.args_len, MAX_FUNC_ARGS, sizeof(arg_value), xdr_arg_value)) {
86
                return (FALSE);
87
        }
88
        return (TRUE);
89
}
90
 
91
bool_t
92
xdr_arg_one(xdrs, objp)
93
        XDR *xdrs;
94
        arg_one *objp;
95
{
96
        if (!xdr_string(xdrs, objp, MAX_ARG_LEN)) {
97
                return (FALSE);
98
        }
99
        return (TRUE);
100
}
101
 
102
 
103
 
104
 
105
bool_t
106
xdr_arg_array(xdrs, objp)
107
        XDR *xdrs;
108
        arg_array *objp;
109
{
110
        if (!xdr_array(xdrs, (char **)&objp->arg_array_val, (u_int *)&objp->arg_array_len, MAX_ARG_CNT, sizeof(arg_one), xdr_arg_one)) {
111
                return (FALSE);
112
        }
113
        return (TRUE);
114
}
115
 
116
/*********************************************************************
117
*
118
* xdr_EVENT_TYPE -
119
*
120
*/
121
 
122
bool_t xdr_EVENT_TYPE(xdrs, objp)
123
    XDR *xdrs;
124
    EVENT_TYPE *objp;
125
 
126
    {
127
    if (!xdr_enum (xdrs, (enum_t *) objp))
128
        return (FALSE);
129
    return (TRUE);
130
    }
131
 
132
/*********************************************************************
133
*
134
* xdr_RDB_EVENT -
135
*
136
*/
137
 
138
bool_t xdr_RDB_EVENT (xdrs, objp)
139
    XDR *xdrs;
140
    RDB_EVENT *objp;
141
 
142
    {
143
    if (!xdr_int (xdrs, &objp->status))
144
        return (FALSE);
145
    if (!xdr_int (xdrs, &objp->taskId))
146
        return (FALSE);
147
    if (!xdr_EVENT_TYPE (xdrs, &objp->eventType))
148
        return (FALSE);
149
    if (!xdr_int (xdrs, &objp->sigType))
150
        return (FALSE);
151
    return (TRUE);
152
    }
153
 
154
/*********************************************************************
155
*
156
* xdr_TASK_START -
157
*
158
*/
159
 
160
bool_t
161
xdr_TASK_START (xdrs, objp)
162
    XDR *xdrs;
163
    TASK_START *objp;
164
 
165
    {
166
    if (!xdr_int (xdrs, &objp->status))
167
        return (FALSE);
168
    if (!xdr_int (xdrs, &objp->pid))
169
        return (FALSE);
170
    return (TRUE);
171
    }
172
 
173
 
174
/*********************************************************************
175
*
176
* xdr_SYMBOL_ADDR -
177
*
178
*/
179
 
180
bool_t
181
xdr_SYMBOL_ADDR (xdrs, objp)
182
    XDR *xdrs;
183
    SYMBOL_ADDR *objp;
184
 
185
    {
186
    if (!xdr_int (xdrs, &objp->status))
187
        return (FALSE);
188
    if (!xdr_u_int (xdrs, &objp->addr))
189
        return (FALSE);
190
    return (TRUE);
191
    }
192
 
193
/*********************************************************************
194
*
195
* xdr_SOURCE_STEP -
196
*
197
*/
198
 
199
bool_t
200
xdr_SOURCE_STEP (xdrs, objp)
201
    XDR *xdrs;
202
    SOURCE_STEP *objp;
203
 
204
    {
205
    if (!xdr_int (xdrs, &objp->taskId))
206
        return (FALSE);
207
    if (!xdr_u_int (xdrs, &objp->startAddr))
208
        return (FALSE);
209
    if (!xdr_u_int (xdrs, &objp->endAddr))
210
        return (FALSE);
211
    return (TRUE);
212
    }

powered by: WebSVN 2.1.0

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