debug: always print TIMER_CLOCK_HZ as a uint64

Signed-off-by: Axel Heider <axelheider@gmx.de>
This commit is contained in:
Axel Heider
2021-06-28 11:26:34 +02:00
committed by Kent McLeod
parent 32d81495fa
commit e65906dfa1

View File

@@ -15,9 +15,14 @@ BOOT_CODE void initGenericTimer(void)
/* The CNTFRQ register is a 32-bit register, its value can safely be
* compared with TIMER_CLOCK_HZ.
*/
if (gpt_cntfrq != 0 && gpt_cntfrq != TIMER_CLOCK_HZ) {
printf("Warning: gpt_cntfrq %"SEL4_PRIu_word", expected %u\n",
gpt_cntfrq, (uint32_t)TIMER_CLOCK_HZ);
if ((gpt_cntfrq != 0) && (gpt_cntfrq != TIMER_CLOCK_HZ)) {
/* TIMER_CLOCK_HZ is supposed to be a 64-bit value, but that is not
* really enforced, it could be any integer type. Variable args
* require the type to be very well defined to work properly, so
* casting explicitly to unit64_t here is the best option.
*/
printf("Warning: gpt_cntfrq %"SEL4_PRIu_word", expected %"PRIu64"\n",
gpt_cntfrq, (uint64_t)TIMER_CLOCK_HZ);
}
}