/* * This routine handles various exception codes. It determines the address, * and the problem, and then passes it off to one of the appropriate * routines. */ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long offset) { static spinlock_t terminate_lock = SPIN_LOCK_UNLOCKED; set_eiem(0); __cli(); spin_lock(&terminate_lock); /* unlock the pdc lock if necessary */ pdc_emergency_unlock(); /* restart pdc console if necessary */ if (!console_drivers) pdc_console_restart(); /* Not all switch paths will gutter the processor... */ switch(code){ case 1: transfer_pim_to_trap_frame(regs); break; default: /* Fall through */ break; } show_stack((unsigned long *)regs->gr[30]); printk("\n"); printk(KERN_CRIT "%s: Code=%d regs=%p (Addr=" RFMT ")\n", msg, code, regs, offset); show_regs(regs); spin_unlock(&terminate_lock); /* put soft power button back under hardware control; * if the user had pressed it once at any time, the * system will shut down immediately right here. */ pdc_soft_power_button(0); /* Gutter the processor... */ for(;;) ; }
/* * This routine is called from sys_reboot to actually turn off the * machine */ void machine_power_off(void) { /* If there is a registered power off handler, call it. */ if(pm_power_off) pm_power_off(); /* Put the soft power button back under hardware control. * If the user had already pressed the power button, the * following call will immediately power off. */ pdc_soft_power_button(0); /* It seems we have no way to power the system off via * software. The user has to press the button himself. */ printk(KERN_EMERG "System shut down completed.\n" KERN_EMERG "Please power this system off now."); }
/* * This routine is called from sys_reboot to actually turn off the * machine */ void machine_power_off(void) { /* If there is a registered power off handler, call it. */ if (chassis_power_off) chassis_power_off(); /* Put the soft power button back under hardware control. * If the user had already pressed the power button, the * following call will immediately power off. */ pdc_soft_power_button(0); pdc_chassis_send_status(PDC_CHASSIS_DIRECT_SHUTDOWN); /* It seems we have no way to power the system off via * software. The user has to press the button himself. */ printk(KERN_EMERG "System shut down completed.\n" "Please power this system off now."); /* prevent soft lockup/stalled CPU messages for endless loop. */ rcu_sysrq_start(); for (;;); }