Go to the first, previous, next, last section, table of contents.


Processor

Function: kern_return_t host_processors (mach_port_t host_priv, processor_array_t *processor_list, mach_msg_type_number_t *processor_count)
The function host_processors gets send rights to the processor port for each processor existing on host_priv. This is the privileged port that allows its holder to control a processor.

processor_list is an array that is created as a result of this call. The caller may wish to vm_deallocate this array when the data is no longer needed. processor_count is set to the number of processors in the processor_list.

This function returns KERN_SUCCESS if the call succeeded, KERN_INVALID_ARGUMENT if host_priv is not a privileged host port, and KERN_INVALID_ADDRESS if processor_count points to inaccessible memory.

Function: kern_return_t processor_start (mach_port_t processor)
Function: kern_return_t processor_exit (mach_port_t processor)
Function: kern_return_t processor_control (mach_port_t processor, processor_info_t *cmd, mach_msg_type_number_t count)
Some multiprocessors may allow privileged software to control processors. The processor_start, processor_exit, and processor_control operations implement this. The interpretation of the command in cmd is machine dependent. A newly started processor is assigned to the default processor set. An exited processor is removed from the processor set to which it was assigned and ceases to be active.

count contains the length of the command cmd as a number of ints.

Availability limited. All of these operations are machine-dependent. They may do nothing. The ability to restart an exited processor is also machine-dependent.

This function returns KERN_SUCCESS if the operation was performed, KERN_FAILURE if the operation was not performed (a likely reason is that it is not supported on this processor), KERN_INVALID_ARGUMENT if processor is not a processor, and KERN_INVALID_ADDRESS if cmd points to inaccessible memory.

Function: kern_return_t processor_assign (mach_port_t processor, mach_port_t processor_set, boolean_t wait)
The function processor_assign assigns processor to the the set processor_set. After the assignment is completed, the processor only executes threads that are assigned to that processor set. Any previous assignment of the processor is nullified. The master processor cannot be reassigned. All processors take clock interrupts at all times. The wait argument indicates whether the caller should wait for the assignment to be completed or should return immediately. Dedicated kernel threads are used to perform processor assignment, so setting wait to FALSE allows assignment requests to be queued and performed faster, especially if the kernel has more than one dedicated internal thread for processor assignment. Redirection of other device interrupts away from processors assigned to other than the default processor set is machine-dependent. Intermediaries that interpose on ports must be sure to interpose on both ports involved in this call if they interpose on either.

This function returns KERN_SUCCESS if the assignment has been performed, KERN_INVALID_ARGUMENT if processor is not a processor, or processor_set is not a processor set on the same host as processor.

Function: kern_return_t processor_get_assignment (mach_port_t processor, mach_port_t *assigned_set)
The function processor_get_assignment obtains the current assignment of a processor. The name port of the processor set is returned in assigned_set.

Function: kern_return_t processor_info (mach_port_t processor, int flavor, mach_port_t *host, processor_info_t processor_info, mach_msg_type_number_t *processor_infoCnt)
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_infoCnt 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 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 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.


Go to the first, previous, next, last section, table of contents.