diff options
author | Jon Medhurst <tixy@yxit.co.uk> | 2011-08-27 12:40:30 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@yxit.co.uk> | 2011-09-20 18:17:43 +0000 |
commit | c7054aad538c18bc4c311e74a24cb2e205f02e04 (patch) | |
tree | 436e5b6bf57c756ab1b6fd1c95064b49edb49334 /arch/arm/kernel/kprobes-test.c | |
parent | a43bc69b39484a448293f2eddc7e98ff15437414 (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.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/kernel/kprobes-test.c b/arch/arm/kernel/kprobes-test.c index e22c3f2aff1..1cef0fa996e 100644 --- a/arch/arm/kernel/kprobes-test.c +++ b/arch/arm/kernel/kprobes-test.c @@ -1117,6 +1117,15 @@ end: * Top level test functions */ +static int run_test_cases(void (*tests)(void)) +{ + pr_info(" Run test cases\n"); + tests(); + + return 0; +} + + static int __init run_all_tests(void) { int ret = 0; @@ -1147,8 +1156,24 @@ static int __init run_all_tests(void) if (ret) goto out; + pr_info("16-bit Thumb instruction simulation\n"); + ret = run_test_cases(kprobe_thumb16_test_cases); + if (ret) + goto out; + + pr_info("32-bit Thumb instruction simulation\n"); + ret = run_test_cases(kprobe_thumb32_test_cases); + if (ret) + goto out; #endif + pr_info("Total instruction simulation tests=%d, pass=%d fail=%d\n", + test_try_count, test_pass_count, test_fail_count); + if (test_fail_count) { + ret = -EINVAL; + goto out; + } + out: if (ret == 0) pr_info("Finished kprobe tests OK\n"); |