aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrikar Dronamraju <srikar@linux.vnet.ibm.com>2012-03-12 05:25:14 -0400
committerIngo Molnar <mingo@elte.hu>2012-03-13 01:22:20 -0400
commit900771a483ef28915a48066d7895d8252315607a (patch)
tree08941df642cc6bb61ef764b3344c87790c831145
parent35aa621b5ab9d08767f7bc8d209b696df281d715 (diff)
uprobes/core: Make macro names consistent
Rename macros that refer to individual uprobe to start with UPROBE_ instead of UPROBES_. This is pure cleanup, no functional change intended. Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linux-mm <linux-mm@kvack.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20120312092514.5379.36595.sendpatchset@srdronam.in.ibm.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/include/asm/uprobes.h6
-rw-r--r--arch/x86/kernel/uprobes.c18
-rw-r--r--include/linux/uprobes.h4
-rw-r--r--kernel/events/uprobes.c18
4 files changed, 23 insertions, 23 deletions
diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h
index f7ce310a429d..5c399e446512 100644
--- a/arch/x86/include/asm/uprobes.h
+++ b/arch/x86/include/asm/uprobes.h
@@ -26,10 +26,10 @@
26typedef u8 uprobe_opcode_t; 26typedef u8 uprobe_opcode_t;
27 27
28#define MAX_UINSN_BYTES 16 28#define MAX_UINSN_BYTES 16
29#define UPROBES_XOL_SLOT_BYTES 128 /* to keep it cache aligned */ 29#define UPROBE_XOL_SLOT_BYTES 128 /* to keep it cache aligned */
30 30
31#define UPROBES_BKPT_INSN 0xcc 31#define UPROBE_BKPT_INSN 0xcc
32#define UPROBES_BKPT_INSN_SIZE 1 32#define UPROBE_BKPT_INSN_SIZE 1
33 33
34struct arch_uprobe { 34struct arch_uprobe {
35 u16 fixups; 35 u16 fixups;
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 04dfcef2d028..6dfa89e6f24a 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -31,14 +31,14 @@
31/* Post-execution fixups. */ 31/* Post-execution fixups. */
32 32
33/* No fixup needed */ 33/* No fixup needed */
34#define UPROBES_FIX_NONE 0x0 34#define UPROBE_FIX_NONE 0x0
35/* Adjust IP back to vicinity of actual insn */ 35/* Adjust IP back to vicinity of actual insn */
36#define UPROBES_FIX_IP 0x1 36#define UPROBE_FIX_IP 0x1
37/* Adjust the return address of a call insn */ 37/* Adjust the return address of a call insn */
38#define UPROBES_FIX_CALL 0x2 38#define UPROBE_FIX_CALL 0x2
39 39
40#define UPROBES_FIX_RIP_AX 0x8000 40#define UPROBE_FIX_RIP_AX 0x8000
41#define UPROBES_FIX_RIP_CX 0x4000 41#define UPROBE_FIX_RIP_CX 0x4000
42 42
43/* Adaptations for mhiramat x86 decoder v14. */ 43/* Adaptations for mhiramat x86 decoder v14. */
44#define OPCODE1(insn) ((insn)->opcode.bytes[0]) 44#define OPCODE1(insn) ((insn)->opcode.bytes[0])
@@ -269,9 +269,9 @@ static void prepare_fixups(struct arch_uprobe *auprobe, struct insn *insn)
269 break; 269 break;
270 } 270 }
271 if (fix_ip) 271 if (fix_ip)
272 auprobe->fixups |= UPROBES_FIX_IP; 272 auprobe->fixups |= UPROBE_FIX_IP;
273 if (fix_call) 273 if (fix_call)
274 auprobe->fixups |= UPROBES_FIX_CALL; 274 auprobe->fixups |= UPROBE_FIX_CALL;
275} 275}
276 276
277#ifdef CONFIG_X86_64 277#ifdef CONFIG_X86_64
@@ -341,12 +341,12 @@ static void handle_riprel_insn(struct mm_struct *mm, struct arch_uprobe *auprobe
341 * is NOT the register operand, so we use %rcx (register 341 * is NOT the register operand, so we use %rcx (register
342 * #1) for the scratch register. 342 * #1) for the scratch register.
343 */ 343 */
344 auprobe->fixups = UPROBES_FIX_RIP_CX; 344 auprobe->fixups = UPROBE_FIX_RIP_CX;
345 /* Change modrm from 00 000 101 to 00 000 001. */ 345 /* Change modrm from 00 000 101 to 00 000 001. */
346 *cursor = 0x1; 346 *cursor = 0x1;
347 } else { 347 } else {
348 /* Use %rax (register #0) for the scratch register. */ 348 /* Use %rax (register #0) for the scratch register. */
349 auprobe->fixups = UPROBES_FIX_RIP_AX; 349 auprobe->fixups = UPROBE_FIX_RIP_AX;
350 /* Change modrm from 00 xxx 101 to 00 xxx 000 */ 350 /* Change modrm from 00 xxx 101 to 00 xxx 000 */
351 *cursor = (reg << 3); 351 *cursor = (reg << 3);
352 } 352 }
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index f85797e1ccd4..838fb312926a 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -35,10 +35,10 @@ struct vm_area_struct;
35/* flags that denote/change uprobes behaviour */ 35/* flags that denote/change uprobes behaviour */
36 36
37/* Have a copy of original instruction */ 37/* Have a copy of original instruction */
38#define UPROBES_COPY_INSN 0x1 38#define UPROBE_COPY_INSN 0x1
39 39
40/* Dont run handlers when first register/ last unregister in progress*/ 40/* Dont run handlers when first register/ last unregister in progress*/
41#define UPROBES_RUN_HANDLER 0x2 41#define UPROBE_RUN_HANDLER 0x2
42 42
43struct uprobe_consumer { 43struct uprobe_consumer {
44 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); 44 int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs);
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 5ce32e3ae9e9..0d36bf3920ba 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -177,7 +177,7 @@ out:
177 */ 177 */
178bool __weak is_bkpt_insn(uprobe_opcode_t *insn) 178bool __weak is_bkpt_insn(uprobe_opcode_t *insn)
179{ 179{
180 return *insn == UPROBES_BKPT_INSN; 180 return *insn == UPROBE_BKPT_INSN;
181} 181}
182 182
183/* 183/*
@@ -259,8 +259,8 @@ static int write_opcode(struct mm_struct *mm, struct arch_uprobe *auprobe,
259 259
260 /* poke the new insn in, ASSUMES we don't cross page boundary */ 260 /* poke the new insn in, ASSUMES we don't cross page boundary */
261 vaddr &= ~PAGE_MASK; 261 vaddr &= ~PAGE_MASK;
262 BUG_ON(vaddr + UPROBES_BKPT_INSN_SIZE > PAGE_SIZE); 262 BUG_ON(vaddr + UPROBE_BKPT_INSN_SIZE > PAGE_SIZE);
263 memcpy(vaddr_new + vaddr, &opcode, UPROBES_BKPT_INSN_SIZE); 263 memcpy(vaddr_new + vaddr, &opcode, UPROBE_BKPT_INSN_SIZE);
264 264
265 kunmap_atomic(vaddr_new); 265 kunmap_atomic(vaddr_new);
266 kunmap_atomic(vaddr_old); 266 kunmap_atomic(vaddr_old);
@@ -308,7 +308,7 @@ static int read_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_
308 lock_page(page); 308 lock_page(page);
309 vaddr_new = kmap_atomic(page); 309 vaddr_new = kmap_atomic(page);
310 vaddr &= ~PAGE_MASK; 310 vaddr &= ~PAGE_MASK;
311 memcpy(opcode, vaddr_new + vaddr, UPROBES_BKPT_INSN_SIZE); 311 memcpy(opcode, vaddr_new + vaddr, UPROBE_BKPT_INSN_SIZE);
312 kunmap_atomic(vaddr_new); 312 kunmap_atomic(vaddr_new);
313 unlock_page(page); 313 unlock_page(page);
314 314
@@ -352,7 +352,7 @@ int __weak set_bkpt(struct mm_struct *mm, struct arch_uprobe *auprobe, unsigned
352 if (result) 352 if (result)
353 return result; 353 return result;
354 354
355 return write_opcode(mm, auprobe, vaddr, UPROBES_BKPT_INSN); 355 return write_opcode(mm, auprobe, vaddr, UPROBE_BKPT_INSN);
356} 356}
357 357
358/** 358/**
@@ -635,7 +635,7 @@ static int install_breakpoint(struct mm_struct *mm, struct uprobe *uprobe,
635 635
636 addr = (unsigned long)vaddr; 636 addr = (unsigned long)vaddr;
637 637
638 if (!(uprobe->flags & UPROBES_COPY_INSN)) { 638 if (!(uprobe->flags & UPROBE_COPY_INSN)) {
639 ret = copy_insn(uprobe, vma, addr); 639 ret = copy_insn(uprobe, vma, addr);
640 if (ret) 640 if (ret)
641 return ret; 641 return ret;
@@ -647,7 +647,7 @@ static int install_breakpoint(struct mm_struct *mm, struct uprobe *uprobe,
647 if (ret) 647 if (ret)
648 return ret; 648 return ret;
649 649
650 uprobe->flags |= UPROBES_COPY_INSN; 650 uprobe->flags |= UPROBE_COPY_INSN;
651 } 651 }
652 ret = set_bkpt(mm, &uprobe->arch, addr); 652 ret = set_bkpt(mm, &uprobe->arch, addr);
653 653
@@ -857,7 +857,7 @@ int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *
857 uprobe->consumers = NULL; 857 uprobe->consumers = NULL;
858 __uprobe_unregister(uprobe); 858 __uprobe_unregister(uprobe);
859 } else { 859 } else {
860 uprobe->flags |= UPROBES_RUN_HANDLER; 860 uprobe->flags |= UPROBE_RUN_HANDLER;
861 } 861 }
862 } 862 }
863 863
@@ -889,7 +889,7 @@ void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consume
889 if (consumer_del(uprobe, consumer)) { 889 if (consumer_del(uprobe, consumer)) {
890 if (!uprobe->consumers) { 890 if (!uprobe->consumers) {
891 __uprobe_unregister(uprobe); 891 __uprobe_unregister(uprobe);
892 uprobe->flags &= ~UPROBES_RUN_HANDLER; 892 uprobe->flags &= ~UPROBE_RUN_HANDLER;
893 } 893 }
894 } 894 }
895 895