It's particularly convenient to define a pair of functions (or macros)
int disable_interrupts (void);
restore_interrupts(int flag);
// start critical section
int flag = disable_interrupts();
// do stuff in an atomic manner
restore_interrupts(flag);
// end critical section
where disable_interrupts() returns a flag indicating whether interrupts were enabled or not before the call, and restore_interrupts() restores them to the previous state. This makes it safe to put the critical section inside a function that might be called from a context where interrupts shouldn't be enabled (like inside another critical section, or during startup code).
Unconditionally enabling interrupts (as opposed to restoring the previous state) is usually quite a rare operation: at the end of startup code once the interrupt service routines (ISRs) are setup, or within a NiosI ISR (since interrupts were disabled when the ISR was invoked).