Don't terminate waves halted at s_endpgm

To support single stepping the instruction preceding an s_endpgm,
unwind the PC by 8 bytes and set ttmp11[9] to notify the debugger
that the wave is halted with a modified PC.

Bump the debug r_version for this new trap handler ABI.

Change-Id: I55e4e0d65576f92da14a336266c31c513baab547
Tento commit je obsažen v:
Laurent Morichetti
2021-01-21 11:51:37 -08:00
rodič 8808ed3177
revize 8aec53969f
2 změnil soubory, kde provedl 31 přidání a 34 odebrání
+2 -1
Zobrazit soubor
@@ -75,7 +75,8 @@ __attribute__((noinline)) static void _loader_debug_state() {
// r_version history:
// 1: Initial debug protocol
// 2: New trap handler ABI. The reason for halting a wave is recorded in ttmp11[8:7].
HSA_API r_debug _amdgpu_r_debug = {2,
// 3: New trap handler ABI. A wave halted at S_ENDPGM rewinds its PC by 8 bytes, and sets ttmp11[9]=1.
HSA_API r_debug _amdgpu_r_debug = {3,
nullptr,
reinterpret_cast<uintptr_t>(&_loader_debug_state),
r_debug::RT_CONSISTENT,