* @brief Command handler for CPU binding operation * * @param[in] argc Number of command arguments * @param[in] argv Array of command argument strings * * @note Requires exactly 2 arguments: pid (process ID) and cpu (CPU core number) */
| 2291 | * @note Requires exactly 2 arguments: pid (process ID) and cpu (CPU core number) |
| 2292 | */ |
| 2293 | static void cmd_cpu_bind(int argc, char** argv) |
| 2294 | { |
| 2295 | int pid; |
| 2296 | int cpu; |
| 2297 | |
| 2298 | if (argc < 3) |
| 2299 | { |
| 2300 | rt_kprintf("Useage: cpu_bind pid cpu\n"); |
| 2301 | return; |
| 2302 | } |
| 2303 | |
| 2304 | pid = atoi(argv[1]); |
| 2305 | cpu = atoi(argv[2]); |
| 2306 | lwp_setaffinity((pid_t)pid, cpu); |
| 2307 | } |
| 2308 | MSH_CMD_EXPORT_ALIAS(cmd_cpu_bind, cpu_bind, set a process bind to a cpu); |
| 2309 | #endif |
nothing calls this directly
no test coverage detected