| 80 | } |
| 81 | |
| 82 | rt_inline int _bus_ring_space_nr(struct rt_vbus_ring *rg) |
| 83 | { |
| 84 | int delta; |
| 85 | |
| 86 | rt_vbus_smp_rmb(); |
| 87 | delta = rg->get_idx - rg->put_idx; |
| 88 | |
| 89 | if (delta > 0) |
| 90 | { |
| 91 | /* Put is behind the get. */ |
| 92 | return delta - 1; |
| 93 | } |
| 94 | else |
| 95 | { |
| 96 | /* delta is negative. */ |
| 97 | return RT_VMM_RB_BLK_NR + delta - 1; |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | struct rt_vbus_pkg { |
| 102 | rt_uint8_t id; |
no test coverage detected