suspect spotted

I've managed to find the faulty function. It's openfirmware() from ofw_machdep.c. Back to __asm__ and OF vs SF...


Bad surprise

I've been playing around with the kernel to turn on some debugging
in the driver source code, and it appeared that it doesn't even come to
SI_SUB_CONFIGURE. I've turned on VERBOSE_SYSINIT, here's the snipped:

0x253718(0x57d068)... done.
0x253718(0x57d120)... done.
0x253718(0x578dcc)... done.
0x26d900(0x56f194)... done.
0x253718(0x56f19c)... done.
0x253718(0x57d5a0)... done.
0x2a46e8(0)... done.
0x308d88(0)... done.
0x295c50(0)... done.
subsystem 1c00000
0x293e94(0)... done.
subsystem 1c00001
0x27a9d8(0)... done.
subsystem 2000000
0x2520e0(0)... done.
0x245f24(0)... done.
0x284630(0)... done.
linker_file_unload(0)... done.
ktrsyscall(0)... done.
linker_file_lookup_set(0)... done.
subsystem 2100000
freebsd4_sigreturn(0)... cpu_exception:
SRR0 0x004A0D10 SRR1 0x00003030 MSR 0x00003030
LR 0x01003ED8 CTR 0x00000000 CR 0x24002044 XER 0x0
DAR 0xD0004D3C DSISR 0x42000000 Type 3
GPR[] 0x004A0BC4 0xD0004D30 0x00000000 0x01003ED8 0x00003030 0x00000000 0x00000020 0x00000000
GPR[] 0x00000000 0x00000000 0x00000000 0x004A0D00 0x00003030 0x00000000 0xEFF7737F 0x00575BC8
GPR[] 0x00590000 0x00554D0C 0x00522C6C 0x00522C4C 0x00522C5C 0x00522C90 0xD0004E18 0xD0004E1C
GPR[] 0x00590000 0x00800001 0x00590000 0x00000001 0x00590000 0x02100000 0x00003032 0xD0004D40
ibat0U 0x00001FFF ibat0L 0x00000012
ibat1U 0xF0001FFF ibat1L 0xF0000012
ibat2U 0x00000000 ibat2L 0x00000000
ibat3U 0x00000000 ibat3L 0x00000000
dbat0U 0xF0001FFF dbat0L 0xF000002A
dbat1U 0x80001FFF dbat1L 0x8000002A
dbat2U 0x00001FFF dbat2L 0x00000012
dbat3U 0xC0001FFF dbat3L 0xC000002A
HID0 0x0000C000

The crashing subsystem is subsystem 2100000, and is responsible for the
CPU resources:

from sys/sys/kernel.h

enum sysinit_sub_id {
SI_SUB_KLD = 0x2000000, /* KLD and module setup */
SI_SUB_CPU = 0x2100000, /* CPU resource(s)*/

It crashes somwhere near sigreturn(). The PIC has to wait for a second...