opal/patch: add call to check if binary patching is supported
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
родитель
11e2d7886e
Коммит
4cac623aeb
@ -241,7 +241,11 @@ static int patcher_register (void)
|
|||||||
|
|
||||||
static int patcher_query (int *priority)
|
static int patcher_query (int *priority)
|
||||||
{
|
{
|
||||||
*priority = mca_memory_patcher_priority;
|
if (opal_patch_supported ()) {
|
||||||
|
*priority = mca_memory_patcher_priority;
|
||||||
|
} else {
|
||||||
|
*priority = -1;
|
||||||
|
}
|
||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,6 +195,11 @@ int opal_patch_symbol (const char *func_symbol_name, uintptr_t func_new_addr)
|
|||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool opal_patch_supported (void)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/* end of #if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) */
|
/* end of #if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) */
|
||||||
// ------------------------------------------------- PPC equivalent:
|
// ------------------------------------------------- PPC equivalent:
|
||||||
#elif OPAL_ENABLE_DLOPEN_SUPPORT && defined(__PPC__)
|
#elif OPAL_ENABLE_DLOPEN_SUPPORT && defined(__PPC__)
|
||||||
@ -338,10 +343,20 @@ int opal_patch_symbol (const char *sys_func, uintptr_t hook_addr)
|
|||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool opal_patch_supported (void)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int opal_patch_symbol (const char *sys_func, uintptr_t hook_addr) {
|
int opal_patch_symbol (const char *sys_func, uintptr_t hook_addr)
|
||||||
|
{
|
||||||
return OPAL_ERR_NOT_SUPPORTED;
|
return OPAL_ERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool opal_patch_supported (void)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -53,5 +53,9 @@
|
|||||||
*/
|
*/
|
||||||
int opal_patch_symbol (const char *func_symbol_name, uintptr_t func_new_addr);
|
int opal_patch_symbol (const char *func_symbol_name, uintptr_t func_new_addr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if symbol patching is available
|
||||||
|
*/
|
||||||
|
bool opal_patch_supported (void);
|
||||||
|
|
||||||
#endif /* !defined(OPAL_PATCHER_H) */
|
#endif /* !defined(OPAL_PATCHER_H) */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user