diff --git a/sys/src/9/kw/syscall.c b/sys/src/9/kw/syscall.c index 555d767ee..30cc29c40 100644 --- a/sys/src/9/kw/syscall.c +++ b/sys/src/9/kw/syscall.c @@ -78,6 +78,7 @@ noted(Ureg* cur, uintptr arg0) nf->arg0 = &nf->ureg; nf->ip = 0; cur->sp = PTR2UINT(nf); + cur->r0 = PTR2UINT(nf->arg0); break; default: up->lastnote.flag = NDebug; @@ -163,6 +164,8 @@ notify(Ureg* ureg) ureg->sp = sp; ureg->pc = PTR2UINT(up->notify); + ureg->r0 = PTR2UINT(nf->arg0); + up->notified = 1; up->nnote--; memmove(&up->lastnote, &up->note[0], sizeof(Note)); diff --git a/sys/src/9/omap/syscall.c b/sys/src/9/omap/syscall.c index 224ee2c29..882aef2cc 100644 --- a/sys/src/9/omap/syscall.c +++ b/sys/src/9/omap/syscall.c @@ -78,6 +78,7 @@ noted(Ureg* cur, uintptr arg0) nf->arg0 = &nf->ureg; nf->ip = 0; cur->sp = PTR2UINT(nf); + cur->r0 = PTR2UINT(nf->arg0); break; default: up->lastnote.flag = NDebug; @@ -163,6 +164,8 @@ notify(Ureg* ureg) ureg->sp = sp; ureg->pc = PTR2UINT(up->notify); + ureg->r0 = PTR2UINT(nf->arg0); + up->notified = 1; up->nnote--; memmove(&up->lastnote, &up->note[0], sizeof(Note)); diff --git a/sys/src/9/teg2/syscall.c b/sys/src/9/teg2/syscall.c index 4bdfc4edb..be24849b2 100644 --- a/sys/src/9/teg2/syscall.c +++ b/sys/src/9/teg2/syscall.c @@ -84,6 +84,7 @@ noted(Ureg* cur, uintptr arg0) nf->arg0 = &nf->ureg; nf->ip = 0; cur->sp = PTR2UINT(nf); + cur->r0 = PTR2UINT(nf->arg0); break; default: up->lastnote.flag = NDebug; @@ -169,6 +170,7 @@ notify(Ureg* ureg) ureg->sp = sp; ureg->pc = PTR2UINT(up->notify); + ureg->r0 = PTR2UINT(nf->arg0); up->notified = 1; up->nnote--; diff --git a/sys/src/9/zynq/trap.c b/sys/src/9/zynq/trap.c index 54e445899..510860b63 100644 --- a/sys/src/9/zynq/trap.c +++ b/sys/src/9/zynq/trap.c @@ -423,6 +423,7 @@ noted(Ureg *ureg, ulong arg0) sp = oureg - 4 * BY2WD - ERRMAX; splhi(); ureg->sp = sp; + ureg->r0 = (uintptr) oureg; ((ulong *) sp)[1] = oureg; ((ulong *) sp)[0] = 0; break;