xref: /onnv-gate/usr/src/uts/common/sys/systeminfo.h (revision 8662:18153249ee93)
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
5*8662SJordan.Vaughan@Sun.com  * Common Development and Distribution License (the "License").
6*8662SJordan.Vaughan@Sun.com  * 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*8662SJordan.Vaughan@Sun.com  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
270Sstevel@tonic-gate /*	  All Rights Reserved  	*/
280Sstevel@tonic-gate 
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifndef _SYS_SYSTEMINFO_H
310Sstevel@tonic-gate #define	_SYS_SYSTEMINFO_H
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #ifdef	__cplusplus
340Sstevel@tonic-gate extern "C" {
350Sstevel@tonic-gate #endif
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #ifdef	_KERNEL
380Sstevel@tonic-gate extern char architecture[];
390Sstevel@tonic-gate extern char architecture_32[];
40*8662SJordan.Vaughan@Sun.com extern char hw_serial[];	/* machine's 32-bit hostid; a decimal string */
410Sstevel@tonic-gate extern char hw_provider[];
420Sstevel@tonic-gate extern char srpc_domain[];
430Sstevel@tonic-gate extern char platform[];
440Sstevel@tonic-gate #endif	/* _KERNEL */
450Sstevel@tonic-gate 
460Sstevel@tonic-gate /*
470Sstevel@tonic-gate  * Commands to sysinfo(2)
480Sstevel@tonic-gate  *
490Sstevel@tonic-gate  * Values for sysinfo(2) commands are to be assigned by the following
500Sstevel@tonic-gate  * algorithm:
510Sstevel@tonic-gate  *
520Sstevel@tonic-gate  *    1 -  256	Unix International assigned numbers for `get' style commands.
530Sstevel@tonic-gate  *  257 -  512	Unix International assigned numbers for `set' style commands
540Sstevel@tonic-gate  *		where the value is selected to be the value for the
550Sstevel@tonic-gate  *		corresponding `get' command plus 256.
560Sstevel@tonic-gate  *  513 -  768	Solaris specific `get' style commands.
570Sstevel@tonic-gate  *  769 - 1024	Solaris specific `set' style commands where the value is
580Sstevel@tonic-gate  *		selected to be the value for the corresponding `get' command
590Sstevel@tonic-gate  *		plus 256.
600Sstevel@tonic-gate  *
610Sstevel@tonic-gate  * These values have be registered
620Sstevel@tonic-gate  * with Unix International can't be corrected now.  The status of a command
630Sstevel@tonic-gate  * as published or unpublished does not alter the algorithm.
640Sstevel@tonic-gate  */
650Sstevel@tonic-gate 
660Sstevel@tonic-gate /* UI defined `get' commands (1-256) */
670Sstevel@tonic-gate #define	SI_SYSNAME		1	/* return name of operating system */
680Sstevel@tonic-gate #define	SI_HOSTNAME		2	/* return name of node */
690Sstevel@tonic-gate #define	SI_RELEASE 		3	/* return release of operating system */
700Sstevel@tonic-gate #define	SI_VERSION		4	/* return version field of utsname */
710Sstevel@tonic-gate #define	SI_MACHINE		5	/* return kind of machine */
720Sstevel@tonic-gate #define	SI_ARCHITECTURE		6	/* return instruction set arch */
730Sstevel@tonic-gate #define	SI_HW_SERIAL		7	/* return hardware serial number */
740Sstevel@tonic-gate #define	SI_HW_PROVIDER		8	/* return hardware manufacturer */
750Sstevel@tonic-gate #define	SI_SRPC_DOMAIN		9	/* return secure RPC domain */
760Sstevel@tonic-gate 
770Sstevel@tonic-gate /* UI defined `set' commands (257-512) */
780Sstevel@tonic-gate #define	SI_SET_HOSTNAME		258	/* set name of node */
790Sstevel@tonic-gate #define	SI_SET_SRPC_DOMAIN	265	/* set secure RPC domain */
800Sstevel@tonic-gate 
810Sstevel@tonic-gate /* Solaris defined `get' commands (513-768) */
820Sstevel@tonic-gate #define	SI_PLATFORM		513	/* return platform identifier */
830Sstevel@tonic-gate #define	SI_ISALIST		514	/* return supported isa list */
840Sstevel@tonic-gate #define	SI_DHCP_CACHE		515	/* return kernel-cached DHCPACK */
850Sstevel@tonic-gate #define	SI_ARCHITECTURE_32	516	/* basic 32-bit SI_ARCHITECTURE */
860Sstevel@tonic-gate #define	SI_ARCHITECTURE_64	517	/* basic 64-bit SI_ARCHITECTURE */
870Sstevel@tonic-gate #define	SI_ARCHITECTURE_K	518	/* kernel SI_ARCHITECTURE equivalent */
880Sstevel@tonic-gate #define	SI_ARCHITECTURE_NATIVE	519	/* SI_ARCHITECTURE of the caller */
890Sstevel@tonic-gate 
900Sstevel@tonic-gate /* Solaris defined `set' commands (769-1024) (none currently assigned) */
910Sstevel@tonic-gate 
920Sstevel@tonic-gate 
93*8662SJordan.Vaughan@Sun.com #define	HW_INVALID_HOSTID	0xFFFFFFFF	/* an invalid hostid */
94*8662SJordan.Vaughan@Sun.com #define	HW_HOSTID_LEN		11		/* minimum buffer size needed */
95*8662SJordan.Vaughan@Sun.com 						/* to hold a decimal or hex */
96*8662SJordan.Vaughan@Sun.com 						/* hostid string */
97*8662SJordan.Vaughan@Sun.com #define	DOM_NM_LN		64		/* maximum length of domain */
98*8662SJordan.Vaughan@Sun.com 						/* name */
990Sstevel@tonic-gate 
1000Sstevel@tonic-gate #if !defined(_KERNEL)
1010Sstevel@tonic-gate #if defined(__STDC__)
1020Sstevel@tonic-gate int sysinfo(int, char *, long);
1030Sstevel@tonic-gate #else
1040Sstevel@tonic-gate int sysinfo();
1050Sstevel@tonic-gate #endif
1060Sstevel@tonic-gate #endif
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate #ifdef	__cplusplus
1090Sstevel@tonic-gate }
1100Sstevel@tonic-gate #endif
1110Sstevel@tonic-gate 
1120Sstevel@tonic-gate #endif /* _SYS_SYSTEMINFO_H */
113