/* Return 1 if corrected (or delivered a signal). Return 0 if there is nothing we can do.  */
static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err)
/* Return 1 if corrected (or delivered a signal). Return 0 if there is nothing we can do.  */
static int recover_mce(struct pt_regs *regs, struct rtas_error_log *err)
{
	int nonfatal = 0;
	if (err->disposition == RTAS_DISP_FULLY_RECOVERED) {
		nonfatal = 1;
	} else if ((regs->msr & MSR_RI) &&
		   user_mode(regs) &&
		   err->severity == RTAS_SEVERITY_ERROR_SYNC &&
		   err->disposition == RTAS_DISP_NOT_RECOVERED &&
		   err->target == RTAS_TARGET_MEMORY &&
		   err->type == RTAS_TYPE_ECC_UNCORR &&
		   !(current->pid == 0 || is_global_init(current))) {
		printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n",
		       current->pid);
		_exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
		nonfatal = 1;
	}
	log_error((char *)err, ERR_TYPE_RTAS_LOG, !nonfatal);
	return nonfatal;
}