I've modeled my ethernet code after the Starterware LWIP interface examples (although I'm not using LWIP for various reasons).
During the time the Receive interrupt process is called, I handle the incoming packets -- using some variables that are used in other parts of the system.
So, I need to be able to "protect" these variables and temporarily disable the receive interrupt.
I've tried using something like:
//Disable the Global Interrupts
intStatus = IntDisable();
/* Disable the interrupts for channel 0 and for control core 0 */
CPSWCPDMATxIntDisable(me->cpdma_base, 0);
CPSWWrCoreIntDisable(me->wrpr_base, 0, 0, CPSW_CORE_INT_TX_PULSE);
CPSWCPDMARxIntDisable(me->cpdma_base, 0);
CPSWWrCoreIntDisable(me->wrpr_base, 0, 0, CPSW_CORE_INT_RX_PULSE);
//Enable the Global Interrupts
IntEnable(intStatus);
or even just
//Disable the Global Interrupts
intStatus = IntDisable();
/* Disable the interrupts for channel 0 and for control core 0 */
CPSWWrCoreIntDisable(me->wrpr_base, 0, 0, CPSW_CORE_INT_TX_PULSE);
CPSWWrCoreIntDisable(me->wrpr_base, 0, 0, CPSW_CORE_INT_RX_PULSE);
//Enable the Global Interrupts
IntEnable(intStatus);
but this seems to cause crashes.
Is this the correct way to temporarily disable the interrupts?