diff options
author | Peter Marheine <pmarheine@chromium.org> | 2024-03-28 13:43:08 +1100 |
---|---|---|
committer | Peter Marheine <pmarheine@chromium.org> | 2024-05-09 01:03:04 +0000 |
commit | 59c4597071cb75fa27d5db7211eb8ea095218b5f (patch) | |
tree | fa0b682a20f0a61541c56863b4703a8efbd702c3 /Makefile | |
parent | 9a86bd3113d119380779cc2178b18128fe14d0bf (diff) | |
download | flashrom-59c4597071cb75fa27d5db7211eb8ea095218b5f.tar.gz flashrom-59c4597071cb75fa27d5db7211eb8ea095218b5f.tar.bz2 flashrom-59c4597071cb75fa27d5db7211eb8ea095218b5f.zip |
Make sleep threshold for delays configurable
This allows the minimum time that default_delay() will choose to sleep
for instead of polling to be configured at build-time. The default
remains unchanged at 100 milliseconds for now.
The test's correctness has been checked by testing with minimum sleep
time left at its default and set to a non-default value smaller than 100
microseconds (both pass without sleeping, verified with strace) and with
the minimum sleep time set to 0 (causing the test to be skipped). The
configured value from the macro needs to be stored in a const to avoid
-Werror=type-limits errors when configured to be zero.
Change-Id: Ida96e0816ac914ed69d6fd82ad90ebe89cdef1cc
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/81606
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -542,6 +542,11 @@ CONFIG_NI845X_SPI ?= no # Disable wiki printing by default. It is only useful if you have wiki access. CONFIG_PRINT_WIKI ?= no +# Minimum time in microseconds to suspend execution for (rather than polling) +# when a delay is required. Larger values may perform better on machines with +# low timer resolution, at the cost of increased power. +CONFIG_DELAY_MINIMUM_SLEEP_US ?= 100000 + # Disable all features if CONFIG_NOTHING=yes is given unless CONFIG_EVERYTHING was also set ifeq ($(CONFIG_NOTHING), yes) ifeq ($(CONFIG_EVERYTHING), yes) @@ -587,6 +592,7 @@ FEATURE_FLAGS += -D'CONFIG_DEFAULT_PROGRAMMER_NAME=NULL' endif FEATURE_FLAGS += -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="$(CONFIG_DEFAULT_PROGRAMMER_ARGS)"' +FEATURE_FLAGS += -D'CONFIG_DELAY_MINIMUM_SLEEP_US=$(CONFIG_DELAY_MINIMUM_SLEEP_US)' ################################################################################ |