summaryrefslogtreecommitdiff
path: root/gdb/osf-share/cma_handle.h
blob: e63de018a047cf0d724d2c207f61d82dd6aba209 (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
/* 
 * (c) Copyright 1990-1996 OPEN SOFTWARE FOUNDATION, INC.
 * (c) Copyright 1990-1996 HEWLETT-PACKARD COMPANY
 * (c) Copyright 1990-1996 DIGITAL EQUIPMENT CORPORATION
 * (c) Copyright 1991, 1992 Siemens-Nixdorf Information Systems
 * To anyone who acknowledges that this file is provided "AS IS" without
 * any express or implied warranty: permission to use, copy, modify, and
 * distribute this file for any purpose is hereby granted without fee,
 * provided that the above copyright notices and this notice appears in
 * all source code copies, and that none of the names listed above be used
 * in advertising or publicity pertaining to distribution of the software
 * without specific, written prior permission.  None of these organizations
 * makes any representations about the suitability of this software for
 * any purpose.
 */
/*
 *	Header file for handles
 */

#ifndef CMA_HANDLE
#define CMA_HANDLE

/*
 *  INCLUDE FILES
 */

#include <cma_defs.h>
#include <cma_attr.h>

/*
 * CONSTANTS AND MACROS
 */

#define cma__validate_attr(handle) \
    ((cma__t_int_attr *)cma__validate_handle ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_attr))

#define cma__validate_cv(handle) \
    ((cma__t_int_cv *)cma__validate_handle ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_cv))

#define cma__validate_mutex(handle) \
    ((cma__t_int_mutex *)cma__validate_handle ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_mutex))

#define cma__validate_tcb(handle) \
    ((cma__t_int_tcb *)cma__validate_handle ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_tcb))

#define cma__validate_stack(handle) \
    ((cma__t_int_stack *)cma__validate_handle ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_stack))

#define cma__validate_null_attr(handle) \
    ((cma__t_int_attr *)cma__validate_handle_null ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_attr))

#define cma__validate_null_cv(handle) \
    ((cma__t_int_cv *)cma__validate_handle_null ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_cv))

#define cma__validate_null_mutex(handle) \
    ((cma__t_int_mutex *)cma__validate_handle_null ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_mutex))

#define cma__validate_null_tcb(handle) \
    ((cma__t_int_tcb *)cma__validate_handle_null ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_tcb))

#define cma__validate_null_stack(handle) \
    ((cma__t_int_stack *)cma__validate_handle_null ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_stack))

#define cma__val_attr_stat(handle,obj) \
    cma__val_hand_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_attr, \
	    (cma__t_object **)obj)

#define cma__val_cv_stat(handle,obj) \
    cma__val_hand_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_cv, \
	    (cma__t_object **)obj)

#define cma__val_mutex_stat(handle,obj) \
    cma__val_hand_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_mutex, \
	    (cma__t_object **)obj)

#define cma__val_tcb_stat(handle) \
    cma__val_hand_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_tcb, \
	    (cma__t_object **)obj)

#define cma__val_stack_stat(handle,obj) \
    cma__val_hand_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_stack, \
	    (cma__t_object **)obj)

#define cma__val_nullattr_stat(handle,obj) \
    cma__val_handnull_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_attr, \
	    (cma__t_object **)obj)

#define cma__val_nullcv_stat(handle,obj) \
    cma__val_handnull_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_cv, \
	    (cma__t_object **)obj)

#define cma__val_nullmutex_stat(handle,obj) \
    cma__val_handnull_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_mutex, \
	    (cma__t_object **)obj)

#define cma__val_nulltcb_stat(handle,obj) \
    cma__val_handnull_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_tcb, \
	    (cma__t_object **)obj)

#define cma__val_nullstack_stat(handle) \
    cma__val_handnull_stat ( \
	    (cma_t_handle *)(handle), \
	    cma__c_obj_stack, \
	    (cma__t_object **)obj)

/*
 * TYPEDEFS
 */

/*
 * Internal format of a handle (to the outside world it's an array of two
 * addresses, but we know better).
 */
typedef struct CMA__T_INT_HANDLE {
    cma__t_object	*pointer;	/* Address of internal structure */
    cma__t_short	sequence;	/* Sequence number of object */
    cma__t_short	type;		/* Type code of object */
    } cma__t_int_handle;

/*
 *  GLOBAL DATA
 */

/*
 * INTERNAL INTERFACES
 */

extern void cma__clear_handle (cma_t_handle *);

extern void cma__object_to_handle (cma__t_object *,cma_t_handle *);

extern cma__t_int_attr * cma__validate_default_attr (cma_t_handle *);

extern cma_t_status cma__val_defattr_stat (cma_t_handle *,cma__t_int_attr **);

extern cma__t_object * cma__validate_handle (cma_t_handle *,cma_t_natural );

extern cma_t_status cma__val_hand_stat (cma_t_handle *,cma_t_natural,cma__t_object **);

extern 	cma__t_object	*cma__validate_handle_null (cma_t_handle *,cma_t_natural);

extern cma_t_status cma__val_handnull_stat (cma_t_handle *,cma_t_natural,cma__t_object **);

#endif