diff --git a/TODO b/TODO index 0965b445f91..2b508866be4 100644 --- a/TODO +++ b/TODO @@ -591,10 +591,10 @@ o SMP The log below was reported is Nuttx running on two cores Cortex-A7 architecture in SMP mode. You can notice see that - when sched_addreadytorun() was called, the g_cpu_irqset is 3. + when nxsched_add_readytorun() was called, the g_cpu_irqset is 3. - sched_addreadytorun: irqset cpu 1, me 0 btcbname init, irqset 1 irqcount 2. - sched_addreadytorun: sched_addreadytorun line 338 g_cpu_irqset = 3. + nxsched_add_readytorun: irqset cpu 1, me 0 btcbname init, irqset 1 irqcount 2. + nxsched_add_readytorun: nxsched_add_readytorun line 338 g_cpu_irqset = 3. This can happen, but only under a very certain condition. g_cpu_irqset only exists to support this certain condition: diff --git a/arch/arm/src/arm/arm_blocktask.c b/arch/arm/src/arm/arm_blocktask.c index 85e0c46059d..d1469273899 100644 --- a/arch/arm/src/arm/arm_blocktask.c +++ b/arch/arm/src/arm/arm_blocktask.c @@ -89,11 +89,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -101,7 +101,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/arm/src/arm/arm_releasepending.c b/arch/arm/src/arm/arm_releasepending.c index 2ff74c72807..cb36eaa8ee5 100644 --- a/arch/arm/src/arm/arm_releasepending.c +++ b/arch/arm/src/arm/arm_releasepending.c @@ -56,7 +56,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/arm/src/arm/arm_reprioritizertr.c b/arch/arm/src/arm/arm_reprioritizertr.c index 3b3d8538682..6c2416b58a8 100644 --- a/arch/arm/src/arm/arm_reprioritizertr.c +++ b/arch/arm/src/arm/arm_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/arm/src/arm/arm_unblocktask.c b/arch/arm/src/arm/arm_unblocktask.c index c0dd378ecc0..2642253578a 100644 --- a/arch/arm/src/arm/arm_unblocktask.c +++ b/arch/arm/src/arm/arm_unblocktask.c @@ -65,13 +65,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/arm/src/armv6-m/arm_blocktask.c b/arch/arm/src/armv6-m/arm_blocktask.c index 5af2d45f94d..90562fa6221 100644 --- a/arch/arm/src/armv6-m/arm_blocktask.c +++ b/arch/arm/src/armv6-m/arm_blocktask.c @@ -73,11 +73,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -85,7 +85,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/arm/src/armv6-m/arm_releasepending.c b/arch/arm/src/armv6-m/arm_releasepending.c index cf5b6c811e9..07269e7ba1c 100644 --- a/arch/arm/src/armv6-m/arm_releasepending.c +++ b/arch/arm/src/armv6-m/arm_releasepending.c @@ -55,7 +55,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to * switch contexts. diff --git a/arch/arm/src/armv6-m/arm_reprioritizertr.c b/arch/arm/src/armv6-m/arm_reprioritizertr.c index 71ff1d67bb5..993dd020a9d 100644 --- a/arch/arm/src/armv6-m/arm_reprioritizertr.c +++ b/arch/arm/src/armv6-m/arm_reprioritizertr.c @@ -82,24 +82,24 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just removed the head + * nxsched_remove_readytorun will return true if we just removed the head * of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; - /* Return the task to the ready-to-run task list. sched_addreadytorun + /* Return the task to the ready-to-run task list. nxsched_add_readytorun * will return true if the task was added to the head of ready-to-run * list. We will need to perform a context switch only if the * EXCLUSIVE or of the two calls is non-zero (i.e., one and only one * the calls changes the head of the ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed (i.e. if the head * of the ready-to-run list is no longer the same). @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/arm/src/armv6-m/arm_unblocktask.c b/arch/arm/src/armv6-m/arm_unblocktask.c index d6558d8dccc..ff4845ad28f 100644 --- a/arch/arm/src/armv6-m/arm_unblocktask.c +++ b/arch/arm/src/armv6-m/arm_unblocktask.c @@ -63,13 +63,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/arm/src/armv7-a/arm_blocktask.c b/arch/arm/src/armv7-a/arm_blocktask.c index e82fe616100..4f554fffdd1 100644 --- a/arch/arm/src/armv7-a/arm_blocktask.c +++ b/arch/arm/src/armv7-a/arm_blocktask.c @@ -89,11 +89,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -101,7 +101,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/arm/src/armv7-a/arm_releasepending.c b/arch/arm/src/armv7-a/arm_releasepending.c index 9e954dff3d6..5cfffc9b5d3 100644 --- a/arch/arm/src/armv7-a/arm_releasepending.c +++ b/arch/arm/src/armv7-a/arm_releasepending.c @@ -55,7 +55,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to * switch contexts. diff --git a/arch/arm/src/armv7-a/arm_reprioritizertr.c b/arch/arm/src/armv7-a/arm_reprioritizertr.c index 4fbc45a57ad..683d0ec7edd 100644 --- a/arch/arm/src/armv7-a/arm_reprioritizertr.c +++ b/arch/arm/src/armv7-a/arm_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-a/arm_unblocktask.c b/arch/arm/src/armv7-a/arm_unblocktask.c index 106d08820e2..6bee68dc0da 100644 --- a/arch/arm/src/armv7-a/arm_unblocktask.c +++ b/arch/arm/src/armv7-a/arm_unblocktask.c @@ -78,13 +78,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/arm/src/armv7-m/arm_blocktask.c b/arch/arm/src/armv7-m/arm_blocktask.c index af1b0cdee8a..3f6b8bac3d6 100644 --- a/arch/arm/src/armv7-m/arm_blocktask.c +++ b/arch/arm/src/armv7-m/arm_blocktask.c @@ -73,11 +73,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -85,7 +85,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/arm/src/armv7-m/arm_releasepending.c b/arch/arm/src/armv7-m/arm_releasepending.c index 1ffc48d11fe..b228bbb8846 100644 --- a/arch/arm/src/armv7-m/arm_releasepending.c +++ b/arch/arm/src/armv7-m/arm_releasepending.c @@ -59,7 +59,7 @@ void up_release_pending(void) sched_lock(); #endif - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/arm/src/armv7-m/arm_reprioritizertr.c b/arch/arm/src/armv7-m/arm_reprioritizertr.c index d84d37ae1ca..3695be7aebf 100644 --- a/arch/arm/src/armv7-m/arm_reprioritizertr.c +++ b/arch/arm/src/armv7-m/arm_reprioritizertr.c @@ -82,24 +82,24 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just removed the head + * nxsched_remove_readytorun will return true if we just removed the head * of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; - /* Return the task to the ready-to-run task list. sched_addreadytorun + /* Return the task to the ready-to-run task list. nxsched_add_readytorun * will return true if the task was added to the head of ready-to-run * list. We will need to perform a context switch only if the * EXCLUSIVE or of the two calls is non-zero (i.e., one and only one * the calls changes the head of the ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed (i.e. if the head * of the ready-to-run list is no longer the same). @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-m/arm_unblocktask.c b/arch/arm/src/armv7-m/arm_unblocktask.c index 5b5071f4d29..d4d41485741 100644 --- a/arch/arm/src/armv7-m/arm_unblocktask.c +++ b/arch/arm/src/armv7-m/arm_unblocktask.c @@ -64,13 +64,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/arm/src/armv7-r/arm_blocktask.c b/arch/arm/src/armv7-r/arm_blocktask.c index efefdd68ff9..d6a2e8dc6bc 100644 --- a/arch/arm/src/armv7-r/arm_blocktask.c +++ b/arch/arm/src/armv7-r/arm_blocktask.c @@ -89,11 +89,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -101,7 +101,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/arm/src/armv7-r/arm_releasepending.c b/arch/arm/src/armv7-r/arm_releasepending.c index c5ddf765ce1..d134a72fc62 100644 --- a/arch/arm/src/armv7-r/arm_releasepending.c +++ b/arch/arm/src/armv7-r/arm_releasepending.c @@ -56,7 +56,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to * switch contexts. diff --git a/arch/arm/src/armv7-r/arm_reprioritizertr.c b/arch/arm/src/armv7-r/arm_reprioritizertr.c index 5f13b2070fa..ce9ef3797dd 100644 --- a/arch/arm/src/armv7-r/arm_reprioritizertr.c +++ b/arch/arm/src/armv7-r/arm_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/arm/src/armv7-r/arm_unblocktask.c b/arch/arm/src/armv7-r/arm_unblocktask.c index baf24902069..ce845df054e 100644 --- a/arch/arm/src/armv7-r/arm_unblocktask.c +++ b/arch/arm/src/armv7-r/arm_unblocktask.c @@ -77,13 +77,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/arm/src/armv8-m/arm_blocktask.c b/arch/arm/src/armv8-m/arm_blocktask.c index 240b51ae3fe..ae2b46e036e 100755 --- a/arch/arm/src/armv8-m/arm_blocktask.c +++ b/arch/arm/src/armv8-m/arm_blocktask.c @@ -73,11 +73,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -85,7 +85,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/arm/src/armv8-m/arm_releasepending.c b/arch/arm/src/armv8-m/arm_releasepending.c index 1a470740dec..c3755ecfece 100755 --- a/arch/arm/src/armv8-m/arm_releasepending.c +++ b/arch/arm/src/armv8-m/arm_releasepending.c @@ -59,7 +59,7 @@ void up_release_pending(void) sched_lock(); #endif - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/arm/src/armv8-m/arm_reprioritizertr.c b/arch/arm/src/armv8-m/arm_reprioritizertr.c index 2d855fb919b..2c1203a2281 100755 --- a/arch/arm/src/armv8-m/arm_reprioritizertr.c +++ b/arch/arm/src/armv8-m/arm_reprioritizertr.c @@ -82,24 +82,24 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just removed the head + * nxsched_remove_readytorun will return true if we just removed the head * of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; - /* Return the task to the ready-to-run task list. sched_addreadytorun + /* Return the task to the ready-to-run task list. nxsched_add_readytorun * will return true if the task was added to the head of ready-to-run * list. We will need to perform a context switch only if the * EXCLUSIVE or of the two calls is non-zero (i.e., one and only one * the calls changes the head of the ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed (i.e. if the head * of the ready-to-run list is no longer the same). @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/arm/src/armv8-m/arm_unblocktask.c b/arch/arm/src/armv8-m/arm_unblocktask.c index e4ec9032412..75f42bf7119 100755 --- a/arch/arm/src/armv8-m/arm_unblocktask.c +++ b/arch/arm/src/armv8-m/arm_unblocktask.c @@ -64,13 +64,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/avr/src/avr/up_blocktask.c b/arch/avr/src/avr/up_blocktask.c index 8db6d1b8e52..e0c13aa7ab8 100644 --- a/arch/avr/src/avr/up_blocktask.c +++ b/arch/avr/src/avr/up_blocktask.c @@ -88,11 +88,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -100,7 +100,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/avr/src/avr/up_releasepending.c b/arch/avr/src/avr/up_releasepending.c index 9f7ee47d048..a8c24b15338 100644 --- a/arch/avr/src/avr/up_releasepending.c +++ b/arch/avr/src/avr/up_releasepending.c @@ -55,7 +55,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/avr/src/avr/up_reprioritizertr.c b/arch/avr/src/avr/up_reprioritizertr.c index a883babd13b..ce91625ee8b 100644 --- a/arch/avr/src/avr/up_reprioritizertr.c +++ b/arch/avr/src/avr/up_reprioritizertr.c @@ -82,25 +82,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -113,7 +113,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/avr/src/avr/up_unblocktask.c b/arch/avr/src/avr/up_unblocktask.c index d369726ebdc..dafba0f751e 100644 --- a/arch/avr/src/avr/up_unblocktask.c +++ b/arch/avr/src/avr/up_unblocktask.c @@ -79,13 +79,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/avr/src/avr32/up_blocktask.c b/arch/avr/src/avr32/up_blocktask.c index 759c8d39868..38d8f0cbd5f 100644 --- a/arch/avr/src/avr32/up_blocktask.c +++ b/arch/avr/src/avr32/up_blocktask.c @@ -89,11 +89,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -101,7 +101,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/avr/src/avr32/up_releasepending.c b/arch/avr/src/avr32/up_releasepending.c index f25b6281553..63448add825 100644 --- a/arch/avr/src/avr32/up_releasepending.c +++ b/arch/avr/src/avr32/up_releasepending.c @@ -56,7 +56,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/avr/src/avr32/up_reprioritizertr.c b/arch/avr/src/avr32/up_reprioritizertr.c index c8293de03d5..cb01037b0da 100644 --- a/arch/avr/src/avr32/up_reprioritizertr.c +++ b/arch/avr/src/avr32/up_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/avr/src/avr32/up_unblocktask.c b/arch/avr/src/avr32/up_unblocktask.c index 1afbf66630f..1b52d3508b1 100644 --- a/arch/avr/src/avr32/up_unblocktask.c +++ b/arch/avr/src/avr32/up_unblocktask.c @@ -80,13 +80,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/hc/src/common/up_blocktask.c b/arch/hc/src/common/up_blocktask.c index dc94aaaffae..5ce5c6fed7a 100644 --- a/arch/hc/src/common/up_blocktask.c +++ b/arch/hc/src/common/up_blocktask.c @@ -74,11 +74,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -86,7 +86,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/hc/src/common/up_releasepending.c b/arch/hc/src/common/up_releasepending.c index 8e827976c94..d140da121e3 100644 --- a/arch/hc/src/common/up_releasepending.c +++ b/arch/hc/src/common/up_releasepending.c @@ -55,7 +55,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/hc/src/common/up_reprioritizertr.c b/arch/hc/src/common/up_reprioritizertr.c index 74177a30410..48002b1420d 100644 --- a/arch/hc/src/common/up_reprioritizertr.c +++ b/arch/hc/src/common/up_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/hc/src/common/up_unblocktask.c b/arch/hc/src/common/up_unblocktask.c index 7fe7b15db91..bc92418c5b1 100644 --- a/arch/hc/src/common/up_unblocktask.c +++ b/arch/hc/src/common/up_unblocktask.c @@ -65,13 +65,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/mips/src/mips32/mips_blocktask.c b/arch/mips/src/mips32/mips_blocktask.c index 82a1cbdce8b..78b6153e505 100644 --- a/arch/mips/src/mips32/mips_blocktask.c +++ b/arch/mips/src/mips32/mips_blocktask.c @@ -90,11 +90,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -102,7 +102,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/mips/src/mips32/mips_releasepending.c b/arch/mips/src/mips32/mips_releasepending.c index bddf88e0b66..3b0aff4f9f7 100644 --- a/arch/mips/src/mips32/mips_releasepending.c +++ b/arch/mips/src/mips32/mips_releasepending.c @@ -75,7 +75,7 @@ void up_release_pending(void) /* sched_lock(); */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/mips/src/mips32/mips_reprioritizertr.c b/arch/mips/src/mips32/mips_reprioritizertr.c index 05472826196..a9c2699b85e 100644 --- a/arch/mips/src/mips32/mips_reprioritizertr.c +++ b/arch/mips/src/mips32/mips_reprioritizertr.c @@ -100,25 +100,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -131,7 +131,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/mips/src/mips32/mips_unblocktask.c b/arch/mips/src/mips32/mips_unblocktask.c index 73b2168ef5d..9fc88d7020a 100644 --- a/arch/mips/src/mips32/mips_unblocktask.c +++ b/arch/mips/src/mips32/mips_unblocktask.c @@ -82,13 +82,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/misoc/src/lm32/lm32_blocktask.c b/arch/misoc/src/lm32/lm32_blocktask.c index 7f4c60e24ef..08c94a479b7 100644 --- a/arch/misoc/src/lm32/lm32_blocktask.c +++ b/arch/misoc/src/lm32/lm32_blocktask.c @@ -91,11 +91,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -103,7 +103,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/misoc/src/lm32/lm32_releasepending.c b/arch/misoc/src/lm32/lm32_releasepending.c index be20f9a463b..8807e661e43 100644 --- a/arch/misoc/src/lm32/lm32_releasepending.c +++ b/arch/misoc/src/lm32/lm32_releasepending.c @@ -74,7 +74,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/misoc/src/lm32/lm32_reprioritizertr.c b/arch/misoc/src/lm32/lm32_reprioritizertr.c index aebdee31127..0063dcaf83f 100644 --- a/arch/misoc/src/lm32/lm32_reprioritizertr.c +++ b/arch/misoc/src/lm32/lm32_reprioritizertr.c @@ -85,25 +85,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -116,7 +116,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/misoc/src/lm32/lm32_unblocktask.c b/arch/misoc/src/lm32/lm32_unblocktask.c index 90050de7c1e..dbe93343b5a 100644 --- a/arch/misoc/src/lm32/lm32_unblocktask.c +++ b/arch/misoc/src/lm32/lm32_unblocktask.c @@ -83,13 +83,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/misoc/src/minerva/minerva_blocktask.c b/arch/misoc/src/minerva/minerva_blocktask.c index 9233f70a8d3..772ef883785 100644 --- a/arch/misoc/src/minerva/minerva_blocktask.c +++ b/arch/misoc/src/minerva/minerva_blocktask.c @@ -91,11 +91,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t) task_state); + nxsched_add_blocked(tcb, (tstate_t) task_state); /* If there are any pending tasks, then add them to the ready-to-run task * list now @@ -103,7 +103,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/misoc/src/minerva/minerva_releasepending.c b/arch/misoc/src/minerva/minerva_releasepending.c index e036d10c797..a30ab96cc1f 100644 --- a/arch/misoc/src/minerva/minerva_releasepending.c +++ b/arch/misoc/src/minerva/minerva_releasepending.c @@ -76,7 +76,7 @@ void up_release_pending(void) /* sched_lock(); */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. Update scheduler parameters. diff --git a/arch/misoc/src/minerva/minerva_reprioritizertr.c b/arch/misoc/src/minerva/minerva_reprioritizertr.c index a6f4daffddb..697e4e53b23 100644 --- a/arch/misoc/src/minerva/minerva_reprioritizertr.c +++ b/arch/misoc/src/minerva/minerva_reprioritizertr.c @@ -85,24 +85,24 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun() will return true if we just remove the + * nxsched_remove_readytorun() will return true if we just remove the * head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t) priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was added to the + * nxsched_add_readytorun will return true if the task was added to the * new list. We will need to perform a context switch only if the * EXCLUSIVE or of the two calls is non-zero (i.e., one and only one * the calls changes the head of the ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -115,7 +115,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/misoc/src/minerva/minerva_unblocktask.c b/arch/misoc/src/minerva/minerva_unblocktask.c index 65704f3b5f8..495790f6b57 100644 --- a/arch/misoc/src/minerva/minerva_unblocktask.c +++ b/arch/misoc/src/minerva/minerva_unblocktask.c @@ -83,13 +83,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized ready-to-run * task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do a context * switch to the new task. diff --git a/arch/or1k/src/common/up_blocktask.c b/arch/or1k/src/common/up_blocktask.c index 732c0b21088..61040158f58 100644 --- a/arch/or1k/src/common/up_blocktask.c +++ b/arch/or1k/src/common/up_blocktask.c @@ -89,11 +89,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -101,7 +101,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/or1k/src/common/up_releasepending.c b/arch/or1k/src/common/up_releasepending.c index 1fe4ac63774..a322a53b41d 100644 --- a/arch/or1k/src/common/up_releasepending.c +++ b/arch/or1k/src/common/up_releasepending.c @@ -56,7 +56,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/or1k/src/common/up_reprioritizertr.c b/arch/or1k/src/common/up_reprioritizertr.c index 1cea87c3824..6ea650bc0ed 100644 --- a/arch/or1k/src/common/up_reprioritizertr.c +++ b/arch/or1k/src/common/up_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/or1k/src/common/up_unblocktask.c b/arch/or1k/src/common/up_unblocktask.c index 95da3159bae..1ef8ac27b55 100644 --- a/arch/or1k/src/common/up_unblocktask.c +++ b/arch/or1k/src/common/up_unblocktask.c @@ -65,13 +65,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/renesas/src/common/up_blocktask.c b/arch/renesas/src/common/up_blocktask.c index 3a643fc7c5d..9aca4367f9e 100644 --- a/arch/renesas/src/common/up_blocktask.c +++ b/arch/renesas/src/common/up_blocktask.c @@ -73,11 +73,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -85,7 +85,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/renesas/src/common/up_releasepending.c b/arch/renesas/src/common/up_releasepending.c index 29caeb10ace..6c25fdef14a 100644 --- a/arch/renesas/src/common/up_releasepending.c +++ b/arch/renesas/src/common/up_releasepending.c @@ -56,7 +56,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/renesas/src/common/up_reprioritizertr.c b/arch/renesas/src/common/up_reprioritizertr.c index 2092be8fb80..12d3fb32ed0 100644 --- a/arch/renesas/src/common/up_reprioritizertr.c +++ b/arch/renesas/src/common/up_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/renesas/src/common/up_unblocktask.c b/arch/renesas/src/common/up_unblocktask.c index f54844e53bd..f1cd8674ee3 100644 --- a/arch/renesas/src/common/up_unblocktask.c +++ b/arch/renesas/src/common/up_unblocktask.c @@ -65,13 +65,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/risc-v/src/rv32im/riscv_blocktask.c b/arch/risc-v/src/rv32im/riscv_blocktask.c index 7fa6a8b2a0f..2b141833a17 100644 --- a/arch/risc-v/src/rv32im/riscv_blocktask.c +++ b/arch/risc-v/src/rv32im/riscv_blocktask.c @@ -90,11 +90,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -102,7 +102,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/risc-v/src/rv32im/riscv_releasepending.c b/arch/risc-v/src/rv32im/riscv_releasepending.c index f825745af1d..d8c0de1a6cb 100644 --- a/arch/risc-v/src/rv32im/riscv_releasepending.c +++ b/arch/risc-v/src/rv32im/riscv_releasepending.c @@ -75,7 +75,7 @@ void up_release_pending(void) /* sched_lock(); */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/risc-v/src/rv32im/riscv_reprioritizertr.c b/arch/risc-v/src/rv32im/riscv_reprioritizertr.c index 1bea1ddd93d..4c42e5822a2 100644 --- a/arch/risc-v/src/rv32im/riscv_reprioritizertr.c +++ b/arch/risc-v/src/rv32im/riscv_reprioritizertr.c @@ -100,25 +100,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -131,7 +131,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/risc-v/src/rv32im/riscv_unblocktask.c b/arch/risc-v/src/rv32im/riscv_unblocktask.c index 739b8b7f4d7..3b67cf82611 100644 --- a/arch/risc-v/src/rv32im/riscv_unblocktask.c +++ b/arch/risc-v/src/rv32im/riscv_unblocktask.c @@ -82,13 +82,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/risc-v/src/rv64gc/riscv_blocktask.c b/arch/risc-v/src/rv64gc/riscv_blocktask.c index ce07e638802..24b98ca4b30 100644 --- a/arch/risc-v/src/rv64gc/riscv_blocktask.c +++ b/arch/risc-v/src/rv64gc/riscv_blocktask.c @@ -90,11 +90,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -102,7 +102,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/risc-v/src/rv64gc/riscv_releasepending.c b/arch/risc-v/src/rv64gc/riscv_releasepending.c index 6009e5e3cb8..eff977cb09d 100644 --- a/arch/risc-v/src/rv64gc/riscv_releasepending.c +++ b/arch/risc-v/src/rv64gc/riscv_releasepending.c @@ -75,7 +75,7 @@ void up_release_pending(void) /* sched_lock(); */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c b/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c index 13990b74c0f..a415766f1fd 100644 --- a/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c +++ b/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c @@ -100,25 +100,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -131,7 +131,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/risc-v/src/rv64gc/riscv_unblocktask.c b/arch/risc-v/src/rv64gc/riscv_unblocktask.c index 01b40a5b75e..0dfd147df3e 100644 --- a/arch/risc-v/src/rv64gc/riscv_unblocktask.c +++ b/arch/risc-v/src/rv64gc/riscv_unblocktask.c @@ -82,13 +82,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/sim/src/sim/up_blocktask.c b/arch/sim/src/sim/up_blocktask.c index a8bc9b28d74..e81df88b59f 100644 --- a/arch/sim/src/sim/up_blocktask.c +++ b/arch/sim/src/sim/up_blocktask.c @@ -90,11 +90,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -102,7 +102,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/sim/src/sim/up_releasepending.c b/arch/sim/src/sim/up_releasepending.c index 113ec2a02a7..b1c1fb961a9 100644 --- a/arch/sim/src/sim/up_releasepending.c +++ b/arch/sim/src/sim/up_releasepending.c @@ -72,7 +72,7 @@ void up_release_pending(void) /* sched_lock(); */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/sim/src/sim/up_reprioritizertr.c b/arch/sim/src/sim/up_reprioritizertr.c index 6347a4e4123..c4ce3172b0e 100644 --- a/arch/sim/src/sim/up_reprioritizertr.c +++ b/arch/sim/src/sim/up_reprioritizertr.c @@ -98,25 +98,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -129,7 +129,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/sim/src/sim/up_unblocktask.c b/arch/sim/src/sim/up_unblocktask.c index a2eb19f7320..5f739bcbfd2 100644 --- a/arch/sim/src/sim/up_unblocktask.c +++ b/arch/sim/src/sim/up_unblocktask.c @@ -82,13 +82,13 @@ void up_unblock_task(FAR struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! */ diff --git a/arch/x86/src/common/up_blocktask.c b/arch/x86/src/common/up_blocktask.c index 318ce829664..b3504bde94f 100644 --- a/arch/x86/src/common/up_blocktask.c +++ b/arch/x86/src/common/up_blocktask.c @@ -74,11 +74,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -86,7 +86,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/x86/src/common/up_releasepending.c b/arch/x86/src/common/up_releasepending.c index 4e379e6f1a9..7cafbd19802 100644 --- a/arch/x86/src/common/up_releasepending.c +++ b/arch/x86/src/common/up_releasepending.c @@ -56,7 +56,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/x86/src/common/up_reprioritizertr.c b/arch/x86/src/common/up_reprioritizertr.c index f5638f5760b..25013bd693b 100644 --- a/arch/x86/src/common/up_reprioritizertr.c +++ b/arch/x86/src/common/up_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/x86/src/common/up_unblocktask.c b/arch/x86/src/common/up_unblocktask.c index aedc3ec2eba..d62d00bab8e 100644 --- a/arch/x86/src/common/up_unblocktask.c +++ b/arch/x86/src/common/up_unblocktask.c @@ -64,13 +64,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/x86_64/src/common/up_blocktask.c b/arch/x86_64/src/common/up_blocktask.c index fb4fa67735d..7a9143b7633 100644 --- a/arch/x86_64/src/common/up_blocktask.c +++ b/arch/x86_64/src/common/up_blocktask.c @@ -74,11 +74,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -86,7 +86,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/x86_64/src/common/up_releasepending.c b/arch/x86_64/src/common/up_releasepending.c index 98481e15353..1d8298cc1d8 100644 --- a/arch/x86_64/src/common/up_releasepending.c +++ b/arch/x86_64/src/common/up_releasepending.c @@ -56,7 +56,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/x86_64/src/common/up_reprioritizertr.c b/arch/x86_64/src/common/up_reprioritizertr.c index f95a59594cf..843f38dadee 100644 --- a/arch/x86_64/src/common/up_reprioritizertr.c +++ b/arch/x86_64/src/common/up_reprioritizertr.c @@ -83,25 +83,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -114,7 +114,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/x86_64/src/common/up_unblocktask.c b/arch/x86_64/src/common/up_unblocktask.c index 1f07cc38489..1cac932e61d 100644 --- a/arch/x86_64/src/common/up_unblocktask.c +++ b/arch/x86_64/src/common/up_unblocktask.c @@ -66,13 +66,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/xtensa/src/common/xtensa_blocktask.c b/arch/xtensa/src/common/xtensa_blocktask.c index 197504da22e..934f46080f9 100644 --- a/arch/xtensa/src/common/xtensa_blocktask.c +++ b/arch/xtensa/src/common/xtensa_blocktask.c @@ -90,11 +90,11 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -102,7 +102,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/xtensa/src/common/xtensa_releasepending.c b/arch/xtensa/src/common/xtensa_releasepending.c index b63ba175106..3f875c81ede 100644 --- a/arch/xtensa/src/common/xtensa_releasepending.c +++ b/arch/xtensa/src/common/xtensa_releasepending.c @@ -75,7 +75,7 @@ void up_release_pending(void) /* sched_lock(); */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to * switch contexts. diff --git a/arch/xtensa/src/common/xtensa_reprioritizertr.c b/arch/xtensa/src/common/xtensa_reprioritizertr.c index 27a9a9ec2c8..501964fef60 100644 --- a/arch/xtensa/src/common/xtensa_reprioritizertr.c +++ b/arch/xtensa/src/common/xtensa_reprioritizertr.c @@ -85,25 +85,25 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -116,7 +116,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/xtensa/src/common/xtensa_unblocktask.c b/arch/xtensa/src/common/xtensa_unblocktask.c index 4727046d0be..2c796ed96b8 100644 --- a/arch/xtensa/src/common/xtensa_unblocktask.c +++ b/arch/xtensa/src/common/xtensa_unblocktask.c @@ -82,13 +82,13 @@ void up_unblock_task(struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/z16/src/common/z16_blocktask.c b/arch/z16/src/common/z16_blocktask.c index b44d105dd36..3de333b145a 100644 --- a/arch/z16/src/common/z16_blocktask.c +++ b/arch/z16/src/common/z16_blocktask.c @@ -75,11 +75,11 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -87,7 +87,7 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/z16/src/common/z16_releasepending.c b/arch/z16/src/common/z16_releasepending.c index 9fd93eae849..19212404d0b 100644 --- a/arch/z16/src/common/z16_releasepending.c +++ b/arch/z16/src/common/z16_releasepending.c @@ -57,7 +57,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/z16/src/common/z16_reprioritizertr.c b/arch/z16/src/common/z16_reprioritizertr.c index 499ae0b6de6..b047dcc33c1 100644 --- a/arch/z16/src/common/z16_reprioritizertr.c +++ b/arch/z16/src/common/z16_reprioritizertr.c @@ -84,25 +84,25 @@ void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -115,7 +115,7 @@ void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/z16/src/common/z16_unblocktask.c b/arch/z16/src/common/z16_unblocktask.c index 0b55619c1f1..f113ca2d0ef 100644 --- a/arch/z16/src/common/z16_unblocktask.c +++ b/arch/z16/src/common/z16_unblocktask.c @@ -68,13 +68,13 @@ void up_unblock_task(FAR struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/arch/z80/src/common/z80_blocktask.c b/arch/z80/src/common/z80_blocktask.c index ad962c8eb16..5d521081757 100644 --- a/arch/z80/src/common/z80_blocktask.c +++ b/arch/z80/src/common/z80_blocktask.c @@ -77,11 +77,11 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) * it should also be true that rtcb == tcb. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Add the task to the specified blocked task list */ - sched_addblocked(tcb, (tstate_t)task_state); + nxsched_add_blocked(tcb, (tstate_t)task_state); /* If there are any pending tasks, then add them to the ready-to-run * task list now @@ -89,7 +89,7 @@ void up_block_task(FAR struct tcb_s *tcb, tstate_t task_state) if (g_pendingtasks.head) { - switch_needed |= sched_mergepending(); + switch_needed |= nxsched_merge_pending(); } /* Now, perform the context switch if one is needed */ diff --git a/arch/z80/src/common/z80_releasepending.c b/arch/z80/src/common/z80_releasepending.c index c7214ff6abc..1d591f5d944 100644 --- a/arch/z80/src/common/z80_releasepending.c +++ b/arch/z80/src/common/z80_releasepending.c @@ -59,7 +59,7 @@ void up_release_pending(void) /* Merge the g_pendingtasks list into the ready-to-run task list */ - if (sched_mergepending()) + if (nxsched_merge_pending()) { /* The currently active task has changed! We will need to switch * contexts. diff --git a/arch/z80/src/common/z80_reprioritizertr.c b/arch/z80/src/common/z80_reprioritizertr.c index 2ab11034d9b..70a28325d20 100644 --- a/arch/z80/src/common/z80_reprioritizertr.c +++ b/arch/z80/src/common/z80_reprioritizertr.c @@ -86,25 +86,25 @@ void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority) sinfo("TCB=%p PRI=%d\n", tcb, priority); /* Remove the tcb task from the ready-to-run list. - * sched_removereadytorun will return true if we just + * nxsched_remove_readytorun will return true if we just * remove the head of the ready to run list. */ - switch_needed = sched_removereadytorun(tcb); + switch_needed = nxsched_remove_readytorun(tcb); /* Setup up the new task priority */ tcb->sched_priority = (uint8_t)priority; /* Return the task to the specified blocked task list. - * sched_addreadytorun will return true if the task was + * nxsched_add_readytorun will return true if the task was * added to the new list. We will need to perform a context * switch only if the EXCLUSIVE or of the two calls is non-zero * (i.e., one and only one the calls changes the head of the * ready-to-run list). */ - switch_needed ^= sched_addreadytorun(tcb); + switch_needed ^= nxsched_add_readytorun(tcb); /* Now, perform the context switch if one is needed */ @@ -117,7 +117,7 @@ void up_reprioritize_rtr(FAR struct tcb_s *tcb, uint8_t priority) if (g_pendingtasks.head) { - sched_mergepending(); + nxsched_merge_pending(); } /* Update scheduler parameters */ diff --git a/arch/z80/src/common/z80_unblocktask.c b/arch/z80/src/common/z80_unblocktask.c index c49824d8cd8..d88672ee415 100644 --- a/arch/z80/src/common/z80_unblocktask.c +++ b/arch/z80/src/common/z80_unblocktask.c @@ -70,13 +70,13 @@ void up_unblock_task(FAR struct tcb_s *tcb) /* Remove the task from the blocked task list */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Add the task in the correct location in the prioritized * ready-to-run task list */ - if (sched_addreadytorun(tcb)) + if (nxsched_add_readytorun(tcb)) { /* The currently active task has changed! We need to do * a context switch to the new task. diff --git a/sched/group/group_continue.c b/sched/group/group_continue.c index 9b06ec4429e..7efcd04e19c 100644 --- a/sched/group/group_continue.c +++ b/sched/group/group_continue.c @@ -64,7 +64,7 @@ static int group_continue_handler(pid_t pid, FAR void *arg) rtcb = nxsched_get_tcb(pid); if (rtcb != NULL) { - sched_continue(rtcb); + nxsched_continue(rtcb); } /* Always return zero. We need to visit each member of the group */ diff --git a/sched/group/group_suspendchildren.c b/sched/group/group_suspendchildren.c index 1c71fc4be35..5ce006ace7d 100644 --- a/sched/group/group_suspendchildren.c +++ b/sched/group/group_suspendchildren.c @@ -83,7 +83,7 @@ static int group_suspendchildren_handler(pid_t pid, FAR void *arg) rtcb = nxsched_get_tcb(pid); if (rtcb != NULL) { - sched_suspend(rtcb); + nxsched_suspend(rtcb); } } diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c index dbe97d3cb5b..dea9427cb94 100644 --- a/sched/irq/irq_csection.c +++ b/sched/irq/irq_csection.c @@ -376,7 +376,7 @@ try_again: /* Note that we have entered the critical section */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_csection(rtcb, true); + nxsched_critmon_csection(rtcb, true); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION sched_note_csection(rtcb, true); @@ -419,7 +419,7 @@ irqstate_t enter_critical_section(void) /* Note that we have entered the critical section */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_csection(rtcb, true); + nxsched_critmon_csection(rtcb, true); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION sched_note_csection(rtcb, true); @@ -526,7 +526,7 @@ void leave_critical_section(irqstate_t flags) /* No.. Note that we have left the critical section */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_csection(rtcb, false); + nxsched_critmon_csection(rtcb, false); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION sched_note_csection(rtcb, false); @@ -550,7 +550,7 @@ void leave_critical_section(irqstate_t flags) * because we were within a critical section then. */ - if (g_pendingtasks.head != NULL && !sched_islocked_global()) + if (g_pendingtasks.head != NULL && !nxsched_islocked_global()) { /* Release any ready-to-run tasks that have collected * in g_pendingtasks. NOTE: This operation has a very @@ -604,7 +604,7 @@ void leave_critical_section(irqstate_t flags) /* Note that we have left the critical section */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_csection(rtcb, false); + nxsched_critmon_csection(rtcb, false); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_CSECTION sched_note_csection(rtcb, false); diff --git a/sched/paging/pg_miss.c b/sched/paging/pg_miss.c index 380014b2623..8960e6a79a8 100644 --- a/sched/paging/pg_miss.c +++ b/sched/paging/pg_miss.c @@ -166,7 +166,7 @@ void pg_miss(void) pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, ftcb->sched_priority); - nxsched_setpriority(wtcb, ftcb->sched_priority); + nxsched_set_priority(wtcb, ftcb->sched_priority); } /* Signal the page fill worker thread. diff --git a/sched/paging/pg_worker.c b/sched/paging/pg_worker.c index 49dcedcbd52..b12dda58401 100644 --- a/sched/paging/pg_worker.c +++ b/sched/paging/pg_worker.c @@ -177,7 +177,7 @@ static void pg_callback(FAR struct tcb_s *tcb, int result) { pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, priority); - nxsched_setpriority(wtcb, priority); + nxsched_set_priority(wtcb, priority); } /* Save the page fill result (don't permit the value -EBUSY) */ @@ -289,7 +289,7 @@ static inline bool pg_dequeue(void) pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, priority); - nxsched_setpriority(wtcb, priority); + nxsched_set_priority(wtcb, priority); } /* Return with g_pftcb holding the pointer to @@ -456,7 +456,7 @@ static inline void pg_alldone(void) g_pftcb = NULL; pginfo("New worker priority. %d->%d\n", wtcb->sched_priority, CONFIG_PAGING_DEFPRIO); - nxsched_setpriority(wtcb, CONFIG_PAGING_DEFPRIO); + nxsched_set_priority(wtcb, CONFIG_PAGING_DEFPRIO); } /**************************************************************************** diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index df3715a559f..2d635fea5d5 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -196,7 +196,7 @@ static void pthread_start(void) if (ptcb->cmn.sched_priority > ptcb->cmn.init_priority) { - DEBUGVERIFY(nxsched_setpriority(&ptcb->cmn, ptcb->cmn.init_priority)); + DEBUGVERIFY(nxsched_set_priority(&ptcb->cmn, ptcb->cmn.init_priority)); } /* Pass control to the thread entry point. In the kernel build this has to @@ -389,7 +389,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, /* Initialize the sporadic policy */ - ret = sched_sporadic_initialize(&ptcb->cmn); + ret = nxsched_initialize_sporadic(&ptcb->cmn); if (ret >= 0) { sporadic = ptcb->cmn.sporadic; @@ -405,7 +405,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, /* And start the first replenishment interval */ - ret = sched_sporadic_start(&ptcb->cmn); + ret = nxsched_start_sporadic(&ptcb->cmn); } /* Handle any failures */ @@ -556,7 +556,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, if (ptcb->cmn.sched_priority < parent->sched_priority) { - ret = nxsched_setpriority(&ptcb->cmn, parent->sched_priority); + ret = nxsched_set_priority(&ptcb->cmn, parent->sched_priority); if (ret < 0) { ret = -ret; diff --git a/sched/sched/sched.h b/sched/sched/sched.h index a1dfe70a525..5490ff9b6b9 100644 --- a/sched/sched/sched.h +++ b/sched/sched/sched.h @@ -369,15 +369,15 @@ extern volatile int16_t g_global_lockcount; /* Task list manipulation functions */ -bool sched_addreadytorun(FAR struct tcb_s *rtrtcb); -bool sched_removereadytorun(FAR struct tcb_s *rtrtcb); -bool sched_addprioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list); -void sched_mergeprioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2, +bool nxsched_add_readytorun(FAR struct tcb_s *rtrtcb); +bool nxsched_remove_readytorun(FAR struct tcb_s *rtrtcb); +bool nxsched_add_prioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list); +void nxsched_merge_prioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2, uint8_t task_state); -bool sched_mergepending(void); -void sched_addblocked(FAR struct tcb_s *btcb, tstate_t task_state); -void sched_removeblocked(FAR struct tcb_s *btcb); -int nxsched_setpriority(FAR struct tcb_s *tcb, int sched_priority); +bool nxsched_merge_pending(void); +void nxsched_add_blocked(FAR struct tcb_s *btcb, tstate_t task_state); +void nxsched_remove_blocked(FAR struct tcb_s *btcb); +int nxsched_set_priority(FAR struct tcb_s *tcb, int sched_priority); /* Priority inheritance support */ @@ -385,43 +385,43 @@ int nxsched_setpriority(FAR struct tcb_s *tcb, int sched_priority); int nxsched_reprioritize(FAR struct tcb_s *tcb, int sched_priority); #else # define nxsched_reprioritize(tcb,sched_priority) \ - nxsched_setpriority(tcb,sched_priority) + nxsched_set_priority(tcb,sched_priority) #endif /* Support for tickless operation */ #ifdef CONFIG_SCHED_TICKLESS -unsigned int sched_timer_cancel(void); -void sched_timer_resume(void); -void sched_timer_reassess(void); +unsigned int nxsched_cancel_timer(void); +void nxsched_resume_timer(void); +void nxsched_reassess_timer(void); #else -# define sched_timer_cancel() (0) -# define sched_timer_resume() -# define sched_timer_reassess() +# define nxsched_cancel_timer() (0) +# define nxsched_resume_timer() +# define nxsched_reassess_timer() #endif /* Scheduler policy support */ #if CONFIG_RR_INTERVAL > 0 -uint32_t sched_roundrobin_process(FAR struct tcb_s *tcb, uint32_t ticks, +uint32_t nxsched_process_roundrobin(FAR struct tcb_s *tcb, uint32_t ticks, bool noswitches); #endif #ifdef CONFIG_SCHED_SPORADIC -int sched_sporadic_initialize(FAR struct tcb_s *tcb); -int sched_sporadic_start(FAR struct tcb_s *tcb); -int sched_sporadic_stop(FAR struct tcb_s *tcb); -int sched_sporadic_reset(FAR struct tcb_s *tcb); -int sched_sporadic_resume(FAR struct tcb_s *tcb); -int sched_sporadic_suspend(FAR struct tcb_s *tcb); -uint32_t sched_sporadic_process(FAR struct tcb_s *tcb, uint32_t ticks, +int nxsched_initialize_sporadic(FAR struct tcb_s *tcb); +int nxsched_start_sporadic(FAR struct tcb_s *tcb); +int nxsched_stop_sporadic(FAR struct tcb_s *tcb); +int nxsched_reset_sporadic(FAR struct tcb_s *tcb); +int nxsched_resume_sporadic(FAR struct tcb_s *tcb); +int nxsched_suspend_sporadic(FAR struct tcb_s *tcb); +uint32_t nxsched_process_sporadic(FAR struct tcb_s *tcb, uint32_t ticks, bool noswitches); -void sched_sporadic_lowpriority(FAR struct tcb_s *tcb); +void nxsched_sporadic_lowpriority(FAR struct tcb_s *tcb); #endif #ifdef CONFIG_SIG_SIGSTOP_ACTION -void sched_suspend(FAR struct tcb_s *tcb); -void sched_continue(FAR struct tcb_s *tcb); +void nxsched_suspend(FAR struct tcb_s *tcb); +void nxsched_continue(FAR struct tcb_s *tcb); #endif #ifdef CONFIG_SMP @@ -429,26 +429,26 @@ void sched_continue(FAR struct tcb_s *tcb); FAR struct tcb_s *this_task(void); #endif -int sched_cpu_select(cpu_set_t affinity); -int sched_cpu_pause(FAR struct tcb_s *tcb); +int nxsched_select_cpu(cpu_set_t affinity); +int nxsched_pause_cpu(FAR struct tcb_s *tcb); -irqstate_t sched_tasklist_lock(void); -void sched_tasklist_unlock(irqstate_t lock); +irqstate_t nxsched_lock_tasklist(void); +void nxsched_unlock_tasklist(irqstate_t lock); #if defined(CONFIG_ARCH_HAVE_FETCHADD) && !defined(CONFIG_ARCH_GLOBAL_IRQDISABLE) -# define sched_islocked_global() \ +# define nxsched_islocked_global() \ (spin_islocked(&g_cpu_schedlock) || g_global_lockcount > 0) #else -# define sched_islocked_global() \ +# define nxsched_islocked_global() \ spin_islocked(&g_cpu_schedlock) #endif -# define sched_islocked_tcb(tcb) sched_islocked_global() +# define nxsched_islocked_tcb(tcb) nxsched_islocked_global() #else -# define sched_cpu_select(a) (0) -# define sched_cpu_pause(t) (-38) /* -ENOSYS */ -# define sched_islocked_tcb(tcb) ((tcb)->lockcount > 0) +# define nxsched_select_cpu(a) (0) +# define nxsched_pause_cpu(t) (-38) /* -ENOSYS */ +# define nxsched_islocked_tcb(tcb) ((tcb)->lockcount > 0) #endif #if defined(CONFIG_SCHED_CPULOAD) && !defined(CONFIG_SCHED_CPULOAD_EXTCLK) @@ -460,14 +460,14 @@ void weak_function nxsched_process_cpuload(void); /* Critical section monitor */ #ifdef CONFIG_SCHED_CRITMONITOR -void sched_critmon_preemption(FAR struct tcb_s *tcb, bool state); -void sched_critmon_csection(FAR struct tcb_s *tcb, bool state); -void sched_critmon_resume(FAR struct tcb_s *tcb); -void sched_critmon_suspend(FAR struct tcb_s *tcb); +void nxsched_critmon_preemption(FAR struct tcb_s *tcb, bool state); +void nxsched_critmon_csection(FAR struct tcb_s *tcb, bool state); +void nxsched_resume_critmon(FAR struct tcb_s *tcb); +void nxsched_suspend_critmon(FAR struct tcb_s *tcb); #endif /* TCB operations */ -bool sched_verifytcb(FAR struct tcb_s *tcb); +bool nxsched_verify_tcb(FAR struct tcb_s *tcb); #endif /* __SCHED_SCHED_SCHED_H */ diff --git a/sched/sched/sched_addblocked.c b/sched/sched/sched_addblocked.c index 487330714de..6b6d8559c7c 100644 --- a/sched/sched/sched_addblocked.c +++ b/sched/sched/sched_addblocked.c @@ -49,7 +49,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_addblocked + * Name: nxsched_add_blocked * * Description: * This function adds a TCB to one of the blocked state task lists as @@ -68,7 +68,7 @@ * ****************************************************************************/ -void sched_addblocked(FAR struct tcb_s *btcb, tstate_t task_state) +void nxsched_add_blocked(FAR struct tcb_s *btcb, tstate_t task_state) { FAR dq_queue_t *tasklist; @@ -80,7 +80,7 @@ void sched_addblocked(FAR struct tcb_s *btcb, tstate_t task_state) #ifdef CONFIG_SMP /* Lock the tasklists before accessing */ - irqstate_t lock = sched_tasklist_lock(); + irqstate_t lock = nxsched_lock_tasklist(); #endif /* Add the TCB to the blocked task list associated with this state. */ @@ -93,7 +93,7 @@ void sched_addblocked(FAR struct tcb_s *btcb, tstate_t task_state) { /* Add the task to a prioritized list */ - sched_addprioritized(btcb, tasklist); + nxsched_add_prioritized(btcb, tasklist); } else { @@ -105,7 +105,7 @@ void sched_addblocked(FAR struct tcb_s *btcb, tstate_t task_state) #ifdef CONFIG_SMP /* Unlock the tasklists */ - sched_tasklist_unlock(lock); + nxsched_unlock_tasklist(lock); #endif /* Make sure the TCB's state corresponds to the list */ diff --git a/sched/sched/sched_addprioritized.c b/sched/sched/sched_addprioritized.c index 7bdf66a4557..84d007609b9 100644 --- a/sched/sched/sched_addprioritized.c +++ b/sched/sched/sched_addprioritized.c @@ -51,7 +51,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_addprioritized + * Name: nxsched_add_prioritized * * Description: * This function adds a TCB to a prioritized TCB list. @@ -76,7 +76,7 @@ * ****************************************************************************/ -bool sched_addprioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list) +bool nxsched_add_prioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list) { FAR struct tcb_s *next; FAR struct tcb_s *prev; diff --git a/sched/sched/sched_addreadytorun.c b/sched/sched/sched_addreadytorun.c index c5e7c9a6d49..acb5ecac08f 100644 --- a/sched/sched/sched_addreadytorun.c +++ b/sched/sched/sched_addreadytorun.c @@ -52,7 +52,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_addreadytorun + * Name: nxsched_add_readytorun * * Description: * This function adds a TCB to the ready to run list. If the currently @@ -80,7 +80,7 @@ ****************************************************************************/ #ifndef CONFIG_SMP -bool sched_addreadytorun(FAR struct tcb_s *btcb) +bool nxsched_add_readytorun(FAR struct tcb_s *btcb) { FAR struct tcb_s *rtcb = this_task(); bool ret; @@ -97,14 +97,14 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * g_pendingtasks task list for now. */ - sched_addprioritized(btcb, (FAR dq_queue_t *)&g_pendingtasks); + nxsched_add_prioritized(btcb, (FAR dq_queue_t *)&g_pendingtasks); btcb->task_state = TSTATE_TASK_PENDING; ret = false; } /* Otherwise, add the new task to the ready-to-run task list */ - else if (sched_addprioritized(btcb, (FAR dq_queue_t *)&g_readytorun)) + else if (nxsched_add_prioritized(btcb, (FAR dq_queue_t *)&g_readytorun)) { /* The new btcb was added at the head of the ready-to-run list. It * is now the new active task! @@ -129,7 +129,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) #endif /* !CONFIG_SMP */ /**************************************************************************** - * Name: sched_addreadytorun + * Name: nxsched_add_readytorun * * Description: * This function adds a TCB to one of the ready to run lists. That might @@ -164,7 +164,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) ****************************************************************************/ #ifdef CONFIG_SMP -bool sched_addreadytorun(FAR struct tcb_s *btcb) +bool nxsched_add_readytorun(FAR struct tcb_s *btcb) { FAR struct tcb_s *rtcb; FAR dq_queue_t *tasklist; @@ -176,7 +176,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) /* Lock the tasklists before accessing */ - irqstate_t lock = sched_tasklist_lock(); + irqstate_t lock = nxsched_lock_tasklist(); /* Check if the blocked TCB is locked to this CPU */ @@ -192,7 +192,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * (possibly its IDLE task). */ - cpu = sched_cpu_select(btcb->affinity); + cpu = nxsched_select_cpu(btcb->affinity); } /* Get the task currently running on the CPU (may be the IDLE task) */ @@ -242,14 +242,14 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) */ me = this_cpu(); - if ((sched_islocked_global() || irq_cpu_locked(me)) && + if ((nxsched_islocked_global() || irq_cpu_locked(me)) && task_state != TSTATE_TASK_ASSIGNED) { /* Add the new ready-to-run task to the g_pendingtasks task list for * now. */ - sched_addprioritized(btcb, (FAR dq_queue_t *)&g_pendingtasks); + nxsched_add_prioritized(btcb, (FAR dq_queue_t *)&g_pendingtasks); btcb->task_state = TSTATE_TASK_PENDING; doswitch = false; } @@ -263,7 +263,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * Add the task to the ready-to-run (but not running) task list */ - sched_addprioritized(btcb, (FAR dq_queue_t *)&g_readytorun); + nxsched_add_prioritized(btcb, (FAR dq_queue_t *)&g_readytorun); btcb->task_state = TSTATE_TASK_READYTORUN; doswitch = false; @@ -276,9 +276,9 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) if (cpu != me) { - sched_tasklist_unlock(lock); + nxsched_unlock_tasklist(lock); DEBUGVERIFY(up_cpu_pause(cpu)); - lock = sched_tasklist_lock(); + lock = nxsched_lock_tasklist(); } /* Add the task to the list corresponding to the selected state @@ -286,7 +286,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) */ tasklist = (FAR dq_queue_t *)&g_assignedtasks[cpu]; - switched = sched_addprioritized(btcb, tasklist); + switched = nxsched_add_prioritized(btcb, tasklist); /* If the selected task list was the g_assignedtasks[] list and if the * new tasks is the highest priority (RUNNING) task, then a context @@ -391,7 +391,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * different CPU the next time that it runs. */ - if (sched_islocked_global()) + if (nxsched_islocked_global()) { next->task_state = TSTATE_TASK_PENDING; tasklist = (FAR dq_queue_t *)&g_pendingtasks; @@ -402,7 +402,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) tasklist = (FAR dq_queue_t *)&g_readytorun; } - sched_addprioritized(next, tasklist); + nxsched_add_prioritized(next, tasklist); } doswitch = true; @@ -413,7 +413,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * * REVISIT: I have seen this assertion fire. Apparently another * CPU may add another, higher priority task to the same - * g_assignedtasks[] list sometime after sched_cpu_select() was + * g_assignedtasks[] list sometime after nxsched_select_cpu() was * called above, leaving this TCB in the wrong task list if * task_state is TSTATE_TASK_ASSIGNED). */ @@ -435,7 +435,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) /* Unlock the tasklists */ - sched_tasklist_unlock(lock); + nxsched_unlock_tasklist(lock); return doswitch; } diff --git a/sched/sched/sched_continue.c b/sched/sched/sched_continue.c index ba2ca768cf7..c89d08b1215 100644 --- a/sched/sched/sched_continue.c +++ b/sched/sched/sched_continue.c @@ -39,7 +39,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_continue + * Name: nxsched_continue * * Description: * Resume the specified thread. This is normally calling indirectly @@ -47,7 +47,7 @@ * ****************************************************************************/ -void sched_continue(FAR struct tcb_s *tcb) +void nxsched_continue(FAR struct tcb_s *tcb) { irqstate_t flags; diff --git a/sched/sched/sched_cpupause.c b/sched/sched/sched_cpupause.c index d2b14d187d7..525193a9e22 100644 --- a/sched/sched/sched_cpupause.c +++ b/sched/sched/sched_cpupause.c @@ -55,7 +55,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_cpu_pause + * Name: nxsched_pause_cpu * * Description: * Check if task associated with 'tcb' is running on a different CPU. If @@ -78,7 +78,7 @@ * ****************************************************************************/ -int sched_cpu_pause(FAR struct tcb_s *tcb) +int nxsched_pause_cpu(FAR struct tcb_s *tcb) { int cpu; int ret; diff --git a/sched/sched/sched_cpuselect.c b/sched/sched/sched_cpuselect.c index 09d457c93fb..d6ff83505f4 100644 --- a/sched/sched/sched_cpuselect.c +++ b/sched/sched/sched_cpuselect.c @@ -59,7 +59,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_cpu_select + * Name: nxsched_select_cpu * * Description: * Return the index to the CPU with the lowest priority running task, @@ -76,7 +76,7 @@ * ****************************************************************************/ -int sched_cpu_select(cpu_set_t affinity) +int nxsched_select_cpu(cpu_set_t affinity) { uint8_t minprio; int cpu; diff --git a/sched/sched/sched_critmonitor.c b/sched/sched/sched_critmonitor.c index 897e5ce4719..5cff390bc1e 100644 --- a/sched/sched/sched_critmonitor.c +++ b/sched/sched/sched_critmonitor.c @@ -79,7 +79,7 @@ uint32_t g_crit_max[1]; ****************************************************************************/ /**************************************************************************** - * Name: sched_critmon_preemption + * Name: nxsched_critmon_preemption * * Description: * Called when there is any change in pre-emptible state of a thread. @@ -90,7 +90,7 @@ uint32_t g_crit_max[1]; * ****************************************************************************/ -void sched_critmon_preemption(FAR struct tcb_s *tcb, bool state) +void nxsched_critmon_preemption(FAR struct tcb_s *tcb, bool state) { int cpu = this_cpu(); @@ -144,7 +144,7 @@ void sched_critmon_preemption(FAR struct tcb_s *tcb, bool state) } /**************************************************************************** - * Name: sched_critmon_csection + * Name: nxsched_critmon_csection * * Description: * Called when a thread enters or leaves a critical section. @@ -155,7 +155,7 @@ void sched_critmon_preemption(FAR struct tcb_s *tcb, bool state) * ****************************************************************************/ -void sched_critmon_csection(FAR struct tcb_s *tcb, bool state) +void nxsched_critmon_csection(FAR struct tcb_s *tcb, bool state) { int cpu = this_cpu(); @@ -208,7 +208,7 @@ void sched_critmon_csection(FAR struct tcb_s *tcb, bool state) } /**************************************************************************** - * Name: sched_critmon_resume + * Name: nxsched_resume_critmon * * Description: * Called when a thread resumes execution, perhaps re-establishing a @@ -220,7 +220,7 @@ void sched_critmon_csection(FAR struct tcb_s *tcb, bool state) * ****************************************************************************/ -void sched_critmon_resume(FAR struct tcb_s *tcb) +void nxsched_resume_critmon(FAR struct tcb_s *tcb) { uint32_t elapsed; int cpu = this_cpu(); @@ -285,7 +285,7 @@ void sched_critmon_resume(FAR struct tcb_s *tcb) } /**************************************************************************** - * Name: sched_critmon_suspend + * Name: nxsched_suspend_critmon * * Description: * Called when a thread suspends execution, perhaps terminating a @@ -297,7 +297,7 @@ void sched_critmon_resume(FAR struct tcb_s *tcb) * ****************************************************************************/ -void sched_critmon_suspend(FAR struct tcb_s *tcb) +void nxsched_suspend_critmon(FAR struct tcb_s *tcb) { uint32_t elapsed; diff --git a/sched/sched/sched_lock.c b/sched/sched/sched_lock.c index d77d6d32dba..e0dc6f5f653 100644 --- a/sched/sched/sched_lock.c +++ b/sched/sched/sched_lock.c @@ -1,35 +1,20 @@ /**************************************************************************** * sched/sched/sched_lock.c * - * Copyright (C) 2007, 2009, 2016, 2018 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -259,7 +244,7 @@ int sched_lock(void) /* Note that we have pre-emption locked */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_preemption(rtcb, true); + nxsched_critmon_preemption(rtcb, true); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION sched_note_premption(rtcb, true); @@ -269,12 +254,12 @@ int sched_lock(void) /* Move any tasks in the ready-to-run list to the pending task list * where they will not be available to run until the scheduler is - * unlocked and sched_mergepending() is called. + * unlocked and nxsched_merge_pending() is called. */ - sched_mergeprioritized((FAR dq_queue_t *)&g_readytorun, - (FAR dq_queue_t *)&g_pendingtasks, - TSTATE_TASK_PENDING); + nxsched_merge_prioritized((FAR dq_queue_t *)&g_readytorun, + (FAR dq_queue_t *)&g_pendingtasks, + TSTATE_TASK_PENDING); } return OK; @@ -314,7 +299,7 @@ int sched_lock(void) /* Note that we have pre-emption locked */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_preemption(rtcb, true); + nxsched_critmon_preemption(rtcb, true); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION sched_note_premption(rtcb, true); diff --git a/sched/sched/sched_mergepending.c b/sched/sched/sched_mergepending.c index 79b41ec61df..fa70fc29caf 100644 --- a/sched/sched/sched_mergepending.c +++ b/sched/sched/sched_mergepending.c @@ -47,7 +47,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_mergepending + * Name: nxsched_merge_pending * * Description: * This function merges the prioritized g_pendingtasks list into the @@ -69,7 +69,7 @@ ****************************************************************************/ #ifndef CONFIG_SMP -bool sched_mergepending(void) +bool nxsched_merge_pending(void) { FAR struct tcb_s *ptcb; FAR struct tcb_s *pnext; @@ -90,7 +90,7 @@ bool sched_mergepending(void) pnext = ptcb->flink; /* REVISIT: Why don't we just remove the ptcb from pending task list - * and call sched_addreadytorun? + * and call nxsched_add_readytorun? */ /* Search the ready-to-run list to find the location to insert the @@ -153,7 +153,7 @@ bool sched_mergepending(void) #endif /* !CONFIG_SMP */ /**************************************************************************** - * Name: sched_mergepending + * Name: nxsched_merge_pending * * Description: * This function merges the prioritized g_pendingtasks list into the @@ -175,7 +175,7 @@ bool sched_mergepending(void) ****************************************************************************/ #ifdef CONFIG_SMP -bool sched_mergepending(void) +bool nxsched_merge_pending(void) { FAR struct tcb_s *rtcb; FAR struct tcb_s *ptcb; @@ -186,7 +186,7 @@ bool sched_mergepending(void) /* Lock the tasklist before accessing */ - irqstate_t lock = sched_tasklist_lock(); + irqstate_t lock = nxsched_lock_tasklist(); /* Remove and process every TCB in the g_pendingtasks list. * @@ -195,7 +195,7 @@ bool sched_mergepending(void) */ me = this_cpu(); - if (!sched_islocked_global() && !irq_cpu_locked(me)) + if (!nxsched_islocked_global() && !irq_cpu_locked(me)) { /* Find the CPU that is executing the lowest priority task */ @@ -207,7 +207,7 @@ bool sched_mergepending(void) goto errout_with_lock; } - cpu = sched_cpu_select(ALL_CPUS); /* REVISIT: Maybe ptcb->affinity */ + cpu = nxsched_select_cpu(ALL_CPUS); /* REVISIT: Maybe ptcb->affinity */ rtcb = current_task(cpu); /* Loop while there is a higher priority task in the pending task list @@ -228,24 +228,24 @@ bool sched_mergepending(void) /* Add the pending task to the correct ready-to-run list. */ - sched_tasklist_unlock(lock); - ret |= sched_addreadytorun(tcb); - lock = sched_tasklist_lock(); + nxsched_unlock_tasklist(lock); + ret |= nxsched_add_readytorun(tcb); + lock = nxsched_lock_tasklist(); /* This operation could cause the scheduler to become locked. * Check if that happened. */ - if (sched_islocked_global() || irq_cpu_locked(me)) + if (nxsched_islocked_global() || irq_cpu_locked(me)) { /* Yes.. then we may have incorrectly placed some TCBs in the * g_readytorun list (unlikely, but possible). We will have to * move them back to the pending task list. */ - sched_mergeprioritized((FAR dq_queue_t *)&g_readytorun, - (FAR dq_queue_t *)&g_pendingtasks, - TSTATE_TASK_PENDING); + nxsched_merge_prioritized((FAR dq_queue_t *)&g_readytorun, + (FAR dq_queue_t *)&g_pendingtasks, + TSTATE_TASK_PENDING); /* And return with the scheduler locked and tasks in the * pending task list. @@ -265,7 +265,7 @@ bool sched_mergepending(void) goto errout_with_lock; } - cpu = sched_cpu_select(ALL_CPUS); /* REVISIT: Maybe ptcb->affinity */ + cpu = nxsched_select_cpu(ALL_CPUS); /* REVISIT: Maybe ptcb->affinity */ rtcb = current_task(cpu); } @@ -273,7 +273,7 @@ bool sched_mergepending(void) * tasks in the pending task list to the ready-to-run task list. */ - sched_mergeprioritized((FAR dq_queue_t *)&g_pendingtasks, + nxsched_merge_prioritized((FAR dq_queue_t *)&g_pendingtasks, (FAR dq_queue_t *)&g_readytorun, TSTATE_TASK_READYTORUN); } @@ -282,7 +282,7 @@ errout_with_lock: /* Unlock the tasklist */ - sched_tasklist_unlock(lock); + nxsched_unlock_tasklist(lock); return ret; } #endif /* CONFIG_SMP */ diff --git a/sched/sched/sched_mergeprioritized.c b/sched/sched/sched_mergeprioritized.c index 4372588c437..2a6ee478e48 100644 --- a/sched/sched/sched_mergeprioritized.c +++ b/sched/sched/sched_mergeprioritized.c @@ -36,7 +36,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_mergeprioritized + * Name: nxsched_merge_prioritized * * Description: * This function merges the content of the prioritized task list '1ist1' @@ -60,7 +60,7 @@ * ****************************************************************************/ -void sched_mergeprioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2, +void nxsched_merge_prioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2, uint8_t task_state) { dq_queue_t clone; @@ -71,7 +71,7 @@ void sched_mergeprioritized(FAR dq_queue_t *list1, FAR dq_queue_t *list2, #ifdef CONFIG_SMP /* Lock the tasklists before accessing */ - irqstate_t lock = sched_tasklist_lock(); + irqstate_t lock = nxsched_lock_tasklist(); #endif DEBUGASSERT(list1 != NULL && list2 != NULL); @@ -168,7 +168,7 @@ ret_with_lock: #ifdef CONFIG_SMP /* Unlock the tasklists */ - sched_tasklist_unlock(lock); + nxsched_unlock_tasklist(lock); #endif return; } diff --git a/sched/sched/sched_processtimer.c b/sched/sched/sched_processtimer.c index 19c906addfc..b6ff2702f5a 100644 --- a/sched/sched/sched_processtimer.c +++ b/sched/sched/sched_processtimer.c @@ -87,7 +87,7 @@ static inline void nxsched_cpu_scheduler(int cpu) * timeslice. */ - sched_roundrobin_process(rtcb, 1, false); + nxsched_process_roundrobin(rtcb, 1, false); } #endif @@ -100,7 +100,7 @@ static inline void nxsched_cpu_scheduler(int cpu) * budget. */ - sched_sporadic_process(rtcb, 1, false); + nxsched_process_sporadic(rtcb, 1, false); } #endif } diff --git a/sched/sched/sched_removeblocked.c b/sched/sched/sched_removeblocked.c index 9ed15a98bbc..ccf9360fb81 100644 --- a/sched/sched/sched_removeblocked.c +++ b/sched/sched/sched_removeblocked.c @@ -49,7 +49,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_removeblocked + * Name: nxsched_remove_blocked * * Description: * This function removes a TCB from one of the blocked state task @@ -67,7 +67,7 @@ * ****************************************************************************/ -void sched_removeblocked(FAR struct tcb_s *btcb) +void nxsched_remove_blocked(FAR struct tcb_s *btcb) { tstate_t task_state = btcb->task_state; diff --git a/sched/sched/sched_removereadytorun.c b/sched/sched/sched_removereadytorun.c index fa842be933c..094ffa2ca7a 100644 --- a/sched/sched/sched_removereadytorun.c +++ b/sched/sched/sched_removereadytorun.c @@ -53,7 +53,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_removereadytorun + * Name: nxsched_remove_readytorun * * Description: * This function removes a TCB from the ready to run list. @@ -75,7 +75,7 @@ ****************************************************************************/ #ifndef CONFIG_SMP -bool sched_removereadytorun(FAR struct tcb_s *rtcb) +bool nxsched_remove_readytorun(FAR struct tcb_s *rtcb) { bool doswitch = false; @@ -112,7 +112,7 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) #endif /* !CONFIG_SMP */ /**************************************************************************** - * Name: sched_removereadytorun + * Name: nxsched_remove_readytorun * * Description: * This function removes a TCB from the ready to run list. @@ -134,7 +134,7 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) ****************************************************************************/ #ifdef CONFIG_SMP -bool sched_removereadytorun(FAR struct tcb_s *rtcb) +bool nxsched_remove_readytorun(FAR struct tcb_s *rtcb) { FAR dq_queue_t *tasklist; bool doswitch = false; @@ -142,7 +142,7 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) /* Lock the tasklists before accessing */ - irqstate_t lock = sched_tasklist_lock(); + irqstate_t lock = nxsched_lock_tasklist(); /* Which CPU (if any) is the task running on? Which task list holds the * TCB? @@ -188,9 +188,9 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) me = this_cpu(); if (cpu != me) { - sched_tasklist_unlock(lock); + nxsched_unlock_tasklist(lock); DEBUGVERIFY(up_cpu_pause(cpu)); - lock = sched_tasklist_lock(); + lock = nxsched_lock_tasklist(); } /* The task is running but the CPU that it was running on has been @@ -211,7 +211,7 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) * REVISIT: What if it is not the IDLE thread? */ - if (!sched_islocked_global() && !irq_cpu_locked(me)) + if (!nxsched_islocked_global() && !irq_cpu_locked(me)) { /* Search for the highest priority task that can run on this * CPU. @@ -338,7 +338,7 @@ bool sched_removereadytorun(FAR struct tcb_s *rtcb) /* Unlock the tasklists */ - sched_tasklist_unlock(lock); + nxsched_unlock_tasklist(lock); return doswitch; } #endif /* CONFIG_SMP */ diff --git a/sched/sched/sched_reprioritize.c b/sched/sched/sched_reprioritize.c index 3d88accdfe2..6312df3bac7 100644 --- a/sched/sched/sched_reprioritize.c +++ b/sched/sched/sched_reprioritize.c @@ -80,12 +80,12 @@ int nxsched_reprioritize(FAR struct tcb_s *tcb, int sched_priority) { - /* This function is equivalent to nxsched_setpriority() BUT it also has the + /* This function is equivalent to nxsched_set_priority() BUT it also has the * side effect of discarding all priority inheritance history. This is * done only on explicit, user-initiated reprioritization. */ - int ret = nxsched_setpriority(tcb, sched_priority); + int ret = nxsched_set_priority(tcb, sched_priority); if (ret == 0) { /* Reset the base_priority -- the priority that the thread would return diff --git a/sched/sched/sched_resumescheduler.c b/sched/sched/sched_resumescheduler.c index 4802fe58792..fc9fe265688 100644 --- a/sched/sched/sched_resumescheduler.c +++ b/sched/sched/sched_resumescheduler.c @@ -91,14 +91,14 @@ void nxsched_resume_scheduler(FAR struct tcb_s *tcb) { /* Reset the replenishment cycle if it is appropriate to do so */ - DEBUGVERIFY(sched_sporadic_resume(tcb)); + DEBUGVERIFY(nxsched_resume_sporadic(tcb)); } #endif /* Indicate the task has been resumed */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_resume(tcb); + nxsched_resume_critmon(tcb); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION sched_note_resume(tcb); @@ -106,7 +106,7 @@ void nxsched_resume_scheduler(FAR struct tcb_s *tcb) #ifdef CONFIG_SMP /* NOTE: The following logic for adjusting global IRQ controls were - * derived from sched_addreadytorun() and sched_removedreadytorun() + * derived from nxsched_add_readytorun() and sched_removedreadytorun() * Here, we only handles clearing logic to defer unlocking IRQ lock * followed by context switching. */ @@ -120,8 +120,8 @@ void nxsched_resume_scheduler(FAR struct tcb_s *tcb) if (tcb->irqcount > 0) { /* Do notihing here - * NOTE: spin_setbit() is done in sched_addreadytorun() - * and sched_removereadytorun() + * NOTE: spin_setbit() is done in nxsched_add_readytorun() + * and nxsched_remove_readytorun() */ } diff --git a/sched/sched/sched_roundrobin.c b/sched/sched/sched_roundrobin.c index 4c289cb6e5b..8367ae26f56 100644 --- a/sched/sched/sched_roundrobin.c +++ b/sched/sched/sched_roundrobin.c @@ -68,7 +68,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_roundrobin_process + * Name: nxsched_process_roundrobin * * Description: * Check if the currently executing task has exceeded its time slice. @@ -96,7 +96,7 @@ * ****************************************************************************/ -uint32_t sched_roundrobin_process(FAR struct tcb_s *tcb, uint32_t ticks, +uint32_t nxsched_process_roundrobin(FAR struct tcb_s *tcb, uint32_t ticks, bool noswitches) { uint32_t ret; @@ -121,10 +121,10 @@ uint32_t sched_roundrobin_process(FAR struct tcb_s *tcb, uint32_t ticks, /* Did decrementing the timeslice counter cause the timeslice to expire? */ ret = tcb->timeslice; - if (tcb->timeslice <= 0 && !sched_islocked_tcb(tcb)) + if (tcb->timeslice <= 0 && !nxsched_islocked_tcb(tcb)) { /* We will also suppress context switches if we were called via one - * of the unusual cases handled by sched_timer_reassess(). In that + * of the unusual cases handled by nxsched_reassess_timer(). In that * case, we will return a value of one so that the timer will expire * as soon as possible and we can perform this action in the normal * timer expiration context. diff --git a/sched/sched/sched_setaffinity.c b/sched/sched/sched_setaffinity.c index 4919d9ea7f0..813175f7516 100644 --- a/sched/sched/sched_setaffinity.c +++ b/sched/sched/sched_setaffinity.c @@ -130,13 +130,13 @@ int nxsched_set_affinity(pid_t pid, size_t cpusetsize, /* No.. then we will need to move the task from the assigned * task list to some other ready to run list. * - * nxsched_setpriority() will do just what we want... it will + * nxsched_set_priority() will do just what we want... it will * remove the task from its current position in the some assigned * task list and then simply put it back in the right place. This * works even if the task is this task. */ - ret = nxsched_setpriority(tcb, tcb->sched_priority); + ret = nxsched_set_priority(tcb, tcb->sched_priority); } } diff --git a/sched/sched/sched_setparam.c b/sched/sched/sched_setparam.c index d3bfe7ab31d..75cc804f970 100644 --- a/sched/sched/sched_setparam.c +++ b/sched/sched/sched_setparam.c @@ -186,7 +186,7 @@ int nxsched_set_param(pid_t pid, FAR const struct sched_param *param) /* Stop/reset current sporadic scheduling */ flags = enter_critical_section(); - ret = sched_sporadic_reset(tcb); + ret = nxsched_reset_sporadic(tcb); if (ret >= 0) { /* Save the sporadic scheduling parameters and reset to the @@ -206,7 +206,7 @@ int nxsched_set_param(pid_t pid, FAR const struct sched_param *param) /* And restart at the next replenishment interval */ - ret = sched_sporadic_start(tcb); + ret = nxsched_start_sporadic(tcb); } /* Restore interrupts and handler errors */ diff --git a/sched/sched/sched_setpriority.c b/sched/sched/sched_setpriority.c index 83dc88bc7a1..7487962a58b 100644 --- a/sched/sched/sched_setpriority.c +++ b/sched/sched/sched_setpriority.c @@ -68,7 +68,7 @@ static FAR struct tcb_s *nxsched_nexttcb(FAR struct tcb_s *tcb) * then use the 'nxttcb' which will probably be the IDLE thread. */ - if (!sched_islocked_global() && !irq_cpu_locked(cpu)) + if (!nxsched_islocked_global() && !irq_cpu_locked(cpu)) { /* Search for the highest priority task that can run on this CPU. */ @@ -188,7 +188,7 @@ static void nxsched_readytorun_setpriority(FAR struct tcb_s *tcb, if (tcb->task_state == TSTATE_TASK_READYTORUN) { - cpu = sched_cpu_select(tcb->affinity); + cpu = nxsched_select_cpu(tcb->affinity); } /* CASE 2b. The task is ready to run, and assigned to a CPU. An increase @@ -236,7 +236,7 @@ static void nxsched_readytorun_setpriority(FAR struct tcb_s *tcb, * It should not be at the head of the list. */ - bool check = sched_removereadytorun(tcb); + bool check = nxsched_remove_readytorun(tcb); DEBUGASSERT(check == false); UNUSED(check); @@ -248,7 +248,7 @@ static void nxsched_readytorun_setpriority(FAR struct tcb_s *tcb, * end up at the head of the list. */ - check = sched_addreadytorun(tcb); + check = nxsched_add_readytorun(tcb); DEBUGASSERT(check == false); UNUSED(check); } @@ -291,7 +291,7 @@ static inline void nxsched_blocked_setpriority(FAR struct tcb_s *tcb, /* Put it back into the prioritized list at the correct position. */ - sched_addprioritized(tcb, tasklist); + nxsched_add_prioritized(tcb, tasklist); } /* CASE 3b. The task resides in a non-prioritized list. */ @@ -309,7 +309,7 @@ static inline void nxsched_blocked_setpriority(FAR struct tcb_s *tcb, ****************************************************************************/ /**************************************************************************** - * Name: nxsched_setpriority + * Name: nxsched_set_priority * * Description: * This function sets the priority of a specified task. @@ -323,7 +323,7 @@ static inline void nxsched_blocked_setpriority(FAR struct tcb_s *tcb, * sched_priority - The new task priority * * Returned Value: - * On success, nxsched_setpriority() returns 0 (OK). On error, a negated + * On success, nxsched_set_priority() returns 0 (OK). On error, a negated * errno value is returned. * * EINVAL The parameter 'param' is invalid or does not make sense for the @@ -333,7 +333,7 @@ static inline void nxsched_blocked_setpriority(FAR struct tcb_s *tcb, * ****************************************************************************/ -int nxsched_setpriority(FAR struct tcb_s *tcb, int sched_priority) +int nxsched_set_priority(FAR struct tcb_s *tcb, int sched_priority) { irqstate_t flags; diff --git a/sched/sched/sched_setscheduler.c b/sched/sched/sched_setscheduler.c index f9cd7a5a452..1768c08e2ea 100644 --- a/sched/sched/sched_setscheduler.c +++ b/sched/sched/sched_setscheduler.c @@ -134,7 +134,7 @@ int nxsched_set_scheduler(pid_t pid, int policy, if ((tcb->flags & TCB_FLAG_POLICY_MASK) == TCB_FLAG_SCHED_SPORADIC) { - DEBUGVERIFY(sched_sporadic_stop(tcb)); + DEBUGVERIFY(nxsched_stop_sporadic(tcb)); } #endif @@ -155,7 +155,7 @@ int nxsched_set_scheduler(pid_t pid, int policy, if ((tcb->flags & TCB_FLAG_POLICY_MASK) == TCB_FLAG_SCHED_SPORADIC) { - DEBUGVERIFY(sched_sporadic_stop(tcb)); + DEBUGVERIFY(nxsched_stop_sporadic(tcb)); } #endif @@ -220,11 +220,11 @@ int nxsched_set_scheduler(pid_t pid, int policy, if ((tcb->flags & TCB_FLAG_POLICY_MASK) == TCB_FLAG_SCHED_SPORADIC) { - ret = sched_sporadic_reset(tcb); + ret = nxsched_reset_sporadic(tcb); } else { - ret = sched_sporadic_initialize(tcb); + ret = nxsched_initialize_sporadic(tcb); } /* Save the sporadic scheduling parameters. */ @@ -245,7 +245,7 @@ int nxsched_set_scheduler(pid_t pid, int policy, /* And restart at the next replenishment interval */ - ret = sched_sporadic_start(tcb); + ret = nxsched_start_sporadic(tcb); } /* Handle errors */ diff --git a/sched/sched/sched_sporadic.c b/sched/sched/sched_sporadic.c index b511e0d1d9c..981ec3bf15c 100644 --- a/sched/sched/sched_sporadic.c +++ b/sched/sched/sched_sporadic.c @@ -470,12 +470,12 @@ static void sporadic_budget_expire(int argc, wdparm_t arg1, ...) * violating the lock. * * What we do instead is just deallocate all timers. When the lock is - * finally released, sched_sporadic_lowpriority() and that will restart + * finally released, nxsched_sporadic_lowpriority() and that will restart * the interval period. timeslice == -1 is the cue to sched_unlock() that * this operation is needed. */ - if (sched_islocked_tcb(tcb)) + if (nxsched_islocked_tcb(tcb)) { DEBUGASSERT((mrepl->flags && SPORADIC_FLAG_ALLOCED) != 0 && sporadic->nrepls > 0); @@ -619,12 +619,12 @@ static void sporadic_replenish_expire(int argc, wdparm_t arg1, ...) * violating the lock. * * What we do instead is just deallocate all timers. When the lock is - * finally released, sched_sporadic_lowpriority() and that will restart + * finally released, nxsched_sporadic_lowpriority() and that will restart * the interval period. timeslice == -1 is the cue to sched_unlock() that * this operation is needed. */ - if (sched_islocked_tcb(tcb)) + if (nxsched_islocked_tcb(tcb)) { /* Set the timeslice to the magic value */ @@ -768,7 +768,7 @@ FAR struct replenishment_s * ****************************************************************************/ /**************************************************************************** - * Name: sched_sporadic_initialize + * Name: nxsched_initialize_sporadic * * Description: * Allocate resources needed by the sporadic scheduling policy. @@ -781,7 +781,7 @@ FAR struct replenishment_s * * ****************************************************************************/ -int sched_sporadic_initialize(FAR struct tcb_s *tcb) +int nxsched_initialize_sporadic(FAR struct tcb_s *tcb) { FAR struct sporadic_s *sporadic; int i; @@ -815,7 +815,7 @@ int sched_sporadic_initialize(FAR struct tcb_s *tcb) } /**************************************************************************** - * Name: sched_sporadic_start + * Name: nxsched_start_sporadic * * Description: * Called to initialize sporadic scheduling on a given thread. This @@ -841,7 +841,7 @@ int sched_sporadic_initialize(FAR struct tcb_s *tcb) * ****************************************************************************/ -int sched_sporadic_start(FAR struct tcb_s *tcb) +int nxsched_start_sporadic(FAR struct tcb_s *tcb) { FAR struct sporadic_s *sporadic; FAR struct replenishment_s *mrepl; @@ -866,7 +866,7 @@ int sched_sporadic_start(FAR struct tcb_s *tcb) } /**************************************************************************** - * Name: sched_sporadic_stop + * Name: nxsched_stop_sporadic * * Description: * Called to terminate sporadic scheduling on a given thread and to @@ -890,13 +890,13 @@ int sched_sporadic_start(FAR struct tcb_s *tcb) * ****************************************************************************/ -int sched_sporadic_stop(FAR struct tcb_s *tcb) +int nxsched_stop_sporadic(FAR struct tcb_s *tcb) { DEBUGASSERT(tcb && tcb->sporadic); /* Stop all timers, reset scheduling */ - sched_sporadic_reset(tcb); + nxsched_reset_sporadic(tcb); /* The free the container holder the sporadic scheduling parameters */ @@ -906,7 +906,7 @@ int sched_sporadic_stop(FAR struct tcb_s *tcb) } /**************************************************************************** - * Name: sched_sporadic_reset + * Name: nxsched_reset_sporadic * * Description: * Called to stop sporadic scheduling on a given thread. This @@ -914,7 +914,7 @@ int sched_sporadic_stop(FAR struct tcb_s *tcb) * * - When the sporadic scheduling parameters are changed via * sched_setparam() - * - From sched_sporadic_stop when under those conditions. + * - From nxsched_stop_sporadic when under those conditions. * * Input Parameters: * tcb - The TCB of the thread that is beginning sporadic scheduling. @@ -929,7 +929,7 @@ int sched_sporadic_stop(FAR struct tcb_s *tcb) * ****************************************************************************/ -int sched_sporadic_reset(FAR struct tcb_s *tcb) +int nxsched_reset_sporadic(FAR struct tcb_s *tcb) { FAR struct sporadic_s *sporadic; FAR struct replenishment_s *repl; @@ -970,7 +970,7 @@ int sched_sporadic_reset(FAR struct tcb_s *tcb) } /**************************************************************************** - * Name: sched_sporadic_resume + * Name: nxsched_resume_sporadic * * Description: * Called to start the next replenishment interval. This function is @@ -995,7 +995,7 @@ int sched_sporadic_reset(FAR struct tcb_s *tcb) * ****************************************************************************/ -int sched_sporadic_resume(FAR struct tcb_s *tcb) +int nxsched_resume_sporadic(FAR struct tcb_s *tcb) { FAR struct sporadic_s *sporadic; FAR struct replenishment_s *repl; @@ -1115,7 +1115,7 @@ int sched_sporadic_resume(FAR struct tcb_s *tcb) } /**************************************************************************** - * Name: sched_sporadic_suspend + * Name: nxsched_suspend_sporadic * * Description: * Called to when a thread with sporadic scheduling is suspended. In this @@ -1131,7 +1131,7 @@ int sched_sporadic_resume(FAR struct tcb_s *tcb) * ****************************************************************************/ -int sched_sporadic_suspend(FAR struct tcb_s *tcb) +int nxsched_suspend_sporadic(FAR struct tcb_s *tcb) { FAR struct sporadic_s *sporadic; @@ -1161,7 +1161,7 @@ int sched_sporadic_suspend(FAR struct tcb_s *tcb) } /**************************************************************************** - * Name: sched_sporadic_process + * Name: nxsched_process_sporadic * * Description: * Process the elapsed time interval. Called from this context: @@ -1188,7 +1188,7 @@ int sched_sporadic_suspend(FAR struct tcb_s *tcb) * ****************************************************************************/ -uint32_t sched_sporadic_process(FAR struct tcb_s *tcb, uint32_t ticks, +uint32_t nxsched_process_sporadic(FAR struct tcb_s *tcb, uint32_t ticks, bool noswitches) { FAR struct sporadic_s *sporadic; @@ -1225,7 +1225,7 @@ uint32_t sched_sporadic_process(FAR struct tcb_s *tcb, uint32_t ticks, /* Does the thread have the scheduler locked? */ sporadic = tcb->sporadic; - if (sched_islocked_tcb(tcb)) + if (nxsched_islocked_tcb(tcb)) { /* Yes... then we have no option but to give the thread more * time at the higher priority. Dropping the priority could @@ -1241,7 +1241,7 @@ uint32_t sched_sporadic_process(FAR struct tcb_s *tcb, uint32_t ticks, } /* We will also suppress context switches if we were called via one of - * the unusual cases handled by sched_timer_reassess(). In that case, + * the unusual cases handled by nxsched_reassess_timer(). In that case, * we will return a value of one so that the timer will expire as soon * as possible and we can perform this action in the normal timer * expiration context. @@ -1287,7 +1287,7 @@ uint32_t sched_sporadic_process(FAR struct tcb_s *tcb, uint32_t ticks, } /**************************************************************************** - * Name: sched_sporadic_lowpriority + * Name: nxsched_sporadic_lowpriority * * Description: * Drop to the lower priority for the duration of the replenishment @@ -1309,7 +1309,7 @@ uint32_t sched_sporadic_process(FAR struct tcb_s *tcb, uint32_t ticks, * ****************************************************************************/ -void sched_sporadic_lowpriority(FAR struct tcb_s *tcb) +void nxsched_sporadic_lowpriority(FAR struct tcb_s *tcb) { FAR struct sporadic_s *sporadic; FAR struct replenishment_s *mrepl; @@ -1324,7 +1324,7 @@ void sched_sporadic_lowpriority(FAR struct tcb_s *tcb) tcb->timeslice = 0; /* Allocate a new main timer. There should be no timers active at this - * phase since they were stopped in sched_sporadic_process(). + * phase since they were stopped in nxsched_process_sporadic(). */ DEBUGASSERT(sporadic->nrepls < sporadic->max_repl); diff --git a/sched/sched/sched_suspend.c b/sched/sched/sched_suspend.c index e24b1fc99dd..10591c540c2 100644 --- a/sched/sched/sched_suspend.c +++ b/sched/sched/sched_suspend.c @@ -39,7 +39,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_suspend + * Name: nxsched_suspend * * Description: * Suspend/pause the specified thread. This is normally calling indirectly @@ -47,7 +47,7 @@ * ****************************************************************************/ -void sched_suspend(FAR struct tcb_s *tcb) +void nxsched_suspend(FAR struct tcb_s *tcb) { irqstate_t flags; @@ -62,7 +62,7 @@ void sched_suspend(FAR struct tcb_s *tcb) { /* Remove the TCB from the the blocked task list. */ - sched_removeblocked(tcb); + nxsched_remove_blocked(tcb); /* Set the errno value to EINTR. The task will be restarted in the * running or runnable state and will appear to have awakened from @@ -73,7 +73,7 @@ void sched_suspend(FAR struct tcb_s *tcb) /* Move the TCB to the g_stoppedtasks list. */ - sched_addblocked(tcb, TSTATE_TASK_STOPPED); + nxsched_add_blocked(tcb, TSTATE_TASK_STOPPED); } else { diff --git a/sched/sched/sched_suspendscheduler.c b/sched/sched/sched_suspendscheduler.c index e2023573dc4..d6344254919 100644 --- a/sched/sched/sched_suspendscheduler.c +++ b/sched/sched/sched_suspendscheduler.c @@ -79,14 +79,14 @@ void nxsched_suspend_scheduler(FAR struct tcb_s *tcb) if ((tcb->flags & TCB_FLAG_POLICY_MASK) == TCB_FLAG_SCHED_SPORADIC) { - DEBUGVERIFY(sched_sporadic_suspend(tcb)); + DEBUGVERIFY(nxsched_suspend_sporadic(tcb)); } #endif /* Indicate that the task has been suspended */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_suspend(tcb); + nxsched_suspend_critmon(tcb); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION sched_note_suspend(tcb); diff --git a/sched/sched/sched_tasklistlock.c b/sched/sched/sched_tasklistlock.c index 9e2f90b050e..82264718183 100644 --- a/sched/sched/sched_tasklistlock.c +++ b/sched/sched/sched_tasklistlock.c @@ -62,7 +62,7 @@ static volatile uint8_t g_tasklist_lock_count[CONFIG_SMP_NCPUS]; ****************************************************************************/ /**************************************************************************** - * Name: sched_tasklist_lock() + * Name: nxsched_lock_tasklist() * * Description: * Disable local interrupts and take the global spinlock (g_tasklist_lock) @@ -74,10 +74,10 @@ static volatile uint8_t g_tasklist_lock_count[CONFIG_SMP_NCPUS]; * * Returned Value: * An opaque, architecture-specific value that represents the state of - * the interrupts prior to the call to sched_tasklist_lock(); + * the interrupts prior to the call to nxsched_lock_tasklist(); ****************************************************************************/ -irqstate_t sched_tasklist_lock(void) +irqstate_t nxsched_lock_tasklist(void) { int me; irqstate_t ret; @@ -96,26 +96,26 @@ irqstate_t sched_tasklist_lock(void) } /**************************************************************************** - * Name: sched_tasklist_unlock() + * Name: nxsched_unlock_tasklist() * * Description: * Decrement the call counter (g_tasklist_lock_count[cpu]) and if it * decrements to zero then release the spinlock (g_tasklist_lock) and * restore the interrupt state as it was prior to the previous call to - * sched_tasklist_lock(). + * nxsched_lock_tasklist(). * * NOTE: This API is used to protect tasklists in the scheduler. So do not * use this API for other purposes. * * Input Parameters: * lock - The architecture-specific value that represents the state of - * the interrupts prior to the call to sched_tasklist_lock(). + * the interrupts prior to the call to nxsched_lock_tasklist(). * * Returned Value: * None ****************************************************************************/ -void sched_tasklist_unlock(irqstate_t lock) +void nxsched_unlock_tasklist(irqstate_t lock) { int me; diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c index 2d091f9b81e..d3899d9dc6a 100644 --- a/sched/sched/sched_timerexpiration.c +++ b/sched/sched/sched_timerexpiration.c @@ -48,7 +48,7 @@ * Pre-processor Definitions ****************************************************************************/ -/* In the original design, it was planned that sched_timer_reassess() be +/* In the original design, it was planned that nxsched_reassess_timer() be * called whenever there was a change at the head of the ready-to-run * list. That call was intended to establish a new time-slice or to * stop an old time-slice timer. However, it turns out that that @@ -185,7 +185,7 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks, * timeslice. */ - ret = sched_roundrobin_process(rtcb, ticks, noswitches); + ret = nxsched_process_roundrobin(rtcb, ticks, noswitches); } #endif @@ -212,7 +212,7 @@ static uint32_t nxsched_cpu_scheduler(int cpu, uint32_t ticks, * budget. */ - ret = sched_sporadic_process(rtcb, ticks, noswitches); + ret = nxsched_process_sporadic(rtcb, ticks, noswitches); } #endif @@ -558,12 +558,12 @@ void nxsched_timer_expiration(void) #endif /**************************************************************************** - * Name: sched_timer_cancel + * Name: nxsched_cancel_timer * * Description: * Stop the current timing activity. This is currently called just before * a new entry is inserted at the head of a timer list and also as part - * of the processing of sched_timer_reassess(). + * of the processing of nxsched_reassess_timer(). * * This function(1) cancels the current timer, (2) determines how much of * the interval has elapsed, (3) completes any partially timed events @@ -581,7 +581,7 @@ void nxsched_timer_expiration(void) ****************************************************************************/ #ifdef CONFIG_SCHED_TICKLESS_ALARM -unsigned int sched_timer_cancel(void) +unsigned int nxsched_cancel_timer(void) { struct timespec ts; unsigned int elapsed; @@ -631,7 +631,7 @@ unsigned int sched_timer_cancel(void) return nxsched_timer_process(elapsed, true); } #else -unsigned int sched_timer_cancel(void) +unsigned int nxsched_cancel_timer(void) { struct timespec ts; unsigned int ticks; @@ -674,7 +674,7 @@ unsigned int sched_timer_cancel(void) #endif /**************************************************************************** - * Name: sched_timer_resume + * Name: nxsched_resume_timer * * Description: * Re-assess the next deadline and restart the interval timer. This is @@ -688,13 +688,13 @@ unsigned int sched_timer_cancel(void) * None. * * Assumptions: - * This function is called right after sched_timer_cancel(). If + * This function is called right after nxsched_cancel_timer(). If * CONFIG_SCHED_TICKLESS_ALARM=y, then g_stop_time must be the value time * when the timer was cancelled. * ****************************************************************************/ -void sched_timer_resume(void) +void nxsched_resume_timer(void) { unsigned int nexttime; @@ -713,7 +713,7 @@ void sched_timer_resume(void) } /**************************************************************************** - * Name: sched_timer_reassess + * Name: nxsched_reassess_timer * * Description: * It is necessary to re-assess the timer interval in several @@ -725,7 +725,7 @@ void sched_timer_resume(void) * - When pre-emption is re-enabled. A previous time slice may have * expired while pre-emption was enabled and now needs to be executed. * - * In the original design, it was also planned that sched_timer_reassess() + * In the original design, it was also planned that nxsched_reassess_timer() * be called whenever there was a change at the head of the ready-to-run * list. That call was intended to establish a new time-slice for the * newly activated task or to stop the timer if time-slicing is no longer @@ -746,13 +746,13 @@ void sched_timer_resume(void) * ****************************************************************************/ -void sched_timer_reassess(void) +void nxsched_reassess_timer(void) { unsigned int nexttime; /* Cancel and restart the timer */ - nexttime = sched_timer_cancel(); + nexttime = nxsched_cancel_timer(); nxsched_timer_start(nexttime); } diff --git a/sched/sched/sched_unlock.c b/sched/sched/sched_unlock.c index c454f5e5916..ea32ff8aaa2 100644 --- a/sched/sched/sched_unlock.c +++ b/sched/sched/sched_unlock.c @@ -106,7 +106,7 @@ int sched_unlock(void) /* Note that we no longer have pre-emption disabled. */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_preemption(rtcb, false); + nxsched_critmon_preemption(rtcb, false); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION sched_note_premption(rtcb, false); @@ -142,7 +142,7 @@ int sched_unlock(void) * There are certain conditions that we must avoid by preventing * releasing the pending tasks while within the critical section * of other CPUs. This logic does that and there is matching - * logic in sched_addreadytorun to avoid starting new tasks within + * logic in nxsched_add_readytorun to avoid starting new tasks within * the critical section (unless the CPU is the holder of the lock). * * REVISIT: If this CPU is only one that holds the IRQ lock, then @@ -151,7 +151,7 @@ int sched_unlock(void) * BEFORE it clears IRQ lock. */ - if (!sched_islocked_global() && !irq_cpu_locked(cpu) && + if (!nxsched_islocked_global() && !irq_cpu_locked(cpu) && g_pendingtasks.head != NULL) { up_release_pending(); @@ -182,7 +182,7 @@ int sched_unlock(void) #ifdef CONFIG_SCHED_TICKLESS else { - sched_timer_reassess(); + nxsched_reassess_timer(); } #endif } @@ -206,7 +206,7 @@ int sched_unlock(void) * now */ - sched_sporadic_lowpriority(rtcb); + nxsched_sporadic_lowpriority(rtcb); #ifdef CONFIG_SCHED_TICKLESS /* Make sure that the call to up_release_pending() did not @@ -215,7 +215,7 @@ int sched_unlock(void) if (rtcb == current_task(cpu)) { - sched_timer_reassess(); + nxsched_reassess_timer(); } #endif } @@ -261,7 +261,7 @@ int sched_unlock(void) /* Note that we no longer have pre-emption disabled. */ #ifdef CONFIG_SCHED_CRITMONITOR - sched_critmon_preemption(rtcb, false); + nxsched_critmon_preemption(rtcb, false); #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_PREEMPTION sched_note_premption(rtcb, false); @@ -313,7 +313,7 @@ int sched_unlock(void) #ifdef CONFIG_SCHED_TICKLESS else { - sched_timer_reassess(); + nxsched_reassess_timer(); } #endif } @@ -337,7 +337,7 @@ int sched_unlock(void) * now */ - sched_sporadic_lowpriority(rtcb); + nxsched_sporadic_lowpriority(rtcb); #ifdef CONFIG_SCHED_TICKLESS /* Make sure that the call to up_release_pending() did not @@ -346,7 +346,7 @@ int sched_unlock(void) if (rtcb == this_task()) { - sched_timer_reassess(); + nxsched_reassess_timer(); } #endif } diff --git a/sched/sched/sched_verifytcb.c b/sched/sched/sched_verifytcb.c index 887672bf24e..3344acf8f18 100644 --- a/sched/sched/sched_verifytcb.c +++ b/sched/sched/sched_verifytcb.c @@ -49,7 +49,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_verifytcb + * Name: nxsched_verify_tcb * * Description: * Return true if the tcb refers to an active task; false if it is a stale @@ -57,7 +57,7 @@ * ****************************************************************************/ -bool sched_verifytcb(FAR struct tcb_s *tcb) +bool nxsched_verify_tcb(FAR struct tcb_s *tcb) { /* Return true if the PID hashes to this TCB. This will catch the case * where the task associated with the TCB has terminated (note that diff --git a/sched/sched/sched_yield.c b/sched/sched/sched_yield.c index 2387433470c..76c78fc63b3 100644 --- a/sched/sched/sched_yield.c +++ b/sched/sched/sched_yield.c @@ -74,6 +74,6 @@ int sched_yield(void) * at the same priority. */ - ret = nxsched_setpriority(rtcb, rtcb->sched_priority); + ret = nxsched_set_priority(rtcb, rtcb->sched_priority); return ret < 0 ? ERROR : OK; } diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c index c91ab6ae776..c72ccd685e7 100644 --- a/sched/semaphore/sem_holder.c +++ b/sched/semaphore/sem_holder.c @@ -326,7 +326,7 @@ static int nxsem_boostholderprio(FAR struct semholder_s *pholder, * Perhaps its plan is to kill a thread, then destroy the semaphore. */ - if (!sched_verifytcb(htcb)) + if (!nxsched_verify_tcb(htcb)) { swarn("WARNING: TCB 0x%08x is a stale handle, counts lost\n", htcb); nxsem_freeholder(sem, pholder); @@ -377,7 +377,7 @@ static int nxsem_boostholderprio(FAR struct semholder_s *pholder, * switch may occur during up_block_task() processing. */ - nxsched_setpriority(htcb, rtcb->sched_priority); + nxsched_set_priority(htcb, rtcb->sched_priority); } else { @@ -415,7 +415,7 @@ static int nxsem_boostholderprio(FAR struct semholder_s *pholder, * will occur during up_block_task() processing. */ - nxsched_setpriority(htcb, rtcb->sched_priority); + nxsched_set_priority(htcb, rtcb->sched_priority); } #endif @@ -490,7 +490,7 @@ static int nxsem_restoreholderprio(FAR struct tcb_s *htcb, * Perhaps its plan is to kill a thread, then destroy the semaphore. */ - if (!sched_verifytcb(htcb)) + if (!nxsched_verify_tcb(htcb)) { swarn("WARNING: TCB 0x%08x is a stale handle, counts lost\n", htcb); @@ -570,7 +570,7 @@ static int nxsem_restoreholderprio(FAR struct tcb_s *htcb, * base_priority) */ - nxsched_setpriority(htcb, rpriority); + nxsched_set_priority(htcb, rpriority); } else { diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c index b30a7daf83e..264509f10e8 100644 --- a/sched/signal/sig_default.c +++ b/sched/signal/sig_default.c @@ -337,7 +337,7 @@ static void nxsig_stop_task(int signo) #endif /* Lock the scheduler so this thread is not pre-empted until after we - * call sched_suspend(). + * call nxsched_suspend(). */ sched_lock(); @@ -377,7 +377,7 @@ static void nxsig_stop_task(int signo) /* Then, finally, suspend this the final thread of the task group */ - sched_suspend(rtcb); + nxsched_suspend(rtcb); sched_unlock(); } #endif diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 44c89604973..782d5b1cdfa 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -461,7 +461,7 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info) #ifdef HAVE_GROUP_MEMBERS group_continue(stcb); #else - sched_continue(stcb); + nxsched_continue(stcb); #endif } #endif diff --git a/sched/task/task_exit.c b/sched/task/task_exit.c index 6558dce9105..c7317865781 100644 --- a/sched/task/task_exit.c +++ b/sched/task/task_exit.c @@ -104,11 +104,11 @@ int nxtask_exit(void) * context switch will definitely be necessary -- that must be done * by the architecture-specific logic. * - * sched_removereadytorun will mark the task at the head of the + * nxsched_remove_readytorun will mark the task at the head of the * ready-to-run with state == TSTATE_TASK_RUNNING */ - sched_removereadytorun(dtcb); + nxsched_remove_readytorun(dtcb); /* Get the new task at the head of the ready to run list */ @@ -119,7 +119,7 @@ int nxtask_exit(void) #endif #ifdef CONFIG_SMP - /* Because clearing the global IRQ control in sched_removereadytorun() + /* Because clearing the global IRQ control in nxsched_remove_readytorun() * was moved to nxsched_resume_scheduler(). So call the API here. */ @@ -153,7 +153,7 @@ int nxtask_exit(void) * behavior. */ - sched_addblocked(dtcb, TSTATE_TASK_INACTIVE); + nxsched_add_blocked(dtcb, TSTATE_TASK_INACTIVE); ret = nxtask_terminate(dtcb->pid, true); rtcb->task_state = TSTATE_TASK_RUNNING; @@ -177,7 +177,7 @@ int nxtask_exit(void) if (g_pendingtasks.head != NULL) { - sched_mergepending(); + nxsched_merge_pending(); } return ret; diff --git a/sched/task/task_recover.c b/sched/task/task_recover.c index 2a0efbf8d98..483d2c804ad 100644 --- a/sched/task/task_recover.c +++ b/sched/task/task_recover.c @@ -97,7 +97,7 @@ void nxtask_recover(FAR struct tcb_s *tcb) { /* Stop current sporadic scheduling */ - DEBUGVERIFY(sched_sporadic_stop(tcb)); + DEBUGVERIFY(nxsched_stop_sporadic(tcb)); } #endif } diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c index b4a692923b1..247fe3a9255 100644 --- a/sched/task/task_restart.c +++ b/sched/task/task_restart.c @@ -117,7 +117,7 @@ int task_restart(pid_t pid) * that CPU, the restart take effect. */ - cpu = sched_cpu_pause(&tcb->cmn); + cpu = nxsched_pause_cpu(&tcb->cmn); #endif /* CONFIG_SMP */ /* Try to recover from any bad states */ diff --git a/sched/task/task_terminate.c b/sched/task/task_terminate.c index ca1e1fcfada..127ca5bcef0 100644 --- a/sched/task/task_terminate.c +++ b/sched/task/task_terminate.c @@ -142,7 +142,7 @@ int nxtask_terminate(pid_t pid, bool nonblocking) * the case, then we will pause the CPU that the thread is running on. */ - cpu = sched_cpu_pause(dtcb); + cpu = nxsched_pause_cpu(dtcb); /* Get the task list associated with the thread's state and CPU */ diff --git a/sched/wdog/wd_cancel.c b/sched/wdog/wd_cancel.c index b38738610de..f7354bfcd4e 100644 --- a/sched/wdog/wd_cancel.c +++ b/sched/wdog/wd_cancel.c @@ -121,7 +121,7 @@ int wd_cancel(WDOG_ID wdog) * interval event. */ - sched_timer_reassess(); + nxsched_reassess_timer(); } /* Mark the watchdog inactive */ diff --git a/sched/wdog/wd_start.c b/sched/wdog/wd_start.c index cf9cb27cede..19d2a2d453f 100644 --- a/sched/wdog/wd_start.c +++ b/sched/wdog/wd_start.c @@ -236,7 +236,7 @@ int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...) * could even remove it). */ - sched_timer_cancel(); + nxsched_cancel_timer(); #endif /* Do the easy case first -- when the watchdog timer queue is empty. */ @@ -340,7 +340,7 @@ int wd_start(WDOG_ID wdog, int32_t delay, wdentry_t wdentry, int argc, ...) * new delay. */ - sched_timer_resume(); + nxsched_resume_timer(); #endif leave_critical_section(flags); diff --git a/sched/wqueue/kwork_inherit.c b/sched/wqueue/kwork_inherit.c index 75d95a452cb..795740970dd 100644 --- a/sched/wqueue/kwork_inherit.c +++ b/sched/wqueue/kwork_inherit.c @@ -109,7 +109,7 @@ static void lpwork_boostworker(pid_t wpid, uint8_t reqprio) * sched_unblock() processing. */ - nxsched_setpriority(wtcb, reqprio); + nxsched_set_priority(wtcb, reqprio); } else { @@ -146,7 +146,7 @@ static void lpwork_boostworker(pid_t wpid, uint8_t reqprio) * sched_unlock() processing. */ - nxsched_setpriority(wtcb, reqprio); + nxsched_set_priority(wtcb, reqprio); } #endif } @@ -250,7 +250,7 @@ static void lpwork_restoreworker(pid_t wpid, uint8_t reqprio) * base_priority) */ - nxsched_setpriority(wtcb, wpriority); + nxsched_set_priority(wtcb, wpriority); } else {