mirror of
https://xff.cz/git/u-boot/
synced 2025-09-05 02:32:11 +02:00
event: fix static events for CONFIG_NEEDS_MANUAL_RELOC
Static events do not currently work post-relocation for boards that enable CONFIG_NEEDS_MANUAL_RELOC. Relocate event handler pointers for all event spies to fix this. Tested on Microblaze. Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
This commit is contained in:
@@ -612,6 +612,9 @@ static init_fnc_t init_sequence_r[] = {
|
|||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
initr_reloc_global_data,
|
initr_reloc_global_data,
|
||||||
|
#if CONFIG_IS_ENABLED(NEEDS_MANUAL_RELOC) && CONFIG_IS_ENABLED(EVENT)
|
||||||
|
event_manual_reloc,
|
||||||
|
#endif
|
||||||
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
|
#if defined(CONFIG_SYS_INIT_RAM_LOCK) && defined(CONFIG_E500)
|
||||||
initr_unlock_ram_in_cache,
|
initr_unlock_ram_in_cache,
|
||||||
#endif
|
#endif
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <asm/global_data.h>
|
#include <asm/global_data.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
|
#include <relocate.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
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)
|
#if CONFIG_IS_ENABLED(EVENT_DYNAMIC)
|
||||||
static void spy_free(struct event_spy *spy)
|
static void spy_free(struct event_spy *spy)
|
||||||
{
|
{
|
||||||
|
@@ -144,6 +144,16 @@ int event_register(const char *id, enum event_t type, event_handler_t func,
|
|||||||
/** event_show_spy_list( - Show a list of event spies */
|
/** event_show_spy_list( - Show a list of event spies */
|
||||||
void event_show_spy_list(void);
|
void event_show_spy_list(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* event_manual_reloc() - Relocate event handler pointers
|
||||||
|
*
|
||||||
|
* Relocate event handler pointers for all static event spies. It is called
|
||||||
|
* during the generic board init sequence, after relocation.
|
||||||
|
*
|
||||||
|
* Return: 0 if OK
|
||||||
|
*/
|
||||||
|
int event_manual_reloc(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_notify() - notify spies about an event
|
* event_notify() - notify spies about an event
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user