next up previous contents index
Next: 11.3.5 smp_get_num_cpus: Returns the Up: 11.3 API reference Previous: 11.3.3 smp_find_cpu: Return the

11.3.4 smp_start_cpu: Starts a processor running a specified function

 

SYNOPSIS

#include <oskit/smp.h>

void smp_start_cpu(int processor_id, void (*func)(void *data), void *data, void *stack_ptr);

DESCRIPTION

This releases the specified processor to start running a function with the specified stack.

Results are undefined if:

  1. the processor indicated does not exist,
  2. a processor attempts to start itself,
  3. any processor is started more than once, or
  4. any of the parameters is invalid.

smp_find_cur_cpu can be used to prevent calling smp_start_cpu on yourself. This function must be called for each processor started up by smp_init; if the processor is not used, then func should execute the halt instruction immediately.

It is up to the user to verify that the processor is started up correctly.

PARAMETERS

processor_id
The ID of a processor found by the startup code.
func
A function pointer to be called by the processor after it has set up its stack.
data
A pointer to some structure that is placed on that stack before func is called.
stack_ptr
The stack pointer to be used by the processor. This should point to the top of the stack to be used by the processor, and should be large enough for func's requirements.



University of Utah Flux Research Group