@@ -190,39 +190,17 @@ void OS::halt() {
190190}
191191
192192// Keep track of blocking levels
193- static uint32_t * blocking_level = 0 ;
194- static uint32_t * highest_blocking_level = 0 ;
195-
196-
197- // Getters, mostly for testing
198- extern " C" uint32_t os_get_blocking_level () {
199- return *blocking_level;
200- }
201- extern " C" uint32_t os_get_highest_blocking_level () {
202- return *highest_blocking_level;
203- }
193+ static uint32_t blocking_level = 0 ;
194+ static uint32_t highest_blocking_level = 0 ;
204195
205196void OS::block ()
206197{
207- // Initialize stats
208- if (not blocking_level) {
209- blocking_level = &Statman::get ()
210- .create (Stat::UINT32, std::string (" blocking.current_level" )).get_uint32 ();
211- *blocking_level = 0 ;
212- }
213-
214- if (not highest_blocking_level) {
215- highest_blocking_level = &Statman::get ()
216- .create (Stat::UINT32, std::string (" blocking.highest" )).get_uint32 ();
217- *highest_blocking_level = 0 ;
218- }
219-
220198 // Increment level
221- * blocking_level += 1 ;
199+ blocking_level += 1 ;
222200
223201 // Increment highest if applicable
224- if (* blocking_level > * highest_blocking_level)
225- * highest_blocking_level = * blocking_level;
202+ if (blocking_level > highest_blocking_level)
203+ highest_blocking_level = blocking_level;
226204
227205 int rc;
228206 rc = solo5_poll (solo5_clock_monotonic () + 50000ULL ); // now + 0.05 ms
@@ -238,7 +216,7 @@ void OS::block()
238216 }
239217
240218 // Decrement level
241- * blocking_level -= 1 ;
219+ blocking_level -= 1 ;
242220}
243221
244222extern " C"
0 commit comments