Replies: 2 comments 1 reply
-
That's obviously not true, without context switching you would not have preemption nor multitasking.
There is no spec for that. Every OS or architecture does that differently.
The caller-saved registers are saved on exception entry: in zephyr/arch/arm64/core/vector_table.S Line 27 in 44488f1 and restored on exception exit in: zephyr/arch/arm64/core/vector_table.S Line 213 in 44488f1 The callee-saved registers are lazily saved / restored only when a context switch does happen in: zephyr/arch/arm64/core/switch.S Line 33 in 44488f1
Again, it depends (i.e. MMU vs no-MMU, FPU vs no-FPU, ASID vs no-ASID, etc...) you can have a possible comprehensive list at https://developer.arm.com/documentation/den0024/a/The-Memory-Management-Unit/Context-switching |
Beta Was this translation helpful? Give feedback.
-
Yes, this is missing. You can add it to the Lines 33 to 51 in c9225e4 Anyway, this is proved not to a be an issue (so far) on emulation and real hardware. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to add support for SMP for AArch32 (specifically 'fvp_baser_aemv8r_aarch32' platform).
I see that AArch32 lacks support for context switching.
I am trying to follow the context switching code for Arm64, and z_arm64_context_switch() caught my attention.
Do we know any Arm specification that states how context switching is to be done ? For eg I see that we are saving and restoring registers x19 ... x29, but not the previous registers. Do we know the reason why ?
Is there any list of registers (specified in any Arm docs) which are to be saved and restored.
@carlocaione :- I see that you are author, can you provide some pointers, please ?
Beta Was this translation helpful? Give feedback.
All reactions