diff options
author | Richard Braun <rbraun@sceen.net> | 2018-01-05 16:12:25 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-01-05 16:12:25 +0100 |
commit | 897447864c8e67203ceb0998f4d02e4aa41a635c (patch) | |
tree | 89b57ca21f08cd3d9525d277ce26c8c8d747c0ff /src/cpu.c | |
parent | 5ad6a354a9a5ba37a57a743ddf3c0659e73e29a9 (diff) |
cpu: discuss the stack on interrupt handling
Diffstat (limited to 'src/cpu.c')
-rw-r--r-- | src/cpu.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -463,6 +463,30 @@ cpu_intr_main(const struct cpu_intr_frame *frame) * because the interrupt handler has awaken a higher priority thread, * in which case a context switch is triggerred. Such context switches * are called involuntary. + * + * Here is what the stack looks like when such a context switch occurs : + * + * | | Stack grows down. + * | | + * | stack of the interrupted thread | + * | | + * +---------------------------------+ <- interrupt occurs + * | | + * | struct cpu_intr_frame | + * | | + * +---------------------------------+ + * | | + * | cpu_intr_main stack frame | + * | | + * +---------------------------------+ + * | | + * | thread function stack frames | + * | | + * +---------------------------------+ + * | | + * | thread context on switch | See thread_switch_context in + * | | thread_asm.S. + * +---------------------------------+ */ thread_preempt_enable(); } |