Introduce generic IRQ handling

Signed-off-by: Boris Figovsky <borfig@gmail.com>