xref: /illumos-gate/usr/src/uts/common/sys/sysconf.h (revision 1a578a15d3f76161f037cd99883a1f54a9eda785)
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  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*
27  * sysconf.h - include file for sysconf utility and the kernel.
28  */
29 
30 #ifndef _SYS_SYSCONF_H
31 #define	_SYS_SYSCONF_H
32 
33 #pragma ident	"%Z%%M%	%I%	%E% SMI"
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 /*
40  * For each entry in /etc/system a sysparam record is created.
41  */
42 struct sysparam {
43 	struct sysparam *sys_next; /* pointer to next */
44 	int	sys_type;	/* type of record */
45 	int	sys_op;		/* operation */
46 	char 	*sys_modnam;	/* module name (null if param in kernel) */
47 	char	*sys_ptr;	/* string pointer to device, etc. */
48 	u_longlong_t	sys_info;	/* additional information */
49 	char	*sys_config;	/* configuration data */
50 	int	sys_len;	/* len of config data */
51 	ulong_t	*addrp;		/* pointer to valloced config addresses */
52 	int	sys_flags; 	/* flags to check duplicate entries */
53 };
54 
55 #define	MAXLINESIZE 80		/* max size of a line in /etc/system */
56 
57 struct modcmd {
58 	char *mc_cmdname;
59 	int mc_type;
60 };
61 
62 #define	MOD_EXCLUDE	0	/* we'll never load this one */
63 #define	MOD_INCLUDE	1	/* load on demand */
64 #define	MOD_FORCELOAD	2	/* load during initialization */
65 #define	MOD_ROOTDEV	3	/* root device */
66 #define	MOD_ROOTFS 	4	/* root fs type */
67 #define	MOD_SWAPDEV	5	/* swap device */
68 #define	MOD_SWAPFS 	6	/* swap fs type */
69 #define	MOD_MODDIR	7	/* default directory for modules */
70 #define	MOD_SET		8	/* set int to specified value */
71 #define	MOD_UNKNOWN	9	/* unknown command */
72 #define	MOD_SET32	10	/* like MOD_SET but -only- on 32-bit kernel */
73 #define	MOD_SET64	11	/* like MOD_SET but -only- on 64-bit kernel */
74 
75 /*
76  * Commands for mod_sysctl()
77  */
78 #define	SYS_FORCELOAD	0	/* forceload modules */
79 #define	SYS_SET_KVAR	1	/* set kernel variables */
80 #define	SYS_SET_MVAR 	2	/* set module variables */
81 #define	SYS_CHECK_EXCLUDE 3	/* check if a module is excluded */
82 
83 /*
84  * Legal operations for MOD_SET.
85  */
86 #define	SETOP_NONE	0	/* no op - for types other than MOD_SET */
87 #define	SETOP_ASSIGN	1	/* '=' - simple assignment */
88 #define	SETOP_AND	2	/* '&' - bitwise AND */
89 #define	SETOP_OR	3	/* '|' - bitwise OR */
90 
91 /*
92  * Defines for sys_flags.
93  */
94 #define	SYSPARAM_STR_TOKEN	0x0001 /* a string token is set */
95 #define	SYSPARAM_HEX_TOKEN	0x0002 /* a hexadecimal number is set */
96 #define	SYSPARAM_DEC_TOKEN	0x0004 /* a decimal number is set */
97 #define	SYSPARAM_DUP		0x0010 /* this entry is duplicated */
98 #define	SYSPARAM_TERM		0x0020 /* this entry is the last entry */
99 
100 #ifdef	__cplusplus
101 }
102 #endif
103 
104 #endif	/* _SYS_SYSCONF_H */
105