public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] eCos interrupt handling
@ 2005-10-03 18:40 Wilson Tsao
  2005-10-04  8:48 ` Nick Garnett
  0 siblings, 1 reply; 5+ messages in thread
From: Wilson Tsao @ 2005-10-03 18:40 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I am porting eCos to my company's own platform. We are using MIPS 4KEp as
our processor.
I modified some of the HAL files to fit our processor. But I found some
problems regrading the interuupt
handling. Very likely the problems are caused by my modifications.

In my interrupt DSR, it writes mailbox to wake up a thread which is waiting
for mailbox event. But I saw
the thread is waken up and running while HAL default interrupt VSR is not
returned yet (eret is not called yet).
I thought the scheduler should decide which thread to run after the whole
interrupt is completed, includes
HAL default VSR, ISR, DSR, and restore_state. Can someone give me some
directions what could go wrong?

Thanks a lot,

Wilson

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] eCos interrupt handling
  2005-10-03 18:40 [ECOS] eCos interrupt handling Wilson Tsao
@ 2005-10-04  8:48 ` Nick Garnett
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Garnett @ 2005-10-04  8:48 UTC (permalink / raw)
  To: Wilson Tsao; +Cc: ecos-discuss

Wilson Tsao <Wilson.Tsao@iteusa.com> writes:

> Hi,
> 
> I am porting eCos to my company's own platform. We are using MIPS 4KEp as
> our processor.
> I modified some of the HAL files to fit our processor. But I found some
> problems regrading the interuupt
> handling. Very likely the problems are caused by my modifications.
> 
> In my interrupt DSR, it writes mailbox to wake up a thread which is waiting
> for mailbox event. But I saw
> the thread is waken up and running while HAL default interrupt VSR is not
> returned yet (eret is not called yet).
> I thought the scheduler should decide which thread to run after the whole
> interrupt is completed, includes
> HAL default VSR, ISR, DSR, and restore_state. Can someone give me some
> directions what could go wrong?

This will happen if the thread you are waking up is higher priority
that the thread that was interrupted.

When an interrupt occurs the thread's state is saved on its own stack,
a switch is made to the interrupt stack and the ISR called. When the
ISR returns we switch back to the thread's stack and call
interrupt_end(). This arranges for the DSR to be posted and then, if
the scheduler lock allows, calls it. If this causes a higher priority
thread to be woken up then the context switch to this thread will
happen in interrupt_end(). Only when the current thread becomes the
highest priority thread again will interrupt_end() return and restore
the thread's state from its stack. So, restore_state can happen long
after the original interrupt.

-- 
Nick Garnett                                     eCos Kernel Architect
http://www.ecoscentric.com                The eCos and RedBoot experts


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ECOS] Ecos interrupt handling
  2002-11-26  0:54 ` [ECOS] Ecos " A.K.V.SAI JAYRAM
@ 2002-11-26 10:37   ` Nick Garnett
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Garnett @ 2002-11-26 10:37 UTC (permalink / raw)
  To: A.K.V.SAI JAYRAM; +Cc: ecos-discuss, Tim Hölters

"A.K.V.SAI JAYRAM" <sai@cdotb.ernet.in> writes:

> Hi Tim...
> Thanx for the info.
> I have checked the documents for interrupts. But nothing is given in
> detail.

I'm not sure how much detail you want, but there is some in the
documentation in at least these places:

http://www.vsr.si/ecos/ecos/cvsdoc/kernel-interrupts.html
http://www.vsr.si/ecos/ecos/cvsdoc/hal-interrupt-handling.html
http://www.vsr.si/ecos/ecos/cvsdoc/hal-exception-handling.html
http://www.vsr.si/ecos/ecos/cvsdoc/devapi-device-driver-interface-to-the-kernel.html

> 
> Is there any document which explains the implementation methodology...? or
> source code document..?

If you need more detail, read the code. I would recommend starting
with the MIPS or PowerPC HALs, since these architectures are cleaner
in this area that things like the ARM or 386.

-- 
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ECOS] Ecos interrupt handling
       [not found] <000501c2951f$841f3e00$d3590c0a@np008>
@ 2002-11-26  0:54 ` A.K.V.SAI JAYRAM
  2002-11-26 10:37   ` Nick Garnett
  0 siblings, 1 reply; 5+ messages in thread
From: A.K.V.SAI JAYRAM @ 2002-11-26  0:54 UTC (permalink / raw)
  To: ecos-discuss, Tim Hölters

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 1137 bytes --]

Hi Tim...
Thanx for the info.
I have checked the documents for interrupts. But nothing is given in
detail.

Is there any document which explains the implementation methodology...? or
source code document..?



Best wishes
sai




On Tue, 26 Nov 2002, [iso-8859-1] Tim Hölters wrote:

> Hi,
> 
> try     http://www4.ncsu.edu/~abdudani/ecos/docs/
> 
> for little more informations.
> 
> rgds,
> Tim.
> 
> 
> ----- Original Message ----- 
> From: "A.K.V.SAI JAYRAM" <sai@cdotb.ernet.in>
> To: <ecos-discuss@sources.redhat.com>
> Sent: Tuesday, November 26, 2002 4:32 AM
> Subject: [ECOS] Ecos interrupt handling
> 
> 
> > hi all....
> > Where can I find document for Ecos on how interrupts are exactly
> > handled...?
> > 
> > rgds
> > sai
> > 
> > 
> > 
> > 
> > 
> > -- 
> > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> > and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> > 
> 
> 


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ECOS] Ecos interrupt handling
  2002-11-25 17:38 [ECOS] interface document Simon_Tsai
@ 2002-11-25 19:22 ` A.K.V.SAI JAYRAM
  0 siblings, 0 replies; 5+ messages in thread
From: A.K.V.SAI JAYRAM @ 2002-11-25 19:22 UTC (permalink / raw)
  To: ecos-discuss

hi all....
Where can I find document for Ecos on how interrupts are exactly
handled...?

rgds
sai





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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-10-04  8:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-03 18:40 [ECOS] eCos interrupt handling Wilson Tsao
2005-10-04  8:48 ` Nick Garnett
     [not found] <000501c2951f$841f3e00$d3590c0a@np008>
2002-11-26  0:54 ` [ECOS] Ecos " A.K.V.SAI JAYRAM
2002-11-26 10:37   ` Nick Garnett
  -- strict thread matches above, loose matches on Subject: below --
2002-11-25 17:38 [ECOS] interface document Simon_Tsai
2002-11-25 19:22 ` [ECOS] Ecos interrupt handling A.K.V.SAI JAYRAM

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).