From c8e7ab5dd655a2f9266f693084c7931cee3a8244 Mon Sep 17 00:00:00 2001 From: Balaji Gontumukkala Date: Tue, 26 Nov 2024 06:00:53 +0000 Subject: [PATCH] Added logic to display freq in decimal - Added changes to counter frequency in MHz/KHz Signed-off-by: Balaji Gontumukkala --- .../timer/operating_system/test_os_t001.c | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/test_pool/timer/operating_system/test_os_t001.c b/test_pool/timer/operating_system/test_os_t001.c index cf98f08d..2e3e55cc 100644 --- a/test_pool/timer/operating_system/test_os_t001.c +++ b/test_pool/timer/operating_system/test_os_t001.c @@ -27,18 +27,35 @@ void payload() { - uint32_t counter_freq; + uint64_t counter_freq; uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); + uint32_t print_mhz = 0; counter_freq = val_timer_get_info(TIMER_INFO_CNTFREQ, 0); - val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %x ", counter_freq); + + if (counter_freq != 0) { + counter_freq = counter_freq/1000; + if (counter_freq > 1000) { + counter_freq = counter_freq/1000; + print_mhz = 1; + } + } + + if (print_mhz) + val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld MHz", counter_freq); + else + val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld KHz", counter_freq); if (counter_freq > 10*1000*1000) { val_set_status(index, RESULT_PASS(TEST_NUM, 1)); return; } - val_print(ACS_PRINT_ERR, "\n Counter frequency is %x ", counter_freq); + if (print_mhz) + val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld MHz", counter_freq); + else + val_print(ACS_PRINT_DEBUG, "\n Counter frequency is %ld KHz", counter_freq); + val_set_status(index, RESULT_FAIL(TEST_NUM, 1)); }