/* returns true if interrupts had been enabled before we disabled them  */
int disable_interrupts(void)
/* returns true if interrupts had been enabled before we disabled them  */
int disable_interrupts(void)
{
	int status = read_aux_reg(ARC_AUX_STATUS32);
	int state = (status & (E1_MASK | E2_MASK)) ? 1 : 0;
	status &= ~(E1_MASK | E2_MASK);
	__asm__("flag %0" : : "r" (status));
	return state;
}