diff --git a/repos/os/run/cpu_bench.run b/repos/os/run/cpu_bench.run index ff73399d6f..7c8f72207e 100644 --- a/repos/os/run/cpu_bench.run +++ b/repos/os/run/cpu_bench.run @@ -42,17 +42,17 @@ append qemu_args " -nographic " # regressions in the platform initialization code # proc bogomips_max_time { } { - if {[board] == "rpi"} { return 14300 } - if {[board] == "imx53_qsb"} { return 7520 } - if {[board] == "imx53_qsb_tz"} { return 7520 } - if {[board] == "imx6q_sabrelite"} { return 6320 } - if {[board] == "imx7d_sabre"} { return 9470 } - if {[board] == "imx8q_evk"} { return 7510 } - if {[board] == "pc"} { - if {[have_spec x86_64]} { return 600 } - if {[have_spec x86_32]} { return 3150 } + if {[have_board rpi]} { return 14300 } + if {[have_board imx53_qsb]} { return 7520 } + if {[have_board imx53_qsb_tz]} { return 7520 } + if {[have_board imx6q_sabrelite]} { return 6320 } + if {[have_board imx7d_sabre]} { return 9470 } + if {[have_board imx8q_evk]} { return 7510 } + if {[have_board pc]} { + if {[have_spec x86_64]} { return 600 } + if {[have_spec x86_32]} { return 3150 } } - if {[board] == "muen"} { return 600 } + if {[have_board muen]} { return 600 } return 0 } diff --git a/repos/os/run/smbios_decoder.run b/repos/os/run/smbios_decoder.run index 899ca88517..4e8edc7eb9 100644 --- a/repos/os/run/smbios_decoder.run +++ b/repos/os/run/smbios_decoder.run @@ -1,6 +1,6 @@ assert_spec x86_64 -if { "[board]" ne "pc" || [expr ![have_spec nova] && ![have_spec hw]] } { +if {![have_board pc] || [expr ![have_spec nova] && ![have_spec hw]] } { puts "Run script is only supported on hw/pc and nova/pc" exit 0 } diff --git a/tool/run/boot_dir/linux b/tool/run/boot_dir/linux index 2c6498d068..3451e9359b 100644 --- a/tool/run/boot_dir/linux +++ b/tool/run/boot_dir/linux @@ -31,7 +31,7 @@ proc run_boot_dir {binaries} { # Save config part of the image.elf for easy inspection exec cp -f [run_dir]/genode/config [run_dir].config - if {[board] == "pc"} { + if {[have_board pc]} { build_initrd $binaries diff --git a/tool/run/qemu.inc b/tool/run/qemu.inc index b67fca67c9..7e9707d737 100644 --- a/tool/run/qemu.inc +++ b/tool/run/qemu.inc @@ -44,9 +44,7 @@ proc append_qemu_nic_args { { extra_netdev_args "" } } { # XXX should by removed in favor of [have_include "exec/qemu"] # proc is_qemu_available { } { - if {[expr [have_spec linux] && {"[board]"} == {"linux"}]} { return false } - - if {[have_spec rpi]} { + if {[have_board rpi] || [have_board linux]} { puts stderr "skipping execution because platform is not supported by qemu" return false } diff --git a/tool/run/run b/tool/run/run index d1b6149646..bbf33c35ab 100755 --- a/tool/run/run +++ b/tool/run/run @@ -835,6 +835,10 @@ proc board { } { return $board_var } +## +# Return whether the board equals to the given string +# +proc have_board {board} { global board_var; return [expr {$board_var} eq {$board}] } ## # Determine GDB executable installed at the host