Change the runstate of a processor
#include <sys/sysmgr.h> int sysmgr_runstate( unsigned cpu, int enable ); int sysmgr_runstate_dynamic( unsigned cpu, int enable );
- The index of the CPU whose state you want to change.
- 0 to turn the processor off; non-zero to turn it on. For more details, see below.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The sysmgr_runstate() and sysmgr_runstate_dynamic() functions turn the specified CPU on or off as follows:
- sysmgr_runstate() takes a CPU down manually (if enable is zero) or lets it run (if one).
- sysmgr_runstate_dynamic() lets the kernel dynamically bring a CPU up or down (if enable is one), depending on the system load.
These settings work together:
|0||—||The CPU is permanently off|
|1||0||The CPU is permanently on (the default)|
|1||1||The CPU is dynamically brought up or down by the kernel, depending on load.|
- The CPU index is invalid.
- The calling process doesn't have the required permission; see procmgr_ability().
Last modified: 2013-09-30