diff options
author | Tom Rini <trini@konsulko.com> | 2022-06-07 12:21:57 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-06-07 12:21:57 -0400 |
commit | ed1cbbe2afe4d4c7c25316db4c2e15c4c579fc4e (patch) | |
tree | a8315fd7fca59a0cff90ba0343d73c3f15e18c50 /common/event.c | |
parent | 41e47b420d6b122f6eb21e6e4438b334cc983eb1 (diff) | |
parent | b62450cf229c50ad2ce819dd02a09726909cc89a (diff) |
Merge branch '2022-06-07-assorted-improvements' into next
- A wide ranging set of minor clean-ups and improvements
Diffstat (limited to 'common/event.c')
-rw-r--r-- | common/event.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/common/event.c b/common/event.c index 9d67a060a02..af1ed4121d8 100644 --- a/common/event.c +++ b/common/event.c @@ -17,6 +17,7 @@ #include <malloc.h> #include <asm/global_data.h> #include <linux/list.h> +#include <relocate.h> DECLARE_GLOBAL_DATA_PTR; @@ -148,6 +149,20 @@ void event_show_spy_list(void) } } +#if CONFIG_IS_ENABLED(NEEDS_MANUAL_RELOC) +int event_manual_reloc(void) +{ + struct evspy_info *spy, *end; + + spy = ll_entry_start(struct evspy_info, evspy_info); + end = ll_entry_end(struct evspy_info, evspy_info); + for (; spy < end; spy++) + MANUAL_RELOC(spy->func); + + return 0; +} +#endif + #if CONFIG_IS_ENABLED(EVENT_DYNAMIC) static void spy_free(struct event_spy *spy) { @@ -159,8 +174,6 @@ int event_register(const char *id, enum event_t type, event_handler_t func, void struct event_state *state = gd_event_state(); struct event_spy *spy; - if (!CONFIG_IS_ENABLED(EVENT_DYNAMIC)) - return -ENOSYS; spy = malloc(sizeof(*spy)); if (!spy) return log_msg_ret("alloc", -ENOMEM); |