[coreboot-gerrit] New patch to review for coreboot: 83edd1b reg_script: add reg_script_run_on_dev()

Aaron Durbin (adurbin@google.com) gerrit at coreboot.org
Tue Jan 28 03:57:18 CET 2014


Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5005

-gerrit

commit 83edd1bb8ce2d406aab7fce0e9a93b9df08e673a
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Tue Dec 10 17:09:40 2013 -0800

    reg_script: add reg_script_run_on_dev()
    
    The reg_script library has proven to be useful. It's
    also shown that many scripts operate on devices. However,
    certain code paths run the same script on multiple,
    but different, devices. In order to make that easier
    introduce reg_script_run_on_dev() which takes a device
    as a parameter. That way, chained reg_scripts are not
    scrictly needed to run the same script on multiple devices.
    
    BUG=None
    BRANCH=None
    TEST=Built.
    
    Change-Id: I273499af4d303ebd7dc19e9b635ca23cf9bb2225
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
    Reviewed-on: https://chromium-review.googlesource.com/179540
    Reviewed-by: Duncan Laurie <dlaurie at chromium.org>
---
 src/include/reg_script.h | 1 +
 src/lib/reg_script.c     | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/include/reg_script.h b/src/include/reg_script.h
index 81a4648..72e1e96 100644
--- a/src/include/reg_script.h
+++ b/src/include/reg_script.h
@@ -334,5 +334,6 @@ struct reg_script {
 	_REG_SCRIPT_ENCODE_RAW(REG_SCRIPT_COMMAND_END, 0, 0, 0, 0, 0, 0, 0)
 
 void reg_script_run(const struct reg_script *script);
+void reg_script_run_on_dev(device_t dev, const struct reg_script *step);
 
 #endif /* REG_SCRIPT_H */
diff --git a/src/lib/reg_script.c b/src/lib/reg_script.c
index a331b14..7d03463 100644
--- a/src/lib/reg_script.c
+++ b/src/lib/reg_script.c
@@ -468,11 +468,16 @@ static void reg_script_run_next(struct reg_script_context *prev_ctx,
 	reg_script_run_with_context(&ctx);
 }
 
-void reg_script_run(const struct reg_script *step)
+void reg_script_run_on_dev(device_t dev, const struct reg_script *step)
 {
 	struct reg_script_context ctx;
 
-	reg_script_set_dev(&ctx, EMPTY_DEV);
+	reg_script_set_dev(&ctx, dev);
 	reg_script_set_step(&ctx, step);
 	reg_script_run_with_context(&ctx);
 }
+
+void reg_script_run(const struct reg_script *step)
+{
+	reg_script_run_on_dev(EMPTY_DEV, step);
+}



More information about the coreboot-gerrit mailing list