--- xinu/sys/preceive.c 2018/04/24 17:39:04 1.1 +++ xinu/sys/preceive.c 2018/04/24 17:39:49 1.1.1.2 @@ -12,19 +12,21 @@ SYSCALL preceive(portid) int portid; { - PStype ps; struct pt *ptptr; int seq; - int msg; + WORD msg; struct ptnode *nxtnode; - disable(ps); +#ifdef DEBUG + dotrace("preceive", &portid, 1); +#endif + disable(); if ( isbadport(portid) || #ifdef MEMMARK unmarked(ptmark) || #endif (ptptr= &ports[portid])->ptstate != PTALLOC ) { - restore(ps); + restore(); return(SYSERR); } @@ -33,7 +35,7 @@ int portid; seq = ptptr->ptseq; if (wait(ptptr->ptrsem) == SYSERR || ptptr->ptstate != PTALLOC || ptptr->ptseq != seq) { - restore(ps); + restore(); return(SYSERR); } @@ -42,12 +44,12 @@ int portid; nxtnode = ptptr->pthead; msg = nxtnode->ptmsg; if (ptptr->pthead == ptptr->pttail) /* delete last item */ - ptptr->pthead = ptptr->pttail = (struct ptnode *) NULL; + ptptr->pthead = ptptr->pttail = (struct ptnode *)NULL; else ptptr->pthead = nxtnode->ptnext; nxtnode->ptnext = ptfree; /* return to free list */ ptfree = nxtnode; signal(ptptr->ptssem); - restore(ps); + restore(); return(msg); }