arch/arm/src/armv7-a: Found some additional places were the new this_task() function cannot be called in the i.MX6 SMP configuration.

This commit is contained in:
Gregory Nutt
2018-02-06 10:33:28 -06:00
parent 0ba7853016
commit 8aa1538506
3 changed files with 74 additions and 4 deletions
+23 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/up_blocktask.c
*
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2015, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -76,8 +76,21 @@
void up_block_task(struct tcb_s *tcb, tstate_t task_state)
{
struct tcb_s *rtcb = this_task();
struct tcb_s *rtcb;
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 */
@@ -128,7 +141,11 @@ 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 */
@@ -152,7 +169,11 @@ 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
+23 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/armv7-a/arm_unblocktask.c
*
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2015, 2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -71,7 +71,20 @@
void up_unblock_task(struct tcb_s *tcb)
{
struct tcb_s *rtcb = this_task();
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
/* Verify that the context switch can be performed */
@@ -110,7 +123,11 @@ void up_unblock_task(struct tcb_s *tcb)
* of the ready-to-run task list.
*/
#ifdef CONFIG_SMP
rtcb = current_task(cpu);
#else
rtcb = this_task();
#endif
/* Update scheduler parameters */
@@ -136,7 +153,11 @@ void up_unblock_task(struct tcb_s *tcb)
* 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
+28
View File
@@ -121,6 +121,34 @@ Status
2016-12-07: Just a note to remind myself. The PL310 L2 cache has *not*
yet been enabled.
2018-02-06: Revisited SMP to see how has been broken due to bit rot.
Several fixes were needed mostly due to: (1) The new version of
this_task() that calls sched_lock() and sched_unlock(), and (2) to
deferred setting g_cpu_irqlock(). That latter setting is now deferred
until sched_resume_scheduler() runs. This means several changes similar
to the following were necessary in order to get things working from:
struct tcb_s *rtcb = this_task();
To:
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
At present, the NSH prompt does come up but there there still hangs that
must be addressed.
Platform Features
=================