xref: /onnv-gate/usr/src/uts/common/sys/sysconf.h (revision 3912:f6891a60bd72)
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
51544Seschrock  * Common Development and Distribution License (the "License").
61544Seschrock  * 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*3912Slling  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*
270Sstevel@tonic-gate  * sysconf.h - include file for sysconf utility and the kernel.
280Sstevel@tonic-gate  */
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifndef _SYS_SYSCONF_H
310Sstevel@tonic-gate #define	_SYS_SYSCONF_H
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
340Sstevel@tonic-gate 
350Sstevel@tonic-gate #ifdef	__cplusplus
360Sstevel@tonic-gate extern "C" {
370Sstevel@tonic-gate #endif
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /*
400Sstevel@tonic-gate  * For each entry in /etc/system a sysparam record is created.
410Sstevel@tonic-gate  */
420Sstevel@tonic-gate struct sysparam {
430Sstevel@tonic-gate 	struct sysparam *sys_next; /* pointer to next */
440Sstevel@tonic-gate 	int	sys_type;	/* type of record */
450Sstevel@tonic-gate 	int	sys_op;		/* operation */
460Sstevel@tonic-gate 	char 	*sys_modnam;	/* module name (null if param in kernel) */
470Sstevel@tonic-gate 	char	*sys_ptr;	/* string pointer to device, etc. */
480Sstevel@tonic-gate 	u_longlong_t	sys_info;	/* additional information */
490Sstevel@tonic-gate 	char	*sys_config;	/* configuration data */
500Sstevel@tonic-gate 	int	sys_len;	/* len of config data */
510Sstevel@tonic-gate 	ulong_t	*addrp;		/* pointer to valloced config addresses */
520Sstevel@tonic-gate 	int	sys_flags; 	/* flags to check duplicate entries */
530Sstevel@tonic-gate };
540Sstevel@tonic-gate 
550Sstevel@tonic-gate #define	MAXLINESIZE 80		/* max size of a line in /etc/system */
560Sstevel@tonic-gate 
570Sstevel@tonic-gate struct modcmd {
580Sstevel@tonic-gate 	char *mc_cmdname;
590Sstevel@tonic-gate 	int mc_type;
600Sstevel@tonic-gate };
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #define	MOD_EXCLUDE	0	/* we'll never load this one */
630Sstevel@tonic-gate #define	MOD_INCLUDE	1	/* load on demand */
640Sstevel@tonic-gate #define	MOD_FORCELOAD	2	/* load during initialization */
650Sstevel@tonic-gate #define	MOD_ROOTDEV	3	/* root device */
660Sstevel@tonic-gate #define	MOD_ROOTFS 	4	/* root fs type */
670Sstevel@tonic-gate #define	MOD_SWAPDEV	5	/* swap device */
680Sstevel@tonic-gate #define	MOD_SWAPFS 	6	/* swap fs type */
690Sstevel@tonic-gate #define	MOD_MODDIR	7	/* default directory for modules */
700Sstevel@tonic-gate #define	MOD_SET		8	/* set int to specified value */
710Sstevel@tonic-gate #define	MOD_UNKNOWN	9	/* unknown command */
720Sstevel@tonic-gate #define	MOD_SET32	10	/* like MOD_SET but -only- on 32-bit kernel */
730Sstevel@tonic-gate #define	MOD_SET64	11	/* like MOD_SET but -only- on 64-bit kernel */
740Sstevel@tonic-gate 
750Sstevel@tonic-gate /*
760Sstevel@tonic-gate  * Commands for mod_sysctl()
770Sstevel@tonic-gate  */
780Sstevel@tonic-gate #define	SYS_FORCELOAD	0	/* forceload modules */
790Sstevel@tonic-gate #define	SYS_SET_KVAR	1	/* set kernel variables */
800Sstevel@tonic-gate #define	SYS_SET_MVAR 	2	/* set module variables */
810Sstevel@tonic-gate #define	SYS_CHECK_EXCLUDE 3	/* check if a module is excluded */
820Sstevel@tonic-gate 
830Sstevel@tonic-gate /*
840Sstevel@tonic-gate  * Legal operations for MOD_SET.
850Sstevel@tonic-gate  */
860Sstevel@tonic-gate #define	SETOP_NONE	0	/* no op - for types other than MOD_SET */
870Sstevel@tonic-gate #define	SETOP_ASSIGN	1	/* '=' - simple assignment */
880Sstevel@tonic-gate #define	SETOP_AND	2	/* '&' - bitwise AND */
890Sstevel@tonic-gate #define	SETOP_OR	3	/* '|' - bitwise OR */
900Sstevel@tonic-gate 
910Sstevel@tonic-gate /*
920Sstevel@tonic-gate  * Defines for sys_flags.
930Sstevel@tonic-gate  */
940Sstevel@tonic-gate #define	SYSPARAM_STR_TOKEN	0x0001 /* a string token is set */
950Sstevel@tonic-gate #define	SYSPARAM_HEX_TOKEN	0x0002 /* a hexadecimal number is set */
960Sstevel@tonic-gate #define	SYSPARAM_DEC_TOKEN	0x0004 /* a decimal number is set */
970Sstevel@tonic-gate #define	SYSPARAM_DUP		0x0010 /* this entry is duplicated */
980Sstevel@tonic-gate #define	SYSPARAM_TERM		0x0020 /* this entry is the last entry */
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate #ifdef	__cplusplus
1010Sstevel@tonic-gate }
1020Sstevel@tonic-gate #endif
1030Sstevel@tonic-gate 
1040Sstevel@tonic-gate #endif	/* _SYS_SYSCONF_H */
105