xref: /illumos-gate/usr/src/uts/common/sys/sysconf.h (revision 2d6eb4a5)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5ea8dc4b6Seschrock  * Common Development and Distribution License (the "License").
6ea8dc4b6Seschrock  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*b1b8ab34Slling  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  * sysconf.h - include file for sysconf utility and the kernel.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _SYS_SYSCONF_H
317c478bd9Sstevel@tonic-gate #define	_SYS_SYSCONF_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
347c478bd9Sstevel@tonic-gate extern "C" {
357c478bd9Sstevel@tonic-gate #endif
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * For each entry in /etc/system a sysparam record is created.
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate struct sysparam {
417c478bd9Sstevel@tonic-gate 	struct sysparam *sys_next; /* pointer to next */
427c478bd9Sstevel@tonic-gate 	int	sys_type;	/* type of record */
437c478bd9Sstevel@tonic-gate 	int	sys_op;		/* operation */
447c478bd9Sstevel@tonic-gate 	char 	*sys_modnam;	/* module name (null if param in kernel) */
457c478bd9Sstevel@tonic-gate 	char	*sys_ptr;	/* string pointer to device, etc. */
467c478bd9Sstevel@tonic-gate 	u_longlong_t	sys_info;	/* additional information */
477c478bd9Sstevel@tonic-gate 	char	*sys_config;	/* configuration data */
487c478bd9Sstevel@tonic-gate 	int	sys_len;	/* len of config data */
497c478bd9Sstevel@tonic-gate 	ulong_t	*addrp;		/* pointer to valloced config addresses */
507c478bd9Sstevel@tonic-gate 	int	sys_flags; 	/* flags to check duplicate entries */
517c478bd9Sstevel@tonic-gate };
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #define	MAXLINESIZE 80		/* max size of a line in /etc/system */
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate struct modcmd {
567c478bd9Sstevel@tonic-gate 	char *mc_cmdname;
577c478bd9Sstevel@tonic-gate 	int mc_type;
587c478bd9Sstevel@tonic-gate };
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #define	MOD_EXCLUDE	0	/* we'll never load this one */
617c478bd9Sstevel@tonic-gate #define	MOD_INCLUDE	1	/* load on demand */
627c478bd9Sstevel@tonic-gate #define	MOD_FORCELOAD	2	/* load during initialization */
637c478bd9Sstevel@tonic-gate #define	MOD_ROOTDEV	3	/* root device */
647c478bd9Sstevel@tonic-gate #define	MOD_ROOTFS 	4	/* root fs type */
657c478bd9Sstevel@tonic-gate #define	MOD_SWAPDEV	5	/* swap device */
667c478bd9Sstevel@tonic-gate #define	MOD_SWAPFS 	6	/* swap fs type */
677c478bd9Sstevel@tonic-gate #define	MOD_MODDIR	7	/* default directory for modules */
687c478bd9Sstevel@tonic-gate #define	MOD_SET		8	/* set int to specified value */
697c478bd9Sstevel@tonic-gate #define	MOD_UNKNOWN	9	/* unknown command */
707c478bd9Sstevel@tonic-gate #define	MOD_SET32	10	/* like MOD_SET but -only- on 32-bit kernel */
717c478bd9Sstevel@tonic-gate #define	MOD_SET64	11	/* like MOD_SET but -only- on 64-bit kernel */
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate /*
747c478bd9Sstevel@tonic-gate  * Commands for mod_sysctl()
757c478bd9Sstevel@tonic-gate  */
767c478bd9Sstevel@tonic-gate #define	SYS_FORCELOAD	0	/* forceload modules */
777c478bd9Sstevel@tonic-gate #define	SYS_SET_KVAR	1	/* set kernel variables */
787c478bd9Sstevel@tonic-gate #define	SYS_SET_MVAR 	2	/* set module variables */
797c478bd9Sstevel@tonic-gate #define	SYS_CHECK_EXCLUDE 3	/* check if a module is excluded */
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate /*
827c478bd9Sstevel@tonic-gate  * Legal operations for MOD_SET.
837c478bd9Sstevel@tonic-gate  */
847c478bd9Sstevel@tonic-gate #define	SETOP_NONE	0	/* no op - for types other than MOD_SET */
857c478bd9Sstevel@tonic-gate #define	SETOP_ASSIGN	1	/* '=' - simple assignment */
867c478bd9Sstevel@tonic-gate #define	SETOP_AND	2	/* '&' - bitwise AND */
877c478bd9Sstevel@tonic-gate #define	SETOP_OR	3	/* '|' - bitwise OR */
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate /*
907c478bd9Sstevel@tonic-gate  * Defines for sys_flags.
917c478bd9Sstevel@tonic-gate  */
927c478bd9Sstevel@tonic-gate #define	SYSPARAM_STR_TOKEN	0x0001 /* a string token is set */
937c478bd9Sstevel@tonic-gate #define	SYSPARAM_HEX_TOKEN	0x0002 /* a hexadecimal number is set */
947c478bd9Sstevel@tonic-gate #define	SYSPARAM_DEC_TOKEN	0x0004 /* a decimal number is set */
957c478bd9Sstevel@tonic-gate #define	SYSPARAM_DUP		0x0010 /* this entry is duplicated */
967c478bd9Sstevel@tonic-gate #define	SYSPARAM_TERM		0x0020 /* this entry is the last entry */
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
997c478bd9Sstevel@tonic-gate }
1007c478bd9Sstevel@tonic-gate #endif
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #endif	/* _SYS_SYSCONF_H */
103