SMP: Cosmetic renaming to clarify functionality of SMP interfaces. Update comments.

This commit is contained in:
Gregory Nutt 2016-02-17 13:36:25 -06:00
parent b50325bb38
commit 95735519dd
6 changed files with 21 additions and 19 deletions

2
arch

@ -1 +1 @@
Subproject commit 17b239501e1b11ae065586efe31f2c4e8ffd4122
Subproject commit bd833ac25f0f982a372d8d9df5e1634a6eb21b32

@ -1 +1 @@
Subproject commit af52276c2aa09944c1c2f158cdb05e7eb53c1659
Subproject commit 0ace58ab548d5aeae58ebdda44e9ef08d6a79bef

View File

@ -1660,7 +1660,7 @@ int up_timer_start(FAR const struct timespec *ts);
/* See prototype in include/nuttx/spinlock.h */
/****************************************************************************
* Name: up_cpundx
* Name: up_cpu_index
*
* Description:
* Return an index in the range of 0 through (CONFIG_SMP_NCPUS-1) that
@ -1676,13 +1676,13 @@ int up_timer_start(FAR const struct timespec *ts);
****************************************************************************/
#ifdef CONFIG_SMP
int up_cpundx(void);
int up_cpu_index(void);
#else
# define up_cpundx() (0)
# define up_cpu_index() (0)
#endif
/****************************************************************************
* Name: up_cpustart
* Name: up_cpu_start
*
* Description:
* In an SMP configution, only one CPU is initially active (CPU 0). System
@ -1710,15 +1710,16 @@ int up_cpundx(void);
****************************************************************************/
#ifdef CONFIG_SMP
int up_cpustart(int cpu, main_t idletask);
int up_cpu_start(int cpu, main_t idletask);
#endif
/****************************************************************************
* Name: up_cpustop
* Name: up_cpu_pause
*
* Description:
* Save the state of the current task at the head of the
* g_assignedtasks[cpu] task list and then stop the CPU.
* g_assignedtasks[cpu] task list and then pause task execution on the
* CPU.
*
* This function is called by the OS when the logic executing on one CPU
* needs to modify the state of the g_assignedtasks[cpu] list for another
@ -1733,17 +1734,18 @@ int up_cpustart(int cpu, main_t idletask);
****************************************************************************/
#ifdef CONFIG_SMP
int up_cpustop(int cpu);
int up_cpu_pause(int cpu);
#endif
/****************************************************************************
* Name: up_cpurestart
* Name: up_cpu_resume
*
* Description:
* Restart the cpu, restoring the state of the task at the head of the
* g_assignedtasks[cpu] list.
* Restart the cpu after it was paused via up_cpu_pause(), restoring the
* state of the task at the head of the g_assignedtasks[cpu] list, and
* resume normal tasking.
*
* This function is called after up_cpustop in order resume operation of
* This function is called after up_cpu_pause in order resume operation of
* the CPU after modifying its g_assignedtasks[cpu] list.
*
* Input Parameters:
@ -1755,7 +1757,7 @@ int up_cpustop(int cpu);
****************************************************************************/
#ifdef CONFIG_SMP
int up_cpurestart(int cpu);
int up_cpu_resume(int cpu);
#endif
/****************************************************************************

View File

@ -168,7 +168,7 @@ int os_smpstart(void)
{
/* And start the CPU. */
ret = up_cpustart(cpu, os_idletask);
ret = up_cpu_start(cpu, os_idletask);
if (ret < 0)
{
sdbg("ERROR: Failed to start CPU%d: %d\n", cpu, ret);

View File

@ -72,7 +72,7 @@
#ifdef CONFIG_SMP
# define current_task(cpu) ((FAR struct tcb_s *)g_assignedtasks[cpu].head)
# define this_cpu() up_cpundx()
# define this_cpu() up_cpu_index()
#else
# define current_task(cpu) ((FAR struct tcb_s *)g_readytorun.head)
# define this_cpu() (0)

View File

@ -264,7 +264,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb)
if (cpu != me)
{
DEBUGVERIFY(up_cpustop(cpu));
DEBUGVERIFY(up_cpu_pause(cpu));
}
/* Add the task to the list corresponding to the selected state
@ -372,7 +372,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb)
if (cpu != me)
{
DEBUGVERIFY(up_cpurestart(cpu));
DEBUGVERIFY(up_cpu_resume(cpu));
doswitch = false;
}
}