Several kernel functions are available for disabling interrupts:
- Disable all interrupts on this processor
- Disalbe a particular interrupt on all processors.
Disabling interrupts guarantees that an interrupt handler will not interrupt you and it also guarantees that your (kernel) code won't be preempted.
However, in a multiprocessor machine, this doesn't guarantee that code running on a different processor won't access the same resources as your code.
A "lock" of some kind is needed to prevent code running on another processor from simultaneously accessing any shared data.