Skip to content

Commit

Permalink
smp:fix sim build error under config CONFIG_SMP
Browse files Browse the repository at this point in the history
CC:  sim/sim_smpsignal.c init/nx_smpstart.c: In function ‘nx_idle_trampoline’:
init/nx_smpstart.c:68:21: warning: unused variable ‘tcb’ [-Wunused-variable]
   68 |   FAR struct tcb_s *tcb = this_task_inirq();
      |                     ^~~
sim/sim_smpsignal.c: In function ‘host_cpu_started’:
sim/sim_smpsignal.c:271:17: warning: unused variable ‘tcb’ [-Wunused-variable]
  271 |   struct tcb_s *tcb = this_task();

sim/sim_smpsignal.c:249:33: error: ‘cpu’ undeclared (first use in this function)
  249 |   restore_critical_section(tcb, cpu);
      |                                 ^~~

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
  • Loading branch information
dulibo1 authored and jasonbu committed Sep 27, 2024
1 parent 10dcbf4 commit e9648f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions arch/sim/src/sim/sim_smpsignal.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,6 @@ int up_cpu_paused_restore(void)

nxsched_resume_scheduler(tcb);

/* Restore the cpu lock */

restore_critical_section(tcb, this_cpu());

/* Then switch contexts. Any necessary address environment changes
* will be made when the interrupt returns.
*/
Expand All @@ -267,7 +263,7 @@ int up_cpu_paused_restore(void)

void host_cpu_started(void)
{
#ifdef CONFIG_SCHED_INSTRUMENTATION
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
struct tcb_s *tcb = this_task();

/* Notify that this CPU has started */
Expand Down
2 changes: 1 addition & 1 deletion sched/init/nx_smpstart.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

void nx_idle_trampoline(void)
{
#ifdef CONFIG_SCHED_INSTRUMENTATION
#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
FAR struct tcb_s *tcb = this_task();

/* Announce that the IDLE task has started */
Expand Down

0 comments on commit e9648f3

Please sign in to comment.