#include <oskit/smp.h>void smp_start_cpu(int processor_id, void (*func)(void *data), void *data, void *stack_ptr);
This releases the specified processor to start running a function with the specified stack.Results are undefined if:
- the processor indicated does not exist,
- a processor attempts to start itself,
- any processor is started more than once, or
- 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.
- 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.