You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/02/20 02:05:10 UTC
[incubator-nuttx] 01/04: arch: armv7-a: Apply armv7-m SMP related
logic to armv7-a
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit bbefad449cf53c4fc24b330b20553d5ca921bb33
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Thu Feb 20 09:25:43 2020 +0900
arch: armv7-a: Apply armv7-m SMP related logic to armv7-a
Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
arch/arm/src/armv7-a/arm_blocktask.c | 23 +----------------------
arch/arm/src/armv7-a/arm_releasepending.c | 23 +----------------------
arch/arm/src/armv7-a/arm_reprioritizertr.c | 23 +----------------------
3 files changed, 3 insertions(+), 66 deletions(-)
diff --git a/arch/arm/src/armv7-a/arm_blocktask.c b/arch/arm/src/armv7-a/arm_blocktask.c
index ec0339a..a11c7b8 100644
--- a/arch/arm/src/armv7-a/arm_blocktask.c
+++ b/arch/arm/src/armv7-a/arm_blocktask.c
@@ -76,21 +76,8 @@
void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{
- struct tcb_s *rtcb;
+ struct tcb_s *rtcb = this_task();
bool switch_needed;
-#ifdef CONFIG_SMP
- int cpu;
-
- /* Get the TCB of the currently executing task on this CPU (avoid using
- * this_task() because the TCBs may be in an inappropriate state right
- * now).
- */
-
- cpu = this_cpu();
- rtcb = current_task(cpu);
-#else
- rtcb = this_task();
-#endif
/* Verify that the context switch can be performed */
@@ -141,11 +128,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
* of the ready-to-run task list.
*/
-#ifdef CONFIG_SMP
- rtcb = current_task(cpu);
-#else
rtcb = this_task();
-#endif
/* Reset scheduler parameters */
@@ -169,11 +152,7 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state)
* of the ready-to-run task list.
*/
-#ifdef CONFIG_SMP
- rtcb = current_task(cpu);
-#else
rtcb = this_task();
-#endif
#ifdef CONFIG_ARCH_ADDRENV
/* Make sure that the address environment for the previously
diff --git a/arch/arm/src/armv7-a/arm_releasepending.c b/arch/arm/src/armv7-a/arm_releasepending.c
index 6a3638a..a30460b 100644
--- a/arch/arm/src/armv7-a/arm_releasepending.c
+++ b/arch/arm/src/armv7-a/arm_releasepending.c
@@ -64,20 +64,7 @@
void up_release_pending(void)
{
- struct tcb_s *rtcb;
-#ifdef CONFIG_SMP
- int cpu;
-
- /* Get the TCB of the currently executing task on this CPU (avoid using
- * this_task() because the TCBs may be in an inappropriate state right
- * now).
- */
-
- cpu = this_cpu();
- rtcb = current_task(cpu);
-#else
- rtcb = this_task();
-#endif
+ struct tcb_s *rtcb = this_task();
sinfo("From TCB=%p\n", rtcb);
@@ -108,11 +95,7 @@ void up_release_pending(void)
* of the ready-to-run task list.
*/
-#ifdef CONFIG_SMP
- rtcb = current_task(cpu);
-#else
rtcb = this_task();
-#endif
/* Update scheduler parameters */
@@ -137,11 +120,7 @@ void up_release_pending(void)
* of the ready-to-run task list.
*/
-#ifdef CONFIG_SMP
- rtcb = current_task(cpu);
-#else
rtcb = this_task();
-#endif
#ifdef CONFIG_ARCH_ADDRENV
/* Make sure that the address environment for the previously
diff --git a/arch/arm/src/armv7-a/arm_reprioritizertr.c b/arch/arm/src/armv7-a/arm_reprioritizertr.c
index 2a2b837..399a7f5 100644
--- a/arch/arm/src/armv7-a/arm_reprioritizertr.c
+++ b/arch/arm/src/armv7-a/arm_reprioritizertr.c
@@ -92,21 +92,8 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
}
else
{
- struct tcb_s *rtcb;
+ struct tcb_s *rtcb = this_task();
bool switch_needed;
-#ifdef CONFIG_SMP
- int cpu;
-
- /* Get the TCB of the currently executing task on this CPU (avoid
- * using this_task() because the TCBs may be in an inappropriate
- * state right now).
- */
-
- cpu = this_cpu();
- rtcb = current_task(cpu);
-#else
- rtcb = this_task();
-#endif
sinfo("TCB=%p PRI=%d\n", tcb, priority);
@@ -163,11 +150,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
* of the ready-to-run task list.
*/
-#ifdef CONFIG_SMP
- rtcb = current_task(cpu);
-#else
rtcb = this_task();
-#endif
/* Update scheduler parameters */
@@ -191,11 +174,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
* of the ready-to-run task list.
*/
-#ifdef CONFIG_SMP
- rtcb = current_task(cpu);
-#else
rtcb = this_task();
-#endif
#ifdef CONFIG_ARCH_ADDRENV
/* Make sure that the address environment for the previously