Skip to content

Commit 11a3aab

Browse files
Fix typo in allocate_slot
1 parent 065cdad commit 11a3aab

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

Src/HALAL/Services/Time/Scheduler.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,7 @@ inline uint64_t Scheduler::get_global_tick() { return global_tick_us_; }
121121
// void Scheduler::global_timer_callback() { on_timer_update(); }
122122

123123
inline uint8_t Scheduler::allocate_slot() {
124-
/* https://developer.arm.com/documentation/dui0204/j/arm-and-thumb-instructions/general-data-processing-instructions/clz
125-
* clz(0) = 32 -> 32 - clz(0) = 0
126-
* clz(0xFFFF'FFFF) = 0 -> 32 - clz(0xFFFF'FFFF) > kMaxTasks
127-
*/
128-
uint32_t idx = __builtin_ffs(~Scheduler::free_bitmap_) - 1;
124+
uint32_t idx = __builtin_ffs(Scheduler::free_bitmap_) - 1;
129125
if(idx > static_cast<int>(Scheduler::kMaxTasks)) [[unlikely]]
130126
return static_cast<uint8_t>(Scheduler::INVALID_ID);
131127
Scheduler::active_task_count_++;

0 commit comments

Comments
 (0)