From 3f4e9a6995d3646319e3f34e0e1d458d60ebbc7a Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 24 Feb 2017 14:09:00 +0000 Subject: Don't check ICSR.RETTOBASE outside an exception handler The ICSR.RETTOBASE bit value is UNKNOWN when not inside an exception handler, so don't try to test it in that situation. Signed-off-by: Peter Maydell --- test4.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test4.c') diff --git a/test4.c b/test4.c index c2c1701..b5f62ae 100644 --- a/test4.c +++ b/test4.c @@ -109,7 +109,10 @@ void main(void) test_equal("ENA ", 3, in32(SCB(0x100))); test_equal("PEND", 0, in32(SCB(0x200))); test_equal("ACT ", 0, in32(SCB(0x300))); - test_equal("ICSR", 0x00000000, in32(SCB(0xd04))); + /* Note that we don't compare ICSR.RETTOBASE as that bit is + * architecturally UNKNOWN outside an exception handler. + */ + test_equal("ICSR", 0x00000000, in32(SCB(0xd04)) & ~ICSR_RETTOBASE); testDiag("Pend IRQ0 (shouldn't run)"); out32(SCB(0x200), 1); @@ -117,7 +120,7 @@ void main(void) test_equal("PEND", 1, in32(SCB(0x200))); test_equal("ACT ", 0, in32(SCB(0x300))); /* ISRPENDING and VECTPENDING==16 */ - test_equal("ICSR", 0x00410000, in32(SCB(0xd04))); + test_equal("ICSR", 0x00410000, in32(SCB(0xd04)) & ~ICSR_RETTOBASE); CHECK_SEQ(1); testDiag("Unmask (should run now)"); -- cgit v1.2.3