home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / mach / processor_info.h < prev    next >
Text File  |  1993-10-19  |  3KB  |  111 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1989 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  */
  7. /*
  8.  * HISTORY
  9.  * $Log:    processor_info.h,v $
  10.  * Revision 2.3  89/10/15  02:05:54  rpd
  11.  *     Minor cleanups.
  12.  * 
  13.  * Revision 2.2  89/10/11  14:41:03  dlb
  14.  *     Add scheduling flavor of information.
  15.  * 
  16.  *     Add load average and mach factor to processor set basic info.
  17.  *     [89/02/09            dlb]
  18.  * 
  19.  * Revision 2.1.1.4  89/08/02  23:12:21  dlb
  20.  *     Merge to X96
  21.  * 
  22.  * Revision 2.1.1.3  89/07/25  18:52:18  dlb
  23.  *     Add scheduling flavor of information.
  24.  * 
  25.  * Revision 2.1.1.2  89/02/13  23:05:49  dlb
  26.  *     Add load average and mach factor to processor set basic info.
  27.  *     [89/02/09            dlb]
  28.  * 
  29.  */
  30.  
  31. /*
  32.  *    File:    mach/processor_info.h
  33.  *    Author:    David L. Black
  34.  *
  35.  *    Copyright (C) 1988 David L. Black
  36.  *
  37.  *    Data structure definitions for processor_info, processor_set_info
  38.  */
  39.  
  40. #ifndef    _MACH_PROCESSOR_INFO_H_
  41. #define _MACH_PROCESSOR_INFO_H_
  42.  
  43. #import <mach/machine.h>
  44.  
  45. /*
  46.  *    Generic information structure to allow for expansion.
  47.  */
  48. typedef int    *processor_info_t;    /* varying array of int. */
  49.  
  50. #define PROCESSOR_INFO_MAX    (1024)    /* max array size */
  51. typedef int    processor_info_data_t[PROCESSOR_INFO_MAX];
  52.  
  53.  
  54. typedef int    *processor_set_info_t;    /* varying array of int. */
  55.  
  56. #define PROCESSOR_SET_INFO_MAX    (1024)    /* max array size */
  57. typedef int    processor_set_info_data_t[PROCESSOR_SET_INFO_MAX];
  58.  
  59. /*
  60.  *    Currently defined information.
  61.  */
  62. #define    PROCESSOR_BASIC_INFO    1        /* basic information */
  63.  
  64. struct processor_basic_info {
  65.     cpu_type_t    cpu_type;    /* type of cpu */
  66.     cpu_subtype_t    cpu_subtype;    /* subtype of cpu */
  67.     boolean_t    running;    /* is processor running */
  68.     int        slot_num;    /* slot number */
  69.     boolean_t    is_master;    /* is this the master processor */
  70. };
  71.  
  72. typedef    struct processor_basic_info    processor_basic_info_data_t;
  73. typedef struct processor_basic_info    *processor_basic_info_t;
  74. #define PROCESSOR_BASIC_INFO_COUNT \
  75.         (sizeof(processor_basic_info_data_t)/sizeof(int))
  76.  
  77.  
  78. #define    PROCESSOR_SET_BASIC_INFO    1    /* basic information */
  79.  
  80. struct processor_set_basic_info {
  81.     int        processor_count;    /* How many processors */
  82.     int        task_count;        /* How many tasks */
  83.     int        thread_count;        /* How many threads */
  84.     int        load_average;        /* Scaled */
  85.     int        mach_factor;        /* Scaled */
  86. };
  87.  
  88. /*
  89.  *    Scaling factor for load_average, mach_factor.
  90.  */
  91. #define    LOAD_SCALE    1000        
  92.  
  93. typedef    struct processor_set_basic_info    processor_set_basic_info_data_t;
  94. typedef struct processor_set_basic_info    *processor_set_basic_info_t;
  95. #define PROCESSOR_SET_BASIC_INFO_COUNT \
  96.         (sizeof(processor_set_basic_info_data_t)/sizeof(int))
  97.  
  98. #define PROCESSOR_SET_SCHED_INFO    2    /* scheduling info */
  99.  
  100. struct processor_set_sched_info {
  101.     int        policies;    /* allowed policies */
  102.     int        max_priority;    /* max priority for new threads */
  103. };
  104.  
  105. typedef    struct processor_set_sched_info    processor_set_sched_info_data_t;
  106. typedef struct processor_set_sched_info    *processor_set_sched_info_t;
  107. #define PROCESSOR_SET_SCHED_INFO_COUNT \
  108.         (sizeof(processor_set_sched_info_data_t)/sizeof(int))
  109.  
  110. #endif    _MACH_PROCESSOR_INFO_H_
  111.