Commit 6772926bef3c9f0ec761b39e5702535471fff70b

Authored by Rusty Lynch
Committed by Linus Torvalds
1 parent 4b1294f928

[PATCH] kprobes: fix namespace problem and sparc64 build

The following renames arch_init, a kprobes function for performing any
architecture specific initialization, to arch_init_kprobes in order to
cleanup the namespace.

Also, this patch adds arch_init_kprobes to sparc64 to fix the sparc64 kprobes
build from the last return probe patch.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 7 changed files with 11 additions and 6 deletions Side-by-side Diff

arch/i386/kernel/kprobes.c
... ... @@ -537,7 +537,7 @@
537 537 .pre_handler = trampoline_probe_handler
538 538 };
539 539  
540   -int __init arch_init(void)
  540 +int __init arch_init_kprobes(void)
541 541 {
542 542 return register_kprobe(&trampoline_p);
543 543 }
arch/ia64/kernel/kprobes.c
... ... @@ -713,7 +713,7 @@
713 713 .pre_handler = trampoline_probe_handler
714 714 };
715 715  
716   -int __init arch_init(void)
  716 +int __init arch_init_kprobes(void)
717 717 {
718 718 trampoline_p.addr =
719 719 (kprobe_opcode_t *)((struct fnptr *)kretprobe_trampoline)->ip;
arch/ppc64/kernel/kprobes.c
... ... @@ -444,7 +444,7 @@
444 444 .pre_handler = trampoline_probe_handler
445 445 };
446 446  
447   -int __init arch_init(void)
  447 +int __init arch_init_kprobes(void)
448 448 {
449 449 return register_kprobe(&trampoline_p);
450 450 }
arch/sparc64/kernel/kprobes.c
... ... @@ -432,4 +432,10 @@
432 432 }
433 433 return 0;
434 434 }
  435 +
  436 +/* architecture specific initialization */
  437 +int arch_init_kprobes(void)
  438 +{
  439 + return 0;
  440 +}
arch/x86_64/kernel/kprobes.c
... ... @@ -682,7 +682,7 @@
682 682 .pre_handler = trampoline_probe_handler
683 683 };
684 684  
685   -int __init arch_init(void)
  685 +int __init arch_init_kprobes(void)
686 686 {
687 687 return register_kprobe(&trampoline_p);
688 688 }
include/linux/kprobes.h
... ... @@ -155,7 +155,7 @@
155 155 extern void arch_arm_kprobe(struct kprobe *p);
156 156 extern void arch_disarm_kprobe(struct kprobe *p);
157 157 extern void arch_remove_kprobe(struct kprobe *p);
158   -extern int arch_init(void);
  158 +extern int arch_init_kprobes(void);
159 159 extern void show_registers(struct pt_regs *regs);
160 160 extern kprobe_opcode_t *get_insn_slot(void);
161 161 extern void free_insn_slot(kprobe_opcode_t *slot);
... ... @@ -574,7 +574,7 @@
574 574 INIT_HLIST_HEAD(&kretprobe_inst_table[i]);
575 575 }
576 576  
577   - err = arch_init();
  577 + err = arch_init_kprobes();
578 578 if (!err)
579 579 err = register_die_notifier(&kprobe_exceptions_nb);
580 580