Previous: Processors and Sets, Up: Processor Interface

9.2.4 Processor Info

— Function: kern_return_t processor_info (processor_t processor, int flavor, host_t *host, processor_info_t processor_info, mach_msg_type_number_t *processor_info_count)

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:

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 is PROCESSOR_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 and KERN_INVALID_ARGUMENT if processor is not a processor or flavor is not recognized. The function returns MIG_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.

— Data type: struct processor_basic_info

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 type processor_info_t to a pointer of this type if you provided it as the processor_info parameter for the PROCESSOR_BASIC_INFO flavor of processor_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

— Data type: processor_basic_info_t

This is a pointer to a struct processor_basic_info.