walnux/sched/task
Ville Juven c12aa5663d sched/affinity: Fix CPU_LOCKED functionality for some SMP calls
For some SMP calls it is necessary to lock the current CPU for the process
receiving the SMP call. This is done by setting the CPU affinity to the
current CPU and preventing the CPU selection algorithm from switching
CPUs.

  dtcb->flags |= TCB_FLAG_CPU_LOCKED;
  CPU_SET(dtcb->cpu, &dtcb->affinity);

However, this logic is currently broken, as CPU_SET is defined as:

  #define CPU_SET(c,s) do { *(s) |= (1u << (c)); } while (0)

In order to assign tcb->cpu (the current CPU) to the affinity mask, the
mask must be cleared first by calling CPU_ZERO.
2025-04-26 13:56:27 +08:00
..
CMakeLists.txt binfmt:use crt0 inside of starthook 2025-04-09 23:07:29 +08:00
exit.c sched: add header irq.h to exit.c 2024-11-04 11:07:40 -03:00
Make.defs binfmt:use crt0 inside of starthook 2025-04-09 23:07:29 +08:00
spawn.h sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task.h task: merge nxtask_setup_name() before create_stack 2024-10-07 15:47:13 +08:00
task_activate.c task: use get_task_name where possible 2024-10-01 20:38:06 +08:00
task_argvstr.c Rename group_argvstr to nxtask_argvstr 2024-10-10 23:13:37 +08:00
task_cancelpt.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_create.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_delete.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_execve.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_exit.c task_exit.c: Add missing sched_note_stop() 2024-10-23 12:08:18 -03:00
task_exithook.c sched: Replace direct semaphore value access with nxsem_get_value 2025-04-07 16:29:57 +08:00
task_fork.c pthread: remove enter_critical_section in pthread_mutex 2025-01-12 22:30:35 +08:00
task_getgroup.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_getpid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_getppid.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_gettid.c sched/gettid: Move thread ID to TLS 2025-04-08 22:53:10 +08:00
task_init.c sched/gettid: Move thread ID to TLS 2025-04-08 22:53:10 +08:00
task_join.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_posixspawn.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_prctl.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_recover.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_reparent.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_restart.c sched/affinity: Fix CPU_LOCKED functionality for some SMP calls 2025-04-26 13:56:27 +08:00
task_setup.c sched: remove all spin_lock_irqsave(NULL) 2025-01-06 23:11:44 +08:00
task_spawn.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_spawnparms.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_start.c binfmt:use crt0 inside of starthook 2025-04-09 23:07:29 +08:00
task_terminate.c sched/affinity: Fix CPU_LOCKED functionality for some SMP calls 2025-04-26 13:56:27 +08:00