2011-12-22 15:19:25 +00:00
|
|
|
build "core init test/sub_rm"
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2017-08-10 19:32:21 +00:00
|
|
|
set config {
|
2011-12-22 15:19:25 +00:00
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2017-08-10 19:32:21 +00:00
|
|
|
<start name="test-sub_rm">}
|
|
|
|
|
|
|
|
append_if [have_spec linux] config {
|
|
|
|
<config attach_twice_forbidden="true" support_attach_sub_any="false"/>}
|
|
|
|
|
|
|
|
append config {
|
2011-12-22 15:19:25 +00:00
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
2017-08-10 19:32:21 +00:00
|
|
|
install_config $config
|
|
|
|
|
2016-12-01 18:00:11 +00:00
|
|
|
build_boot_image "core ld.lib.so init test-sub_rm"
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args "-nographic "
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
run_genode_until {.*--- end of sub-rm test ---.*} 10
|
|
|
|
|
2017-01-03 12:17:41 +00:00
|
|
|
if {([have_spec linux] && [have_spec x86_32])} {
|
2011-12-22 15:19:25 +00:00
|
|
|
set maps [exec cat /proc/[exec pidof test-sub_rm]/maps]
|
|
|
|
|
|
|
|
puts "\nmemory map after test completion follows:\n"
|
|
|
|
puts "$maps\n"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Validate some properties of the final mmap
|
|
|
|
#
|
|
|
|
if {![regexp {60000000-60040000 ---p} $maps]} {
|
|
|
|
puts "Error: detaching from sub RM session failed"
|
|
|
|
exit -1
|
|
|
|
}
|
2012-04-16 16:55:18 +00:00
|
|
|
if {![regexp {60040000-60044000 rw.s} $maps]} {
|
2011-12-22 15:19:25 +00:00
|
|
|
puts "Error: populating already attached sub RM session failed"
|
|
|
|
exit -1
|
|
|
|
}
|
2012-04-16 16:55:18 +00:00
|
|
|
if {![regexp {60080000-60083000 rw.s 00001000} $maps]} {
|
2011-12-22 15:19:25 +00:00
|
|
|
puts "Error: using offset parameter to sub RM attach did not work"
|
|
|
|
exit -1
|
|
|
|
}
|
2012-04-16 16:55:18 +00:00
|
|
|
if {![regexp {600c0000-600c2000 rw.s 00001000} $maps]} {
|
2011-12-22 15:19:25 +00:00
|
|
|
puts "Error: using offset and size parameters to sub RM attach did not work"
|
|
|
|
exit -1
|
|
|
|
}
|
|
|
|
if {![regexp -- {-60100000 ---p} $maps]} {
|
|
|
|
puts "Error: attached sub RM session exceeds region boundary"
|
|
|
|
exit -1
|
|
|
|
}
|
|
|
|
}
|