From 173ddeb61782ed90b94d4672022a53a58b2d59b0 Mon Sep 17 00:00:00 2001 From: Prem Mallappa Date: Fri, 20 Nov 2009 00:36:09 +0530 Subject: [PATCH] Graceful handling of Undefined instruction --- conts/posix/test0/src/undeftest.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 conts/posix/test0/src/undeftest.c diff --git a/conts/posix/test0/src/undeftest.c b/conts/posix/test0/src/undeftest.c new file mode 100644 index 0000000..bf991ce --- /dev/null +++ b/conts/posix/test0/src/undeftest.c @@ -0,0 +1,29 @@ +/* + * undeftest.c: + * Tests to see if kernel gracefully handles the undef exception + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include INC_GLUE(memory.h) + + +int undeftest(void) +{ + test_printf("UNDEF: Start\n"); + + /* need a way to report FAIL case */ + __asm__ __volatile__(".word 0xf1f0feed\n\t"); /* Some pattern for easy recongition */ + + /* If code reaches here its passed */ + printf("UNDEF TEST -- PASSED --\n"); + test_printf("UNDEF: Passed\n"); + + return 0; +}