mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-06 01:11:46 +00:00
parent
9e3233f13f
commit
c3b53bc2ec
@ -18,6 +18,7 @@
|
|||||||
#include <util/fifo.h>
|
#include <util/fifo.h>
|
||||||
#include <util/misc_math.h>
|
#include <util/misc_math.h>
|
||||||
#include <base/attached_rom_dataspace.h>
|
#include <base/attached_rom_dataspace.h>
|
||||||
|
#include <cpu/memory_barrier.h>
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
@ -521,7 +522,7 @@ struct Fast_polling : Test
|
|||||||
|
|
||||||
/* measure consumed time of a limited busy loop */
|
/* measure consumed time of a limited busy loop */
|
||||||
uint64_t volatile start_ms = timer_2.elapsed_ms();
|
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();
|
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++) {
|
for (unsigned poll = 0; poll < nr_of_polls; poll++) {
|
||||||
|
|
||||||
/* create delay between two polls */
|
/* 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 */
|
/* 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
|
* We buffer the results in local variables first so the RAM
|
||||||
@ -646,10 +648,13 @@ struct Fast_polling : Test
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (timer_2_delayed) {
|
if (timer_2_delayed) {
|
||||||
local_us_1_buf.value[poll] += timer_diff_us;
|
local_us_1_buf.value[poll] =
|
||||||
local_us_2_buf.value[poll] += timer_diff_us;
|
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 {
|
} 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++;
|
nr_of_good_polls++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user