p                  14 grep.c           char *p, *q;
p                  20 grep.c             p = buf;
p                  21 grep.c             while((q = strchr(p, '\n')) != 0){
p                  23 grep.c               if(match(pattern, p)){
p                  25 grep.c                 write(1, p, q+1 - p);
p                  27 grep.c               p = q+1;
p                  29 grep.c             if(p == buf)
p                  32 grep.c               m -= p - buf;
p                  33 grep.c               memmove(buf, p, m);
p                  49 kalloc.c         char *p;
p                  50 kalloc.c         p = (char*)PGROUNDUP((uint)vstart);
p                  51 kalloc.c         for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
p                  52 kalloc.c           kfree(p);
p                  10 ls.c             char *p;
p                  13 ls.c             for(p=path+strlen(path); p >= path && *p != '/'; p--)
p                  15 ls.c             p++;
p                  18 ls.c             if(strlen(p) >= DIRSIZ)
p                  19 ls.c               return p;
p                  20 ls.c             memmove(buf, p, strlen(p));
p                  21 ls.c             memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
p                  28 ls.c             char buf[512], *p;
p                  55 ls.c               p = buf+strlen(buf);
p                  56 ls.c               *p++ = '/';
p                  60 ls.c                 memmove(p, de.name, DIRSIZ);
p                  61 ls.c                 p[DIRSIZ] = 0;
p                  41 memide.c         uchar *p;
p                  52 memide.c         p = memdisk + b->blockno*BSIZE;
p                  56 memide.c           memmove(p, b->data, BSIZE);
p                  58 memide.c           memmove(b->data, p, BSIZE);
p                  42 mkfs.c         void iappend(uint inum, void *p, int n);
p                 258 mkfs.c           char *p = (char*)xp;
p                 289 mkfs.c             bcopy(p, buf + off - (fbn * BSIZE), n1);
p                 293 mkfs.c             p += n1;
p                  33 mmu.h            uint p : 1;          // Present
p                 156 mmu.h            uint p : 1;           // Present
p                 177 mmu.h            (gate).p = 1;                                           \
p                  33 mp.c             uchar *e, *p, *addr;
p                  37 mp.c             for(p = addr; p < e; p += sizeof(struct mp))
p                  38 mp.c               if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
p                  39 mp.c                 return (struct mp*)p;
p                  52 mp.c             uint p;
p                  56 mp.c             if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
p                  57 mp.c               if((mp = mpsearch1(p, 1024)))
p                  60 mp.c               p = ((bda[0x14]<<8)|bda[0x13])*1024;
p                  61 mp.c               if((mp = mpsearch1(p-1024, 1024)))
p                  94 mp.c             uchar *p, *e;
p                 105 mp.c             for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
p                 106 mp.c               switch(*p){
p                 108 mp.c                 proc = (struct mpproc*)p;
p                 113 mp.c                 p += sizeof(struct mpproc);
p                 116 mp.c                 ioapic = (struct mpioapic*)p;
p                 118 mp.c                 p += sizeof(struct mpioapic);
p                 123 mp.c                 p += 8;
p                  25 pipe.c           struct pipe *p;
p                  27 pipe.c           p = 0;
p                  31 pipe.c           if((p = (struct pipe*)kalloc()) == 0)
p                  33 pipe.c           p->readopen = 1;
p                  34 pipe.c           p->writeopen = 1;
p                  35 pipe.c           p->nwrite = 0;
p                  36 pipe.c           p->nread = 0;
p                  37 pipe.c           initlock(&p->lock, "pipe");
p                  41 pipe.c           (*f0)->pipe = p;
p                  45 pipe.c           (*f1)->pipe = p;
p                  50 pipe.c           if(p)
p                  51 pipe.c             kfree((char*)p);
p                  60 pipe.c         pipeclose(struct pipe *p, int writable)
p                  62 pipe.c           acquire(&p->lock);
p                  64 pipe.c             p->writeopen = 0;
p                  65 pipe.c             wakeup(&p->nread);
p                  67 pipe.c             p->readopen = 0;
p                  68 pipe.c             wakeup(&p->nwrite);
p                  70 pipe.c           if(p->readopen == 0 && p->writeopen == 0){
p                  71 pipe.c             release(&p->lock);
p                  72 pipe.c             kfree((char*)p);
p                  74 pipe.c             release(&p->lock);
p                  79 pipe.c         pipewrite(struct pipe *p, char *addr, int n)
p                  83 pipe.c           acquire(&p->lock);
p                  85 pipe.c             while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
p                  86 pipe.c               if(p->readopen == 0 || myproc()->killed){
p                  87 pipe.c                 release(&p->lock);
p                  90 pipe.c               wakeup(&p->nread);
p                  91 pipe.c               sleep(&p->nwrite, &p->lock);  //DOC: pipewrite-sleep
p                  93 pipe.c             p->data[p->nwrite++ % PIPESIZE] = addr[i];
p                  95 pipe.c           wakeup(&p->nread);  //DOC: pipewrite-wakeup1
p                  96 pipe.c           release(&p->lock);
p                 101 pipe.c         piperead(struct pipe *p, char *addr, int n)
p                 105 pipe.c           acquire(&p->lock);
p                 106 pipe.c           while(p->nread == p->nwrite && p->writeopen){  //DOC: pipe-empty
p                 108 pipe.c               release(&p->lock);
p                 111 pipe.c             sleep(&p->nread, &p->lock); //DOC: piperead-sleep
p                 114 pipe.c             if(p->nread == p->nwrite)
p                 116 pipe.c             addr[i] = p->data[p->nread++ % PIPESIZE];
p                 118 pipe.c           wakeup(&p->nwrite);  //DOC: piperead-wakeup
p                 119 pipe.c           release(&p->lock);
p                  60 proc.c           struct proc *p;
p                  63 proc.c           p = c->proc;
p                  65 proc.c           return p;
p                  76 proc.c           struct proc *p;
p                  81 proc.c           for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
p                  82 proc.c             if(p->state == UNUSED)
p                  89 proc.c           p->state = EMBRYO;
p                  90 proc.c           p->pid = nextpid++;
p                  95 proc.c           if((p->kstack = kalloc()) == 0){
p                  96 proc.c             p->state = UNUSED;
p                  99 proc.c           sp = p->kstack + KSTACKSIZE;
p                 102 proc.c           sp -= sizeof *p->tf;
p                 103 proc.c           p->tf = (struct trapframe*)sp;
p                 110 proc.c           sp -= sizeof *p->context;
p                 111 proc.c           p->context = (struct context*)sp;
p                 112 proc.c           memset(p->context, 0, sizeof *p->context);
p                 113 proc.c           p->context->eip = (uint)forkret;
p                 115 proc.c           return p;
p                 123 proc.c           struct proc *p;
p                 126 proc.c           p = allocproc();
p                 128 proc.c           initproc = p;
p                 129 proc.c           if((p->pgdir = setupkvm()) == 0)
p                 131 proc.c           inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
p                 132 proc.c           p->sz = PGSIZE;
p                 133 proc.c           memset(p->tf, 0, sizeof(*p->tf));
p                 134 proc.c           p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
p                 135 proc.c           p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
p                 136 proc.c           p->tf->es = p->tf->ds;
p                 137 proc.c           p->tf->ss = p->tf->ds;
p                 138 proc.c           p->tf->eflags = FL_IF;
p                 139 proc.c           p->tf->esp = PGSIZE;
p                 140 proc.c           p->tf->eip = 0;  // beginning of initcode.S
p                 142 proc.c           safestrcpy(p->name, "initcode", sizeof(p->name));
p                 143 proc.c           p->cwd = namei("/");
p                 151 proc.c           p->state = RUNNABLE;
p                 231 proc.c           struct proc *p;
p                 256 proc.c           for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
p                 257 proc.c             if(p->parent == curproc){
p                 258 proc.c               p->parent = initproc;
p                 259 proc.c               if(p->state == ZOMBIE)
p                 275 proc.c           struct proc *p;
p                 283 proc.c             for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
p                 284 proc.c               if(p->parent != curproc)
p                 287 proc.c               if(p->state == ZOMBIE){
p                 289 proc.c                 pid = p->pid;
p                 290 proc.c                 kfree(p->kstack);
p                 291 proc.c                 p->kstack = 0;
p                 292 proc.c                 freevm(p->pgdir);
p                 293 proc.c                 p->pid = 0;
p                 294 proc.c                 p->parent = 0;
p                 295 proc.c                 p->name[0] = 0;
p                 296 proc.c                 p->killed = 0;
p                 297 proc.c                 p->state = UNUSED;
p                 325 proc.c           struct proc *p;
p                 335 proc.c             for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
p                 336 proc.c               if(p->state != RUNNABLE)
p                 342 proc.c               c->proc = p;
p                 343 proc.c               switchuvm(p);
p                 344 proc.c               p->state = RUNNING;
p                 346 proc.c               swtch(&(c->scheduler), p->context);
p                 369 proc.c           struct proc *p = myproc();
p                 375 proc.c           if(p->state == RUNNING)
p                 380 proc.c           swtch(&p->context, mycpu()->scheduler);
p                 420 proc.c           struct proc *p = myproc();
p                 422 proc.c           if(p == 0)
p                 439 proc.c           p->chan = chan;
p                 440 proc.c           p->state = SLEEPING;
p                 445 proc.c           p->chan = 0;
p                 460 proc.c           struct proc *p;
p                 462 proc.c           for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
p                 463 proc.c             if(p->state == SLEEPING && p->chan == chan)
p                 464 proc.c               p->state = RUNNABLE;
p                 482 proc.c           struct proc *p;
p                 485 proc.c           for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
p                 486 proc.c             if(p->pid == pid){
p                 487 proc.c               p->killed = 1;
p                 489 proc.c               if(p->state == SLEEPING)
p                 490 proc.c                 p->state = RUNNABLE;
p                 515 proc.c           struct proc *p;
p                 519 proc.c           for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
p                 520 proc.c             if(p->state == UNUSED)
p                 522 proc.c             if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
p                 523 proc.c               state = states[p->state];
p                 526 proc.c             cprintf("%d %s %s", p->pid, state, p->name);
p                 527 proc.c             if(p->state == SLEEPING){
p                 528 proc.c               getcallerpcs((uint*)p->context->ebp+2, pc);
p                  60 sh.c             int p[2];
p                 102 sh.c               if(pipe(p) < 0)
p                 106 sh.c                 dup(p[1]);
p                 107 sh.c                 close(p[0]);
p                 108 sh.c                 close(p[1]);
p                 113 sh.c                 dup(p[0]);
p                 114 sh.c                 close(p[0]);
p                 115 sh.c                 close(p[1]);
p                 118 sh.c               close(p[0]);
p                 119 sh.c               close(p[1]);
p                  59 string.c       strncmp(const char *p, const char *q, uint n)
p                  61 string.c         while(n > 0 && *p && *p == *q)
p                  62 string.c           n--, p++, q++;
p                  65 string.c         return (uchar)*p - (uchar)*q;
p                  74 sysfile.c        char *p;
p                  76 sysfile.c        if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
p                  78 sysfile.c        return fileread(f, p, n);
p                  86 sysfile.c        char *p;
p                  88 sysfile.c        if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
p                  90 sysfile.c        return filewrite(f, p, n);
p                  22 uart.c           char *p;
p                  47 uart.c           for(p="xv6...\n"; *p; p++)
p                  48 uart.c             uartputc(*p);
p                  19 ulib.c         strcmp(const char *p, const char *q)
p                  21 ulib.c           while(*p && *p == *q)
p                  22 ulib.c             p++, q++;
p                  23 ulib.c           return (uchar)*p - (uchar)*q;
p                  27 umalloc.c        Header *bp, *p;
p                  30 umalloc.c        for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
p                  31 umalloc.c          if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
p                  33 umalloc.c        if(bp + bp->s.size == p->s.ptr){
p                  34 umalloc.c          bp->s.size += p->s.ptr->s.size;
p                  35 umalloc.c          bp->s.ptr = p->s.ptr->s.ptr;
p                  37 umalloc.c          bp->s.ptr = p->s.ptr;
p                  38 umalloc.c        if(p + p->s.size == bp){
p                  39 umalloc.c          p->s.size += bp->s.size;
p                  40 umalloc.c          p->s.ptr = bp->s.ptr;
p                  42 umalloc.c          p->s.ptr = bp;
p                  43 umalloc.c        freep = p;
p                  49 umalloc.c        char *p;
p                  54 umalloc.c        p = sbrk(nu * sizeof(Header));
p                  55 umalloc.c        if(p == (char*)-1)
p                  57 umalloc.c        hp = (Header*)p;
p                  66 umalloc.c        Header *p, *prevp;
p                  74 umalloc.c        for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
p                  75 umalloc.c          if(p->s.size >= nunits){
p                  76 umalloc.c            if(p->s.size == nunits)
p                  77 umalloc.c              prevp->s.ptr = p->s.ptr;
p                  79 umalloc.c              p->s.size -= nunits;
p                  80 umalloc.c              p += p->s.size;
p                  81 umalloc.c              p->s.size = nunits;
p                  84 umalloc.c            return (void*)(p + 1);
p                  86 umalloc.c          if(p == freep)
p                  87 umalloc.c            if((p = morecore(nunits)) == 0)
p                1418 usertests.c      char *a, *b, *c, *lastaddr, *oldbrk, *p, scratch;
p                1455 usertests.c      p = sbrk(amt);
p                1456 usertests.c      if (p != a) {
p                1550 usertests.c    validateint(int *p)
p                1558 usertests.c          "a" (SYS_sleep), "n" (T_SYSCALL), "c" (p) :
p                1566 usertests.c      uint p;
p                1571 usertests.c      for(p = 0; p <= (uint)hi; p += 4096){
p                1574 usertests.c          validateint((int*)p);
p                1583 usertests.c        if(link("nosuchfile", (char*)p) != -1){
p                 157 vm.c           switchuvm(struct proc *p)
p                 159 vm.c             if(p == 0)
p                 161 vm.c             if(p->kstack == 0)
p                 163 vm.c             if(p->pgdir == 0)
p                 171 vm.c             mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE;
p                 176 vm.c             lcr3(V2P(p->pgdir));  // switch to process's address space
p                 366 vm.c           copyout(pde_t *pgdir, uint va, void *p, uint len)
p                 371 vm.c             buf = (char*)p;
p                  63 x86.h          lgdt(struct segdesc *p, int size)
p                  68 x86.h            pd[1] = (uint)p;
p                  69 x86.h            pd[2] = (uint)p >> 16;
p                  77 x86.h          lidt(struct gatedesc *p, int size)
p                  82 x86.h            pd[1] = (uint)p;
p                  83 x86.h            pd[2] = (uint)p >> 16;