Include the AMR CPU IRQ enable state in the irqmask struct. Restore and save that state in appropriate functions.
Test the disable() routine more fully. New restore() test.