arch: aarch64: Add check on context switch
Check whether we actually need to schedule a new thread before calling the context switch routine. Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
parent
b41e5e67d0
commit
67e4ccbc51
1 changed files with 8 additions and 0 deletions
|
@ -209,6 +209,14 @@ offload:
|
|||
b inv
|
||||
|
||||
context_switch:
|
||||
/* Check if we need to context switch */
|
||||
ldr x1, =_kernel
|
||||
ldr x2, [x1, #_kernel_offset_to_current]
|
||||
ldr x3, [x1, #_kernel_offset_to_ready_q_cache]
|
||||
cmp x2, x3
|
||||
beq exit
|
||||
|
||||
/* Switch thread */
|
||||
bl z_arm64_context_switch
|
||||
|
||||
exit:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue