Skip to content

Commit

Permalink
[PATCH] kprobes: fix namespace problem and sparc64 build
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rustylynch authored and Linus Torvalds committed Jul 6, 2005
1 parent 4b1294f commit 6772926
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arch/i386/kernel/kprobes.c
Expand Up @@ -537,7 +537,7 @@ static struct kprobe trampoline_p = {
.pre_handler = trampoline_probe_handler
};

int __init arch_init(void)
int __init arch_init_kprobes(void)
{
return register_kprobe(&trampoline_p);
}
2 changes: 1 addition & 1 deletion arch/ia64/kernel/kprobes.c
Expand Up @@ -713,7 +713,7 @@ static struct kprobe trampoline_p = {
.pre_handler = trampoline_probe_handler
};

int __init arch_init(void)
int __init arch_init_kprobes(void)
{
trampoline_p.addr =
(kprobe_opcode_t *)((struct fnptr *)kretprobe_trampoline)->ip;
Expand Down
2 changes: 1 addition & 1 deletion arch/ppc64/kernel/kprobes.c
Expand Up @@ -444,7 +444,7 @@ static struct kprobe trampoline_p = {
.pre_handler = trampoline_probe_handler
};

int __init arch_init(void)
int __init arch_init_kprobes(void)
{
return register_kprobe(&trampoline_p);
}
5 changes: 5 additions & 0 deletions arch/sparc64/kernel/kprobes.c
Expand Up @@ -433,3 +433,8 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
return 0;
}

/* architecture specific initialization */
int arch_init_kprobes(void)
{
return 0;
}
2 changes: 1 addition & 1 deletion arch/x86_64/kernel/kprobes.c
Expand Up @@ -682,7 +682,7 @@ static struct kprobe trampoline_p = {
.pre_handler = trampoline_probe_handler
};

int __init arch_init(void)
int __init arch_init_kprobes(void)
{
return register_kprobe(&trampoline_p);
}
2 changes: 1 addition & 1 deletion include/linux/kprobes.h
Expand Up @@ -155,7 +155,7 @@ extern void arch_copy_kprobe(struct kprobe *p);
extern void arch_arm_kprobe(struct kprobe *p);
extern void arch_disarm_kprobe(struct kprobe *p);
extern void arch_remove_kprobe(struct kprobe *p);
extern int arch_init(void);
extern int arch_init_kprobes(void);
extern void show_registers(struct pt_regs *regs);
extern kprobe_opcode_t *get_insn_slot(void);
extern void free_insn_slot(kprobe_opcode_t *slot);
Expand Down
2 changes: 1 addition & 1 deletion kernel/kprobes.c
Expand Up @@ -574,7 +574,7 @@ static int __init init_kprobes(void)
INIT_HLIST_HEAD(&kretprobe_inst_table[i]);
}

err = arch_init();
err = arch_init_kprobes();
if (!err)
err = register_die_notifier(&kprobe_exceptions_nb);

Expand Down

0 comments on commit 6772926

Please sign in to comment.