for fops */
| 1010 | |
| 1011 | /* for fops */ |
| 1012 | static int channel_fops_poll(struct dfs_file *file, struct rt_pollreq *req) |
| 1013 | { |
| 1014 | int mask = POLLOUT; |
| 1015 | rt_channel_t ch; |
| 1016 | rt_base_t level; |
| 1017 | |
| 1018 | ch = (rt_channel_t)file->vnode->data; |
| 1019 | |
| 1020 | level = rt_spin_lock_irqsave(&ch->slock); |
| 1021 | rt_poll_add(&(ch->reader_queue), req); |
| 1022 | if (ch->stat != RT_IPC_STAT_IDLE) |
| 1023 | { |
| 1024 | rt_spin_unlock_irqrestore(&ch->slock, level); |
| 1025 | return mask; |
| 1026 | } |
| 1027 | if (!rt_list_isempty(&ch->wait_msg)) |
| 1028 | { |
| 1029 | mask |= POLLIN; |
| 1030 | } |
| 1031 | rt_spin_unlock_irqrestore(&ch->slock, level); |
| 1032 | |
| 1033 | return mask; |
| 1034 | } |
| 1035 | |
| 1036 | static int channel_fops_close(struct dfs_file *file) |
| 1037 | { |
nothing calls this directly
no test coverage detected