Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67397
b: refs/heads/master
c: 75918a4
h: refs/heads/master
i:
  67395: 573e987
v: v3
  • Loading branch information
Olof Johansson authored and Paul Mackerras committed Oct 2, 2007
1 parent aec2b83 commit 2d583b8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f6682809b994fd9a61081fa0410df31481d5f7f
refs/heads/master: 75918a4b5998c93ee1ab131fbe64b97b5d0d2315
66 changes: 37 additions & 29 deletions trunk/arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,38 +324,10 @@ static inline int check_io_access(struct pt_regs *regs)
#define clear_single_step(regs) ((regs)->msr &= ~MSR_SE)
#endif

void machine_check_exception(struct pt_regs *regs)
static int generic_machine_check_exception(struct pt_regs *regs)
{
int recover = 0;
unsigned long reason = get_mc_reason(regs);

/* See if any machine dependent calls */
if (ppc_md.machine_check_exception)
recover = ppc_md.machine_check_exception(regs);

if (recover)
return;

if (user_mode(regs)) {
regs->msr |= MSR_RI;
_exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
return;
}

#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
/* the qspan pci read routines can cause machine checks -- Cort */
bad_page_fault(regs, regs->dar, SIGBUS);
return;
#endif

if (debugger_fault_handler(regs)) {
regs->msr |= MSR_RI;
return;
}

if (check_io_access(regs))
return;

#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
if (reason & ESR_IMCP) {
printk("Instruction");
Expand Down Expand Up @@ -471,6 +443,42 @@ void machine_check_exception(struct pt_regs *regs)
}
#endif /* CONFIG_4xx */

return 0;
}

void machine_check_exception(struct pt_regs *regs)
{
int recover = 0;

/* See if any machine dependent calls */
if (ppc_md.machine_check_exception)
recover = ppc_md.machine_check_exception(regs);
else
recover = generic_machine_check_exception(regs);

if (recover)
return;

if (user_mode(regs)) {
regs->msr |= MSR_RI;
_exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
return;
}

#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
/* the qspan pci read routines can cause machine checks -- Cort */
bad_page_fault(regs, regs->dar, SIGBUS);
return;
#endif

if (debugger_fault_handler(regs)) {
regs->msr |= MSR_RI;
return;
}

if (check_io_access(regs))
return;

if (debugger_fault_handler(regs))
return;
die("Machine check", regs, SIGBUS);
Expand Down

0 comments on commit 2d583b8

Please sign in to comment.