I think the kernel has an irq api for modules to use. I don't have the kernel docs on my lappy, but look in there
Code:
/usr/src/kernel-source/Documentation
Or, just look in the kernel source of a few block drivers. You should be able to figure it out. I'm not really sure exactly how to do it. Sorry.