diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-04-11 12:32:00 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-04-11 12:32:00 +0100 |
commit | 4669a19d422b9649e21f0f49a1025473805ee091 (patch) | |
tree | 56e35b8af61311ae4eee92dd04ef81cee3c0f320 | |
parent | 6cace9f09aa49f7e73ab8cab5e54b598ff50cb5f (diff) |
test11: Record and check FAR values
Record and check FAR values as well as FSR and fault type.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | test11-buserr.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test11-buserr.c b/test11-buserr.c index 0f695e3..f848dce 100644 --- a/test11-buserr.c +++ b/test11-buserr.c @@ -10,6 +10,8 @@ volatile unsigned fault_type; static volatile unsigned fsr; +static volatile unsigned far; + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) const char *faultnames[] = { @@ -88,6 +90,13 @@ static void set_fault(unsigned actual, unsigned fsrval) } } +static void check_far(unsigned expect) +{ + unsigned actual = far; + testEqI(expect, actual, "FAR"); + far = 0; +} + static void hard(void) { @@ -108,6 +117,7 @@ void bus(uint32_t *sp) if(sts&0x8000) { testDiag("BFARVALID set, BFAR is 0x%x", addr); + far = addr; } if(sts&0x0300) { @@ -146,6 +156,7 @@ void mem(uint32_t *sp) if (sts&0x80) { testDiag("MMARVALID set, MMFAR is 0x%x", addr); + far = addr; } if(sp[6]>=0xf0000000) { @@ -208,7 +219,7 @@ void main(void) run_table.usage = usage_entry; run_table.hard = hard; - testInit(14); + testInit(17); out32(SCB(0xd24), 0x70000); /* Enable Bus, Mem, and Usage Faults */ @@ -331,18 +342,21 @@ void main(void) testDiag("12. Another MemFault 0x10000000"); out32((void*)0x10000000, 0); check_fault(1, 0x82); + check_far(0x10000000); testDiag("Back in Main"); // MemFault because of RO mapping testDiag("13. Another MemFault 0x05000000"); out32((void*)0x05000000, 0); check_fault(1, 0x82); + check_far(0x05000000); testDiag("Back in Main"); testDiag("14. Another MemFault 0xfffffffe"); // UNPREDICTABLE? but as it happens QEMU does this out32((void*)0xfffffffe, 0); check_fault(1, 0x82); + check_far(0xfffffffe); testDiag("Back in Main"); // this jump works, and TI has hidden so data here |