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
|
@ -73,13 +73,13 @@ define_command(ident, ident_handler, "Identifier of the system", SYSTEM_CMDS);
|
|||
#ifdef CSR_TIMER0_UPTIME_CYCLES_ADDR
|
||||
static void uptime_handler(int nb_params, char **params)
|
||||
{
|
||||
unsigned long uptime;
|
||||
uint64_t uptime;
|
||||
|
||||
timer0_uptime_latch_write(1);
|
||||
uptime = timer0_uptime_cycles_read();
|
||||
printf("Uptime: %ld sys_clk cycles / %ld seconds",
|
||||
uptime,
|
||||
uptime/CONFIG_CLOCK_FREQUENCY
|
||||
printf("Uptime: %" PRIu64 " sys_clk cycles / %" PRIu64 " seconds\n",
|
||||
uptime,
|
||||
uptime / CONFIG_CLOCK_FREQUENCY
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue