Home | History | Annotate | Download | only in sys
      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, Version 1.0 only
      6  * (the "License").  You may not use this file except in compliance
      7  * with the License.
      8  *
      9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10  * or http://www.opensolaris.org/os/licensing.
     11  * See the License for the specific language governing permissions
     12  * and limitations under the License.
     13  *
     14  * When distributing Covered Code, include this CDDL HEADER in each
     15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16  * If applicable, add the following below this CDDL HEADER, with the
     17  * fields enclosed by brackets "[]" replaced with your own identifying
     18  * information: Portions Copyright [yyyy] [name of copyright owner]
     19  *
     20  * CDDL HEADER END
     21  */
     22 /*
     23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #ifndef	_SYS_MSACCT_H
     28 #define	_SYS_MSACCT_H
     29 
     30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
     31 
     32 #ifdef	__cplusplus
     33 extern "C" {
     34 #endif
     35 
     36 /* LWP microstates */
     37 #define	LMS_USER	0	/* running in user mode */
     38 #define	LMS_SYSTEM	1	/* running in sys call or page fault */
     39 #define	LMS_TRAP	2	/* running in other trap */
     40 #define	LMS_TFAULT	3	/* asleep in user text page fault */
     41 #define	LMS_DFAULT	4	/* asleep in user data page fault */
     42 #define	LMS_KFAULT	5	/* asleep in kernel page fault */
     43 #define	LMS_USER_LOCK	6	/* asleep waiting for user-mode lock */
     44 #define	LMS_SLEEP	7	/* asleep for any other reason */
     45 #define	LMS_WAIT_CPU	8	/* waiting for CPU (latency) */
     46 #define	LMS_STOPPED	9	/* stopped (/proc, jobcontrol, lwp_suspend) */
     47 
     48 /*
     49  * NMSTATES must never exceed 17 because of the size restriction
     50  * of 128 bytes imposed on struct siginfo (see <sys/siginfo.h>).
     51  */
     52 #define	NMSTATES	10	/* number of microstates */
     53 
     54 /*
     55  * CPU Microstates
     56  *
     57  * The following define the implemented CPU microstates
     58  */
     59 
     60 #define	CMS_USER	0
     61 #define	CMS_SYSTEM	1
     62 #define	CMS_IDLE	2
     63 #define	CMS_DISABLED	3
     64 
     65 /*
     66  * NCMSTATES is set to NMSTATES - 1, because CMS_DISABLED is not a state for
     67  * which accounting information is kept.  CPUs that are offline but remain in
     68  * the system are kept in the CMS_IDLE state until they are brought back online,
     69  * or unconfigured and deleted from the system.  Only when a cpu is unconfigured
     70  * and about to be deleted is the CMS_DISABLED state entered.  It is a
     71  * placeholder state to ensure that our behavior is sane.  ASSERT()s exist to
     72  * verify this.
     73  */
     74 
     75 #define	NCMSTATES	3
     76 
     77 #ifdef	__cplusplus
     78 }
     79 #endif
     80 
     81 #endif	/* _SYS_MSACCT_H */
     82