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]

RE: isr() and dsr() running environment?


On Fri, 2002-10-18 at 05:08, Qiang Huang wrote:
> If consider the following situation what would happens?
> 
> ext_IRQ1(Higher priority) with ISR1() and DSR1()
> ext_IRQ2(Lower priority) with ISR2() and DSR2()
> 
> running flow:
>  ext_IRQ1 happens --> ISR1() runs --> DSR1() runs and interrupted by
> ext_IRQ2 then DSR1() suspended --> ISR2() runs --> DSR2() runs --> continues
> DSR1() operation --> finish
> 
> It seems DSR2() runs before DSR1() finished but ext_IRQ1 has higher priority
> than ext_IRQ2, but DSR2() seems higher than DSR1(); if the operation should
> be finished in DSR1() before running DSR2() how can this happens? (Will ecos
> do something to make sure the higher priority IRQ's DSR runs first than the
> lower priority IRQ's DSR ?)
> 

No, it doesn't work like this.  DSR's do not have priorities and must 
run to completion, so the actual flow would be:
  assert IRQ1
  run ISR1 - interrupts are off (or parially disabled (*))
    ... - post DSR1
  complete ISR1
  run DSR1 - interrupts are on, IRQ1 normally disabled 
    ...
    assert IRQ2  
    run ISR2
      ... - post DSR2
    complete ISR2
  complete DSR1
  run DSR2
    ...
  complete DSR2
  return to interrupted environment

> Thanks a lot
> 
> -----Original Message-----
> From: Jonathan Larmour [mailto:jifl@eCosCentric.com]
> Sent: 18 October 2002 04:32
> To: jameshq@liverpool.ac.uk
> Cc: ecos-discuss@sources.redhat.com
> Subject: Re: [ECOS] isr() and dsr() running environment?
> 
> 
> jameshq@liverpool.ac.uk wrote:
> > Hi all:
> >    in ecos porting guide it says the dsr() should run with interrupt
> > enabled. and according the helpful interrupt handling diagram from
> > Nick. Are the following of my assumption right?? Thanks
> >
> > 1). isr() should run with global interrupt enabled and higher priority
> > interrupt than current interrupt allowed.
> 
> Ideally yes *if* you want to use nested interrupts. Not everyone wants to,
> in which case you can leave global interrupts disabled.
> 
> > 2). dsr() should run with global interrupt enabled and all level(lower
> > and higher than current) priority interrupt source allowed.
> 
> Yes.
> 
> > 3). means during the time processing dsr(), it can be interrupted by
> > any other interrupt souce regardless its interrupt priority?
> 
> Yes.
> 
> > BTW seems sparc works in that way, right?
> 
> Should do. If not, it's a bug.
> 
> Jifl
> --
> eCosCentric       http://www.eCosCentric.com/       <info@eCosCentric.com>
> --[ "You can complain because roses have thorns, or you ]--
> --[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine
> 
> 
> 
> -- 
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
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


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