x 26 kernel/console.c #define C(x) ((x) - '@') // Control-x x 186 kernel/defs.h #define NELEM(x) (sizeof(x) / sizeof((x)[0])) x 33 kernel/printk.c unsigned long long x; x 36 kernel/printk.c x = -xx; x 38 kernel/printk.c x = xx; x 42 kernel/printk.c buf[i++] = digits[x % base]; x 43 kernel/printk.c } while ((x /= base) != 0); x 53 kernel/printk.c printptr(uint64 x) x 58 kernel/printk.c for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) x 59 kernel/printk.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 22 kernel/riscv.h uint64 x; x 23 kernel/riscv.h asm volatile("csrr %0, mstatus" : "=r"(x)); x 24 kernel/riscv.h return x; x 28 kernel/riscv.h w_mstatus(uint64 x) x 30 kernel/riscv.h asm volatile("csrw mstatus, %0" : : "r"(x)); x 37 kernel/riscv.h w_mepc(uint64 x) x 39 kernel/riscv.h asm volatile("csrw mepc, %0" : : "r"(x)); x 53 kernel/riscv.h uint64 x; x 54 kernel/riscv.h asm volatile("csrr %0, sstatus" : "=r"(x)); x 55 kernel/riscv.h return x; x 59 kernel/riscv.h w_sstatus(uint64 x) x 61 kernel/riscv.h asm volatile("csrw sstatus, %0" : : "r"(x)); x 65 kernel/riscv.h s_sstatus(uint64 x) x 67 kernel/riscv.h __asm__ __volatile__("csrs sstatus, %0" ::"rK"(x) : "memory"); x 71 kernel/riscv.h c_sstatus(uint64 x) x 73 kernel/riscv.h __asm__ __volatile__("csrc sstatus, %0" ::"rK"(x) : "memory"); x 77 kernel/riscv.h rc_sstatus(uint64 x) x 79 kernel/riscv.h __asm__ __volatile__("csrrc %0, sstatus, %1" : "=r"(x) : "rK"(x) : "memory"); x 80 kernel/riscv.h return x; x 87 kernel/riscv.h uint64 x; x 88 kernel/riscv.h asm volatile("csrr %0, sip" : "=r"(x)); x 89 kernel/riscv.h return x; x 93 kernel/riscv.h w_sip(uint64 x) x 95 kernel/riscv.h asm volatile("csrw sip, %0" : : "r"(x)); x 104 kernel/riscv.h uint64 x; x 105 kernel/riscv.h asm volatile("csrr %0, sie" : "=r"(x)); x 106 kernel/riscv.h return x; x 110 kernel/riscv.h w_sie(uint64 x) x 112 kernel/riscv.h asm volatile("csrw sie, %0" : : "r"(x)); x 120 kernel/riscv.h uint64 x; x 121 kernel/riscv.h asm volatile("csrr %0, mie" : "=r"(x)); x 122 kernel/riscv.h return x; x 126 kernel/riscv.h w_mie(uint64 x) x 128 kernel/riscv.h asm volatile("csrw mie, %0" : : "r"(x)); x 135 kernel/riscv.h w_sepc(uint64 x) x 137 kernel/riscv.h asm volatile("csrw sepc, %0" : : "r"(x)); x 143 kernel/riscv.h uint64 x; x 144 kernel/riscv.h asm volatile("csrr %0, sepc" : "=r"(x)); x 145 kernel/riscv.h return x; x 152 kernel/riscv.h uint64 x; x 153 kernel/riscv.h asm volatile("csrr %0, medeleg" : "=r"(x)); x 154 kernel/riscv.h return x; x 158 kernel/riscv.h w_medeleg(uint64 x) x 160 kernel/riscv.h asm volatile("csrw medeleg, %0" : : "r"(x)); x 167 kernel/riscv.h uint64 x; x 168 kernel/riscv.h asm volatile("csrr %0, mideleg" : "=r"(x)); x 169 kernel/riscv.h return x; x 173 kernel/riscv.h w_mideleg(uint64 x) x 175 kernel/riscv.h asm volatile("csrw mideleg, %0" : : "r"(x)); x 181 kernel/riscv.h w_stvec(uint64 x) x 183 kernel/riscv.h asm volatile("csrw stvec, %0" : : "r"(x)); x 189 kernel/riscv.h uint64 x; x 190 kernel/riscv.h asm volatile("csrr %0, stvec" : "=r"(x)); x 191 kernel/riscv.h return x; x 198 kernel/riscv.h uint64 x; x 200 kernel/riscv.h asm volatile("csrr %0, 0x14d" : "=r"(x)); x 201 kernel/riscv.h return x; x 205 kernel/riscv.h w_stimecmp(uint64 x) x 208 kernel/riscv.h asm volatile("csrw 0x14d, %0" : : "r"(x)); x 219 kernel/riscv.h uint64 x; x 221 kernel/riscv.h asm volatile("csrr %0, 0x30a" : "=r"(x)); x 222 kernel/riscv.h return x; x 226 kernel/riscv.h w_menvcfg(uint64 x) x 229 kernel/riscv.h asm volatile("csrw 0x30a, %0" : : "r"(x)); x 234 kernel/riscv.h w_pmpcfg0(uint64 x) x 236 kernel/riscv.h asm volatile("csrw pmpcfg0, %0" : : "r"(x)); x 240 kernel/riscv.h w_pmpaddr0(uint64 x) x 242 kernel/riscv.h asm volatile("csrw pmpaddr0, %0" : : "r"(x)); x 253 kernel/riscv.h w_satp(uint64 x) x 255 kernel/riscv.h asm volatile("csrw satp, %0" : : "r"(x)); x 261 kernel/riscv.h uint64 x; x 262 kernel/riscv.h asm volatile("csrr %0, satp" : "=r"(x)); x 263 kernel/riscv.h return x; x 270 kernel/riscv.h uint64 x; x 271 kernel/riscv.h asm volatile("csrr %0, scause" : "=r"(x)); x 272 kernel/riscv.h return x; x 279 kernel/riscv.h uint64 x; x 280 kernel/riscv.h asm volatile("csrr %0, stval" : "=r"(x)); x 281 kernel/riscv.h return x; x 286 kernel/riscv.h w_mcounteren(uint64 x) x 288 kernel/riscv.h asm volatile("csrw mcounteren, %0" : : "r"(x)); x 294 kernel/riscv.h uint64 x; x 295 kernel/riscv.h asm volatile("csrr %0, mcounteren" : "=r"(x)); x 296 kernel/riscv.h return x; x 303 kernel/riscv.h uint64 x; x 304 kernel/riscv.h asm volatile("csrr %0, time" : "=r"(x)); x 305 kernel/riscv.h return x; x 326 kernel/riscv.h uint64 x = r_sstatus(); x 327 kernel/riscv.h return (x & SSTATUS_SIE) != 0; x 333 kernel/riscv.h uint64 x; x 334 kernel/riscv.h asm volatile("mv %0, sp" : "=r"(x)); x 335 kernel/riscv.h return x; x 343 kernel/riscv.h uint64 x; x 344 kernel/riscv.h asm volatile("mv %0, tp" : "=r"(x)); x 345 kernel/riscv.h return x; x 349 kernel/riscv.h w_tp(uint64 x) x 351 kernel/riscv.h asm volatile("mv tp, %0" : : "r"(x)); x 357 kernel/riscv.h uint64 x; x 358 kernel/riscv.h asm volatile("mv %0, ra" : "=r"(x)); x 359 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 125 kernel/trap.c unsigned long x = r_sstatus(); x 126 kernel/trap.c x &= ~SSTATUS_SPP; // clear SPP to 0 for user mode x 127 kernel/trap.c x |= SSTATUS_SPIE; // enable interrupts in user mode x 128 kernel/trap.c w_sstatus(x); x 51 mkfs/mkfs.c xshort(ushort x) x 55 mkfs/mkfs.c a[0] = x; x 56 mkfs/mkfs.c a[1] = x >> 8; x 61 mkfs/mkfs.c xint(uint x) x 65 mkfs/mkfs.c a[0] = x; x 66 mkfs/mkfs.c a[1] = x >> 8; x 67 mkfs/mkfs.c a[2] = x >> 16; x 68 mkfs/mkfs.c a[3] = x >> 24; x 266 mkfs/mkfs.c uint x; x 278 mkfs/mkfs.c x = xint(din.addrs[fbn]); x 288 mkfs/mkfs.c x = xint(indirect[fbn - NDIRECT]); x 291 mkfs/mkfs.c rsect(x, buf); x 293 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 unsigned long long 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 47 user/printf.c for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) x 48 user/printf.c putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); x 16 user/umalloc.c Align x; x 1538 user/usertests.c unsigned int x = (pid ? 1 : 97); x 1540 user/usertests.c x = x * 1103515245 + 12345; x 1541 user/usertests.c if ((x % 3) == 0) { x 1543 user/usertests.c } else if ((x % 3) == 1) {