Exception in openfirmware calling
Peter Grehan
grehan at freebsd.org
Tue Apr 3 19:26:04 UTC 2007
> I'm getting a cpu exception on the mtmsr instruction on line 213 in
> ofw_machdep.c[1]. A copy of me single stepping through the code is
> available at [2].
>
> I would appreciate any incite to what is going wrong here so I can fix
> it.
What is happening is that at the time of the call, the stack is
virtually addressed (from the %r1 value of 0xD575A898 in the dump).
EFIKA OpenFirmware runs in real mode, so the effect of the mtmsr
instruction is to disable virtual addressing, but the saved value is
being stored on the stack which is no longer valid.
A quick'n'dirty fix is to make all the local variables in this routine
static.
A correct fix is to have different openfirmware() routines for
different implementations - as I've mentioned, I'm (slowly) doing this
for G5 support.
later,
Peter.
More information about the freebsd-ppc
mailing list