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 unsigned long long 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 103 kernel/riscv.h uint64 x; x 104 kernel/riscv.h asm volatile("csrr %0, mie" : "=r" (x) ); x 105 kernel/riscv.h return x; x 109 kernel/riscv.h w_mie(uint64 x) x 111 kernel/riscv.h asm volatile("csrw mie, %0" : : "r" (x)); x 118 kernel/riscv.h w_sepc(uint64 x) x 120 kernel/riscv.h asm volatile("csrw sepc, %0" : : "r" (x)); x 126 kernel/riscv.h uint64 x; x 127 kernel/riscv.h asm volatile("csrr %0, sepc" : "=r" (x) ); x 128 kernel/riscv.h return x; x 135 kernel/riscv.h uint64 x; x 136 kernel/riscv.h asm volatile("csrr %0, medeleg" : "=r" (x) ); x 137 kernel/riscv.h return x; x 141 kernel/riscv.h w_medeleg(uint64 x) x 143 kernel/riscv.h asm volatile("csrw medeleg, %0" : : "r" (x)); x 150 kernel/riscv.h uint64 x; x 151 kernel/riscv.h asm volatile("csrr %0, mideleg" : "=r" (x) ); x 152 kernel/riscv.h return x; x 156 kernel/riscv.h w_mideleg(uint64 x) x 158 kernel/riscv.h asm volatile("csrw mideleg, %0" : : "r" (x)); x 164 kernel/riscv.h w_stvec(uint64 x) x 166 kernel/riscv.h asm volatile("csrw stvec, %0" : : "r" (x)); x 172 kernel/riscv.h uint64 x; x 173 kernel/riscv.h asm volatile("csrr %0, stvec" : "=r" (x) ); x 174 kernel/riscv.h return x; x 181 kernel/riscv.h uint64 x; x 183 kernel/riscv.h asm volatile("csrr %0, 0x14d" : "=r" (x) ); x 184 kernel/riscv.h return x; x 188 kernel/riscv.h w_stimecmp(uint64 x) x 191 kernel/riscv.h asm volatile("csrw 0x14d, %0" : : "r" (x)); x 198 kernel/riscv.h uint64 x; x 200 kernel/riscv.h asm volatile("csrr %0, 0x30a" : "=r" (x) ); x 201 kernel/riscv.h return x; x 205 kernel/riscv.h w_menvcfg(uint64 x) x 208 kernel/riscv.h asm volatile("csrw 0x30a, %0" : : "r" (x)); x 213 kernel/riscv.h w_pmpcfg0(uint64 x) x 215 kernel/riscv.h asm volatile("csrw pmpcfg0, %0" : : "r" (x)); x 219 kernel/riscv.h w_pmpaddr0(uint64 x) x 221 kernel/riscv.h asm volatile("csrw pmpaddr0, %0" : : "r" (x)); x 232 kernel/riscv.h w_satp(uint64 x) x 234 kernel/riscv.h asm volatile("csrw satp, %0" : : "r" (x)); x 240 kernel/riscv.h uint64 x; x 241 kernel/riscv.h asm volatile("csrr %0, satp" : "=r" (x) ); x 242 kernel/riscv.h return x; x 249 kernel/riscv.h uint64 x; x 250 kernel/riscv.h asm volatile("csrr %0, scause" : "=r" (x) ); x 251 kernel/riscv.h return x; x 258 kernel/riscv.h uint64 x; x 259 kernel/riscv.h asm volatile("csrr %0, stval" : "=r" (x) ); x 260 kernel/riscv.h return x; x 265 kernel/riscv.h w_mcounteren(uint64 x) x 267 kernel/riscv.h asm volatile("csrw mcounteren, %0" : : "r" (x)); x 273 kernel/riscv.h uint64 x; x 274 kernel/riscv.h asm volatile("csrr %0, mcounteren" : "=r" (x) ); x 275 kernel/riscv.h return x; x 282 kernel/riscv.h uint64 x; x 283 kernel/riscv.h asm volatile("csrr %0, time" : "=r" (x) ); x 284 kernel/riscv.h return x; x 305 kernel/riscv.h uint64 x = r_sstatus(); x 306 kernel/riscv.h return (x & SSTATUS_SIE) != 0; x 312 kernel/riscv.h uint64 x; x 313 kernel/riscv.h asm volatile("mv %0, sp" : "=r" (x) ); x 314 kernel/riscv.h return x; x 322 kernel/riscv.h uint64 x; x 323 kernel/riscv.h asm volatile("mv %0, tp" : "=r" (x) ); x 324 kernel/riscv.h return x; x 328 kernel/riscv.h w_tp(uint64 x) x 330 kernel/riscv.h asm volatile("mv tp, %0" : : "r" (x)); x 336 kernel/riscv.h uint64 x; x 337 kernel/riscv.h asm volatile("mv %0, ra" : "=r" (x) ); x 338 kernel/riscv.h return x; x 18 kernel/start.c unsigned long x = r_mstatus(); x 19 kernel/start.c x &= ~MSTATUS_MPP_MASK; x 20 kernel/start.c x |= MSTATUS_MPP_S; x 21 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 262 mkfs/mkfs.c uint x; x 274 mkfs/mkfs.c x = xint(din.addrs[fbn]); x 284 mkfs/mkfs.c x = xint(indirect[fbn-NDIRECT]); x 287 mkfs/mkfs.c rsect(x, buf); x 289 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 1506 user/usertests.c unsigned int x = (pid ? 1 : 97); x 1508 user/usertests.c x = x * 1103515245 + 12345; x 1509 user/usertests.c if((x % 3) == 0){ x 1511 user/usertests.c } else if((x % 3) == 1){