xref: /titanic_50/usr/src/uts/common/sys/systeminfo.h (revision ba3594ba9b5dd4c846c472a8d657edcb7c8109ac)
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
55679c89fSjv227347  * Common Development and Distribution License (the "License").
65679c89fSjv227347  * 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*ba3594baSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
23*ba3594baSGarrett D'Amore  *
245679c89fSjv227347  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
297c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifndef _SYS_SYSTEMINFO_H
337c478bd9Sstevel@tonic-gate #define	_SYS_SYSTEMINFO_H
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
367c478bd9Sstevel@tonic-gate extern "C" {
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
407c478bd9Sstevel@tonic-gate extern char architecture[];
417c478bd9Sstevel@tonic-gate extern char architecture_32[];
425679c89fSjv227347 extern char hw_serial[];	/* machine's 32-bit hostid; a decimal string */
437c478bd9Sstevel@tonic-gate extern char hw_provider[];
447c478bd9Sstevel@tonic-gate extern char srpc_domain[];
457c478bd9Sstevel@tonic-gate extern char platform[];
467c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate /*
497c478bd9Sstevel@tonic-gate  * Commands to sysinfo(2)
507c478bd9Sstevel@tonic-gate  *
517c478bd9Sstevel@tonic-gate  * Values for sysinfo(2) commands are to be assigned by the following
527c478bd9Sstevel@tonic-gate  * algorithm:
537c478bd9Sstevel@tonic-gate  *
547c478bd9Sstevel@tonic-gate  *    1 -  256	Unix International assigned numbers for `get' style commands.
557c478bd9Sstevel@tonic-gate  *  257 -  512	Unix International assigned numbers for `set' style commands
567c478bd9Sstevel@tonic-gate  *		where the value is selected to be the value for the
577c478bd9Sstevel@tonic-gate  *		corresponding `get' command plus 256.
587c478bd9Sstevel@tonic-gate  *  513 -  768	Solaris specific `get' style commands.
597c478bd9Sstevel@tonic-gate  *  769 - 1024	Solaris specific `set' style commands where the value is
607c478bd9Sstevel@tonic-gate  *		selected to be the value for the corresponding `get' command
617c478bd9Sstevel@tonic-gate  *		plus 256.
627c478bd9Sstevel@tonic-gate  *
637c478bd9Sstevel@tonic-gate  * These values have be registered
647c478bd9Sstevel@tonic-gate  * with Unix International can't be corrected now.  The status of a command
657c478bd9Sstevel@tonic-gate  * as published or unpublished does not alter the algorithm.
667c478bd9Sstevel@tonic-gate  */
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate /* UI defined `get' commands (1-256) */
697c478bd9Sstevel@tonic-gate #define	SI_SYSNAME		1	/* return name of operating system */
707c478bd9Sstevel@tonic-gate #define	SI_HOSTNAME		2	/* return name of node */
717c478bd9Sstevel@tonic-gate #define	SI_RELEASE 		3	/* return release of operating system */
727c478bd9Sstevel@tonic-gate #define	SI_VERSION		4	/* return version field of utsname */
737c478bd9Sstevel@tonic-gate #define	SI_MACHINE		5	/* return kind of machine */
747c478bd9Sstevel@tonic-gate #define	SI_ARCHITECTURE		6	/* return instruction set arch */
757c478bd9Sstevel@tonic-gate #define	SI_HW_SERIAL		7	/* return hardware serial number */
767c478bd9Sstevel@tonic-gate #define	SI_HW_PROVIDER		8	/* return hardware manufacturer */
777c478bd9Sstevel@tonic-gate #define	SI_SRPC_DOMAIN		9	/* return secure RPC domain */
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /* UI defined `set' commands (257-512) */
807c478bd9Sstevel@tonic-gate #define	SI_SET_HOSTNAME		258	/* set name of node */
817c478bd9Sstevel@tonic-gate #define	SI_SET_SRPC_DOMAIN	265	/* set secure RPC domain */
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate /* Solaris defined `get' commands (513-768) */
847c478bd9Sstevel@tonic-gate #define	SI_PLATFORM		513	/* return platform identifier */
857c478bd9Sstevel@tonic-gate #define	SI_ISALIST		514	/* return supported isa list */
867c478bd9Sstevel@tonic-gate #define	SI_DHCP_CACHE		515	/* return kernel-cached DHCPACK */
877c478bd9Sstevel@tonic-gate #define	SI_ARCHITECTURE_32	516	/* basic 32-bit SI_ARCHITECTURE */
887c478bd9Sstevel@tonic-gate #define	SI_ARCHITECTURE_64	517	/* basic 64-bit SI_ARCHITECTURE */
897c478bd9Sstevel@tonic-gate #define	SI_ARCHITECTURE_K	518	/* kernel SI_ARCHITECTURE equivalent */
907c478bd9Sstevel@tonic-gate #define	SI_ARCHITECTURE_NATIVE	519	/* SI_ARCHITECTURE of the caller */
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate /* Solaris defined `set' commands (769-1024) (none currently assigned) */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate 
955679c89fSjv227347 #define	HW_INVALID_HOSTID	0xFFFFFFFF	/* an invalid hostid */
965679c89fSjv227347 #define	HW_HOSTID_LEN		11		/* minimum buffer size needed */
975679c89fSjv227347 						/* to hold a decimal or hex */
985679c89fSjv227347 						/* hostid string */
995679c89fSjv227347 #define	DOM_NM_LN		64		/* maximum length of domain */
1005679c89fSjv227347 						/* name */
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #if !defined(_KERNEL)
1037c478bd9Sstevel@tonic-gate int sysinfo(int, char *, long);
1047c478bd9Sstevel@tonic-gate #endif
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1077c478bd9Sstevel@tonic-gate }
1087c478bd9Sstevel@tonic-gate #endif
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #endif /* _SYS_SYSTEMINFO_H */
111