aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/kprobes-test.c
diff options
context:
space:
mode:
authorJon Medhurst <tixy@yxit.co.uk>2011-08-27 07:40:30 -0400
committerJon Medhurst <tixy@yxit.co.uk>2011-09-20 14:17:43 -0400
commitc7054aad538c18bc4c311e74a24cb2e205f02e04 (patch)
tree436e5b6bf57c756ab1b6fd1c95064b49edb49334 /arch/arm/kernel/kprobes-test.c
parenta43bc69b39484a448293f2eddc7e98ff15437414 (diff)
ARM: kprobes: Add Thumb instruction simulation test cases
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/kernel/kprobes-test.c')
-rw-r--r--arch/arm/kernel/kprobes-test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c
index e22c3f2aff10..1cef0fa996e2 100644
--- a/arch/arm/kernel/kprobes-test.c
+++ b/arch/arm/kernel/kprobes-test.c
@@ -1117,6 +1117,15 @@ end:
1117 * Top level test functions 1117 * Top level test functions
1118 */ 1118 */
1119 1119
1120static int run_test_cases(void (*tests)(void))
1121{
1122 pr_info(" Run test cases\n");
1123 tests();
1124
1125 return 0;
1126}
1127
1128
1120static int __init run_all_tests(void) 1129static int __init run_all_tests(void)
1121{ 1130{
1122 int ret = 0; 1131 int ret = 0;
@@ -1147,8 +1156,24 @@ static int __init run_all_tests(void)
1147 if (ret) 1156 if (ret)
1148 goto out; 1157 goto out;
1149 1158
1159 pr_info("16-bit Thumb instruction simulation\n");
1160 ret = run_test_cases(kprobe_thumb16_test_cases);
1161 if (ret)
1162 goto out;
1163
1164 pr_info("32-bit Thumb instruction simulation\n");
1165 ret = run_test_cases(kprobe_thumb32_test_cases);
1166 if (ret)
1167 goto out;
1150#endif 1168#endif
1151 1169
1170 pr_info("Total instruction simulation tests=%d, pass=%d fail=%d\n",
1171 test_try_count, test_pass_count, test_fail_count);
1172 if (test_fail_count) {
1173 ret = -EINVAL;
1174 goto out;
1175 }
1176
1152out: 1177out:
1153 if (ret == 0) 1178 if (ret == 0)
1154 pr_info("Finished kprobe tests OK\n"); 1179 pr_info("Finished kprobe tests OK\n");