AnsweredAssumed Answered

How to suppress 'six NOP' warning when disabling interrupts

Question asked by Colin Cameron on Oct 19, 2015
Latest reply on Nov 5, 2015 by Colin Cameron

I've created some 'asm static ...' functions that do certain tasks for the DSC 56f800ex under Code Warrior 10.6. Some of these need to disable interrupts and I get the following warning:

 

>Six NOP(s) required after instruction masking the interrupts. NOP(s) may be

>replaced with instructions located prior to the start of the critical section

>to save code space. Check that the instructions take at least six

>cycles.[INTRWRN_001]

 

However I've checked the code and the instructions following the masking of the interrupts -- they are all safe as intended and the critical section happens six cycles after the interrupts are masked. For example in one function I disable interrupts immediately, then spend several cycles preparing for the actual functionality and only access the shared memory after six cycles.

 

I don't really want to insert the NOPs just to get rid of the warning because there is useful work I can do in that time and these routines are already longer than I'd like. How can I suppress the warning just for these functions that I have been reviewed and checked? I tried to put #pragma supress_warnings on before the code but it had no effect.

 

Ideally I just want to suppress just that warning for just that file and to do so in the source code rather than a build setting.

Outcomes