Skip to content

Commit

Permalink
tool: use bender hwp options also for foc and seL4
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ab committed Jan 16, 2025
1 parent 01ebff7 commit 2f251dc
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 56 deletions.
28 changes: 28 additions & 0 deletions tool/run/bender.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Return Bender option that configures Bender's Intel HWP plugin
#
# \param --bender-intel-hwp-mode Run the Intel HWP plugin of Bender in the
# given mode. Valid argument values are
# "off",
# "performance",
# "balanced", and
# "power_saving"
# The argument value defaults to
# "performance".
#
proc bender_intel_hwp_mode_option { } {

set opt [get_cmd_arg_first --bender-intel-hwp-mode "performance"]
if {$opt == "off"} {
return "intel_hwp_off"
} elseif {$opt == "performance"} {
return "intel_hwp_performance"
} elseif {$opt == "balanced"} {
return "intel_hwp_balanced"
} elseif {$opt == "power_saving"} {
return "intel_hwp_power_saving"
} else {
return "intel_hwp_performance"
}
}

4 changes: 3 additions & 1 deletion tool/run/boot_dir/foc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source [genode_dir]/tool/run/bender.inc

proc binary_name_ld_lib_so { } { return "ld-foc.lib.so" }
proc binary_name_core_a { } { return "core-foc-[board].a" }
proc binary_name_timer { } { return "foc_timer" }
Expand Down Expand Up @@ -94,7 +96,7 @@ proc run_boot_dir_x86 {binaries} {

exec mv [run_dir]/image.elf [run_dir]/boot/image.elf

set options_bender "[boot_output]"
set options_bender "[boot_output] [bender_intel_hwp_mode_option]"

if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {

Expand Down
28 changes: 1 addition & 27 deletions tool/run/boot_dir/hw
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
#
# Return Bender option that configures Bender's Intel HWP plugin
#
# \param --bender-intel-hwp-mode Run the Intel HWP plugin of Bender in the
# given mode. Valid argument values are
# "off",
# "performance",
# "balanced", and
# "power_saving"
# The argument value defaults to
# "performance".
#
proc bender_intel_hwp_mode_option { } {

set opt [get_cmd_arg_first --bender-intel-hwp-mode "performance"]
if {$opt == "off"} {
return "intel_hwp_off"
} elseif {$opt == "performance"} {
return "intel_hwp_performance"
} elseif {$opt == "balanced"} {
return "intel_hwp_balanced"
} elseif {$opt == "power_saving"} {
return "intel_hwp_power_saving"
} else {
return "intel_hwp_performance"
}
}
source [genode_dir]/tool/run/bender.inc

proc binary_name_ld_lib_so { } { return "ld-hw.lib.so" }
proc binary_name_core_a { } { return "core-hw.a" }
Expand Down
28 changes: 1 addition & 27 deletions tool/run/boot_dir/nova
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
#
# Return Bender option that configures Bender's Intel HWP plugin
#
# \param --bender-intel-hwp-mode Run the Intel HWP plugin of Bender in the
# given mode. Valid argument values are
# "off",
# "performance",
# "balanced", and
# "power_saving"
# The argument value defaults to
# "performance".
#
proc bender_intel_hwp_mode_option { } {

set opt [get_cmd_arg_first --bender-intel-hwp-mode "performance"]
if {$opt == "off"} {
return "intel_hwp_off"
} elseif {$opt == "performance"} {
return "intel_hwp_performance"
} elseif {$opt == "balanced"} {
return "intel_hwp_balanced"
} elseif {$opt == "power_saving"} {
return "intel_hwp_power_saving"
} else {
return "intel_hwp_performance"
}
}
source [genode_dir]/tool/run/bender.inc

proc binary_name_ld_lib_so { } { return "ld-nova.lib.so" }
proc binary_name_core_a { } { return "core-nova.a" }
Expand Down
4 changes: 3 additions & 1 deletion tool/run/boot_dir/sel4
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source [genode_dir]/tool/run/bender.inc

proc binary_name_ld_lib_so { } { return "ld-sel4.lib.so" }
proc binary_name_core_a { } { return "core-sel4.a" }
proc binary_name_timer { } {
Expand Down Expand Up @@ -57,7 +59,7 @@ proc run_boot_dir {binaries} {

exec mv [run_dir]/image.elf [run_dir]/boot/image.elf

set options_bender "[boot_output] phys_max=256M"
set options_bender "[boot_output] [bender_intel_hwp_mode_option] phys_max=256M"

if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {

Expand Down

0 comments on commit 2f251dc

Please sign in to comment.