diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-11-27 18:50:20 -0800 |
---|---|---|
committer | David Brownell <dbrownell@users.sourceforge.net> | 2009-11-27 18:50:20 -0800 |
commit | 4e56a2303b3f68bb647d8bb640a830f7f21ea231 (patch) | |
tree | 87df3a19a84c9fa5b591043e2451db68e26550cd /src/target/target.c | |
parent | 4d2750e571b6a3f700cd95542a4bb5c7949e476c (diff) |
target: groundwork for "reset-assert" event
This defines a "reset-assert" event and a supporting utility
routine, and documents both how targets should implement it
and how config scripts should use it. Core-specific updates
are needed to make this work.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/target.c')
-rw-r--r-- | src/target/target.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/target/target.c b/src/target/target.c index 3de9f2c6..a2bd8868 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -147,6 +147,7 @@ static const Jim_Nvp nvp_target_event[] = { { .value = TARGET_EVENT_RESET_START, .name = "reset-start" }, { .value = TARGET_EVENT_RESET_ASSERT_PRE, .name = "reset-assert-pre" }, + { .value = TARGET_EVENT_RESET_ASSERT, .name = "reset-assert" }, { .value = TARGET_EVENT_RESET_ASSERT_POST, .name = "reset-assert-post" }, { .value = TARGET_EVENT_RESET_DEASSERT_PRE, .name = "reset-deassert-pre" }, { .value = TARGET_EVENT_RESET_DEASSERT_POST, .name = "reset-deassert-post" }, @@ -154,8 +155,8 @@ static const Jim_Nvp nvp_target_event[] = { { .value = TARGET_EVENT_RESET_HALT_POST, .name = "reset-halt-post" }, { .value = TARGET_EVENT_RESET_WAIT_PRE, .name = "reset-wait-pre" }, { .value = TARGET_EVENT_RESET_WAIT_POST, .name = "reset-wait-post" }, - { .value = TARGET_EVENT_RESET_INIT , .name = "reset-init" }, - { .value = TARGET_EVENT_RESET_END, .name = "reset-end" }, + { .value = TARGET_EVENT_RESET_INIT, .name = "reset-init" }, + { .value = TARGET_EVENT_RESET_END, .name = "reset-end" }, { .value = TARGET_EVENT_EXAMINE_START, .name = "examine-start" }, { .value = TARGET_EVENT_EXAMINE_END, .name = "examine-end" }, @@ -3523,6 +3524,20 @@ void target_handle_event(struct target *target, enum target_event e) } } +/** + * Returns true only if the target has a handler for the specified event. + */ +bool target_has_event_action(struct target *target, enum target_event event) +{ + struct target_event_action *teap; + + for (teap = target->event_action; teap != NULL; teap = teap->next) { + if (teap->event == event) + return true; + } + return false; +} + enum target_cfg_param { TCFG_TYPE, TCFG_EVENT, |