test-timeout: fix build errors with -std=gnu++20

Fixes #4899
This commit is contained in:
Christian Prochaska 2023-05-16 13:34:00 +02:00 committed by Christian Helmuth
parent 9e3233f13f
commit c3b53bc2ec

View File

@ -18,6 +18,7 @@
#include <util/fifo.h>
#include <util/misc_math.h>
#include <base/attached_rom_dataspace.h>
#include <cpu/memory_barrier.h>
using namespace Genode;
@ -521,7 +522,7 @@ struct Fast_polling : Test
/* measure consumed time of a limited busy loop */
uint64_t volatile start_ms = timer_2.elapsed_ms();
for (unsigned long volatile cnt = 0; cnt < max_cnt; cnt++) { }
for (unsigned long cnt = 0; cnt < max_cnt; cnt++) memory_barrier();
uint64_t volatile end_ms = timer_2.elapsed_ms();
/*
@ -568,10 +569,11 @@ struct Fast_polling : Test
for (unsigned poll = 0; poll < nr_of_polls; poll++) {
/* create delay between two polls */
for (unsigned long volatile i = 0; i < delay_loops_per_poll_; i++) { }
for (unsigned long i = 0; i < delay_loops_per_poll_; i++)
memory_barrier();
/* count delay loops to limit frequency of remote time reading */
delay_loops += delay_loops_per_poll_;
delay_loops = delay_loops + delay_loops_per_poll_;
/*
* We buffer the results in local variables first so the RAM
@ -646,10 +648,13 @@ struct Fast_polling : Test
} else {
if (timer_2_delayed) {
local_us_1_buf.value[poll] += timer_diff_us;
local_us_2_buf.value[poll] += timer_diff_us;
local_us_1_buf.value[poll] =
local_us_1_buf.value[poll] + timer_diff_us;
local_us_2_buf.value[poll] =
local_us_2_buf.value[poll] + timer_diff_us;
} else {
remote_us_buf.value[poll] += timer_diff_us;
remote_us_buf.value[poll] =
remote_us_buf.value[poll] + timer_diff_us;
}
nr_of_good_polls++;
}