From: Paul Mackerras Date: Fri, 25 Sep 2020 08:14:18 +0000 (+1000) Subject: tests/trace: Test trace interrupt vs. FP unavailable interrupt X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=144433218f4e2a68a8ee9a23efc65d781b0f9c3f;p=microwatt.git tests/trace: Test trace interrupt vs. FP unavailable interrupt Signed-off-by: Paul Mackerras --- diff --git a/tests/test_trace.bin b/tests/test_trace.bin index b9a612d..61fa48b 100755 Binary files a/tests/test_trace.bin and b/tests/test_trace.bin differ diff --git a/tests/test_trace.console_out b/tests/test_trace.console_out index 340756c..25e791c 100644 --- a/tests/test_trace.console_out +++ b/tests/test_trace.console_out @@ -5,3 +5,4 @@ test 04:PASS test 05:PASS test 06:PASS test 07:PASS +test 08:PASS diff --git a/tests/trace/head.S b/tests/trace/head.S index d23aeb7..778baaa 100644 --- a/tests/trace/head.S +++ b/tests/trace/head.S @@ -214,3 +214,8 @@ test7: bne 1f li %r3,-1 1: blr + + .global test8 +test8: + lfd %f0,0(%r3) + blr diff --git a/tests/trace/trace.c b/tests/trace/trace.c index 5f7ae9f..a859f4e 100644 --- a/tests/trace/trace.c +++ b/tests/trace/trace.c @@ -8,6 +8,7 @@ extern unsigned long callit(unsigned long arg1, unsigned long arg2, unsigned long (*fn)(unsigned long, unsigned long), unsigned long msr, unsigned long *regs); +#define MSR_FP 0x2000 #define MSR_SE 0x400 #define MSR_BE 0x200 @@ -188,6 +189,22 @@ int trace_test_7(void) return 0; } +extern unsigned long test8(unsigned long, unsigned long); + +int trace_test_8(void) +{ + unsigned long ret; + unsigned long regs[2]; + + ret = callit(0, 0, test8, (mfmsr() & ~MSR_FP) | MSR_SE, regs); + if (ret != 0x800) + return ret + 1; + ret = callit(0, 0, test8, mfmsr() | MSR_FP | MSR_SE, regs); + if (ret != 0xd00) + return ret + 2; + return 0; +} + int fail = 0; void do_test(int num, int (*test)(void)) @@ -217,6 +234,7 @@ int main(void) do_test(5, trace_test_5); do_test(6, trace_test_6); do_test(7, trace_test_7); + do_test(8, trace_test_8); return fail; }