]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/omap/syscall.c
kernel: stop the practice of passing DMDIR to devir() perm argument
[plan9front.git] / sys / src / 9 / omap / syscall.c
index e40a8217449ac7ff75b440bc179c0fe278c80ab2..882aef2cc82bb79e38dba823c70b59ebcaea2260 100644 (file)
@@ -78,18 +78,15 @@ noted(Ureg* cur, uintptr arg0)
                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);
        }
 }
@@ -108,7 +105,7 @@ notify(Ureg* ureg)
        NFrame *nf;
 
        if(up->procctl)
-               procctl(up);
+               procctl();
        if(up->nnote == 0)
                return 0;
 
@@ -127,9 +124,9 @@ notify(Ureg* ureg)
        }
 
        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);
        }
 
@@ -144,8 +141,8 @@ notify(Ureg* ureg)
                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);
        }
 
@@ -167,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));
@@ -200,7 +199,7 @@ syscall(Ureg* ureg)
 
        if(up->procctl == Proc_tracesyscall){
                up->procctl = Proc_stopme;
-               procctl(up);
+               procctl();
        }
 
        scallnr = ureg->r0;
@@ -226,7 +225,7 @@ syscall(Ureg* ureg)
 
        /*      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 */
@@ -251,9 +250,9 @@ syscall(Ureg* ureg)
        ureg->r0 = ret;
 
        if(up->procctl == Proc_tracesyscall){
-               up->procctl = Proc_stopme;
                s = splhi();
-               procctl(up);
+               up->procctl = Proc_stopme;
+               procctl();
                splx(s);
        }
 
@@ -275,8 +274,9 @@ syscall(Ureg* ureg)
        kexit(ureg);
 }
 
-long   /* void* */
-execregs(ulong entry, ulong ssize, ulong nargs)
+
+uintptr
+execregs(uintptr entry, ulong ssize, ulong nargs)
 {
        ulong *sp;
        Ureg *ureg;