| 699 | } |
| 700 | |
| 701 | void sched_note_stop(FAR struct tcb_s *tcb) |
| 702 | { |
| 703 | struct note_stop_s note; |
| 704 | FAR struct note_driver_s **driver; |
| 705 | bool formatted = false; |
| 706 | |
| 707 | #if CONFIG_DRIVERS_NOTE_TASKNAME_BUFSIZE > 0 |
| 708 | note_record_taskname(tcb->pid, tcb->name); |
| 709 | #endif |
| 710 | |
| 711 | for (driver = g_note_drivers; *driver; driver++) |
| 712 | { |
| 713 | if (!note_isenabled(*driver)) |
| 714 | { |
| 715 | continue; |
| 716 | } |
| 717 | |
| 718 | if (note_stop(*driver, tcb)) |
| 719 | { |
| 720 | continue; |
| 721 | } |
| 722 | |
| 723 | if ((*driver)->ops->add == NULL) |
| 724 | { |
| 725 | continue; |
| 726 | } |
| 727 | |
| 728 | /* Format the note */ |
| 729 | |
| 730 | if (!formatted) |
| 731 | { |
| 732 | formatted = true; |
| 733 | note_common(tcb, ¬e.nsp_cmn, sizeof(struct note_stop_s), |
| 734 | NOTE_STOP); |
| 735 | } |
| 736 | |
| 737 | /* Add the note to circular buffer */ |
| 738 | |
| 739 | note_add(*driver, ¬e, sizeof(struct note_stop_s)); |
| 740 | } |
| 741 | } |
| 742 | |
| 743 | void sched_note_suspend(FAR struct tcb_s *tcb) |
| 744 | { |
no test coverage detected