mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-12 07:24:07 +00:00
Disable lock tests on platforms without priorities
The implementations of the lock and C++ guards tests depend on thread-execution priorities, which produces false negatives of the whole thread test on platforms without priority support.
This commit is contained in:
parent
5fec4a2166
commit
019528ee6a
@ -7,13 +7,25 @@ create_boot_directory
|
|||||||
# supported.
|
# supported.
|
||||||
#
|
#
|
||||||
proc pause_resume_supported { } {
|
proc pause_resume_supported { } {
|
||||||
if {[have_spec pistachio]} { return 0 }
|
if {[have_spec pistachio]} { return false }
|
||||||
if {[have_spec linux]} { return 0 }
|
if {[have_spec linux]} { return false }
|
||||||
if {[have_spec fiasco]} { return 0 }
|
if {[have_spec fiasco]} { return false }
|
||||||
return 1;
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
set config {
|
#
|
||||||
|
# We skip the lock and C++ guard tests on kernels without priority support (as
|
||||||
|
# it is needed for the test implementation).
|
||||||
|
#
|
||||||
|
proc prio_supported { } {
|
||||||
|
if {[have_spec hw]} { return false }
|
||||||
|
if {[have_spec sel4]} { return false }
|
||||||
|
if {[have_spec linux]} { return false }
|
||||||
|
if {[have_spec fiasco]} { return false }
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
append config {
|
||||||
<config prio_levels="2">
|
<config prio_levels="2">
|
||||||
<parent-provides>
|
<parent-provides>
|
||||||
<service name="LOG"/>
|
<service name="LOG"/>
|
||||||
@ -27,12 +39,7 @@ set config {
|
|||||||
<start name="test-thread" caps="2000">
|
<start name="test-thread" caps="2000">
|
||||||
<resource name="RAM" quantum="10M"/>
|
<resource name="RAM" quantum="10M"/>
|
||||||
<resource name="CPU" quantum="100"/>
|
<resource name="CPU" quantum="100"/>
|
||||||
<config>}
|
<config pause_resume="} [pause_resume_supported] {" prio="} [prio_supported] {"/>
|
||||||
|
|
||||||
append_if [pause_resume_supported] config { <pause_resume/> }
|
|
||||||
|
|
||||||
append config {
|
|
||||||
</config>
|
|
||||||
</start>
|
</start>
|
||||||
</config>
|
</config>
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <util/reconstructible.h>
|
#include <util/reconstructible.h>
|
||||||
#include <cpu_session/connection.h>
|
#include <cpu_session/connection.h>
|
||||||
#include <cpu_thread/client.h>
|
#include <cpu_thread/client.h>
|
||||||
|
#include <cpu/memory_barrier.h>
|
||||||
|
|
||||||
using namespace Genode;
|
using namespace Genode;
|
||||||
|
|
||||||
@ -407,6 +408,12 @@ static void test_locks(Genode::Env &env)
|
|||||||
Lock_helper l5(env, "lock_low5", cpu_l, lock, lock_is_free, SYNC_STARTUP);
|
Lock_helper l5(env, "lock_low5", cpu_l, lock, lock_is_free, SYNC_STARTUP);
|
||||||
l5.start();
|
l5.start();
|
||||||
|
|
||||||
|
log(" spin for some time");
|
||||||
|
for (unsigned volatile i = 0; i < 8000000; ++i) memory_barrier();
|
||||||
|
log(" still spinning");
|
||||||
|
for (unsigned volatile i = 0; i < 8000000; ++i) memory_barrier();
|
||||||
|
log(" spinning done");
|
||||||
|
|
||||||
lock.lock();
|
lock.lock();
|
||||||
log(" I'm the lock holder - still alive");
|
log(" I'm the lock holder - still alive");
|
||||||
lock_is_free = true;
|
lock_is_free = true;
|
||||||
@ -648,10 +655,11 @@ void Component::construct(Env &env)
|
|||||||
test_stack_alignment(env);
|
test_stack_alignment(env);
|
||||||
test_main_thread();
|
test_main_thread();
|
||||||
test_cpu_session(env);
|
test_cpu_session(env);
|
||||||
|
if (config.xml().attribute_value("prio", false)) {
|
||||||
test_locks(env);
|
test_locks(env);
|
||||||
test_cxa_guards(env);
|
test_cxa_guards(env);
|
||||||
|
}
|
||||||
if (config.xml().has_sub_node("pause_resume"))
|
if (config.xml().attribute_value("pause_resume", false))
|
||||||
test_pause_resume(env);
|
test_pause_resume(env);
|
||||||
|
|
||||||
test_create_as_many_threads(env);
|
test_create_as_many_threads(env);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user