xref: /minix3/external/bsd/elftoolchain/dist/libdwarf/dwarf_attr.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: dwarf_attr.c,v 1.2 2014/03/09 16:58:03 christos Exp $	*/
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc /*-
4*0a6a1f1dSLionel Sambuc  * Copyright (c) 2007 John Birrell (jb@freebsd.org)
5*0a6a1f1dSLionel Sambuc  * Copyright (c) 2009 Kai Wang
6*0a6a1f1dSLionel Sambuc  * All rights reserved.
7*0a6a1f1dSLionel Sambuc  *
8*0a6a1f1dSLionel Sambuc  * Redistribution and use in source and binary forms, with or without
9*0a6a1f1dSLionel Sambuc  * modification, are permitted provided that the following conditions
10*0a6a1f1dSLionel Sambuc  * are met:
11*0a6a1f1dSLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
12*0a6a1f1dSLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
13*0a6a1f1dSLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
14*0a6a1f1dSLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
15*0a6a1f1dSLionel Sambuc  *    documentation and/or other materials provided with the distribution.
16*0a6a1f1dSLionel Sambuc  *
17*0a6a1f1dSLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18*0a6a1f1dSLionel Sambuc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*0a6a1f1dSLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*0a6a1f1dSLionel Sambuc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21*0a6a1f1dSLionel Sambuc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*0a6a1f1dSLionel Sambuc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*0a6a1f1dSLionel Sambuc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*0a6a1f1dSLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*0a6a1f1dSLionel Sambuc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*0a6a1f1dSLionel Sambuc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*0a6a1f1dSLionel Sambuc  * SUCH DAMAGE.
28*0a6a1f1dSLionel Sambuc  */
29*0a6a1f1dSLionel Sambuc 
30*0a6a1f1dSLionel Sambuc #include "_libdwarf.h"
31*0a6a1f1dSLionel Sambuc 
32*0a6a1f1dSLionel Sambuc __RCSID("$NetBSD: dwarf_attr.c,v 1.2 2014/03/09 16:58:03 christos Exp $");
33*0a6a1f1dSLionel Sambuc ELFTC_VCSID("Id: dwarf_attr.c 2072 2011-10-27 03:26:49Z jkoshy ");
34*0a6a1f1dSLionel Sambuc 
35*0a6a1f1dSLionel Sambuc int
dwarf_attr(Dwarf_Die die,Dwarf_Half attr,Dwarf_Attribute * atp,Dwarf_Error * error)36*0a6a1f1dSLionel Sambuc dwarf_attr(Dwarf_Die die, Dwarf_Half attr, Dwarf_Attribute *atp,
37*0a6a1f1dSLionel Sambuc     Dwarf_Error *error)
38*0a6a1f1dSLionel Sambuc {
39*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
40*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
41*0a6a1f1dSLionel Sambuc 
42*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
43*0a6a1f1dSLionel Sambuc 
44*0a6a1f1dSLionel Sambuc 	if (die == NULL || atp == NULL) {
45*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
46*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
47*0a6a1f1dSLionel Sambuc 	}
48*0a6a1f1dSLionel Sambuc 
49*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, attr)) == NULL) {
50*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
51*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
52*0a6a1f1dSLionel Sambuc 	}
53*0a6a1f1dSLionel Sambuc 
54*0a6a1f1dSLionel Sambuc 	*atp = at;
55*0a6a1f1dSLionel Sambuc 
56*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
57*0a6a1f1dSLionel Sambuc }
58*0a6a1f1dSLionel Sambuc 
59*0a6a1f1dSLionel Sambuc int
dwarf_attrlist(Dwarf_Die die,Dwarf_Attribute ** attrbuf,Dwarf_Signed * attrcount,Dwarf_Error * error)60*0a6a1f1dSLionel Sambuc dwarf_attrlist(Dwarf_Die die, Dwarf_Attribute **attrbuf,
61*0a6a1f1dSLionel Sambuc     Dwarf_Signed *attrcount, Dwarf_Error *error)
62*0a6a1f1dSLionel Sambuc {
63*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
64*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
65*0a6a1f1dSLionel Sambuc 	int i;
66*0a6a1f1dSLionel Sambuc 
67*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
68*0a6a1f1dSLionel Sambuc 
69*0a6a1f1dSLionel Sambuc 	if (die == NULL || attrbuf == NULL || attrcount == NULL) {
70*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
71*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
72*0a6a1f1dSLionel Sambuc 	}
73*0a6a1f1dSLionel Sambuc 
74*0a6a1f1dSLionel Sambuc 	if (die->die_ab->ab_atnum == 0) {
75*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
76*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
77*0a6a1f1dSLionel Sambuc 	}
78*0a6a1f1dSLionel Sambuc 
79*0a6a1f1dSLionel Sambuc 	*attrcount = die->die_ab->ab_atnum;
80*0a6a1f1dSLionel Sambuc 
81*0a6a1f1dSLionel Sambuc 	if (die->die_attrarray != NULL) {
82*0a6a1f1dSLionel Sambuc 		*attrbuf = die->die_attrarray;
83*0a6a1f1dSLionel Sambuc 		return (DW_DLV_OK);
84*0a6a1f1dSLionel Sambuc 	}
85*0a6a1f1dSLionel Sambuc 
86*0a6a1f1dSLionel Sambuc 	if ((die->die_attrarray = malloc(*attrcount * sizeof(Dwarf_Attribute)))
87*0a6a1f1dSLionel Sambuc 	    == NULL) {
88*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY);
89*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
90*0a6a1f1dSLionel Sambuc 	}
91*0a6a1f1dSLionel Sambuc 
92*0a6a1f1dSLionel Sambuc 	for (i = 0, at = STAILQ_FIRST(&die->die_attr);
93*0a6a1f1dSLionel Sambuc 	     i < *attrcount && at != NULL; i++, at = STAILQ_NEXT(at, at_next))
94*0a6a1f1dSLionel Sambuc 		die->die_attrarray[i] = at;
95*0a6a1f1dSLionel Sambuc 
96*0a6a1f1dSLionel Sambuc 	*attrbuf = die->die_attrarray;
97*0a6a1f1dSLionel Sambuc 
98*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
99*0a6a1f1dSLionel Sambuc }
100*0a6a1f1dSLionel Sambuc 
101*0a6a1f1dSLionel Sambuc int
dwarf_hasattr(Dwarf_Die die,Dwarf_Half attr,Dwarf_Bool * ret_bool,Dwarf_Error * error)102*0a6a1f1dSLionel Sambuc dwarf_hasattr(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *ret_bool,
103*0a6a1f1dSLionel Sambuc     Dwarf_Error *error)
104*0a6a1f1dSLionel Sambuc {
105*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
106*0a6a1f1dSLionel Sambuc 
107*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
108*0a6a1f1dSLionel Sambuc 
109*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_bool == NULL) {
110*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
111*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
112*0a6a1f1dSLionel Sambuc 	}
113*0a6a1f1dSLionel Sambuc 
114*0a6a1f1dSLionel Sambuc 	*ret_bool = (_dwarf_attr_find(die, attr) != NULL);
115*0a6a1f1dSLionel Sambuc 
116*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
117*0a6a1f1dSLionel Sambuc }
118*0a6a1f1dSLionel Sambuc 
119*0a6a1f1dSLionel Sambuc int
dwarf_lowpc(Dwarf_Die die,Dwarf_Addr * ret_lowpc,Dwarf_Error * error)120*0a6a1f1dSLionel Sambuc dwarf_lowpc(Dwarf_Die die, Dwarf_Addr *ret_lowpc, Dwarf_Error *error)
121*0a6a1f1dSLionel Sambuc {
122*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
123*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
124*0a6a1f1dSLionel Sambuc 
125*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
126*0a6a1f1dSLionel Sambuc 
127*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_lowpc == NULL) {
128*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
129*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
130*0a6a1f1dSLionel Sambuc 	}
131*0a6a1f1dSLionel Sambuc 
132*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, DW_AT_low_pc)) == NULL) {
133*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
134*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
135*0a6a1f1dSLionel Sambuc 	}
136*0a6a1f1dSLionel Sambuc 
137*0a6a1f1dSLionel Sambuc 	*ret_lowpc = at->u[0].u64;
138*0a6a1f1dSLionel Sambuc 
139*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
140*0a6a1f1dSLionel Sambuc }
141*0a6a1f1dSLionel Sambuc 
142*0a6a1f1dSLionel Sambuc int
dwarf_highpc(Dwarf_Die die,Dwarf_Addr * ret_highpc,Dwarf_Error * error)143*0a6a1f1dSLionel Sambuc dwarf_highpc(Dwarf_Die die, Dwarf_Addr *ret_highpc, Dwarf_Error *error)
144*0a6a1f1dSLionel Sambuc {
145*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
146*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
147*0a6a1f1dSLionel Sambuc 
148*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
149*0a6a1f1dSLionel Sambuc 
150*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_highpc == NULL) {
151*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
152*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
153*0a6a1f1dSLionel Sambuc 	}
154*0a6a1f1dSLionel Sambuc 
155*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, DW_AT_high_pc)) == NULL) {
156*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
157*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
158*0a6a1f1dSLionel Sambuc 	}
159*0a6a1f1dSLionel Sambuc 
160*0a6a1f1dSLionel Sambuc 	*ret_highpc = at->u[0].u64;
161*0a6a1f1dSLionel Sambuc 
162*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
163*0a6a1f1dSLionel Sambuc }
164*0a6a1f1dSLionel Sambuc 
165*0a6a1f1dSLionel Sambuc int
dwarf_bytesize(Dwarf_Die die,Dwarf_Unsigned * ret_size,Dwarf_Error * error)166*0a6a1f1dSLionel Sambuc dwarf_bytesize(Dwarf_Die die, Dwarf_Unsigned *ret_size, Dwarf_Error *error)
167*0a6a1f1dSLionel Sambuc {
168*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
169*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
170*0a6a1f1dSLionel Sambuc 
171*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
172*0a6a1f1dSLionel Sambuc 
173*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_size == NULL) {
174*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
175*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
176*0a6a1f1dSLionel Sambuc 	}
177*0a6a1f1dSLionel Sambuc 
178*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, DW_AT_byte_size)) == NULL) {
179*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
180*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
181*0a6a1f1dSLionel Sambuc 	}
182*0a6a1f1dSLionel Sambuc 
183*0a6a1f1dSLionel Sambuc 	*ret_size = at->u[0].u64;
184*0a6a1f1dSLionel Sambuc 
185*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
186*0a6a1f1dSLionel Sambuc }
187*0a6a1f1dSLionel Sambuc 
188*0a6a1f1dSLionel Sambuc int
dwarf_bitsize(Dwarf_Die die,Dwarf_Unsigned * ret_size,Dwarf_Error * error)189*0a6a1f1dSLionel Sambuc dwarf_bitsize(Dwarf_Die die, Dwarf_Unsigned *ret_size, Dwarf_Error *error)
190*0a6a1f1dSLionel Sambuc {
191*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
192*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
193*0a6a1f1dSLionel Sambuc 
194*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
195*0a6a1f1dSLionel Sambuc 
196*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_size == NULL) {
197*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
198*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
199*0a6a1f1dSLionel Sambuc 	}
200*0a6a1f1dSLionel Sambuc 
201*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, DW_AT_bit_size)) == NULL) {
202*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
203*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
204*0a6a1f1dSLionel Sambuc 	}
205*0a6a1f1dSLionel Sambuc 
206*0a6a1f1dSLionel Sambuc 	*ret_size = at->u[0].u64;
207*0a6a1f1dSLionel Sambuc 
208*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
209*0a6a1f1dSLionel Sambuc }
210*0a6a1f1dSLionel Sambuc 
211*0a6a1f1dSLionel Sambuc int
dwarf_bitoffset(Dwarf_Die die,Dwarf_Unsigned * ret_size,Dwarf_Error * error)212*0a6a1f1dSLionel Sambuc dwarf_bitoffset(Dwarf_Die die, Dwarf_Unsigned *ret_size, Dwarf_Error *error)
213*0a6a1f1dSLionel Sambuc {
214*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
215*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
216*0a6a1f1dSLionel Sambuc 
217*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
218*0a6a1f1dSLionel Sambuc 
219*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_size == NULL) {
220*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
221*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
222*0a6a1f1dSLionel Sambuc 	}
223*0a6a1f1dSLionel Sambuc 
224*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, DW_AT_bit_offset)) == NULL) {
225*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
226*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
227*0a6a1f1dSLionel Sambuc 	}
228*0a6a1f1dSLionel Sambuc 
229*0a6a1f1dSLionel Sambuc 	*ret_size = at->u[0].u64;
230*0a6a1f1dSLionel Sambuc 
231*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
232*0a6a1f1dSLionel Sambuc }
233*0a6a1f1dSLionel Sambuc 
234*0a6a1f1dSLionel Sambuc int
dwarf_srclang(Dwarf_Die die,Dwarf_Unsigned * ret_lang,Dwarf_Error * error)235*0a6a1f1dSLionel Sambuc dwarf_srclang(Dwarf_Die die, Dwarf_Unsigned *ret_lang, Dwarf_Error *error)
236*0a6a1f1dSLionel Sambuc {
237*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
238*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
239*0a6a1f1dSLionel Sambuc 
240*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
241*0a6a1f1dSLionel Sambuc 
242*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_lang == NULL) {
243*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
244*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
245*0a6a1f1dSLionel Sambuc 	}
246*0a6a1f1dSLionel Sambuc 
247*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, DW_AT_language)) == NULL) {
248*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
249*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
250*0a6a1f1dSLionel Sambuc 	}
251*0a6a1f1dSLionel Sambuc 
252*0a6a1f1dSLionel Sambuc 	*ret_lang = at->u[0].u64;
253*0a6a1f1dSLionel Sambuc 
254*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
255*0a6a1f1dSLionel Sambuc }
256*0a6a1f1dSLionel Sambuc 
257*0a6a1f1dSLionel Sambuc int
dwarf_arrayorder(Dwarf_Die die,Dwarf_Unsigned * ret_order,Dwarf_Error * error)258*0a6a1f1dSLionel Sambuc dwarf_arrayorder(Dwarf_Die die, Dwarf_Unsigned *ret_order, Dwarf_Error *error)
259*0a6a1f1dSLionel Sambuc {
260*0a6a1f1dSLionel Sambuc 	Dwarf_Attribute at;
261*0a6a1f1dSLionel Sambuc 	Dwarf_Debug dbg;
262*0a6a1f1dSLionel Sambuc 
263*0a6a1f1dSLionel Sambuc 	dbg = die != NULL ? die->die_dbg : NULL;
264*0a6a1f1dSLionel Sambuc 
265*0a6a1f1dSLionel Sambuc 	if (die == NULL || ret_order == NULL) {
266*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_ARGUMENT);
267*0a6a1f1dSLionel Sambuc 		return (DW_DLV_ERROR);
268*0a6a1f1dSLionel Sambuc 	}
269*0a6a1f1dSLionel Sambuc 
270*0a6a1f1dSLionel Sambuc 	if ((at = _dwarf_attr_find(die, DW_AT_ordering)) == NULL) {
271*0a6a1f1dSLionel Sambuc 		DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY);
272*0a6a1f1dSLionel Sambuc 		return (DW_DLV_NO_ENTRY);
273*0a6a1f1dSLionel Sambuc 	}
274*0a6a1f1dSLionel Sambuc 
275*0a6a1f1dSLionel Sambuc 	*ret_order = at->u[0].u64;
276*0a6a1f1dSLionel Sambuc 
277*0a6a1f1dSLionel Sambuc 	return (DW_DLV_OK);
278*0a6a1f1dSLionel Sambuc }
279