AnsweredAssumed Answered

How to get to know the task status of MQX

Question asked by George Fukutomi on Feb 4, 2013
Latest reply on Feb 4, 2013 by Martin Kojtal

Hi all,

 

I want to have a function for fail safe in MQX using Kinetis.

 

I think that it becomes possible by detecting the task which is keeping being blocked by another task.

For example, those status is in mqx_priv.h.

 

390 /*--------------------------------------------------------------------------*/

391 /*

392 **                             TASK STATES

393 **

394 ** The following define all of the states that a task have.

395 */

396

397 /* All blocked states have this bit set */

398 #define IS_BLOCKED                      (0x001)

399

400 /* Some states may also have the task on a timeout queue when blocked */

401 #define IS_ON_TIMEOUT_Q                 (0x100)

402

403 /* Some states may also have their task descriptors on a queue when blocked */

404 #define TD_IS_ON_QUEUE                  (0x200)

405

406 /*

407 ** Some states may also have their task descriptors on a queue using their

408 ** AUX pointer fields in the TD

409 */

410 #define TD_IS_ON_AUX_QUEUE              (0x400)

411

412 /* Mask to remove queueing and timeout bits */

413 #define STATE_MASK                      (0x0ff)

414

415 #define READY                           (0x02)

416 #define BLOCKED                         (0x02 | IS_BLOCKED)

417 #define RCV_SPECIFIC_BLOCKED            (0x04 | IS_BLOCKED)

418 #define RCV_ANY_BLOCKED                 (0x06 | IS_BLOCKED)

419 #define DYING                           (0x08 | IS_BLOCKED)

420 #define UNHANDLED_INT_BLOCKED           (0x0A | IS_BLOCKED)

421 #define SEND_BLOCKED                    (0x0C | IS_BLOCKED)

422 #define BREAKPOINT_BLOCKED              (0x0E | IS_BLOCKED)

423 #define IO_BLOCKED                      (0x10 | IS_BLOCKED | TD_IS_ON_QUEUE)

424

425 #define SEM_BLOCKED                     (0x20 | IS_BLOCKED)

426 #define MUTEX_BLOCKED                   (0x22 | IS_BLOCKED | TD_IS_ON_QUEUE)

427 #define EVENT_BLOCKED                   (0x24 | IS_BLOCKED)

428 #define TASK_QUEUE_BLOCKED              (0x28 | IS_BLOCKED | TD_IS_ON_QUEUE)

429 #define BLOCKED_ON_AUX_QUEUE            (TD_IS_ON_AUX_QUEUE|IS_BLOCKED)

430 #define LWSEM_BLOCKED                   (0x2A | BLOCKED_ON_AUX_QUEUE)

431 #define LWEVENT_BLOCKED                 (0x2C | BLOCKED_ON_AUX_QUEUE)

 

Please tell me how to get to know each task status from other task.

 

And, if there is a way good for others, please let me know.

 

Best Regards,

George

 


Outcomes