mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
cmd_bios.c: Fix wrong byte size of uptime in uptime_handler.
- It's a 64bit not 32bit unsigned and it caused overflow/negative cycles display.
This commit is contained in:
parent
dbc1f665f7
commit
93a7cc2523
1 changed files with 4 additions and 4 deletions
|
@ -73,13 +73,13 @@ define_command(ident, ident_handler, "Identifier of the system", SYSTEM_CMDS);
|
||||||
#ifdef CSR_TIMER0_UPTIME_CYCLES_ADDR
|
#ifdef CSR_TIMER0_UPTIME_CYCLES_ADDR
|
||||||
static void uptime_handler(int nb_params, char **params)
|
static void uptime_handler(int nb_params, char **params)
|
||||||
{
|
{
|
||||||
unsigned long uptime;
|
uint64_t uptime;
|
||||||
|
|
||||||
timer0_uptime_latch_write(1);
|
timer0_uptime_latch_write(1);
|
||||||
uptime = timer0_uptime_cycles_read();
|
uptime = timer0_uptime_cycles_read();
|
||||||
printf("Uptime: %ld sys_clk cycles / %ld seconds",
|
printf("Uptime: %" PRIu64 " sys_clk cycles / %" PRIu64 " seconds\n",
|
||||||
uptime,
|
uptime,
|
||||||
uptime/CONFIG_CLOCK_FREQUENCY
|
uptime / CONFIG_CLOCK_FREQUENCY
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue