Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / arch / tile / include / asm / kprobes.h
blobd8f9a83943b137b57dd32cef2dbb60b5e2f39f63
1 /*
2 * arch/tile/include/asm/kprobes.h
4 * Copyright 2012 Tilera Corporation. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation, version 2.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
13 * NON INFRINGEMENT. See the GNU General Public License for
14 * more details.
17 #ifndef _ASM_TILE_KPROBES_H
18 #define _ASM_TILE_KPROBES_H
20 #include <linux/types.h>
21 #include <linux/ptrace.h>
22 #include <linux/percpu.h>
24 #include <arch/opcode.h>
26 #define __ARCH_WANT_KPROBES_INSN_SLOT
27 #define MAX_INSN_SIZE 2
29 #define kretprobe_blacklist_size 0
31 typedef tile_bundle_bits kprobe_opcode_t;
33 #define flush_insn_slot(p) \
34 flush_icache_range((unsigned long)p->addr, \
35 (unsigned long)p->addr + \
36 (MAX_INSN_SIZE * sizeof(kprobe_opcode_t)))
38 struct kprobe;
40 /* Architecture specific copy of original instruction. */
41 struct arch_specific_insn {
42 kprobe_opcode_t *insn;
45 struct prev_kprobe {
46 struct kprobe *kp;
47 unsigned long status;
48 unsigned long saved_pc;
51 #define MAX_JPROBES_STACK_SIZE 128
52 #define MAX_JPROBES_STACK_ADDR \
53 (((unsigned long)current_thread_info()) + THREAD_SIZE - 32 \
54 - sizeof(struct pt_regs))
56 #define MIN_JPROBES_STACK_SIZE(ADDR) \
57 ((((ADDR) + MAX_JPROBES_STACK_SIZE) > MAX_JPROBES_STACK_ADDR) \
58 ? MAX_JPROBES_STACK_ADDR - (ADDR) \
59 : MAX_JPROBES_STACK_SIZE)
61 /* per-cpu kprobe control block. */
62 struct kprobe_ctlblk {
63 unsigned long kprobe_status;
64 unsigned long kprobe_saved_pc;
65 unsigned long jprobe_saved_sp;
66 struct prev_kprobe prev_kprobe;
67 struct pt_regs jprobe_saved_regs;
68 char jprobes_stack[MAX_JPROBES_STACK_SIZE];
71 extern tile_bundle_bits breakpoint2_insn;
72 extern tile_bundle_bits breakpoint_insn;
74 void arch_remove_kprobe(struct kprobe *);
76 extern int kprobe_exceptions_notify(struct notifier_block *self,
77 unsigned long val, void *data);
79 #endif /* _ASM_TILE_KPROBES_H */