i 61 kernel/console.c int i; i 63 kernel/console.c for(i = 0; i < n; i++){ i 65 kernel/console.c if(either_copyin(&c, user_src, src+i, 1) == -1) i 70 kernel/console.c return i; i 26 kernel/exec.c int i, off; i 53 kernel/exec.c for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ i 150 kernel/exec.c uint i, n; i 153 kernel/exec.c for(i = 0; i < sz; i += PGSIZE){ i 154 kernel/exec.c pa = walkaddr(pagetable, va + i); i 157 kernel/exec.c if(sz - i < PGSIZE) i 158 kernel/exec.c n = sz - i; i 161 kernel/exec.c if(readi(ip, 0, (uint64)pa, offset+i, n) != n) i 156 kernel/file.c int i = 0; i 157 kernel/file.c while(i < n){ i 158 kernel/file.c int n1 = n - i; i 164 kernel/file.c if ((r = writei(f->ip, 1, addr + i, f->off, n1)) > 0) i 173 kernel/file.c i += r; i 175 kernel/file.c ret = (i == n ? n : -1); i 184 kernel/fs.c int i = 0; i 187 kernel/fs.c for(i = 0; i < NINODE; i++) { i 188 kernel/fs.c initsleeplock(&itable.inode[i].lock, "inode"); i 428 kernel/fs.c int i, j; i 432 kernel/fs.c for(i = 0; i < NDIRECT; i++){ i 433 kernel/fs.c if(ip->addrs[i]){ i 434 kernel/fs.c bfree(ip->dev, ip->addrs[i]); i 435 kernel/fs.c ip->addrs[i] = 0; i 45 kernel/fs.h #define IBLOCK(i, sb) ((i) / IPB + sb.inodestart) i 91 kernel/log.c int i; i 93 kernel/log.c for (i = 0; i < log.lh.n; i++) { i 94 kernel/log.c log.lh.block[i] = lh->block[i]; i 107 kernel/log.c int i; i 109 kernel/log.c for (i = 0; i < log.lh.n; i++) { i 110 kernel/log.c hb->block[i] = log.lh.block[i]; i 217 kernel/log.c int i; i 225 kernel/log.c for (i = 0; i < log.lh.n; i++) { i 226 kernel/log.c if (log.lh.block[i] == b->blockno) // log absorption i 229 kernel/log.c log.lh.block[i] = b->blockno; i 230 kernel/log.c if (i == log.lh.n) { // Add new block to log? i 79 kernel/pipe.c int i = 0; i 83 kernel/pipe.c while(i < n){ i 93 kernel/pipe.c if(copyin(pr->pagetable, &ch, addr + i, 1) == -1) i 96 kernel/pipe.c i++; i 102 kernel/pipe.c return i; i 108 kernel/pipe.c int i; i 120 kernel/pipe.c for(i = 0; i < n; i++){ //DOC: piperead-copy i 124 kernel/pipe.c if(copyout(pr->pagetable, addr + i, &ch, 1) == -1) i 129 kernel/pipe.c return i; i 32 kernel/printf.c int i; i 40 kernel/printf.c i = 0; i 42 kernel/printf.c buf[i++] = digits[x % base]; i 46 kernel/printf.c buf[i++] = '-'; i 48 kernel/printf.c while(--i >= 0) i 49 kernel/printf.c consputc(buf[i]); i 55 kernel/printf.c int i; i 58 kernel/printf.c for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) i 67 kernel/printf.c int i, cx, c0, c1, c2, locking; i 75 kernel/printf.c for(i = 0; (cx = fmt[i] & 0xff) != 0; i++){ i 80 kernel/printf.c i++; i 81 kernel/printf.c c0 = fmt[i+0] & 0xff; i 83 kernel/printf.c if(c0) c1 = fmt[i+1] & 0xff; i 84 kernel/printf.c if(c1) c2 = fmt[i+2] & 0xff; i 89 kernel/printf.c i += 1; i 92 kernel/printf.c i += 2; i 97 kernel/printf.c i += 1; i 100 kernel/printf.c i += 2; i 105 kernel/printf.c i += 1; i 108 kernel/printf.c i += 2; i 282 kernel/proc.c int i, pid; i 306 kernel/proc.c for(i = 0; i < NOFILE; i++) i 307 kernel/proc.c if(p->ofile[i]) i 308 kernel/proc.c np->ofile[i] = filedup(p->ofile[i]); i 7 kernel/string.c int i; i 8 kernel/string.c for(i = 0; i < n; i++){ i 9 kernel/string.c cdst[i] = c; i 438 kernel/sysfile.c int i; i 446 kernel/sysfile.c for(i=0;; i++){ i 447 kernel/sysfile.c if(i >= NELEM(argv)){ i 450 kernel/sysfile.c if(fetchaddr(uargv+sizeof(uint64)*i, (uint64*)&uarg) < 0){ i 454 kernel/sysfile.c argv[i] = 0; i 457 kernel/sysfile.c argv[i] = kalloc(); i 458 kernel/sysfile.c if(argv[i] == 0) i 460 kernel/sysfile.c if(fetchstr(uarg, argv[i], PGSIZE) < 0) i 466 kernel/sysfile.c for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) i 467 kernel/sysfile.c kfree(argv[i]); i 472 kernel/sysfile.c for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) i 473 kernel/sysfile.c kfree(argv[i]); i 145 kernel/virtio_disk.c for(int i = 0; i < NUM; i++) i 146 kernel/virtio_disk.c disk.free[i] = 1; i 159 kernel/virtio_disk.c for(int i = 0; i < NUM; i++){ i 160 kernel/virtio_disk.c if(disk.free[i]){ i 161 kernel/virtio_disk.c disk.free[i] = 0; i 162 kernel/virtio_disk.c return i; i 170 kernel/virtio_disk.c free_desc(int i) i 172 kernel/virtio_disk.c if(i >= NUM) i 174 kernel/virtio_disk.c if(disk.free[i]) i 176 kernel/virtio_disk.c disk.desc[i].addr = 0; i 177 kernel/virtio_disk.c disk.desc[i].len = 0; i 178 kernel/virtio_disk.c disk.desc[i].flags = 0; i 179 kernel/virtio_disk.c disk.desc[i].next = 0; i 180 kernel/virtio_disk.c disk.free[i] = 1; i 186 kernel/virtio_disk.c free_chain(int i) i 189 kernel/virtio_disk.c int flag = disk.desc[i].flags; i 190 kernel/virtio_disk.c int nxt = disk.desc[i].next; i 191 kernel/virtio_disk.c free_desc(i); i 193 kernel/virtio_disk.c i = nxt; i 204 kernel/virtio_disk.c for(int i = 0; i < 3; i++){ i 205 kernel/virtio_disk.c idx[i] = alloc_desc(); i 206 kernel/virtio_disk.c if(idx[i] < 0){ i 207 kernel/virtio_disk.c for(int j = 0; j < i; j++) i 282 kernel/vm.c for(int i = 0; i < 512; i++){ i 283 kernel/vm.c pte_t pte = pagetable[i]; i 288 kernel/vm.c pagetable[i] = 0; i 316 kernel/vm.c uint64 pa, i; i 320 kernel/vm.c for(i = 0; i < sz; i += PGSIZE){ i 321 kernel/vm.c if((pte = walk(old, i, 0)) == 0) i 330 kernel/vm.c if(mappages(new, i, PGSIZE, (uint64)mem, flags) != 0){ i 338 kernel/vm.c uvmunmap(new, 0, i / PGSIZE, 1); i 71 mkfs/mkfs.c int i, cc, fd; i 110 mkfs/mkfs.c for(i = 0; i < FSSIZE; i++) i 111 mkfs/mkfs.c wsect(i, zeroes); i 130 mkfs/mkfs.c for(i = 2; i < argc; i++){ i 133 mkfs/mkfs.c if(strncmp(argv[i], "user/", 5) == 0) i 134 mkfs/mkfs.c shortname = argv[i] + 5; i 136 mkfs/mkfs.c shortname = argv[i]; i 140 mkfs/mkfs.c if((fd = open(argv[i], 0)) < 0) i 141 mkfs/mkfs.c die(argv[i]); i 240 mkfs/mkfs.c int i; i 245 mkfs/mkfs.c for(i = 0; i < used; i++){ i 246 mkfs/mkfs.c buf[i/8] = buf[i/8] | (0x1 << (i%8)); i 27 user/cat.c int fd, i; i 34 user/cat.c for(i = 1; i < argc; i++){ i 35 user/cat.c if((fd = open(argv[i], O_RDONLY)) < 0){ i 36 user/cat.c fprintf(2, "cat: cannot open %s\n", argv[i]); i 8 user/echo.c int i; i 10 user/echo.c for(i = 1; i < argc; i++){ i 11 user/echo.c write(1, argv[i], strlen(argv[i])); i 12 user/echo.c if(i + 1 < argc){ i 40 user/grep.c int fd, i; i 54 user/grep.c for(i = 2; i < argc; i++){ i 55 user/grep.c if((fd = open(argv[i], O_RDONLY)) < 0){ i 56 user/grep.c printf("grep: cannot open %s\n", argv[i]); i 8 user/kill.c int i; i 14 user/kill.c for(i=1; i<argc; i++) i 15 user/kill.c kill(atoi(argv[i])); i 78 user/ls.c int i; i 84 user/ls.c for(i=1; i<argc; i++) i 85 user/ls.c ls(argv[i]); i 8 user/mkdir.c int i; i 15 user/mkdir.c for(i = 1; i < argc; i++){ i 16 user/mkdir.c if(mkdir(argv[i]) < 0){ i 17 user/mkdir.c fprintf(2, "mkdir: %s failed to create\n", argv[i]); i 19 user/printf.c int i, neg; i 30 user/printf.c i = 0; i 32 user/printf.c buf[i++] = digits[x % base]; i 35 user/printf.c buf[i++] = '-'; i 37 user/printf.c while(--i >= 0) i 38 user/printf.c putc(fd, buf[i]); i 43 user/printf.c int i; i 46 user/printf.c for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) i 55 user/printf.c int c0, c1, c2, i, state; i 58 user/printf.c for(i = 0; fmt[i]; i++){ i 59 user/printf.c c0 = fmt[i] & 0xff; i 68 user/printf.c if(c0) c1 = fmt[i+1] & 0xff; i 69 user/printf.c if(c1) c2 = fmt[i+2] & 0xff; i 74 user/printf.c i += 1; i 77 user/printf.c i += 2; i 82 user/printf.c i += 1; i 85 user/printf.c i += 2; i 90 user/printf.c i += 1; i 93 user/printf.c i += 2; i 8 user/rm.c int i; i 15 user/rm.c for(i = 1; i < argc; i++){ i 16 user/rm.c if(unlink(argv[i]) < 0){ i 17 user/rm.c fprintf(2, "rm: %s failed to delete\n", argv[i]); i 453 user/sh.c int i; i 466 user/sh.c for(i=0; ecmd->argv[i]; i++) i 467 user/sh.c *ecmd->eargv[i] = 0; i 19 user/stressfs.c int fd, i; i 26 user/stressfs.c for(i = 0; i < 4; i++) i 30 user/stressfs.c printf("write %d\n", i); i 32 user/stressfs.c path[8] += i; i 34 user/stressfs.c for(i = 0; i < 20; i++) i 42 user/stressfs.c for (i = 0; i < 20; i++) i 50 user/ulib.c int i; i 51 user/ulib.c for(i = 0; i < n; i++){ i 52 user/ulib.c cdst[i] = c; i 69 user/ulib.c int i, cc; i 72 user/ulib.c for(i=0; i+1 < max; ){ i 76 user/ulib.c buf[i++] = c; i 80 user/ulib.c buf[i] = '\0'; i 144 user/usertests.c for(int i = 0; i < MAXPATH; i++) i 145 user/usertests.c b[i] = 'x'; i 180 user/usertests.c for(int i = 0; i < PGSIZE; i++) i 181 user/usertests.c big[i] = 'x'; i 386 user/usertests.c for(int i = 0; i < 100; i++){ i 406 user/usertests.c for(int i = 0; i < 150; i++){ i 544 user/usertests.c int i; i 552 user/usertests.c for(i = 0; i < N; i++){ i 554 user/usertests.c printf("%s: error: write aa %d new file failed\n", s, i); i 558 user/usertests.c printf("%s: error: write bb %d new file failed\n", s, i); i 568 user/usertests.c i = read(fd, buf, N*SZ*2); i 569 user/usertests.c if(i != N*SZ*2){ i 584 user/usertests.c int i, fd, n; i 592 user/usertests.c for(i = 0; i < MAXFILE; i++){ i 593 user/usertests.c ((int*)buf)[0] = i; i 595 user/usertests.c printf("%s: error: write big file failed i=%d\n", s, i); i 610 user/usertests.c i = read(fd, buf, BSIZE); i 611 user/usertests.c if(i == 0){ i 617 user/usertests.c } else if(i != BSIZE){ i 618 user/usertests.c printf("%s: read failed %d\n", s, i); i 639 user/usertests.c int i, fd; i 645 user/usertests.c for(i = 0; i < N; i++){ i 646 user/usertests.c name[1] = '0' + i; i 652 user/usertests.c for(i = 0; i < N; i++){ i 653 user/usertests.c name[1] = '0' + i; i 742 user/usertests.c int seq, i, n, cc, total; i 754 user/usertests.c for(i = 0; i < SZ; i++) i 755 user/usertests.c buf[i] = seq++; i 767 user/usertests.c for(i = 0; i < n; i++){ i 768 user/usertests.c if((buf[i] & 0xff) != (seq++ & 0xff)){ i 798 user/usertests.c for(int i = 0; i < 100; i++){ i 881 user/usertests.c int i, pid; i 883 user/usertests.c for(i = 0; i < 100; i++){ i 895 user/usertests.c if(i != xstate) { i 900 user/usertests.c exit(i); i 912 user/usertests.c for(int i = 0; i < 200; i++){ i 939 user/usertests.c for(int i = 0; i < 1000; i++){ i 969 user/usertests.c for(int i = 0; i < N; i++){ i 991 user/usertests.c for(int i = 0; i < N; i++){ i 1038 user/usertests.c for(int i = 0; i < 800; i++){ i 1099 user/usertests.c int fd, pid, i, n, nc, np; i 1111 user/usertests.c for(i = 0; i < N; i++){ i 1134 user/usertests.c for(i = 0; i < sizeof(buf); i++){ i 1135 user/usertests.c if(buf[i] == 'c') i 1137 user/usertests.c if(buf[i] == 'p') i 1156 user/usertests.c int fd, pid, i, j, n, total, pi; i 1179 user/usertests.c for(i = 0; i < N; i++){ i 1196 user/usertests.c for(i = 0; i < NCHILD; i++){ i 1197 user/usertests.c fname = names[i]; i 1202 user/usertests.c if(buf[j] != '0'+i){ i 1223 user/usertests.c int pid, i, fd, pi; i 1236 user/usertests.c for(i = 0; i < N; i++){ i 1237 user/usertests.c name[1] = '0' + i; i 1244 user/usertests.c if(i > 0 && (i % 2 ) == 0){ i 1245 user/usertests.c name[1] = '0' + (i / 2); i 1264 user/usertests.c for(i = 0; i < N; i++){ i 1267 user/usertests.c name[1] = '0' + i; i 1269 user/usertests.c if((i == 0 || i >= N/2) && fd < 0){ i 1272 user/usertests.c } else if((i >= 1 && i < N/2) && fd >= 0){ i 1281 user/usertests.c for(i = 0; i < N; i++){ i 1284 user/usertests.c name[1] = '0' + i; i 1400 user/usertests.c int i, pid, n, fd; i 1409 user/usertests.c for(i = 0; i < N; i++){ i 1410 user/usertests.c file[1] = '0' + i; i 1413 user/usertests.c if(pid && (i % 3) == 1){ i 1415 user/usertests.c } else if(pid == 0 && (i % 5) == 1){ i 1442 user/usertests.c i = de.name[1] - '0'; i 1443 user/usertests.c if(i < 0 || i >= sizeof(fa)){ i 1447 user/usertests.c if(fa[i]){ i 1451 user/usertests.c fa[i] = 1; i 1462 user/usertests.c for(i = 0; i < N; i++){ i 1463 user/usertests.c file[1] = '0' + i; i 1469 user/usertests.c if(((i % 3) == 0 && pid == 0) || i 1470 user/usertests.c ((i % 3) == 1 && pid != 0)){ i 1497 user/usertests.c int pid, i; i 1507 user/usertests.c for(i = 0; i < 100; i++){ i 1717 user/usertests.c int i; i 1718 user/usertests.c for(i = 0; i < 2; i++){ i 1735 user/usertests.c int fd, i, total, cc; i 1743 user/usertests.c for(i = 0; i < N; i++){ i 1744 user/usertests.c memset(buf, i, SZ); i 1758 user/usertests.c for(i = 0; ; i++){ i 1770 user/usertests.c if(buf[0] != i/2 || buf[SZ/2-1] != i/2){ i 1927 user/usertests.c int i, fd; i 1929 user/usertests.c for(i = 0; i < NINODE + 1; i++){ i 1951 user/usertests.c for(i = 0; i < NINODE + 1; i++){ i 2003 user/usertests.c int i, pid, xstatus; i 2037 user/usertests.c for(i = 0; i < 5000; i++){ i 2040 user/usertests.c printf("%s: sbrk test failed %d %p %p\n", s, i, a, b); i 2177 user/usertests.c int i, xstatus; i 2188 user/usertests.c for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ i 2189 user/usertests.c if((pids[i] = fork()) == 0){ i 2196 user/usertests.c if(pids[i] != -1) i 2203 user/usertests.c for(i = 0; i < sizeof(pids)/sizeof(pids[0]); i++){ i 2204 user/usertests.c if(pids[i] == -1) i 2206 user/usertests.c kill(pids[i]); i 2227 user/usertests.c for (i = 0; i < 10*BIG; i += PGSIZE) { i 2228 user/usertests.c n += *(a+i); i 2290 user/usertests.c int i; i 2292 user/usertests.c for(i = 0; i < sizeof(uninit); i++){ i 2293 user/usertests.c if(uninit[i] != '\0'){ i 2312 user/usertests.c int i; i 2316 user/usertests.c for(i = 0; i < MAXARG-1; i++) i 2317 user/usertests.c args[i] = big; i 2579 user/usertests.c for(int i = 0; i < 50000; i++){ i 2666 user/usertests.c int i, fd; i 2678 user/usertests.c for(i = 0; i < N; i++){ i 2680 user/usertests.c name[1] = '0' + (i / 64); i 2681 user/usertests.c name[2] = '0' + (i % 64); i 2684 user/usertests.c printf("%s: bigdir i=%d link(bd, %s) failed\n", s, i, name); i 2690 user/usertests.c for(i = 0; i < N; i++){ i 2692 user/usertests.c name[1] = '0' + (i / 64); i 2693 user/usertests.c name[2] = '0' + (i % 64); i 2725 user/usertests.c for(int i = 0; i < ci+1; i++){ i 2767 user/usertests.c for(int i = 0; i < assumed_free; i++){ i 2815 user/usertests.c for(int i = 0; i < avail; i++) i 2854 user/usertests.c for(int i = 0; i < MAXFILE; i++){ i 2870 user/usertests.c for(int i = 0; i < nzz; i++){ i 2874 user/usertests.c name[2] = '0' + (i / 32); i 2875 user/usertests.c name[3] = '0' + (i % 32); i 2890 user/usertests.c for(int i = 0; i < nzz; i++){ i 2894 user/usertests.c name[2] = '0' + (i / 32); i 2895 user/usertests.c name[3] = '0' + (i % 32); i 2900 user/usertests.c for(int i = 0; '0' + i < 0177; i++){ i 2905 user/usertests.c name[3] = '0' + i; i 2915 user/usertests.c for(int i = 0; i < nzz; i++){ i 2919 user/usertests.c name[2] = '0' + (i / 32); i 2920 user/usertests.c name[3] = '0' + (i % 32); i 2931 user/usertests.c for(int i = 0; i < nzz; i++){ i 2935 user/usertests.c name[2] = '0' + (i / 32); i 2936 user/usertests.c name[3] = '0' + (i % 32); i 11 user/wc.c int i, n; i 17 user/wc.c for(i=0; i<n; i++){ i 19 user/wc.c if(buf[i] == '\n') i 21 user/wc.c if(strchr(" \r\t\n\v", buf[i])) i 39 user/wc.c int fd, i; i 46 user/wc.c for(i = 1; i < argc; i++){ i 47 user/wc.c if((fd = open(argv[i], O_RDONLY)) < 0){ i 48 user/wc.c printf("wc: cannot open %s\n", argv[i]); i 51 user/wc.c wc(fd, argv[i]);