xref: /titanic_44/usr/src/cmd/sgs/include/list.h (revision 1e4c938b57d1656808e4112127ff1dce3eba5314)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  *	Copyright (c) 1988 AT&T
24  *	  All Rights Reserved
25  *
26  *
27  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  *
30  * This file maintains an old style of list processing that is required by
31  * librtld_db to iterate over older core files/process images.
32  */
33 #ifndef	_LIST_H
34 #define	_LIST_H
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #include <sys/elftypes.h>
41 
42 typedef	struct listnode	Listnode;
43 typedef	struct list	List;
44 
45 struct	listnode {			/* a node on a linked list */
46 	void		*data;		/* the data item */
47 	Listnode	*next;		/* the next element */
48 };
49 
50 struct	list {				/* a linked list */
51 	Listnode	*head;		/* the first element */
52 	Listnode	*tail;		/* the last element */
53 };
54 
55 
56 #ifdef _SYSCALL32
57 typedef	struct listnode32	Listnode32;
58 typedef	struct list32		List32;
59 
60 struct	listnode32 {			/* a node on a linked list */
61 	Elf32_Addr	data;		/* the data item */
62 	Elf32_Addr	next;		/* the next element */
63 };
64 
65 struct	list32 {			/* a linked list */
66 	Elf32_Addr	head;		/* the first element */
67 	Elf32_Addr	tail;		/* the last element */
68 };
69 #endif	/* _SYSCALL32 */
70 
71 #ifdef	__cplusplus
72 }
73 #endif
74 
75 #endif /* _LIST_H */
76