This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
context switching in ecos
- To: "'ecos-discuss at sourceware dot cygnus dot com'" <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] context switching in ecos
- From: Suet Fei Li <suetfei at bwrc dot eecs dot berkeley dot edu>
- Date: Fri, 6 Oct 2000 20:25:48 -0700
Hi everyone:
I am trying to understand the context switching stuff in Ecos here. It
seems like it goes the following way:
timer interrupt -> save everything on the current thread stack -> call ISR
-> Interrupt_end -> call DSP -> lock scheduler -> call
HAL_THREAD_SWITCH_CONTEXT -> save current context and load next thread
context -> return from interrupt -> restore everything.
It seems to me that the current status of the CPU has to be saved twice
(once right after the interrupt, the second time during
HAL_THREAD_SWITCH_CONTEXT ). If this is indeed true, isn't it rather
inefficient? Why did not it just:
interrupt -> save everything on the current thread -> scheduler -> load the
context from next thread.
Any input will be very very helpful
thanx a lot
suetfei