Upcall handler

Nick Burrett nick at dsvr.net
Mon Dec 17 05:11:32 PST 2001

Ian Jeffray <ian at jeffray.co.uk> writes:
> Nick Burrett wrote:
> > We could perhaps exit the upcall handler early, if we are in an interrupt.
> The point is, though, that our handler "code" is called when it's not
> there.  When the WIMP hasn't paged us in yet... so some random garbage code
> gets called which invariably stiffs the machine.

Ah yes. Excuse my failing memory.

> Peter's fix -- to put the upcall handler in RMA -- is good, because of
> course, RMA code is always paged-in and at a static address.  There's then
> the issue of what to do once we're in our handler.  Since UnixLib only really
> cares about Upcall 256, we can bin everything else quickly at this stage.
> Upcall 256 also happens to be 'safe' (ie we CAN call our app code) because
> it is only called in the instance when our app is being muted - so the code
> is really there.
> It's upcalls from stuff like the buffer manager, which can end up calling
> our environment upcall handler at any time at all which is the real problem.
> This, I am pretty certain, is a bug/misfeature in RISC OS.  :-(

This sounds entirely reasonably.  I don't think we can rely on
patches to RISC OS to fix this, so the SharedUnixLibrary module
would be the best approach.  It's also a good starting point for
gradually moving bits of common code into RMA.


More information about the gcc mailing list