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 48 kalloc.c char *p; p 49 kalloc.c p = (char*)PGROUNDUP((uint)vstart); p 50 kalloc.c for(; p + PGSIZE <= (char*)vend; p += PGSIZE) p 51 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 40 memide.c uchar *p; p 51 memide.c p = memdisk + b->blockno*BSIZE; p 55 memide.c memmove(p, b->data, BSIZE); p 57 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 59 mmu.h uint p : 1; // Present p 201 mmu.h uint p : 1; // Present p 222 mmu.h (gate).p = 1; \ p 41 mp.c uchar *e, *p, *addr; p 45 mp.c for(p = addr; p < e; p += sizeof(struct mp)) p 46 mp.c if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0) p 47 mp.c return (struct mp*)p; p 60 mp.c uint p; p 64 mp.c if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){ p 65 mp.c if((mp = mpsearch1(p, 1024))) p 68 mp.c p = ((bda[0x14]<<8)|bda[0x13])*1024; p 69 mp.c if((mp = mpsearch1(p-1024, 1024))) p 102 mp.c uchar *p, *e; p 113 mp.c for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){ p 114 mp.c switch(*p){ p 116 mp.c proc = (struct mpproc*)p; p 125 mp.c p += sizeof(struct mpproc); p 128 mp.c ioapic = (struct mpioapic*)p; p 130 mp.c p += sizeof(struct mpioapic); p 135 mp.c p += 8; p 138 mp.c cprintf("mpinit: unknown config type %x\n", *p); p 24 pipe.c struct pipe *p; p 26 pipe.c p = 0; p 30 pipe.c if((p = (struct pipe*)kalloc()) == 0) p 32 pipe.c p->readopen = 1; p 33 pipe.c p->writeopen = 1; p 34 pipe.c p->nwrite = 0; p 35 pipe.c p->nread = 0; p 36 pipe.c initlock(&p->lock, "pipe"); p 40 pipe.c (*f0)->pipe = p; p 44 pipe.c (*f1)->pipe = p; p 49 pipe.c if(p) p 50 pipe.c kfree((char*)p); p 59 pipe.c pipeclose(struct pipe *p, int writable) p 61 pipe.c acquire(&p->lock); p 63 pipe.c p->writeopen = 0; p 64 pipe.c wakeup(&p->nread); p 66 pipe.c p->readopen = 0; p 67 pipe.c wakeup(&p->nwrite); p 69 pipe.c if(p->readopen == 0 && p->writeopen == 0){ p 70 pipe.c release(&p->lock); p 71 pipe.c kfree((char*)p); p 73 pipe.c release(&p->lock); p 78 pipe.c pipewrite(struct pipe *p, char *addr, int n) p 82 pipe.c acquire(&p->lock); p 84 pipe.c while(p->nwrite == p->nread + PIPESIZE){ //DOC: pipewrite-full p 85 pipe.c if(p->readopen == 0 || proc->killed){ p 86 pipe.c release(&p->lock); p 89 pipe.c wakeup(&p->nread); p 90 pipe.c sleep(&p->nwrite, &p->lock); //DOC: pipewrite-sleep p 92 pipe.c p->data[p->nwrite++ % PIPESIZE] = addr[i]; p 94 pipe.c wakeup(&p->nread); //DOC: pipewrite-wakeup1 p 95 pipe.c release(&p->lock); p 100 pipe.c piperead(struct pipe *p, char *addr, int n) p 104 pipe.c acquire(&p->lock); p 105 pipe.c while(p->nread == p->nwrite && p->writeopen){ //DOC: pipe-empty p 107 pipe.c release(&p->lock); p 110 pipe.c sleep(&p->nread, &p->lock); //DOC: piperead-sleep p 113 pipe.c if(p->nread == p->nwrite) p 115 pipe.c addr[i] = p->data[p->nread++ % PIPESIZE]; p 117 pipe.c wakeup(&p->nwrite); //DOC: piperead-wakeup p 118 pipe.c release(&p->lock); p 37 proc.c struct proc *p; p 41 proc.c for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) p 42 proc.c if(p->state == UNUSED) p 48 proc.c p->state = EMBRYO; p 49 proc.c p->pid = nextpid++; p 53 proc.c if((p->kstack = kalloc()) == 0){ p 54 proc.c p->state = UNUSED; p 57 proc.c sp = p->kstack + KSTACKSIZE; p 60 proc.c sp -= sizeof *p->tf; p 61 proc.c p->tf = (struct trapframe*)sp; p 68 proc.c sp -= sizeof *p->context; p 69 proc.c p->context = (struct context*)sp; p 70 proc.c memset(p->context, 0, sizeof *p->context); p 71 proc.c p->context->eip = (uint)forkret; p 73 proc.c return p; p 81 proc.c struct proc *p; p 84 proc.c p = allocproc(); p 85 proc.c initproc = p; p 86 proc.c if((p->pgdir = setupkvm()) == 0) p 88 proc.c inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size); p 89 proc.c p->sz = PGSIZE; p 90 proc.c memset(p->tf, 0, sizeof(*p->tf)); p 91 proc.c p->tf->cs = (SEG_UCODE << 3) | DPL_USER; p 92 proc.c p->tf->ds = (SEG_UDATA << 3) | DPL_USER; p 93 proc.c p->tf->es = p->tf->ds; p 94 proc.c p->tf->ss = p->tf->ds; p 95 proc.c p->tf->eflags = FL_IF; p 96 proc.c p->tf->esp = PGSIZE; p 97 proc.c p->tf->eip = 0; // beginning of initcode.S p 99 proc.c safestrcpy(p->name, "initcode", sizeof(p->name)); p 100 proc.c p->cwd = namei("/"); p 102 proc.c p->state = RUNNABLE; p 175 proc.c struct proc *p; p 200 proc.c for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ p 201 proc.c if(p->parent == proc){ p 202 proc.c p->parent = initproc; p 203 proc.c if(p->state == ZOMBIE) p 219 proc.c struct proc *p; p 226 proc.c for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ p 227 proc.c if(p->parent != proc) p 230 proc.c if(p->state == ZOMBIE){ p 232 proc.c pid = p->pid; p 233 proc.c kfree(p->kstack); p 234 proc.c p->kstack = 0; p 235 proc.c freevm(p->pgdir); p 236 proc.c p->state = UNUSED; p 237 proc.c p->pid = 0; p 238 proc.c p->parent = 0; p 239 proc.c p->name[0] = 0; p 240 proc.c p->killed = 0; p 268 proc.c struct proc *p; p 276 proc.c for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ p 277 proc.c if(p->state != RUNNABLE) p 283 proc.c proc = p; p 284 proc.c switchuvm(p); p 285 proc.c p->state = RUNNING; p 392 proc.c struct proc *p; p 394 proc.c for(p = ptable.proc; p < &ptable.proc[NPROC]; p++) p 395 proc.c if(p->state == SLEEPING && p->chan == chan) p 396 proc.c p->state = RUNNABLE; p 414 proc.c struct proc *p; p 417 proc.c for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ p 418 proc.c if(p->pid == pid){ p 419 proc.c p->killed = 1; p 421 proc.c if(p->state == SLEEPING) p 422 proc.c p->state = RUNNABLE; p 447 proc.c struct proc *p; p 451 proc.c for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){ p 452 proc.c if(p->state == UNUSED) p 454 proc.c if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) p 455 proc.c state = states[p->state]; p 458 proc.c cprintf("%d %s %s", p->pid, state, p->name); p 459 proc.c if(p->state == SLEEPING){ p 460 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 71 sysfile.c char *p; p 73 sysfile.c if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) p 75 sysfile.c return fileread(f, p, n); p 83 sysfile.c char *p; p 85 sysfile.c if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0) p 87 sysfile.c return filewrite(f, p, n); p 21 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 165 vm.c switchuvm(struct proc *p) p 173 vm.c if(p->pgdir == 0) p 175 vm.c lcr3(v2p(p->pgdir)); // switch to new address space p 358 vm.c copyout(pde_t *pgdir, uint va, void *p, uint len) p 363 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;