FreeRTOS SMP: portYIELD_CORE(x)

Hi, I am done implementing the portYIELD_CORE(x) macro but I don’t completely get how it should be used. The inter-core signaling is currently implemented with a software generated interrupt so I need to install an handler on the cores that can receive this kind of interrupt. At this point my questions are:

  1. Is it possible for a core to use portYIELD_CORE(x) on itself?
  2. Can secondary cores (i.e. cores that do not handle the SysTick interrupt) use portYIELD_CORE(x)?

Thanks

No, it is used only to signal other core.

Yes, they can.

Ok, thank you. So even the primary core should be able to handle it, right?

Yes, because a “secondary” core can unblock a task with a higher priority then the primary core is currently running, but below the priority of the task it is running, so the primary core should switch tasks.

Can you help me understand why you mean by “it” here?

Yes, sorry, “it” means “the interrupt directed from the core that executes portYIELD_CORE(x) to core x”.

Yes, then you are right and @richard-damon already explained the reasoning.