nf->arg0 = &nf->ureg;
nf->ip = 0;
cur->sp = PTR2UINT(nf);
+ cur->r0 = PTR2UINT(nf->arg0);
break;
default:
- pprint("unknown noted arg %#p\n", arg0);
up->lastnote.flag = NDebug;
/*FALLTHROUGH*/
case NDFLT:
- if(up->lastnote.flag == NDebug){
- qunlock(&up->debug);
+ qunlock(&up->debug);
+ if(up->lastnote.flag == NDebug)
pprint("suicide: %s\n", up->lastnote.msg);
- }
- else
- qunlock(&up->debug);
pexit(up->lastnote.msg, up->lastnote.flag != NDebug);
}
}
NFrame *nf;
if(up->procctl)
- procctl(up);
+ procctl();
if(up->nnote == 0)
return 0;
}
if(n->flag != NUser && (up->notified || up->notify == 0)){
+ qunlock(&up->debug);
if(n->flag == NDebug)
pprint("suicide: %s\n", n->msg);
- qunlock(&up->debug);
pexit(n->msg, n->flag != NDebug);
}
pexit(n->msg, n->flag != NDebug);
}
if(!okaddr(PTR2UINT(up->notify), 1, 0)){
- pprint("suicide: notify function address %#p\n", up->notify);
qunlock(&up->debug);
+ pprint("suicide: notify function address %#p\n", up->notify);
pexit("Suicide", 0);
}
ureg->sp = sp;
ureg->pc = PTR2UINT(up->notify);
+ ureg->r0 = PTR2UINT(nf->arg0);
up->notified = 1;
up->nnote--;
scallnr = ureg->r0;
up->scallnr = scallnr;
- if(scallnr == RFORK)
- fpusysrfork(ureg);
spllo();
sp = ureg->sp;
syscallfmt(scallnr, ureg->pc, (va_list)(sp+BY2WD));
up->procctl = Proc_stopme;
- procctl(up);
+ procctl();
if (up->syscalltrace)
free(up->syscalltrace);
up->syscalltrace = nil;
/* iprint("%s: syscall %s\n", up->text, sysctab[scallnr]?sysctab[scallnr]:"huh?"); */
- ret = systab[scallnr](up->s.args);
+ ret = systab[scallnr]((va_list)up->s.args);
poperror();
}else{
/* failure: save the error buffer for errstr */
if(up->procctl == Proc_tracesyscall){
stopns = todget(nil);
- up->procctl = Proc_stopme;
sysretfmt(scallnr, (va_list)(sp+BY2WD), ret, startns, stopns);
s = splhi();
- procctl(up);
+ up->procctl = Proc_stopme;
+ procctl();
splx(s);
if(up->syscalltrace)
free(up->syscalltrace);
kexit(ureg);
}
-long
-execregs(ulong entry, ulong ssize, ulong nargs)
+uintptr
+execregs(uintptr entry, ulong ssize, ulong nargs)
{
ulong *sp;
Ureg *ureg;
/* Things from bottom of syscall which were never executed */
p->psstate = 0;
p->insyscall = 0;
-
- fpusysrforkchild(p, cureg, up);
}