For x86 processors, this is caused by IRET and IRETD, before they have changed any processor state.
For ia64 processors, this is caused by rfi, before is has changed any processor state.
For sparc processors, the hap is triggered by the DONE and RETRY instructions, before any processor state has been changed.
The exception_number parameter is only valid for SPARC processors.