From bbefad449cf53c4fc24b330b20553d5ca921bb33 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Thu, 20 Feb 2020 09:25:43 +0900 Subject: [PATCH] arch: armv7-a: Apply armv7-m SMP related logic to armv7-a Signed-off-by: Masayuki Ishikawa --- 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 ec0339a16c..a11c7b83d3 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 6a3638a099..a30460be78 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 2a2b83768e..399a7f50c9 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