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