]> git.sur5r.net Git - openocd/commitdiff
RTOS support: Correction of out of bound access of thread array
authorJonathan Dumaresq <jdumaresq@cimeq.qc.ca>
Fri, 8 Apr 2016 14:38:00 +0000 (10:38 -0400)
committerFreddie Chopin <freddie.chopin@gmail.com>
Wed, 4 May 2016 21:38:44 +0000 (22:38 +0100)
FreeRTOS use an array to store ready task. The array size is
configMAX_PRIORITIES. In the current implementation, the code try to access 1 more priority if the helper from freeRTOS contrib is used.
This has effect of detecting bad thread. This patch correct this and have been tested on
a code with more than 12 task.

Change-Id: Id229f0b2c4bf1aab87a2a69be174cc9b6dda00cb
Signed-off-by: Jonathan Dumaresq <jdumaresq@cimeq.qc.ca>
Reviewed-on: http://openocd.zylin.com/3400
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
contrib/rtos-helpers/FreeRTOS-openocd.c

index 567e710b0b12422fb6bcaccbde9c1b179b09c96c..81a3ab77abb8b95eea85b07e854c77d74771cad0 100644 (file)
@@ -17,4 +17,4 @@
 #define USED
 #endif
 
-const int USED uxTopUsedPriority = configMAX_PRIORITIES;
+const int USED uxTopUsedPriority = configMAX_PRIORITIES - 1;