From c4def60cdd02760bed023bf516ddbbf89e2bd916 Mon Sep 17 00:00:00 2001 From: Marko Gucanin Date: Tue, 5 Jul 2016 16:44:24 +0200 Subject: [PATCH 1/5] removed exception handler for SYSCALL, causing an infinite loop after calling vAHI_SwReset() --- platform/jn516x/dev/exceptions.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/platform/jn516x/dev/exceptions.c b/platform/jn516x/dev/exceptions.c index 10a3bf11b..a04654077 100644 --- a/platform/jn516x/dev/exceptions.c +++ b/platform/jn516x/dev/exceptions.c @@ -182,7 +182,6 @@ vEXC_Register(void) BUS_ERROR = (uint32)exception_handler; UNALIGNED_ACCESS = (uint32)exception_handler; ILLEGAL_INSTRUCTION = (uint32)exception_handler; - SYSCALL = (uint32)exception_handler; TRAP = (uint32)exception_handler; GENERIC = (uint32)exception_handler; STACK_OVERFLOW = (uint32)exception_handler; @@ -211,11 +210,6 @@ vException_IllegalInstruction(uint32 *pu32Stack, eExceptionType eType) exception_handler(pu32Stack, eType); } PUBLIC void -vException_SysCall(uint32 *pu32Stack, eExceptionType eType) -{ - exception_handler(pu32Stack, eType); -} -PUBLIC void vException_Trap(uint32 *pu32Stack, eExceptionType eType) { exception_handler(pu32Stack, eType); From 74d04562df5b665e31a796f38d788ef3e3c7f51d Mon Sep 17 00:00:00 2001 From: Marko Gucanin Date: Wed, 6 Jul 2016 15:45:15 +0200 Subject: [PATCH 2/5] Revert "removed exception handler for SYSCALL, causing an infinite loop after calling vAHI_SwReset()" This reverts commit c4def60cdd02760bed023bf516ddbbf89e2bd916. --- platform/jn516x/dev/exceptions.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform/jn516x/dev/exceptions.c b/platform/jn516x/dev/exceptions.c index a04654077..10a3bf11b 100644 --- a/platform/jn516x/dev/exceptions.c +++ b/platform/jn516x/dev/exceptions.c @@ -182,6 +182,7 @@ vEXC_Register(void) BUS_ERROR = (uint32)exception_handler; UNALIGNED_ACCESS = (uint32)exception_handler; ILLEGAL_INSTRUCTION = (uint32)exception_handler; + SYSCALL = (uint32)exception_handler; TRAP = (uint32)exception_handler; GENERIC = (uint32)exception_handler; STACK_OVERFLOW = (uint32)exception_handler; @@ -210,6 +211,11 @@ vException_IllegalInstruction(uint32 *pu32Stack, eExceptionType eType) exception_handler(pu32Stack, eType); } PUBLIC void +vException_SysCall(uint32 *pu32Stack, eExceptionType eType) +{ + exception_handler(pu32Stack, eType); +} +PUBLIC void vException_Trap(uint32 *pu32Stack, eExceptionType eType) { exception_handler(pu32Stack, eType); From 1a1d17143bcaef6f087ea1fe205cba03bba28ec4 Mon Sep 17 00:00:00 2001 From: Marko Gucanin Date: Wed, 6 Jul 2016 16:28:47 +0200 Subject: [PATCH 3/5] return from exception handler if E_EXC_SYSCALL is generated --- platform/jn516x/dev/exceptions.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/jn516x/dev/exceptions.c b/platform/jn516x/dev/exceptions.c index 10a3bf11b..ac975ecac 100644 --- a/platform/jn516x/dev/exceptions.c +++ b/platform/jn516x/dev/exceptions.c @@ -354,6 +354,9 @@ exception_handler(uint32 *pu32Stack, eExceptionType eType) } #endif + if(eType == E_EXC_SYSCALL) + return; + #if EXCEPTION_STALLS_SYSTEM while(1) { } From 1fc9bbe315b6efdedfe95cdcb34a0f82ede9903e Mon Sep 17 00:00:00 2001 From: Marko Gucanin Date: Fri, 8 Jul 2016 16:25:34 +0200 Subject: [PATCH 4/5] added { } --- platform/jn516x/dev/exceptions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/jn516x/dev/exceptions.c b/platform/jn516x/dev/exceptions.c index ac975ecac..e23ff2906 100644 --- a/platform/jn516x/dev/exceptions.c +++ b/platform/jn516x/dev/exceptions.c @@ -354,8 +354,9 @@ exception_handler(uint32 *pu32Stack, eExceptionType eType) } #endif - if(eType == E_EXC_SYSCALL) + if(eType == E_EXC_SYSCALL){ return; + } #if EXCEPTION_STALLS_SYSTEM while(1) { From 93757e810d375040691bfaf0e7bf1a00e3036c95 Mon Sep 17 00:00:00 2001 From: Marko Gucanin Date: Mon, 5 Sep 2016 17:36:33 +0200 Subject: [PATCH 5/5] added space between ) and { --- platform/jn516x/dev/exceptions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/jn516x/dev/exceptions.c b/platform/jn516x/dev/exceptions.c index e23ff2906..2991de639 100644 --- a/platform/jn516x/dev/exceptions.c +++ b/platform/jn516x/dev/exceptions.c @@ -354,7 +354,7 @@ exception_handler(uint32 *pu32Stack, eExceptionType eType) } #endif - if(eType == E_EXC_SYSCALL){ + if(eType == E_EXC_SYSCALL) { return; }