This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

context switching in ecos


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]