Upcall handler

Kevin Bracey kevin.bracey at pace.co.uk
Mon Dec 17 05:49:33 PST 2001


In message <f82f48ea4a.Justin at gerph.movspclr.co.uk>
          Justin Fletcher <justin.fletcher at ntlworld.com> wrote:

> AIUI, you can't identify that you're in an interrupt though.
> 
> For example, BufferManager triggered on interrupt, issues OS_UpCall
> triggering UpCallV, and the first that happens is that you end up in SVC
> mode (not IRQ mode) and have no idea that you came from IRQ mode. And you
> can't backtrack the stack to find the old PSR, because there might be
> post-trap handlers present.

Regardless of the rest of this discussion, it IS possible to know you're in
an interrupt. There's a semi-public location in zero-page (I think it was at
least documented in the Arthur PRMs) called the interrupt semaphore - it's a
frame pointer pointing at the innermost interrupt on the IRQ stack, or zero
if not in an interrupt. Location &108.

I'd personally have no problem with supervisor mode code peeking this
location.

Otherwise, you'll just have to only deal with UpCalls you know, or rely on
no-one else being silly enought to call UpCall from interrupt routines, and
have special behaviour for the known bad cases.

-- 
Kevin Bracey, Principal Software Engineer
Pace Micro Technology plc                     Tel: +44 (0) 1223 518566
645 Newmarket Road                            Fax: +44 (0) 1223 518526
Cambridge, CB5 8PB, United Kingdom            WWW: http://www.pace.co.uk/



More information about the gcc mailing list