Re: How do I get the program counter of another process (PowerPC)?
- From: Ian Goldby <ian.goldby@xxxxxxxxx>
- Date: Tue, 13 Oct 2009 00:34:50 -0700 (PDT)
Oh dear, replying to my own messages again... Well, this might be
useful to someone else.
I solved the problem by using an interrupt service routine instead of
a system state alarm. I attach my ISR to the clock ticker IRQ vector
at a higher priority than the clock ticker, and then return from it
EOS_NOTME so that the clock ticker (tkdec) is called immediately after
my ISR.
#define VECTOR T_DEC
#define PRIORITY 8
err = _os_irq(VECTOR, PRIORITY, myIsr, data);
Thus myIsr() is called on every clock tick. On entry to myIsr(), the
special register SRR0 contains the program counter to which the ISR
will return - i.e. the program counter of the next instruction at the
point of the interruption, and SRR1 contains the machine status
register (MSR). Bit MSR_PR is clear if the processor is in system
state and set if in user state. (Yes, it really is that way round.)
The functions _get_srr0() and _get_srr1() are useful here.
The essential header files to look at are regs.h, regsppc.h, and
getset.h.
That's basically it.
.
- References:
- How do I get the program counter of another process (PowerPC)?
- From: Ian Goldby
- Re: How do I get the program counter of another process (PowerPC)?
- From: N Morrison
- Re: How do I get the program counter of another process (PowerPC)?
- From: Ian Goldby
- How do I get the program counter of another process (PowerPC)?
- Prev by Date: Re: How do I get the program counter of another process (PowerPC)?
- Previous by thread: Re: How do I get the program counter of another process (PowerPC)?
- Index(es):
Relevant Pages
|