Annotation of XNU/osfmk/mach/processor_info.h, revision 1.1

1.1     ! root        1: /*
        !             2:  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
        !             3:  *
        !             4:  * @APPLE_LICENSE_HEADER_START@
        !             5:  * 
        !             6:  * The contents of this file constitute Original Code as defined in and
        !             7:  * are subject to the Apple Public Source License Version 1.1 (the
        !             8:  * "License").  You may not use this file except in compliance with the
        !             9:  * License.  Please obtain a copy of the License at
        !            10:  * http://www.apple.com/publicsource and read it before using this file.
        !            11:  * 
        !            12:  * This Original Code and all software distributed under the License are
        !            13:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
        !            14:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
        !            15:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
        !            16:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
        !            17:  * License for the specific language governing rights and limitations
        !            18:  * under the License.
        !            19:  * 
        !            20:  * @APPLE_LICENSE_HEADER_END@
        !            21:  */
        !            22: /*
        !            23:  * @OSF_COPYRIGHT@
        !            24:  */
        !            25: /*
        !            26:  * HISTORY
        !            27:  * 
        !            28:  * Revision 1.1.1.1  1998/09/22 21:05:30  wsanchez
        !            29:  * Import of Mac OS X kernel (~semeria)
        !            30:  *
        !            31:  * Revision 1.1.1.1  1998/03/07 02:25:46  wsanchez
        !            32:  * Import of OSF Mach kernel (~mburg)
        !            33:  *
        !            34:  * Revision 1.2.15.4  1996/01/09  19:22:17  devrcs
        !            35:  *     Changes PROCESSOR_SET_*_COUNT to be in sizeof natural_t  units
        !            36:  *     instead of sizeof int .  This agrees with mach_types.defs.
        !            37:  *     [1995/12/01  19:49:29  jfraser]
        !            38:  *
        !            39:  *     Merged '64-bit safe' changes from DEC alpha port.
        !            40:  *     [1995/11/21  18:09:26  jfraser]
        !            41:  *
        !            42:  * Revision 1.2.15.3  1995/01/06  19:51:34  devrcs
        !            43:  *     mk6 CR668 - 1.3b26 merge
        !            44:  *     64bit changes, typedefs
        !            45:  *     [1994/10/14  03:43:07  dwm]
        !            46:  * 
        !            47:  * Revision 1.2.15.2  1994/09/23  02:41:50  ezf
        !            48:  *     change marker to not FREE
        !            49:  *     [1994/09/22  21:42:27  ezf]
        !            50:  * 
        !            51:  * Revision 1.2.15.1  1994/08/07  20:49:52  bolinger
        !            52:  *     Merge up to colo_b7.
        !            53:  *     [1994/08/01  21:01:59  bolinger]
        !            54:  * 
        !            55:  * Revision 1.2.12.3  1994/06/25  03:47:17  dwm
        !            56:  *     mk6 CR98 - add flavor interface typedefs (processor(_set)_flavor_t).
        !            57:  *     [1994/06/24  21:54:55  dwm]
        !            58:  * 
        !            59:  * Revision 1.2.12.2  1994/05/02  21:36:00  dwm
        !            60:  *     Remove nmk15_compat support.
        !            61:  *     [1994/05/02  21:09:07  dwm]
        !            62:  * 
        !            63:  * Revision 1.2.12.1  1994/01/12  17:57:22  dwm
        !            64:  *     Fix "ifdef" NMK15_COMPAT to "if"
        !            65:  *     [1994/01/12  17:31:11  dwm]
        !            66:  * 
        !            67:  * Revision 1.2.3.6  1993/08/03  18:29:48  gm
        !            68:  *     CR9596: Change KERNEL to MACH_KERNEL.
        !            69:  *     [1993/08/02  18:30:33  gm]
        !            70:  * 
        !            71:  * Revision 1.2.3.5  1993/07/08  19:04:50  watkins
        !            72:  *     Change contents of struct processor_set_basic_info and add
        !            73:  *     struct processor_set_load_info for spec conformance.
        !            74:  *     [1993/07/07  21:04:07  watkins]
        !            75:  * 
        !            76:  * Revision 1.2.3.4  1993/06/29  21:55:48  watkins
        !            77:  *     New defines for scheduling control.
        !            78:  *     [1993/06/29  20:50:51  watkins]
        !            79:  * 
        !            80:  * Revision 1.2.3.3  1993/06/29  17:54:42  brezak
        !            81:  *     Add type for processor_slot_t.
        !            82:  *     [1993/06/28  20:59:17  brezak]
        !            83:  * 
        !            84:  * Revision 1.2.3.2  1993/06/09  02:43:05  gm
        !            85:  *     Added to OSF/1 R1.3 from NMK15.0.
        !            86:  *     [1993/06/02  21:17:58  jeffc]
        !            87:  * 
        !            88:  * Revision 1.2  1993/04/19  16:38:44  devrcs
        !            89:  *     ansi C conformance changes
        !            90:  *     [1993/02/02  18:54:34  david]
        !            91:  * 
        !            92:  * Revision 1.1  1992/09/30  02:32:02  robert
        !            93:  *     Initial revision
        !            94:  * 
        !            95:  * $EndLog$
        !            96:  */
        !            97: /* CMU_HIST */
        !            98: /*
        !            99:  * Revision 2.4  91/05/14  16:58:46  mrt
        !           100:  *     Correcting copyright
        !           101:  * 
        !           102:  * Revision 2.3  91/02/05  17:35:31  mrt
        !           103:  *     Changed to new Mach copyright
        !           104:  *     [91/02/01  17:20:39  mrt]
        !           105:  * 
        !           106:  * Revision 2.2  90/06/02  14:59:49  rpd
        !           107:  *     Created for new host/processor technology.
        !           108:  *     [90/03/26  23:51:38  rpd]
        !           109:  * 
        !           110:  *     Merge to X96
        !           111:  *     [89/08/02  23:12:21  dlb]
        !           112:  * 
        !           113:  *     Add scheduling flavor of information.
        !           114:  *     [89/07/25  18:52:18  dlb]
        !           115:  * 
        !           116:  *     Add load average and mach factor to processor set basic info.
        !           117:  *     [89/02/09            dlb]
        !           118:  * 
        !           119:  * Revision 2.3  89/10/15  02:05:54  rpd
        !           120:  *     Minor cleanups.
        !           121:  * 
        !           122:  * Revision 2.2  89/10/11  14:41:03  dlb
        !           123:  *     Add scheduling flavor of information.
        !           124:  * 
        !           125:  *     Add load average and mach factor to processor set basic info.
        !           126:  *     [89/02/09            dlb]
        !           127:  * 
        !           128:  */
        !           129: /* CMU_ENDHIST */
        !           130: /* 
        !           131:  * Mach Operating System
        !           132:  * Copyright (c) 1991,1990,1989 Carnegie Mellon University
        !           133:  * All Rights Reserved.
        !           134:  * 
        !           135:  * Permission to use, copy, modify and distribute this software and its
        !           136:  * documentation is hereby granted, provided that both the copyright
        !           137:  * notice and this permission notice appear in all copies of the
        !           138:  * software, derivative works or modified versions, and any portions
        !           139:  * thereof, and that both notices appear in supporting documentation.
        !           140:  * 
        !           141:  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
        !           142:  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
        !           143:  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
        !           144:  * 
        !           145:  * Carnegie Mellon requests users of this software to return to
        !           146:  * 
        !           147:  *  Software Distribution Coordinator  or  [email protected]
        !           148:  *  School of Computer Science
        !           149:  *  Carnegie Mellon University
        !           150:  *  Pittsburgh PA 15213-3890
        !           151:  * 
        !           152:  * any improvements or extensions that they make and grant Carnegie Mellon
        !           153:  * the rights to redistribute these changes.
        !           154:  */
        !           155: /*
        !           156:  */
        !           157: 
        !           158: /*
        !           159:  *     File:   mach/processor_info.h
        !           160:  *     Author: David L. Black
        !           161:  *     Date:   1988
        !           162:  *
        !           163:  *     Data structure definitions for processor_info, processor_set_info
        !           164:  */
        !           165: 
        !           166: #ifndef        _MACH_PROCESSOR_INFO_H_
        !           167: #define _MACH_PROCESSOR_INFO_H_
        !           168: 
        !           169: #include <mach/machine.h>
        !           170: #include <mach/machine/processor_info.h>
        !           171: 
        !           172: /*
        !           173:  *     Generic information structure to allow for expansion.
        !           174:  */
        !           175: typedef integer_t      *processor_info_t;      /* varying array of int. */
        !           176: 
        !           177: #define PROCESSOR_INFO_MAX     (1024)  /* max array size */
        !           178: typedef integer_t      processor_info_data_t[PROCESSOR_INFO_MAX];
        !           179: 
        !           180: 
        !           181: typedef integer_t      *processor_set_info_t;  /* varying array of int. */
        !           182: 
        !           183: #define PROCESSOR_SET_INFO_MAX (1024)  /* max array size */
        !           184: typedef integer_t      processor_set_info_data_t[PROCESSOR_SET_INFO_MAX];
        !           185: 
        !           186: 
        !           187: typedef int    *processor_slot_t;      /* varying array of int. */
        !           188: 
        !           189: /*
        !           190:  *     Currently defined information.
        !           191:  */
        !           192: typedef int    processor_flavor_t;
        !           193: #define        PROCESSOR_BASIC_INFO    1               /* basic information */
        !           194: #define        PROCESSOR_CPU_LOAD_INFO 2       /* cpu load information */
        !           195: #define        PROCESSOR_PM_REGS_INFO  0x10000001      /* performance monitor register info */
        !           196: 
        !           197: struct processor_basic_info {
        !           198:        cpu_type_t      cpu_type;       /* type of cpu */
        !           199:        cpu_subtype_t   cpu_subtype;    /* subtype of cpu */
        !           200:        boolean_t       running;        /* is processor running */
        !           201:        int             slot_num;       /* slot number */
        !           202:        boolean_t       is_master;      /* is this the master processor */
        !           203: };
        !           204: 
        !           205: typedef        struct processor_basic_info     processor_basic_info_data_t;
        !           206: typedef struct processor_basic_info    *processor_basic_info_t;
        !           207: #define PROCESSOR_BASIC_INFO_COUNT \
        !           208:                (sizeof(processor_basic_info_data_t)/sizeof(natural_t))
        !           209: 
        !           210: struct processor_cpu_load_info {             /* number of ticks while running... */
        !           211:         unsigned long   cpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */
        !           212: }; 
        !           213: 
        !           214: typedef        struct processor_cpu_load_info  processor_cpu_load_info_data_t;
        !           215: typedef struct processor_cpu_load_info *processor_cpu_load_info_t;
        !           216: #define PROCESSOR_CPU_LOAD_INFO_COUNT \
        !           217:                (sizeof(processor_cpu_load_info_data_t)/sizeof(natural_t))
        !           218: 
        !           219: /*
        !           220:  *     Scaling factor for load_average, mach_factor.
        !           221:  */
        !           222: #define        LOAD_SCALE      1000            
        !           223: 
        !           224: typedef        int     processor_set_flavor_t;
        !           225: #define        PROCESSOR_SET_BASIC_INFO        5       /* basic information */
        !           226: 
        !           227: struct processor_set_basic_info {
        !           228:        int             processor_count;        /* How many processors */
        !           229:        int             default_policy;         /* When others not enabled */
        !           230: };
        !           231: 
        !           232: typedef        struct processor_set_basic_info processor_set_basic_info_data_t;
        !           233: typedef struct processor_set_basic_info        *processor_set_basic_info_t;
        !           234: #define PROCESSOR_SET_BASIC_INFO_COUNT \
        !           235:                (sizeof(processor_set_basic_info_data_t)/sizeof(natural_t))
        !           236: 
        !           237: #define PROCESSOR_SET_LOAD_INFO                4       /* scheduling statistics */
        !           238: 
        !           239: struct processor_set_load_info {
        !           240:         int             task_count;             /* How many tasks */
        !           241:         int             thread_count;           /* How many threads */
        !           242:         integer_t       load_average;           /* Scaled */
        !           243:         integer_t       mach_factor;            /* Scaled */
        !           244: };
        !           245: 
        !           246: typedef struct processor_set_load_info processor_set_load_info_data_t;
        !           247: typedef struct processor_set_load_info *processor_set_load_info_t;
        !           248: #define PROCESSOR_SET_LOAD_INFO_COUNT  \
        !           249:                 (sizeof(processor_set_load_info_data_t)/sizeof(natural_t))
        !           250: 
        !           251: 
        !           252: /*
        !           253:  *      New scheduling control interface
        !           254:  */
        !           255: #define PROCESSOR_SET_ENABLED_POLICIES                   3
        !           256: #define PROCESSOR_SET_ENABLED_POLICIES_COUNT   \
        !           257:                (sizeof(policy_t)/sizeof(natural_t))
        !           258: 
        !           259: #define PROCESSOR_SET_TIMESHARE_DEFAULT                 10
        !           260: #define PROCESSOR_SET_TIMESHARE_LIMITS                  11
        !           261: 
        !           262: #define PROCESSOR_SET_RR_DEFAULT                        20
        !           263: #define PROCESSOR_SET_RR_LIMITS                         21
        !           264: 
        !           265: #define PROCESSOR_SET_FIFO_DEFAULT                      30
        !           266: #define PROCESSOR_SET_FIFO_LIMITS                       31
        !           267: 
        !           268: #endif /* _MACH_PROCESSOR_INFO_H_ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.