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
+1 -1
Submodule arch updated: 17b239501e...bd833ac25f
+1 -1
Submodule configs updated: af52276c2a...0ace58ab54
+15 -13
View File
@@ -1660,7 +1660,7 @@ int up_timer_start(FAR const struct timespec *ts);
/* See prototype in include/nuttx/spinlock.h */ /* See prototype in include/nuttx/spinlock.h */
/**************************************************************************** /****************************************************************************
* Name: up_cpundx * Name: up_cpu_index
* *
* Description: * Description:
* Return an index in the range of 0 through (CONFIG_SMP_NCPUS-1) that * 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 #ifdef CONFIG_SMP
int up_cpundx(void); int up_cpu_index(void);
#else #else
# define up_cpundx() (0) # define up_cpu_index() (0)
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: up_cpustart * Name: up_cpu_start
* *
* Description: * Description:
* In an SMP configution, only one CPU is initially active (CPU 0). System * In an SMP configution, only one CPU is initially active (CPU 0). System
@@ -1710,15 +1710,16 @@ int up_cpundx(void);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
int up_cpustart(int cpu, main_t idletask); int up_cpu_start(int cpu, main_t idletask);
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: up_cpustop * Name: up_cpu_pause
* *
* Description: * Description:
* Save the state of the current task at the head of the * 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 * 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 * 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 #ifdef CONFIG_SMP
int up_cpustop(int cpu); int up_cpu_pause(int cpu);
#endif #endif
/**************************************************************************** /****************************************************************************
* Name: up_cpurestart * Name: up_cpu_resume
* *
* Description: * Description:
* Restart the cpu, restoring the state of the task at the head of the * Restart the cpu after it was paused via up_cpu_pause(), restoring the
* g_assignedtasks[cpu] list. * 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. * the CPU after modifying its g_assignedtasks[cpu] list.
* *
* Input Parameters: * Input Parameters:
@@ -1755,7 +1757,7 @@ int up_cpustop(int cpu);
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
int up_cpurestart(int cpu); int up_cpu_resume(int cpu);
#endif #endif
/**************************************************************************** /****************************************************************************
+1 -1
View File
@@ -168,7 +168,7 @@ int os_smpstart(void)
{ {
/* And start the CPU. */ /* And start the CPU. */
ret = up_cpustart(cpu, os_idletask); ret = up_cpu_start(cpu, os_idletask);
if (ret < 0) if (ret < 0)
{ {
sdbg("ERROR: Failed to start CPU%d: %d\n", cpu, ret); sdbg("ERROR: Failed to start CPU%d: %d\n", cpu, ret);
+1 -1
View File
@@ -72,7 +72,7 @@
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
# define current_task(cpu) ((FAR struct tcb_s *)g_assignedtasks[cpu].head) # define current_task(cpu) ((FAR struct tcb_s *)g_assignedtasks[cpu].head)
# define this_cpu() up_cpundx() # define this_cpu() up_cpu_index()
#else #else
# define current_task(cpu) ((FAR struct tcb_s *)g_readytorun.head) # define current_task(cpu) ((FAR struct tcb_s *)g_readytorun.head)
# define this_cpu() (0) # define this_cpu() (0)
+2 -2
View File
@@ -264,7 +264,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb)
if (cpu != me) if (cpu != me)
{ {
DEBUGVERIFY(up_cpustop(cpu)); DEBUGVERIFY(up_cpu_pause(cpu));
} }
/* Add the task to the list corresponding to the selected state /* 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) if (cpu != me)
{ {
DEBUGVERIFY(up_cpurestart(cpu)); DEBUGVERIFY(up_cpu_resume(cpu));
doswitch = false; doswitch = false;
} }
} }