Skip to content

Commit

Permalink
usleep OK after press a twice
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Jan 23, 2024
1 parent 758287c commit 1bcf19a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions riscv_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,8 +1166,9 @@ static void raise_exception2(RISCVCPUState *s, uint32_t cause,

// For RDTIME: Return the time
// https://five-embeddev.com/riscv-isa-manual/latest/counters.html#zicntr-standard-extension-for-base-counters-and-timers
static uint64_t t = 0; s->reg[10] = t++ << 32; printf("After: reg %s=%p\n", reg_name[10], s->reg[10]); //// A0 is X10
sleep(1);
static uint64_t t = 0;
s->reg[10] = t++;
printf("After: reg %s=%p\n", reg_name[10], s->reg[10]); //// A0 is X10

s->pc += 4; // Jump to the next instruction (ret)
return;
Expand Down

0 comments on commit 1bcf19a

Please sign in to comment.