#include <linux/prctl.h>
#include <linux/delay.h>
#include <linux/kprobes.h>
-#include <asm/kdebug.h>
+#include <asm/kdebug.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/rtas.h>
+#include <asm/xmon.h>
#ifdef CONFIG_PPC32
#include <asm/reg.h>
-#include <asm/xmon.h>
+#include <asm/perfmon.h>
+#endif
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
#endif
-#include <asm/perfmon.h>
-#endif
#ifdef CONFIG_PPC64
+#include <asm/firmware.h>
#include <asm/processor.h>
-#include <asm/ppcdebug.h>
-#include <asm/rtas.h>
#include <asm/systemcfg.h>
-#include <asm/machdep.h>
#include <asm/pmc.h>
#endif
+#ifdef CONFIG_PPC64 /* XXX */
+#define _IO_BASE pci_io_base
+#endif
+
#ifdef CONFIG_DEBUGGER
int (*__debugger)(struct pt_regs *regs);
int (*__debugger_ipi)(struct pt_regs *regs);
}
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
-
/* On 4xx, the reason for the machine check or program exception
is in the ESR. */
#define get_reason(regs) ((regs)->dsisr)
#define clear_single_step(regs) (current->thread.dbcr0 &= ~DBCR0_IC)
#else
-
/* On non-4xx, the reason for the machine check or program
exception is in the MSR. */
#define get_reason(regs) ((regs)->msr)
* additional info, e.g. bus error registers.
*/
platform_machine_check(regs);
-#endif /* CONFIG_PPC32 */
+#endif /* CONFIG_PPC64 */
if (debugger_fault_handler(regs))
return;
panic("Unrecoverable Machine check");
}
-#ifdef CONFIG_PPC32
void SMIException(struct pt_regs *regs)
{
die("System Management Interrupt", regs, SIGABRT);
}
-#endif
void unknown_exception(struct pt_regs *regs)
{
_exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip);
}
-#ifdef CONFIG_PPC32
void RunModeException(struct pt_regs *regs)
{
_exception(SIGTRAP, regs, 0, 0);
}
-#endif
void __kprobes single_step_exception(struct pt_regs *regs)
{
if (single_stepping(regs)) {
clear_single_step(regs);
_exception(SIGTRAP, regs, TRAP_TRACE, 0);
- single_step_exception(regs);
}
}
* There are a couple of ways to do this, either "decode" the instruction
* or directly match lots of bits. In this case, matching lots of
* bits is faster and easier.
+ *
*/
#define INST_MFSPR_PVR 0x7c1f42a6
#define INST_MFSPR_PVR_MASK 0xfc1fffff
#define INST_MCRXR 0x7c000400
#define INST_MCRXR_MASK 0x7c0007fe
-#ifdef CONFIG_PPC32
-
#define INST_STRING 0x7c00042a
#define INST_STRING_MASK 0x7c0007fe
#define INST_STRING_GEN_MASK 0x7c00067e
return 0;
}
-#endif /* CONFIG_PPC32 */
static int emulate_instruction(struct pt_regs *regs)
{
/* Emulate the mcrxr insn. */
if ((instword & INST_MCRXR_MASK) == INST_MCRXR) {
- unsigned int shift = (instword >> 21) & 0x1c;
+ int shift = (instword >> 21) & 0x1c;
unsigned long msk = 0xf0000000UL >> shift;
-#ifdef CONFIG_PPC64
- static int warned;
- if (!warned) {
- printk(KERN_WARNING
- "process %d (%s) uses obsolete 'mcrxr' insn\n",
- current->pid, current->comm);
- warned = 1;
- }
-#endif
regs->ccr = (regs->ccr & ~msk) | ((regs->xer >> shift) & msk);
regs->xer &= ~0xf0000000UL;
return 0;
}
-#ifdef CONFIG_PPC32
/* Emulate load/store string insn. */
if ((instword & INST_STRING_GEN_MASK) == INST_STRING)
return emulate_string_inst(regs, instword);
-#endif
return -EINVAL;
}
xmon_printf(KERN_ERR "Badness in %s at %s:%d\n",
bug->function, bug->file,
bug->line & ~BUG_WARNING_TRAP);
-#endif
+#endif /* CONFIG_XMON */
printk(KERN_ERR "Badness in %s at %s:%d\n",
bug->function, bug->file,
bug->line & ~BUG_WARNING_TRAP);
-#ifdef CONFIG_PPC32
dump_stack();
-#else
- show_stack(current, (void *)regs->gpr[1]);
-#endif
return 1;
}
-#if defined(CONFIG_PPC32) && defined(CONFIG_XMON)
+#ifdef CONFIG_XMON
xmon_printf(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
bug->function, bug->file, bug->line);
xmon(regs);
-#endif
+#endif /* CONFIG_XMON */
printk(KERN_CRIT "kernel BUG in %s at %s:%d!\n",
bug->function, bug->file, bug->line);
_exception(SIGBUS, regs, BUS_ADRALN, regs->dar);
}
-#ifdef CONFIG_PPC32
void StackOverflow(struct pt_regs *regs)
{
printk(KERN_CRIT "Kernel stack overflow in process %p, r1=%lx\n",
current, current->pid, regs->nip, regs->link, regs->gpr[0],
regs->ccr&0x10000000?"Error=":"", regs->gpr[3], print_tainted());
}
-#endif /* CONFIG_PPC32 */
void kernel_fp_unavailable_exception(struct pt_regs *regs)
{
}
#endif /* CONFIG_8xx */
-#ifdef CONFIG_PPC32
#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
void DebugException(struct pt_regs *regs, unsigned long debug_status)
regs->nip, regs->msr, regs->trap, print_tainted());
}
#endif /* CONFIG_INT_TAU */
-#endif /* CONFIG_PPC32*/
#ifdef CONFIG_ALTIVEC
void altivec_assist_exception(struct pt_regs *regs)