git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
arch
/
sparc64
/
kernel
/
kprobes.c
diff --git
a/arch/sparc64/kernel/kprobes.c
b/arch/sparc64/kernel/kprobes.c
index
bc5cc1d
..
7d97138
100644
(file)
--- a/
arch/sparc64/kernel/kprobes.c
+++ b/
arch/sparc64/kernel/kprobes.c
@@
-15,7
+15,7
@@
* traps. The top-level scheme is similar to that used
* in the x86 kprobes implementation.
*
* traps. The top-level scheme is similar to that used
* in the x86 kprobes implementation.
*
- * In the kprobe->insn[] array we store the original
+ * In the kprobe->
ainsn.
insn[] array we store the original
* instruction at index zero and a break instruction at
* index one.
*
* instruction at index zero and a break instruction at
* index one.
*
@@
-24,12
+24,12
@@
* - Remember "regs->tnpc" and interrupt level stored in
* "regs->tstate" so we can restore them later
* - Disable PIL interrupts
* - Remember "regs->tnpc" and interrupt level stored in
* "regs->tstate" so we can restore them later
* - Disable PIL interrupts
- * - Set regs->tpc to point to kprobe->insn[0]
- * - Set regs->tnpc to point to kprobe->insn[1]
+ * - Set regs->tpc to point to kprobe->
ainsn.
insn[0]
+ * - Set regs->tnpc to point to kprobe->
ainsn.
insn[1]
* - Mark that we are actively in a kprobe
*
* At this point we wait for the second breakpoint at
* - Mark that we are actively in a kprobe
*
* At this point we wait for the second breakpoint at
- * kprobe->insn[1] to hit. When it does we:
+ * kprobe->
ainsn.
insn[1] to hit. When it does we:
* - Run the post-handler
* - Set regs->tpc to "remembered" regs->tnpc stored above,
* restore the PIL interrupt level in "regs->tstate" as well
* - Run the post-handler
* - Set regs->tpc to "remembered" regs->tnpc stored above,
* restore the PIL interrupt level in "regs->tstate" as well
@@
-38,10
+38,19
@@
* - Mark that we are no longer actively in a kprobe.
*/
* - Mark that we are no longer actively in a kprobe.
*/
-void arch_prepare_kprobe(struct kprobe *p)
+int arch_prepare_kprobe(struct kprobe *p)
+{
+ return 0;
+}
+
+void arch_copy_kprobe(struct kprobe *p)
+{
+ p->ainsn.insn[0] = *p->addr;
+ p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2;
+}
+
+void arch_remove_kprobe(struct kprobe *p)
{
{
- p->insn[0] = *p->addr;
- p->insn[1] = BREAKPOINT_INSTRUCTION_2;
}
/* kprobe_status settings */
}
/* kprobe_status settings */
@@
-59,8
+68,8
@@
static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
current_kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL);
regs->tstate |= TSTATE_PIL;
current_kprobe_orig_tstate_pil = (regs->tstate & TSTATE_PIL);
regs->tstate |= TSTATE_PIL;
- regs->tpc = (unsigned long) &p->insn[0];
- regs->tnpc = (unsigned long) &p->insn[1];
+ regs->tpc = (unsigned long) &p->
ainsn.
insn[0];
+ regs->tnpc = (unsigned long) &p->
ainsn.
insn[1];
}
static inline void disarm_kprobe(struct kprobe *p, struct pt_regs *regs)
}
static inline void disarm_kprobe(struct kprobe *p, struct pt_regs *regs)
@@
-199,19
+208,19
@@
static void retpc_fixup(struct pt_regs *regs, u32 insn, unsigned long real_pc)
* instruction. To avoid the SMP problems that can occur when we
* temporarily put back the original opcode to single-step, we
* single-stepped a copy of the instruction. The address of this
* instruction. To avoid the SMP problems that can occur when we
* temporarily put back the original opcode to single-step, we
* single-stepped a copy of the instruction. The address of this
- * copy is p->insn.
+ * copy is p->
ainsn.
insn.
*
* This function prepares to return from the post-single-step
* breakpoint trap.
*/
static void resume_execution(struct kprobe *p, struct pt_regs *regs)
{
*
* This function prepares to return from the post-single-step
* breakpoint trap.
*/
static void resume_execution(struct kprobe *p, struct pt_regs *regs)
{
- u32 insn = p->insn[0];
+ u32 insn = p->
ainsn.
insn[0];
regs->tpc = current_kprobe_orig_tnpc;
regs->tnpc = relbranch_fixup(insn,
(unsigned long) p->addr,
regs->tpc = current_kprobe_orig_tnpc;
regs->tnpc = relbranch_fixup(insn,
(unsigned long) p->addr,
- (unsigned long) &p->insn[0],
+ (unsigned long) &p->
ainsn.
insn[0],
regs->tnpc);
retpc_fixup(regs, insn, (unsigned long) p->addr);
regs->tnpc);
retpc_fixup(regs, insn, (unsigned long) p->addr);