From what I understand, there are software interrupts and hardware interrupts. Software interrupts include exception and trap, where a trap is called explicitly (such as in the case of systemcalls) and exceptions are called implicitly (such as in the case of division by 0, page fault, etc)
Am I right? Are traps only used for systemcalls?
All the explanations I've read seem to contradict each other.
There is no consistent terminology. Different architectures/vendors use those words to mean different things.
For example, on Motorola 68000 traps are exceptions called by
trap
ortrapv
instructions. They are called explicitly, like you said, however they are still considered exceptions - because Motorola calls all interrupts "exceptions".On x86, exceptions are the first 32 reserved interrupts - they can be implicitly called by the CPU. They are further divided into traps, faults and aborts:
On x86, any interrupt (including hardware and reserved ones) can be explicitly called in software. The
syscall
instruction is not considered an interrupt at all.