aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 15:54:37 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 15:54:37 -0400
commit81cff29955cd1130ae83ec658adf5e6cd0264399 (patch)
treef0364fbed78d889dbe64b27e8c43a5c669b330ed /tools
parent5cb4786f3e25136145fa71c17da7a65be35ff7dd (diff)
nvdrv: Switch 2 GetEngineInfo, TSG flag, Ampere object classes, channel ioctl passthrough
Once an nx2 NvRm identifies itself (0xD0-byte characteristics), nvhost-gpu and nvhost-ctrl-gpu answer unknown ioctls with a logged input echo instead of NotImplemented, ctrl-gpu reports GR + async-copy engines, and Ampere class numbers (and class 0) map onto Eden's Maxwell object slots. gdbrsp.py gains trace/flow/ breakwhen/fp helpers.
Diffstat (limited to 'tools')
-rw-r--r--tools/nx2/gdbrsp.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/nx2/gdbrsp.py b/tools/nx2/gdbrsp.py
index ba81c33c1a..9b3b2d8b37 100644
--- a/tools/nx2/gdbrsp.py
+++ b/tools/nx2/gdbrsp.py
@@ -100,6 +100,35 @@ def main():
print(f" t pc={r['pc']:#x} x0={r['x0']:#x} x8={r['x8']:#x}")
if stop_at is not None and r["pc"] == stop_at:
break
+ elif op == "breakwhen":
+ # breakwhen <addr> <reg> <value> [max]: stop at addr only when reg == value.
+ addr, reg, want = int(parts[1], 16), parts[2], int(parts[3], 16)
+ for _ in range(int(parts[4]) if len(parts) > 4 else 50):
+ rsp.cmd(f"Z0,{addr:x},4")
+ rsp.cmd("c")
+ regs = rsp.regs()
+ if regs.get("pc") != addr:
+ print(" breakwhen: stopped elsewhere at", hex(regs.get("pc", 0)))
+ break
+ if regs.get(reg) == want:
+ print(f" breakwhen: hit with {reg}={want:#x}")
+ break
+ rsp.cmd(f"z0,{addr:x},4")
+ rsp.cmd("s")
+ print(" " + " ".join(f"{k}={v:#x}" for k, v in regs.items() if k in ("pc", "x0", "x1", "x2", "x19", "x20", "x21", "x22", "x24", "x30")))
+ elif op == "flow":
+ # flow N stop_hex: single-step N instructions, print only non-sequential pcs (branches)
+ n, stop_at = int(parts[1]), int(parts[2], 16)
+ prev = rsp.regs().get("pc", 0)
+ for _ in range(n):
+ rsp.cmd("s")
+ r = rsp.regs()
+ pc = r.get("pc", 0)
+ if pc != prev + 4:
+ print(f" f {prev:#x} -> {pc:#x} x0={r.get('x0', 0):#x}")
+ prev = pc
+ if pc == stop_at:
+ break
elif op == "continue":
print("stop:", rsp.cmd("c"))
elif op == "x0":