pi 25 kernel/pipe.c struct pipe *pi; pi 27 kernel/pipe.c pi = 0; pi 31 kernel/pipe.c if((pi = (struct pipe*)kalloc()) == 0) pi 33 kernel/pipe.c pi->readopen = 1; pi 34 kernel/pipe.c pi->writeopen = 1; pi 35 kernel/pipe.c pi->nwrite = 0; pi 36 kernel/pipe.c pi->nread = 0; pi 37 kernel/pipe.c initlock(&pi->lock, "pipe"); pi 41 kernel/pipe.c (*f0)->pipe = pi; pi 45 kernel/pipe.c (*f1)->pipe = pi; pi 49 kernel/pipe.c if(pi) pi 50 kernel/pipe.c kfree((char*)pi); pi 59 kernel/pipe.c pipeclose(struct pipe *pi, int writable) pi 61 kernel/pipe.c acquire(&pi->lock); pi 63 kernel/pipe.c pi->writeopen = 0; pi 64 kernel/pipe.c wakeup(&pi->nread); pi 66 kernel/pipe.c pi->readopen = 0; pi 67 kernel/pipe.c wakeup(&pi->nwrite); pi 69 kernel/pipe.c if(pi->readopen == 0 && pi->writeopen == 0){ pi 70 kernel/pipe.c release(&pi->lock); pi 71 kernel/pipe.c kfree((char*)pi); pi 73 kernel/pipe.c release(&pi->lock); pi 77 kernel/pipe.c pipewrite(struct pipe *pi, uint64 addr, int n) pi 82 kernel/pipe.c acquire(&pi->lock); pi 84 kernel/pipe.c if(pi->readopen == 0 || killed(pr)){ pi 85 kernel/pipe.c release(&pi->lock); pi 88 kernel/pipe.c if(pi->nwrite == pi->nread + PIPESIZE){ //DOC: pipewrite-full pi 89 kernel/pipe.c wakeup(&pi->nread); pi 90 kernel/pipe.c sleep(&pi->nwrite, &pi->lock); pi 95 kernel/pipe.c pi->data[pi->nwrite++ % PIPESIZE] = ch; pi 99 kernel/pipe.c wakeup(&pi->nread); pi 100 kernel/pipe.c release(&pi->lock); pi 106 kernel/pipe.c piperead(struct pipe *pi, uint64 addr, int n) pi 112 kernel/pipe.c acquire(&pi->lock); pi 113 kernel/pipe.c while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty pi 115 kernel/pipe.c release(&pi->lock); pi 118 kernel/pipe.c sleep(&pi->nread, &pi->lock); //DOC: piperead-sleep pi 121 kernel/pipe.c if(pi->nread == pi->nwrite) pi 123 kernel/pipe.c ch = pi->data[pi->nread++ % PIPESIZE]; pi 127 kernel/pipe.c wakeup(&pi->nwrite); //DOC: piperead-wakeup pi 128 kernel/pipe.c release(&pi->lock); pi 1156 user/usertests.c int fd, pid, i, j, n, total, pi; pi 1161 user/usertests.c for(pi = 0; pi < NCHILD; pi++){ pi 1162 user/usertests.c fname = names[pi]; pi 1178 user/usertests.c memset(buf, '0'+pi, SZ); pi 1190 user/usertests.c for(pi = 0; pi < NCHILD; pi++){ pi 1223 user/usertests.c int pid, i, fd, pi; pi 1226 user/usertests.c for(pi = 0; pi < NCHILD; pi++){ pi 1234 user/usertests.c name[0] = 'p' + pi; pi 1257 user/usertests.c for(pi = 0; pi < NCHILD; pi++){ pi 1265 user/usertests.c for(pi = 0; pi < NCHILD; pi++){ pi 1266 user/usertests.c name[0] = 'p' + pi; pi 1282 user/usertests.c for(pi = 0; pi < NCHILD; pi++){ pi 1283 user/usertests.c name[0] = 'p' + pi;