Adam Mallory wrote:
eabrg <> eabrg21@yahoo.com> > wrote in message
news:br5665$1mu$> 1@tiger.openqnx.com> …
I am interested in finding out QNX exception handling code/capabilites for
the PowerPC 405.
In general, when an exception like a machine check or program exception
occurs, the 405 handles exceptions by switching to supervisory state,
saving the processor state to certain registers, and then jumping to an
exception handler routine. Each major type of exception has its own
exception
vector located at an absolute address. Exception handling is performed by
software linked to the appropriated vector offset.
How is all this setup in QNX Neutrino?
I’m interested in being able to save the important registers and stack
info in software log when an exception occurs.
Depending on the exception, different actions are taken. Most exceptions or
trap conditions are indicated via a signal to the thread causing it (if it’s
a synchronous event). If it’s an asynchronous trap (ie. machine check
because of a bad entry not referenced until later), then a signal will be
dropped on whom ever is active - not necessarily the root cause thread.
Traps for page faults in the stack are handled transparently from the user,
as we fault in pages on demand for the stack.
There isn’t really any way for you to save or get at any of the registers at
exception time from a user land perspective.
What kind of information are you trying to get at? Many of the signals
related to things like pagefaults or bounds errors pass information such as
PC, and cause information.
-Adam
Thanks Adam.
With signals, I would have to register the signal condition in each
thread. Isn’t it?
I presume that when an exception condition occurs, an interrupt is
generated.
Can I then make use of interruptAttach() and register my handler function
with it.
What interrupt vector do I use when I call interruptAttach().?
In PowerPC 405, the exception vector offset for the exceptions is defined
from 0x0100 to 0x2000. How does this relate to the interrput vector # to
use in interruptAttach()?
In the registered function handler, I am interested in retrieving the
contents of the following registers: general purpose registers (GPR),
machine state register (MSR), save/restore registers (SRR0, SRR1, SRR2,
SRR3), exception vector prefix register (EVPR), exception syndrom register
(ESR) and the stack traceback.