Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Apr 2007 12:25:59 -0700
From:      Peter Grehan <grehan@freebsd.org>
To:        Andrew Turner <andrew@fubar.geek.nz>
Cc:        freebsd-ppc@freebsd.org
Subject:   Re: Exception in openfirmware calling
Message-ID:  <4612AA47.4060802@freebsd.org>
In-Reply-To: <20070331141428.5f7cb6b4@hermies.int.fubar.geek.nz>
References:  <20070331141428.5f7cb6b4@hermies.int.fubar.geek.nz>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4612AA47.4060802>