dtrace: add support for passing return value from trap handlers
Prior to this patch, trap handlers were called to service traps without
any mechanism to report back to the lowest level trap entry point. The
DTrace FBT implementation on x86 needs to be able to do just that because
FBT probes are enabled by replacing a one-byte assembler instruction with
a one-byte instruction that causes a trap. After the trap is handled, we
need to emulate the instruction that was replaced prior to returning to
the original instruction stream. Because different instructions may occur
at FBT probe points, we need to be able to report back to the trap entry
point which instruction was replaced by the trap.
Handlers that do not use notify_die() always return 0. Those who do use
notify_die() to call handlers have been modified to return the value that
the handler passed on its return.
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-By: Dan Duval <dan.duval@oracle.com>
Orabug:
25312278