A special keyword may be associated with a block or a function declaring it as critical. SDCC will generate code to disable all interrupts upon entry to a critical function and restore the interrupt enable to the previous state before returning. Nesting critical functions will need one additional byte on the stack for each call.
int foo () __criticalThe critical attribute maybe used with other attributes like reentrant.
{
...
...
}
__critical{ i++; }More than one statement could have been included in the block.