| 741 | } |
| 742 | |
| 743 | void sched_note_suspend(FAR struct tcb_s *tcb) |
| 744 | { |
| 745 | struct note_suspend_s note; |
| 746 | FAR struct note_driver_s **driver; |
| 747 | bool formatted = false; |
| 748 | |
| 749 | for (driver = g_note_drivers; *driver; driver++) |
| 750 | { |
| 751 | if (!note_isenabled_switch(*driver)) |
| 752 | { |
| 753 | continue; |
| 754 | } |
| 755 | |
| 756 | if (note_suspend(*driver, tcb)) |
| 757 | { |
| 758 | continue; |
| 759 | } |
| 760 | |
| 761 | if ((*driver)->ops->add == NULL) |
| 762 | { |
| 763 | continue; |
| 764 | } |
| 765 | |
| 766 | /* Format the note */ |
| 767 | |
| 768 | if (!formatted) |
| 769 | { |
| 770 | formatted = true; |
| 771 | note_common(tcb, ¬e.nsu_cmn, sizeof(struct note_suspend_s), |
| 772 | NOTE_SUSPEND); |
| 773 | note.nsu_state = tcb->task_state; |
| 774 | } |
| 775 | |
| 776 | /* Add the note to circular buffer */ |
| 777 | |
| 778 | note_add(*driver, ¬e, sizeof(struct note_suspend_s)); |
| 779 | } |
| 780 | } |
| 781 | |
| 782 | void sched_note_resume(FAR struct tcb_s *tcb) |
| 783 | { |
no test coverage detected