Author: laurent Date: 2009-03-08 01:54:06 +0100 (Sun, 08 Mar 2009) New Revision: 464
Modified: openbios-devel/arch/ppc/qemu/start.S Log: Author: Alexander Graf alex@csgraf.de
PPC64: Switch to 32-bit mode in interrupts
All the code in OpenBIOS runs in 32 bits, which is fine. Now, when an interrupt arrives, the 970 CPU automatically sets the MSR_SF bit, making us run in 64 bit mode.
That breaks address calculation, because 'lis' and 'ba' get sign extended.
In order to circumvent that mess, let's just go back to 32 bit mode whenever we get an interrupt.
Signed-off-by: Alexander Graf alex@csgraf.de Signed-off-by: Laurent Vivier Laurent@vivier.eu
Modified: openbios-devel/arch/ppc/qemu/start.S =================================================================== --- openbios-devel/arch/ppc/qemu/start.S 2009-03-01 20:07:47 UTC (rev 463) +++ openbios-devel/arch/ppc/qemu/start.S 2009-03-08 00:54:06 UTC (rev 464) @@ -34,6 +34,9 @@
#define EXCEPTION_PREAMBLE_TEMPLATE \ mtsprg1 r1 ; /* scratch */ \ + mfmsr r1 ; /* unset MSR_SF */ \ + clrlwi r1,r1,0 ; \ + mtmsr r1 ; \ mfsprg0 r1 ; /* exception stack in sprg0 */ \ .ifc ULONG_SIZE, 8 ; \ addi r1,r1,-(40 * ULONG_SIZE) ; /* push exception frame */ \