Hi Ti Folks,
i have a code doing this operation. This part is in nimu_eth.c [this is in PDK installation folder]
/* Disable the interrupt */
coreKey [CSL_chipReadReg (CSL_CHIP_DNUM)] = Hwi_disableInterrupt(PLATFORM_ETH_INTERRUPT); //Hwi_disable();
/* Begin Critical Section before accessing shared resources. */
key = Osal_qmssCsEnter ();
<<many functions are called here>>
/* End Critical Section */
Osal_qmssCsExit (key);
Hwi_restoreInterrupt(PLATFORM_ETH_INTERRUPT, coreKey [CSL_chipReadReg (CSL_CHIP_DNUM)]);
already many functions are called in here. In addition, i have inserted a function to do a functionality like
1.pop desc from a Free desc queue,
2. fill some contents onto desc
3. push the desc onto a queue.
all in all its around 8 lines of code which is being done here.
what i am seeing is a crash in the code [i understand my code is causing timing issues, but at the same time my code is just 7 lines and i dont think it is occupying too much of time].
what i want to know is, is it ok to put code like qmss_pop and qmss_push..[i assume this is correct since key=Osal_qmssCsEnter() is created for qmss operations to enable sychronization acorss multiple cores] in between hw_disable,getting key .....and......hw_enable,releasing key.
what considerations should be followed for the code to be placed between critical section start and critical section end. In short, what operations are allowed between critical sections and what are not.Any guidelines on the same? please point me to any document on the same.
Thanks
RC Reddy