xref: /onnv-gate/usr/src/cmd/sgs/link_audit/common/bindings.h (revision 12927:a27c46eb192b)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*12927SRod.Evans@Sun.COM  * Common Development and Distribution License (the "License").
6*12927SRod.Evans@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*12927SRod.Evans@Sun.COM  * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate #ifndef	_BINDINGS_H
260Sstevel@tonic-gate #define	_BINDINGS_H
270Sstevel@tonic-gate 
280Sstevel@tonic-gate #include <sys/lwp.h>
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifdef	__cplusplus
310Sstevel@tonic-gate extern "C" {
320Sstevel@tonic-gate #endif
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #define	BINDVERS	2
350Sstevel@tonic-gate #define	BINDCURVERS	BINDVERS
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #define	DEFFILE		"/tmp/bindings.data"
380Sstevel@tonic-gate #define	FILEENV		"BT_BUFFER"
390Sstevel@tonic-gate #define	BLKSIZE		0x4000
400Sstevel@tonic-gate #define	STRBLKSIZE	0x1000
410Sstevel@tonic-gate #define	DEFBKTS		3571			/* nice big prime number */
420Sstevel@tonic-gate 
430Sstevel@tonic-gate #define	MASK		(~(unsigned long)0<<28)
440Sstevel@tonic-gate 
450Sstevel@tonic-gate typedef struct _bind_entry {
460Sstevel@tonic-gate 	unsigned int	be_sym_name;
470Sstevel@tonic-gate 	unsigned int	be_lib_name;
480Sstevel@tonic-gate 	unsigned int	be_count;
490Sstevel@tonic-gate 	unsigned int	be_next;
500Sstevel@tonic-gate } binding_entry;
510Sstevel@tonic-gate 
520Sstevel@tonic-gate typedef struct {
530Sstevel@tonic-gate 	unsigned int	bb_head;	/* first entry in bucket */
540Sstevel@tonic-gate 	unsigned int	bb_pad;		/* maintain alignment for 32/64bit */
550Sstevel@tonic-gate 	lwp_mutex_t	bb_lock;	/* bucket chain lock */
560Sstevel@tonic-gate } binding_bucket;
570Sstevel@tonic-gate 
580Sstevel@tonic-gate typedef struct {
590Sstevel@tonic-gate 	unsigned int	bh_vers;
600Sstevel@tonic-gate 	unsigned int	bh_size;
610Sstevel@tonic-gate 	lwp_mutex_t	bh_lock;
620Sstevel@tonic-gate 	unsigned int	bh_end;
630Sstevel@tonic-gate 	unsigned int	bh_bktcnt;
640Sstevel@tonic-gate 	unsigned int	bh_strcur;		/* current strbuff ptr */
650Sstevel@tonic-gate 	unsigned int	bh_strend;		/* end of current strbuf */
660Sstevel@tonic-gate 	lwp_mutex_t	bh_strlock;		/* mutex to protect strings */
670Sstevel@tonic-gate 	binding_bucket	bh_bkts[DEFBKTS];
680Sstevel@tonic-gate } bindhead;
690Sstevel@tonic-gate 
700Sstevel@tonic-gate #ifdef	__cplusplus
710Sstevel@tonic-gate }
720Sstevel@tonic-gate #endif
730Sstevel@tonic-gate 
740Sstevel@tonic-gate #endif	/* _BINDINGS_H */
75