kprobes.c (cb5629b10d64a8006622ce3a52bc887d91057d69) | kprobes.c (172ae2e7f8ff9053905a36672453a6d2ff95b182) |
---|---|
1/* 2 * Kernel Probes (KProbes) 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 22 unchanged lines hidden (view full) --- 31#include <linux/preempt.h> 32#include <linux/module.h> 33#include <linux/kdebug.h> 34#include <asm/cacheflush.h> 35#include <asm/sstep.h> 36#include <asm/uaccess.h> 37#include <asm/system.h> 38 | 1/* 2 * Kernel Probes (KProbes) 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 22 unchanged lines hidden (view full) --- 31#include <linux/preempt.h> 32#include <linux/module.h> 33#include <linux/kdebug.h> 34#include <asm/cacheflush.h> 35#include <asm/sstep.h> 36#include <asm/uaccess.h> 37#include <asm/system.h> 38 |
39#ifdef CONFIG_BOOKE | 39#ifdef CONFIG_PPC_ADV_DEBUG_REGS |
40#define MSR_SINGLESTEP (MSR_DE) 41#else 42#define MSR_SINGLESTEP (MSR_SE) 43#endif 44 45DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 46DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 47 --- 57 unchanged lines hidden (view full) --- 105static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 106{ 107 /* We turn off async exceptions to ensure that the single step will 108 * be for the instruction we have the kprobe on, if we dont its 109 * possible we'd get the single step reported for an exception handler 110 * like Decrementer or External Interrupt */ 111 regs->msr &= ~MSR_EE; 112 regs->msr |= MSR_SINGLESTEP; | 40#define MSR_SINGLESTEP (MSR_DE) 41#else 42#define MSR_SINGLESTEP (MSR_SE) 43#endif 44 45DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; 46DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); 47 --- 57 unchanged lines hidden (view full) --- 105static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 106{ 107 /* We turn off async exceptions to ensure that the single step will 108 * be for the instruction we have the kprobe on, if we dont its 109 * possible we'd get the single step reported for an exception handler 110 * like Decrementer or External Interrupt */ 111 regs->msr &= ~MSR_EE; 112 regs->msr |= MSR_SINGLESTEP; |
113#ifdef CONFIG_BOOKE | 113#ifdef CONFIG_PPC_ADV_DEBUG_REGS |
114 regs->msr &= ~MSR_CE; 115 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM); 116#endif 117 118 /* 119 * On powerpc we should single step on the original 120 * instruction even if the probed insn is a trap 121 * variant as values in regs could play a part in --- 460 unchanged lines hidden --- | 114 regs->msr &= ~MSR_CE; 115 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM); 116#endif 117 118 /* 119 * On powerpc we should single step on the original 120 * instruction even if the probed insn is a trap 121 * variant as values in regs could play a part in --- 460 unchanged lines hidden --- |