xref: /titanic_41/usr/src/uts/common/sys/sysconf.h (revision fd9cb95cbb2f626355a60efb9d02c5f0a33c10e6)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1990-2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * sysconf.h - include file for sysconf utility and the kernel.
29  */
30 
31 #ifndef _SYS_SYSCONF_H
32 #define	_SYS_SYSCONF_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * For each entry in /etc/system a sysparam record is created.
42  */
43 struct sysparam {
44 	struct sysparam *sys_next; /* pointer to next */
45 	int	sys_type;	/* type of record */
46 	int	sys_op;		/* operation */
47 	char 	*sys_modnam;	/* module name (null if param in kernel) */
48 	char	*sys_ptr;	/* string pointer to device, etc. */
49 	u_longlong_t	sys_info;	/* additional information */
50 	char	*sys_config;	/* configuration data */
51 	int	sys_len;	/* len of config data */
52 	ulong_t	*addrp;		/* pointer to valloced config addresses */
53 	int	sys_flags; 	/* flags to check duplicate entries */
54 };
55 
56 #define	MAXLINESIZE 80		/* max size of a line in /etc/system */
57 
58 struct modcmd {
59 	char *mc_cmdname;
60 	int mc_type;
61 };
62 
63 #define	MOD_EXCLUDE	0	/* we'll never load this one */
64 #define	MOD_INCLUDE	1	/* load on demand */
65 #define	MOD_FORCELOAD	2	/* load during initialization */
66 #define	MOD_ROOTDEV	3	/* root device */
67 #define	MOD_ROOTFS 	4	/* root fs type */
68 #define	MOD_SWAPDEV	5	/* swap device */
69 #define	MOD_SWAPFS 	6	/* swap fs type */
70 #define	MOD_MODDIR	7	/* default directory for modules */
71 #define	MOD_SET		8	/* set int to specified value */
72 #define	MOD_UNKNOWN	9	/* unknown command */
73 #define	MOD_SET32	10	/* like MOD_SET but -only- on 32-bit kernel */
74 #define	MOD_SET64	11	/* like MOD_SET but -only- on 64-bit kernel */
75 
76 /*
77  * Commands for mod_sysctl()
78  */
79 #define	SYS_FORCELOAD	0	/* forceload modules */
80 #define	SYS_SET_KVAR	1	/* set kernel variables */
81 #define	SYS_SET_MVAR 	2	/* set module variables */
82 #define	SYS_CHECK_EXCLUDE 3	/* check if a module is excluded */
83 
84 /*
85  * Legal operations for MOD_SET.
86  */
87 #define	SETOP_NONE	0	/* no op - for types other than MOD_SET */
88 #define	SETOP_ASSIGN	1	/* '=' - simple assignment */
89 #define	SETOP_AND	2	/* '&' - bitwise AND */
90 #define	SETOP_OR	3	/* '|' - bitwise OR */
91 
92 /*
93  * Defines for sys_flags.
94  */
95 #define	SYSPARAM_STR_TOKEN	0x0001 /* a string token is set */
96 #define	SYSPARAM_HEX_TOKEN	0x0002 /* a hexadecimal number is set */
97 #define	SYSPARAM_DEC_TOKEN	0x0004 /* a decimal number is set */
98 #define	SYSPARAM_DUP		0x0010 /* this entry is duplicated */
99 #define	SYSPARAM_TERM		0x0020 /* this entry is the last entry */
100 
101 #ifdef	__cplusplus
102 }
103 #endif
104 
105 #endif	/* _SYS_SYSCONF_H */
106