2013-07-19 13:46:24 +00:00
|
|
|
#
|
|
|
|
# \brief Test to start and call RPC entrypoint on all available CPUs
|
|
|
|
# \author Norman Feske
|
2014-03-06 12:13:15 +00:00
|
|
|
# \author Alexander Boettcher
|
2013-07-19 13:46:24 +00:00
|
|
|
#
|
|
|
|
|
2014-03-06 12:13:15 +00:00
|
|
|
if {
|
|
|
|
![have_spec hw_arndale] &&
|
|
|
|
([have_spec platform_pbxa9] || (![have_spec nova] && ![have_spec foc]))
|
|
|
|
} {
|
2013-07-19 13:46:24 +00:00
|
|
|
puts "Platform is unsupported."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
build "core init test/mp_server"
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
install_config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CAP"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</default-route>
|
|
|
|
<start name="test-server-mp">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
build_boot_image "core init test-server-mp"
|
|
|
|
|
|
|
|
if {[is_qemu_available]} {
|
|
|
|
set want_cpus 2
|
|
|
|
append qemu_args " -nographic -m 64 -smp $want_cpus,cores=$want_cpus "
|
|
|
|
}
|
|
|
|
|
|
|
|
# run the test
|
2013-08-07 20:16:58 +00:00
|
|
|
run_genode_until {\[init -\> test-server-mp\] done.*\n} 60
|
2013-07-19 13:46:24 +00:00
|
|
|
|
2013-08-07 20:16:58 +00:00
|
|
|
set cpus [regexp -inline {Detected [0-9x]+ CPU[ s]\.} $output]
|
|
|
|
set cpus [regexp -all -inline {[0-9]+} $cpus]
|
|
|
|
set cpus [expr [lindex $cpus 0] * [lindex $cpus 1]]
|
2013-07-19 13:46:24 +00:00
|
|
|
|
|
|
|
if {[is_qemu_available]} {
|
|
|
|
if {$want_cpus != $cpus} {
|
|
|
|
puts "CPU count is not as expected: $want_cpus != $cpus"
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# pay only attention to the output of init and its children
|
|
|
|
grep_output {^\[init }
|
|
|
|
|
|
|
|
unify_output {transfer cap [a-f0-9]+} "transfer cap UNIFIED"
|
|
|
|
unify_output {yes - idx [a-f0-9]+} "yes - idx UNIFIED"
|
|
|
|
unify_output {\- received cap [a-f0-9]+} "- received cap UNIFIED"
|
|
|
|
|
|
|
|
compare_output_to {
|
|
|
|
[init -> test-server-mp] --- test-mp_server started ---
|
2013-08-07 20:16:58 +00:00
|
|
|
[init -> test-server-mp] Detected 2x1 CPUs.
|
2013-07-19 13:46:24 +00:00
|
|
|
[init -> test-server-mp] call server on CPU 0
|
|
|
|
[init -> test-server-mp] function test_untyped: got value 0
|
|
|
|
[init -> test-server-mp] call server on CPU 1
|
|
|
|
[init -> test-server-mp] function test_untyped: got value 1
|
|
|
|
[init -> test-server-mp] call server on CPU 0 - transfer cap UNIFIED
|
|
|
|
[init -> test-server-mp] function test_cap: capability is valid ? yes - idx UNIFIED
|
|
|
|
[init -> test-server-mp] call server on CPU 1 - transfer cap UNIFIED
|
|
|
|
[init -> test-server-mp] function test_cap: capability is valid ? yes - idx UNIFIED
|
|
|
|
[init -> test-server-mp] call server on CPU 0 - transfer cap UNIFIED
|
|
|
|
[init -> test-server-mp] function test_cap_reply: capability is valid ? yes - idx UNIFIED
|
|
|
|
[init -> test-server-mp] got from server on CPU 0 - received cap UNIFIED
|
|
|
|
[init -> test-server-mp] call server on CPU 1 - transfer cap UNIFIED
|
|
|
|
[init -> test-server-mp] function test_cap_reply: capability is valid ? yes - idx UNIFIED
|
|
|
|
[init -> test-server-mp] got from server on CPU 1 - received cap UNIFIED
|
|
|
|
[init -> test-server-mp] done
|
|
|
|
}
|