static const char *libappcore_path;
static struct dentry *libappcore_dentry;
+static const char *libcapi_path;
+static struct dentry *libcapi_dentry;
static void uninit_variables(void)
{
kfree(libappcore_path);
libappcore_path = NULL;
libappcore_dentry = NULL;
+
+ kfree(libcapi_path);
+ libcapi_path = NULL;
+ libcapi_dentry = NULL;
}
static bool is_init(void)
{
- return lpad_dentry && libappcore_dentry;
+ return lpad_dentry && libappcore_dentry && libcapi_dentry;
}
static int do_set_lpad_info(const char *path, unsigned long dlopen,
return 0;
}
-static int do_set_appcore_info(struct appcore_info_data *info)
+static int do_set_appcore_info(struct nsp_info_data *info)
{
struct dentry *dentry;
const char *new_path;
+ int ret = 0;
- dentry = dentry_by_path(info->path);
- if (dentry == NULL) {
- pr_err("dentry not found (path='%s')\n", info->path);
- return -EINVAL;
- }
-
- new_path = kstrdup(info->path, GFP_KERNEL);
- if (new_path == NULL) {
- pr_err("out of memory\n");
+ new_path = kstrdup(info->appcore_path, GFP_KERNEL);
+ if (!new_path)
return -ENOMEM;
- }
-
kfree(libappcore_path);
-
libappcore_path = new_path;
+
+ new_path = kstrdup(info->capi_path, GFP_KERNEL);
+ if (!new_path) {
+ ret = -ENOMEM;
+ goto fail_alloc;
+ }
+ kfree(libcapi_path);
+ libcapi_path = new_path;
+
+ dentry = dentry_by_path(info->appcore_path);
+ if (!dentry) {
+ pr_err("dentry not found (path='%s')\n", info->appcore_path);
+ ret = -EINVAL;
+ goto fail;
+ }
libappcore_dentry = dentry;
- p_ac_efl_main.offset = info->ac_efl_main;
+
+ dentry = dentry_by_path(info->capi_path);
+ if (!dentry) {
+ pr_err("dentry not found (path='%s')\n", info->capi_path);
+ ret = -EINVAL;
+ goto fail;
+ }
+ libcapi_dentry = dentry;
+
+ p_ac_efl_main.offset = info->ac_efl_init;
+ p_do_app.offset = info->do_app;
p_ac_init.offset = info->ac_init;
p_elm_run.offset = info->elm_run;
- p_do_app.offset = info->do_app;
return 0;
+
+fail:
+ kfree(libcapi_path);
+ libcapi_path = NULL;
+fail_alloc:
+ kfree(libappcore_path);
+ libappcore_path = NULL;
+
+ return ret;
}
if (ret)
goto ur_main;
- ret = pin_register(&p_ac_init, pfg, libappcore_dentry);
+ ret = pin_register(&p_ac_init, pfg, libcapi_dentry);
if (ret)
goto ur_ac_efl_main;
- ret = pin_register(&p_elm_run, pfg, libappcore_dentry);
+ ret = pin_register(&p_elm_run, pfg, libcapi_dentry);
if (ret)
goto ur_ac_init;
return 0;
ur_elm_run:
- pin_unregister(&p_elm_run, pfg, libappcore_dentry);
+ pin_unregister(&p_elm_run, pfg, libcapi_dentry);
ur_ac_init:
- pin_unregister(&p_ac_init, pfg, libappcore_dentry);
+ pin_unregister(&p_ac_init, pfg, libcapi_dentry);
ur_ac_efl_main:
pin_unregister(&p_ac_efl_main, pfg, libappcore_dentry);
ur_main:
struct pf_group *pfg = data->pfg;
pin_unregister(&p_do_app, pfg, libappcore_dentry);
- pin_unregister(&p_elm_run, pfg, libappcore_dentry);
- pin_unregister(&p_ac_init, pfg, libappcore_dentry);
+ pin_unregister(&p_elm_run, pfg, libcapi_dentry);
+ pin_unregister(&p_ac_init, pfg, libcapi_dentry);
pin_unregister(&p_ac_efl_main, pfg, libappcore_dentry);
pin_unregister(&data->p_main, pfg, data->app_dentry);
pin_unregister(&p_dlopen, pfg, lpad_dentry);
const char *, path, unsigned long, dlopen,
unsigned long, dlsym);
DECLARE_SAFE_FUNC1(nsp_set_appcore_info, do_set_appcore_info,
- struct appcore_info_data *, info);
+ struct nsp_info_data *, info);
/*
* format:
- * appcore_efl_main:__do_app:appcore_init@plt:elm_run@plt:libappcore-efl
+ * appcore_efl_init:__do_app:libappcore-efl ui_app_init:elm_run@plt:libcapi-appfw-application
*
* sample:
- * 0x3730:0x2960:0x1810:0x1c70:/usr/lib/libappcore-efl.so.1
+ * 0x2000:0x2ed0:/usr/lib/libappcore-efl.so.1 0x2b20:0x11f0:/usr/lib/libcapi-appfw-application.so.0
*/
static int do_set_appcore_info(const char *data, size_t len)
{
int n, ret;
- struct appcore_info_data info;
- const char fmt[] = "%%lx:%%lx:%%lx:%%lx:/%%%ds";
+ struct nsp_info_data info;
+ const char fmt[] = "%%lx:%%lx:/%%%ds %%lx:%%lx:/%%%ds";
char fmt_buf[64];
- char *path;
+ char *appcore_path, *capi_path;
- n = snprintf(fmt_buf, sizeof(fmt_buf), fmt, PATH_MAX - 2);
+ n = snprintf(fmt_buf, sizeof(fmt_buf), fmt, PATH_MAX - 2, PATH_MAX - 2);
if (n <= 0)
return -EINVAL;
- path = kmalloc(PATH_MAX, GFP_KERNEL);
- if (path == NULL)
+ appcore_path = kmalloc(PATH_MAX, GFP_KERNEL);
+ if (!appcore_path)
return -ENOMEM;
+ capi_path = kmalloc(PATH_MAX, GFP_KERNEL);
+ if (!capi_path) {
+ ret = -ENOMEM;
+ goto fail_alloc;
+ }
+
n = sscanf(data, fmt_buf,
- &info.ac_efl_main, &info.do_app,
- &info.ac_init, &info.elm_run, path + 1);
- if (n != 5) {
+ &info.ac_efl_init, &info.do_app, appcore_path + 1,
+ &info.ac_init, &info.elm_run, capi_path + 1);
+ if (n != 6) {
ret = -EINVAL;
- goto free_lib_path;
+ goto fail;
}
- path[0] = '/';
+ appcore_path[0] = '/';
+ capi_path[0] = '/';
- info.path = path;
+ info.appcore_path = appcore_path;
+ info.capi_path = capi_path;
ret = nsp_set_appcore_info(&info);
-free_lib_path:
- kfree(path);
+fail:
+ kfree(capi_path);
+fail_alloc:
+ kfree(appcore_path);
return ret;
}
"\tr $app_path - remove\n"
"\tc - remove all\n"
"\tb dlopen_addr@plt:dlsym_addr@plt:launchpad_path\n"
- "\tl appcore_efl_main:__do_app:appcore_init@plt:elm_run@plt:libappcore-efl_path\n";
+ "\tl appcore_efl_init:__do_app:libappcore-efl_path ui_app_init:elm_run@plt:libcapi-appfw-application_path\n";
ssize_t ret;
ret = simple_read_from_buffer(user_buf, count, ppos,