> it should be the same as the other risc machines, and seems all right
> when i test it with 5c/5l. gcc typically also uses a frame pointer,
> which might make it nearly as easy for that compiler.
This seems to work well:
.text
.globl getcallerpc
getcallerpc:
ldr r0, [fp, #-4]
bx lr
I was a bit confused about whether or not the firstarg pointer
is expected to be used by a getcallerpc implementation (so that
it would also work in subfunctions of the current, provided
&firstarg is passed down). The BUGS section of getcallerpc(2/3)
gives a hint how this could be answered.