MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _bus_ring_space_nr

Function _bus_ring_space_nr

components/vbus/vbus.c:82–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82rt_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
101struct rt_vbus_pkg {
102 rt_uint8_t id;

Callers 2

_bus_out_entryFunction · 0.85
rt_vbus_rb_dumpFunction · 0.85

Calls 1

rt_vbus_smp_rmbFunction · 0.50

Tested by

no test coverage detected