Skip to content

Commit 6bd43f1

Browse files
committed
Add three marcos for ready queue bitmap operation
When a task is enqueued into or dequeued from the ready queue, the bitmap that indicates the ready queue state should be updated. These three marcos can be used in mo_task_dequeue() and mo_task_enqueue() APIs to improve readability and maintain consistency.
1 parent 56c1926 commit 6bd43f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/task.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ static kcb_t kernel_state = {
3737
};
3838
kcb_t *kcb = &kernel_state;
3939

40+
/* Bitmap operation */
41+
#define BITMAP_CHECK(prio) (kcb->harts->ready_bitmap & 1U << prio)
42+
#define BITMAP_SET(prio) (kcb->harts->ready_bitmap |= 1U << prio)
43+
#define BITMAP_CLEAN(prio) (kcb->harts->ready_bitmap &= ~(1U << prio))
44+
4045
/* timer work management for reduced latency */
4146
static volatile uint32_t timer_work_pending = 0; /* timer work types */
4247
static volatile uint32_t timer_work_generation = 0; /* counter for coalescing */

0 commit comments

Comments
 (0)