@@ -417,4 +417,25 @@ int kprobe_decode_insn(kprobe_opcode_t insn, struct arch_specific_insn *asi,
const union decode_item *table, bool thumb16);
+
+#ifdef CONFIG_ARM_KPROBES_TESTS
+
+/* Declare decoding tables for access by test code */
+#ifdef CONFIG_THUMB2_KERNEL
+extern const union decode_item kprobe_decode_thumb16_table[];
+extern const union decode_item kprobe_decode_thumb32_table[];
+#else
+extern const union decode_item kprobe_decode_arm_table[];
+#endif
+
+#define EXPORT_KPROBES_TEST_SYMBOL(sym) EXPORT_SYMBOL_GPL(sym)
+
+#else /* !CONFIG_ARM_KPROBES_TESTS */
+
+/* No test exports required */
+#define EXPORT_KPROBES_TEST_SYMBOL(sym)
+
+#endif
+
+
#endif /* _ARM_KERNEL_KPROBES_H */
@@ -60,6 +60,7 @@
#include <linux/kernel.h>
#include <linux/kprobes.h>
+#include <linux/module.h>
#include "kprobes.h"
@@ -971,6 +972,7 @@ const union decode_item kprobe_decode_arm_table[] = {
DECODE_END
};
+EXPORT_KPROBES_TEST_SYMBOL(kprobe_decode_arm_table);
static void __kprobes arm_singlestep(struct kprobe *p, struct pt_regs *regs)
{
@@ -10,6 +10,7 @@
#include <linux/kernel.h>
#include <linux/kprobes.h>
+#include <linux/module.h>
#include "kprobes.h"
@@ -943,6 +944,7 @@ const union decode_item kprobe_decode_thumb32_table[] = {
*/
DECODE_END
};
+EXPORT_KPROBES_TEST_SYMBOL(kprobe_decode_thumb32_table);
static void __kprobes
t16_simulate_bxblx(struct kprobe *p, struct pt_regs *regs)
@@ -1423,6 +1425,7 @@ const union decode_item kprobe_decode_thumb16_table[] = {
DECODE_END
};
+EXPORT_KPROBES_TEST_SYMBOL(kprobe_decode_thumb16_table);
static unsigned long __kprobes thumb_check_cc(unsigned long cpsr)
{