For what it's worth, here's the custom interrupt handler I wrote for the non maskable interrupt IRQ7. I modified the vector table so that this routine is called for IRQ7 instead of the kernel's inthandler. Maybe someone can detect a problem with it?
asm(".text\n"
"hab_nmihandler:\n"
"movel %a0,%sp@-\n"
"movel %d0,%sp@-\n"
/* MCF_INTFRCL |= 0x100 --> force maskable int */
"moveal #(0xe0000000+0x714),%a0\n"
"movel %a0@,%d0\n"
"bset #8,%d0\n"
"movel %d0,%a0@\n"
/* MCF_EPFR = 0x80 --> clear edge port */
"moveq #-128,%d0\n"
"moveb %d0,0xe0000000+0xF0C\n"
"movel %sp@+,%d0\n"
"movel %sp@+,%a0\n"
"rte");