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]
Other format: [Raw text]

Question about Stack usage in eCOS ? Thanks


Hi:

Q1:
   I just wonder the exact meaning of using a seperate stack for interrupt
handling? Is that mean: all the interrupts handling will be in its own stack
rather than the user thread's stack? (Is this correct for all targets?)

Q2:
   Is the thread context switching happens after **exiting**(?) the clock
ISR and uses the old thread's stack rather than the interrupt handler's
stack? (Is this correct for all targets?)

Q3:
  Is the following correct or not?(My assumption)

(Uses seperate interrupt stack)

1). The hightest avaliable Thread (thread_A) get excuted by
HAL_THREAD_LOAD_CONTEXT() (so on thread_A's stack correct??)
--> 2). clock interrupt (Enter ISR and uses the Interrupt's stack correct??)
--> 3). Exit from clock ISR (stack for interrupt handling will be unwinded
back correct??)then stack switch back to thread_A's stack correct??
--> 4). DSR invoked (now uses thread_A's stack correct??)
--> 5). rtc->tick() invoked ( on thread_A's stack correct??)
--> 6). HAL_THREAD_SWITCH_CONTEXT()  invoked ( so up to this point the
thread context for thread_A will be saved to thread_A's stack right (does
this includes??) and thread_B's thread context get restored from thrad_B's
stack right??
--> 7). branch to the thread_B's execution context.

Thanks



-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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