Hi,
I am porting smp on arm cortex-a7 using gic-v2 and the portable part is refered to portable/GCC/ARM_CA9.
I followed the SMP change description to porting. I continued to use portDISABLE_INTERRUPTS() and portSET_INTERRUPT_MASK_FROM_ISR() – portDISABLE_INTERRUPT,because they match the description in the documentation.
portDISABLE_INTERRUPTS()
This must now also return the interrupt mask prior to disabling. It may still be called without
checking the return value.
portDISABLE_INTERRUPTS() sets GICC_ PMR and clears CPSR I bit to enable IRQ.
The FreeRTOS_SWI_Handler and FreeRTOS_IRQ_Handler is also implemented as same as ARM_CA9/portASM.S, but stack corruption happends. Because interrupt is re-enabled is vTaskSwitchContext( CoreID ) which will calls xTaskGetCurrentTaskHandle() and portDISABLE_INTERRUPTS, IRQ is re-enabled at this time and interrupt preempts vTaskSwitchContext().
Main branch has added new marcore portSET_INTERRUPT_MASK() which has return value. I want to know what is the difference between portSET_INTERRUPT_MASK() and portDISABLE_INTERRUPTS and how to implent them.
Got it! When using gic, mask interrupts selectively by setting GICC_PMR to configMAX_SYSCALL_INTERRUPT_PRIORITY, I will try main branch. Thanks for your reply.
BTW, is there any relevant implements that can be refered to?