x 26 kernel/console.c #define C(x) ((x)-'@') // Control-x x 189 kernel/defs.h #define NELEM(x) (sizeof(x)/sizeof((x)[0])) x 33 kernel/printf.c uint x; x 36 kernel/printf.c x = -xx; x 38 kernel/printf.c x = xx; x 42 kernel/printf.c buf[i++] = digits[x % base]; x 43 kernel/printf.c } while((x /= base) != 0); x 53 kernel/printf.c printptr(uint64 x) x 58 kernel/printf.c for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) x 59 kernel/printf.c consputc(digits[x >> (sizeof(uint64) * 8 - 4)]); x 7 kernel/riscv.h uint64 x; x 8 kernel/riscv.h asm volatile("csrr %0, mhartid" : "=r" (x) ); x 9 kernel/riscv.h return x; x 23 kernel/riscv.h uint64 x; x 24 kernel/riscv.h asm volatile("csrr %0, mstatus" : "=r" (x) ); x 25 kernel/riscv.h return x; x 29 kernel/riscv.h w_mstatus(uint64 x) x 31 kernel/riscv.h asm volatile("csrw mstatus, %0" : : "r" (x)); x 38 kernel/riscv.h w_mepc(uint64 x) x 40 kernel/riscv.h asm volatile("csrw mepc, %0" : : "r" (x)); x 54 kernel/riscv.h uint64 x; x 55 kernel/riscv.h asm volatile("csrr %0, sstatus" : "=r" (x) ); x 56 kernel/riscv.h return x; x 60 kernel/riscv.h w_sstatus(uint64 x) x 62 kernel/riscv.h asm volatile("csrw sstatus, %0" : : "r" (x)); x 69 kernel/riscv.h uint64 x; x 70 kernel/riscv.h asm volatile("csrr %0, sip" : "=r" (x) ); x 71 kernel/riscv.h return x; x 75 kernel/riscv.h w_sip(uint64 x) x 77 kernel/riscv.h asm volatile("csrw sip, %0" : : "r" (x)); x 87 kernel/riscv.h uint64 x; x 88 kernel/riscv.h asm volatile("csrr %0, sie" : "=r" (x) ); x 89 kernel/riscv.h return x; x 93 kernel/riscv.h w_sie(uint64 x) x 95 kernel/riscv.h asm volatile("csrw sie, %0" : : "r" (x)); x 105 kernel/riscv.h uint64 x; x 106 kernel/riscv.h asm volatile("csrr %0, mie" : "=r" (x) ); x 107 kernel/riscv.h return x; x 111 kernel/riscv.h w_mie(uint64 x) x 113 kernel/riscv.h asm volatile("csrw mie, %0" : : "r" (x)); x 120 kernel/riscv.h w_sepc(uint64 x) x 122 kernel/riscv.h asm volatile("csrw sepc, %0" : : "r" (x)); x 128 kernel/riscv.h uint64 x; x 129 kernel/riscv.h asm volatile("csrr %0, sepc" : "=r" (x) ); x 130 kernel/riscv.h return x; x 137 kernel/riscv.h uint64 x; x 138 kernel/riscv.h asm volatile("csrr %0, medeleg" : "=r" (x) ); x 139 kernel/riscv.h return x; x 143 kernel/riscv.h w_medeleg(uint64 x) x 145 kernel/riscv.h asm volatile("csrw medeleg, %0" : : "r" (x)); x 152 kernel/riscv.h uint64 x; x 153 kernel/riscv.h asm volatile("csrr %0, mideleg" : "=r" (x) ); x 154 kernel/riscv.h return x; x 158 kernel/riscv.h w_mideleg(uint64 x) x 160 kernel/riscv.h asm volatile("csrw mideleg, %0" : : "r" (x)); x 166 kernel/riscv.h w_stvec(uint64 x) x 168 kernel/riscv.h asm volatile("csrw stvec, %0" : : "r" (x)); x 174 kernel/riscv.h uint64 x; x 175 kernel/riscv.h asm volatile("csrr %0, stvec" : "=r" (x) ); x 176 kernel/riscv.h return x; x 181 kernel/riscv.h w_mtvec(uint64 x) x 183 kernel/riscv.h asm volatile("csrw mtvec, %0" : : "r" (x)); x 188 kernel/riscv.h w_pmpcfg0(uint64 x) x 190 kernel/riscv.h asm volatile("csrw pmpcfg0, %0" : : "r" (x)); x 194 kernel/riscv.h w_pmpaddr0(uint64 x) x 196 kernel/riscv.h asm volatile("csrw pmpaddr0, %0" : : "r" (x)); x 207 kernel/riscv.h w_satp(uint64 x) x 209 kernel/riscv.h asm volatile("csrw satp, %0" : : "r" (x)); x 215 kernel/riscv.h uint64 x; x 216 kernel/riscv.h asm volatile("csrr %0, satp" : "=r" (x) ); x 217 kernel/riscv.h return x; x 221 kernel/riscv.h w_mscratch(uint64 x) x 223 kernel/riscv.h asm volatile("csrw mscratch, %0" : : "r" (x)); x 230 kernel/riscv.h uint64 x; x 231 kernel/riscv.h asm volatile("csrr %0, scause" : "=r" (x) ); x 232 kernel/riscv.h return x; x 239 kernel/riscv.h uint64 x; x 240 kernel/riscv.h asm volatile("csrr %0, stval" : "=r" (x) ); x 241 kernel/riscv.h return x; x 246 kernel/riscv.h w_mcounteren(uint64 x) x 248 kernel/riscv.h asm volatile("csrw mcounteren, %0" : : "r" (x)); x 254 kernel/riscv.h uint64 x; x 255 kernel/riscv.h asm volatile("csrr %0, mcounteren" : "=r" (x) ); x 256 kernel/riscv.h return x; x 263 kernel/riscv.h uint64 x; x 264 kernel/riscv.h asm volatile("csrr %0, time" : "=r" (x) ); x 265 kernel/riscv.h return x; x 286 kernel/riscv.h uint64 x = r_sstatus(); x 287 kernel/riscv.h return (x & SSTATUS_SIE) != 0; x 293 kernel/riscv.h uint64 x; x 294 kernel/riscv.h asm volatile("mv %0, sp" : "=r" (x) ); x 295 kernel/riscv.h return x; x 303 kernel/riscv.h uint64 x; x 304 kernel/riscv.h asm volatile("mv %0, tp" : "=r" (x) ); x 305 kernel/riscv.h return x; x 309 kernel/riscv.h w_tp(uint64 x) x 311 kernel/riscv.h asm volatile("mv tp, %0" : : "r" (x)); x 317 kernel/riscv.h uint64 x; x 318 kernel/riscv.h asm volatile("mv %0, ra" : "=r" (x) ); x 319 kernel/riscv.h return x; x 24 kernel/start.c unsigned long x = r_mstatus(); x 25 kernel/start.c x &= ~MSTATUS_MPP_MASK; x 26 kernel/start.c x |= MSTATUS_MPP_S; x 27 kernel/start.c w_mstatus(x); x 114 kernel/trap.c unsigned long x = r_sstatus(); x 115 kernel/trap.c x &= ~SSTATUS_SPP; // clear SPP to 0 for user mode x 116 kernel/trap.c x |= SSTATUS_SPIE; // enable interrupts in user mode x 117 kernel/trap.c w_sstatus(x); x 47 mkfs/mkfs.c xshort(ushort x) x 51 mkfs/mkfs.c a[0] = x; x 52 mkfs/mkfs.c a[1] = x >> 8; x 57 mkfs/mkfs.c xint(uint x) x 61 mkfs/mkfs.c a[0] = x; x 62 mkfs/mkfs.c a[1] = x >> 8; x 63 mkfs/mkfs.c a[2] = x >> 16; x 64 mkfs/mkfs.c a[3] = x >> 24; x 260 mkfs/mkfs.c uint x; x 272 mkfs/mkfs.c x = xint(din.addrs[fbn]); x 282 mkfs/mkfs.c x = xint(indirect[fbn-NDIRECT]); x 285 mkfs/mkfs.c rsect(x, buf); x 287 mkfs/mkfs.c wsect(x, buf); x 27 user/grind.c long hi, lo, x; x 30 user/grind.c x = (*ctx % 0x7ffffffe) + 1; x 31 user/grind.c hi = x / 127773; x 32 user/grind.c lo = x % 127773; x 33 user/grind.c x = 16807 * lo - 2836 * hi; x 34 user/grind.c if (x < 0) x 35 user/grind.c x += 0x7fffffff; x 37 user/grind.c x--; x 38 user/grind.c *ctx = x; x 39 user/grind.c return (x); x 20 user/printf.c uint x; x 25 user/printf.c x = -xx; x 27 user/printf.c x = xx; x 32 user/printf.c buf[i++] = digits[x % base]; x 33 user/printf.c }while((x /= base) != 0); x 42 user/printf.c printptr(int fd, uint64 x) { x 46 user/printf.c for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) x 47 user/printf.c putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); x 16 user/umalloc.c Align x; x 1503 user/usertests.c unsigned int x = (pid ? 1 : 97); x 1505 user/usertests.c x = x * 1103515245 + 12345; x 1506 user/usertests.c if((x % 3) == 0){ x 1508 user/usertests.c } else if((x % 3) == 1){