Skip to content

Commit 4f29f87

Browse files
committed
Add ready queue bitmap helper functions
When a task is enqueued into or dequeued from the ready queue, the bitmap that indicates the ready queue state should be updated. These two help functions can be used in relatives functions when bitmap operations are required.
1 parent 43f9499 commit 4f29f87

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

kernel/task.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ kcb_t *kcb = &kernel_state;
3838
*/
3939
volatile bool scheduler_started = false;
4040

41+
/* Bitmap functions */
42+
43+
static inline void bitmap_set(uint8_t prio_level)
44+
{
45+
kcb->ready_bitmap |= (1U << prio_level);
46+
}
47+
48+
static inline void bitmap_clean(uint8_t prio_level)
49+
{
50+
kcb->ready_bitmap &= ~(1U << prio_level);
51+
}
52+
4153
/* timer work management for reduced latency */
4254
static volatile uint32_t timer_work_pending = 0; /* timer work types */
4355
static volatile uint32_t timer_work_generation = 0; /* counter for coalescing */

0 commit comments

Comments
 (0)