walnux/sched/task
Jukka Laitinen 3e29996d97 sched: After nxsched_add_readytorun, change first parameter to up_switch_context to this_task()
Change every occurence of up_switch_context to use this_task() as the first parameter.

"nxsched_add_readytorun" returns "true" if context switch is required. "nxsched_add_readytorun"
typically could only switch the assigned/running task to the one which is passed in as parameter.
But this is not strictly guaranteed in SMP; if other CPUs tweak with affinities or priorities,
it may be possible that the running task after the call is changed, but is some other
task from the readytorun list (and it should be, if there is higher priority one available or the
affinity of the added task prevents it to be scheduled in, but the previous head of the readytorun
list should run.

this_task() is always the correct one to switch to, since it always points to the tcb which was
just switched in by the nxsched_add_readytorun.

This is also a precursor to re-writing the SMP queue logic to remove pending lists for SMP.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-20 10:16:43 +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 sched: After nxsched_add_readytorun, change first parameter to up_switch_context to this_task() 2025-08-20 10:16:43 +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: unify Private Types banners 2025-05-28 10:17:15 +08:00
task_setup.c style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
task_spawn.c sched: migrate to SPDX identifier 2024-09-12 01:10:14 +08:00
task_spawnparms.c fs/vfs: Separate file descriptors from file descriptions 2025-06-12 18:12:42 +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