Previous: Processors and Sets, Up: Processor Interface
The function
processor_info
returns the selected information array for a processor, as specified by flavor.host is set to the host on which the processor set resides. This is the non-privileged host port.
processor_info is an array of integers that is supplied by the caller and returned filled with specified information. processor_info_count is supplied as the maximum number of integers in processor_info. On return, it contains the actual number of integers in processor_info. The maximum number of integers returned by any flavor is
PROCESSOR_INFO_MAX
.The type of information returned is defined by flavor, which can be one of the following:
PROCESSOR_BASIC_INFO
- The function returns basic information about the processor, as defined by
processor_basic_info_t
. This includes the slot number of the processor. The number of integers returned isPROCESSOR_BASIC_INFO_COUNT
.Machines which require more configuration information beyond the slot number are expected to define additional (machine-dependent) flavors.
The function returns
KERN_SUCCESS
if the call succeeded andKERN_INVALID_ARGUMENT
if processor is not a processor or flavor is not recognized. The function returnsMIG_ARRAY_TOO_LARGE
if the returned info array is too large for processor_info. In this case, processor_info is filled as much as possible and processor_infoCnt is set to the number of elements that would have been returned if there were enough room.
This structure is returned in processor_info by the
processor_info
function and provides basic information about the processor. You can cast a variable of typeprocessor_info_t
to a pointer of this type if you provided it as the processor_info parameter for thePROCESSOR_BASIC_INFO
flavor ofprocessor_info
. It has the following members:
cpu_type_t cpu_type
- cpu type
cpu_subtype_t cpu_subtype
- cpu subtype
boolean_t running
- is processor running?
int slot_num
- slot number
boolean_t is_master
- is this the master processor