summaryrefslogtreecommitdiff
path: root/usr/src/lib/libc/inc/libc_int.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libc/inc/libc_int.h')
-rw-r--r--usr/src/lib/libc/inc/libc_int.h140
1 files changed, 140 insertions, 0 deletions
diff --git a/usr/src/lib/libc/inc/libc_int.h b/usr/src/lib/libc/inc/libc_int.h
new file mode 100644
index 0000000000..c427a56152
--- /dev/null
+++ b/usr/src/lib/libc/inc/libc_int.h
@@ -0,0 +1,140 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 1999-2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _LIBC_INT_H
+#define _LIBC_INT_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Libc/rtld Runtime Interface
+ */
+#define CI_NULL 0 /* (void) last entry */
+#define CI_VERSION 1 /* current version of ri_interface */
+#define CI_ATEXIT 2 /* _preexec_exit_handlers() address */
+#define CI_LCMESSAGES 3 /* message locale */
+#define CI_BIND_GUARD 4 /* bind_guard() address */
+#define CI_BIND_CLEAR 5 /* bind_clear() address */
+#define CI_THR_SELF 6 /* thr_self() address */
+#define CI_TLS_MODADD 7 /* __tls_mod_add() address */
+#define CI_TLS_MODREM 8 /* __tls_mod_remove() address */
+#define CI_TLS_STATMOD 9 /* __tls_static_mods() address */
+#define CI_THRINIT 10 /* libc thread initialization */
+
+#define CI_MAX 11
+
+#define CI_V_NONE 0 /* ci_version versions */
+#define CI_V_ONE 1 /* original version */
+#define CI_V_TWO 2
+#define CI_V_THREE 3
+#define CI_V_FOUR 4
+#define CI_V_CURRENT CI_V_FOUR /* current version of libc interface */
+#define CI_V_NUM 5 /* number of CI_V_* numbers */
+
+/*
+ * Libc to ld.so.1 interface communication structure.
+ */
+typedef struct {
+ int ci_tag;
+ union {
+ int (*ci_func)();
+ long ci_val;
+ char *ci_ptr;
+ } ci_un;
+} Lc_interface;
+
+/*
+ * Address range returned via CI_ATEXIT. Note, the address range array passed
+ * back from ld.so.1 is maintained by ld.so.1 and should not be freed by libc.
+ */
+typedef struct {
+ void * lb; /* lower bound */
+ void * ub; /* upper bound */
+} Lc_addr_range_t;
+
+/*
+ * Thread-Local storage data type and interfaces shared between
+ * libc & ld.so.1.
+ */
+
+typedef struct {
+ unsigned long ti_moduleid; /* module ID for TLS var */
+ unsigned long ti_tlsoffset; /* offset into tls block for TLS var */
+} TLS_index;
+
+
+typedef struct {
+ const char *tm_modname; /* name of object */
+ /* containing TLS */
+ unsigned long tm_modid; /* TLS module id */
+ void * tm_tlsblock; /* pointer to r/o init image */
+ unsigned long tm_filesz; /* initialized file size */
+ unsigned long tm_memsz; /* memory size */
+ long tm_stattlsoffset; /* signed offset into static */
+ /* TLS block */
+ unsigned long tm_flags;
+ void * tm_tlsinitarray; /* TLS .init function array */
+ unsigned long tm_tlsinitarraycnt; /* # of entries in initarray */
+ void * tm_tlsfiniarray; /* TLS .fini function array */
+ unsigned long tm_tlsfiniarraycnt; /* # of entries in finiarray */
+ unsigned long tm_pad[5]; /* future expansion */
+} TLS_modinfo;
+
+#ifdef _SYSCALL32
+typedef struct {
+ caddr32_t tm_modname; /* name of object */
+ /* containing TLS */
+ uint32_t tm_modid; /* TLS module id */
+ caddr32_t tm_tlsblock; /* pointer to r/o init image */
+ uint32_t tm_filesz; /* initialized file size */
+ uint32_t tm_memsz; /* memory size */
+ int32_t tm_stattlsoffset; /* signed offset into static */
+ /* TLS block */
+ uint32_t tm_flags;
+ caddr32_t tm_tlsinitarray; /* TLS .init function array */
+ uint32_t tm_tlsinitarraycnt; /* # of entries in initarray */
+ caddr32_t tm_tlsfiniarray; /* TLS .fini function array */
+ uint32_t tm_tlsfiniarraycnt; /* # of entries in finiarray */
+ uint32_t tm_pad[5]; /* future expansion */
+} TLS_modinfo32;
+#endif
+
+
+/*
+ * Flag values for TLS_modifo.tm_flags
+ */
+#define TM_FLG_STATICTLS 0x0001 /* Static TLS module */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LIBC_INT_H */