123b2c080a
The current trap handler has 2 limitations: 1) If it receives a HOST_TRAP, it clears the corresponding bit and notifies the host, when it should not. 2) When it is entered because of a debug trap (s_trap 3) and the debugger is not attached, it returns unconditionally. However, if another exception is reported at the same time as the trap handler is entered for the debug trap (a memory violation for example), that other exception ends-up being ignored. This patch addresses both of those issues. It makes it so host traps and debug traps are ignored when necessary. If any other exception is reported to the wave, we halt the wave and notify the host, and if no other exception is reported (i.e. we entered the trap handler because of host trap or debug trap), we return to shader code. Other minor defects are also fixed during this refactor: - Fixed SQ_WAVE_EXCP_FLAG_PRIV_XNACK_ERROR_SHIFT which had an incorrect value - Host traps can be sent at any time, including after we have halted a wave. In such case, the old approach would have: 1) cleared the trap ID saved in ttmp6 2) clobbered ttmp10 where part of the actual wave's PC is saved. Change-Id: I9ecd341f4967e686233dec182b3e5b0388ef19bd