The role of an interrupt handler is to give feedback to its device about interrupt
reception and to read or write data according to the meaning of the interrupt being
serviced. The first step usually consists of clearing a bit on the interface board; most
hardware devices won’t generate other interrupts until their “interrupt-pending” bit
has been cleared. Depending on how your hardware works, this step may need to be
performed last instead of first; there is no catch-all rule here. Some devices don’t
require this step, because they don’t have an “interrupt-pending” bit; such devices
are a minority.