• Home
  • Raw
  • Download

Lines Matching refs:func

89 	struct klp_func *func;  in klp_find_func()  local
91 klp_for_each_func(obj, func) { in klp_find_func()
92 if ((strcmp(old_func->old_name, func->old_name) == 0) && in klp_find_func()
93 (old_func->old_sympos == func->old_sympos)) { in klp_find_func()
94 return func; in klp_find_func()
458 struct klp_func *func);
485 static void klp_free_func_nop(struct klp_func *func) in klp_free_func_nop() argument
487 kfree(func->old_name); in klp_free_func_nop()
488 kfree(func); in klp_free_func_nop()
494 struct klp_func *func; in klp_alloc_func_nop() local
496 func = kzalloc(sizeof(*func), GFP_KERNEL); in klp_alloc_func_nop()
497 if (!func) in klp_alloc_func_nop()
501 func->old_name = kstrdup(old_func->old_name, GFP_KERNEL); in klp_alloc_func_nop()
502 if (!func->old_name) { in klp_alloc_func_nop()
503 kfree(func); in klp_alloc_func_nop()
508 klp_init_func_early(obj, func); in klp_alloc_func_nop()
513 func->old_sympos = old_func->old_sympos; in klp_alloc_func_nop()
514 func->nop = true; in klp_alloc_func_nop()
516 return func; in klp_alloc_func_nop()
523 struct klp_func *func, *old_func; in klp_add_object_nops() local
534 func = klp_find_func(obj, old_func); in klp_add_object_nops()
535 if (func) in klp_add_object_nops()
538 func = klp_alloc_func_nop(old_func, obj); in klp_add_object_nops()
539 if (!func) in klp_add_object_nops()
601 struct klp_func *func; in klp_kobj_release_func() local
603 func = container_of(kobj, struct klp_func, kobj); in klp_kobj_release_func()
605 if (func->nop) in klp_kobj_release_func()
606 klp_free_func_nop(func); in klp_kobj_release_func()
616 struct klp_func *func, *tmp_func; in __klp_free_funcs() local
618 klp_for_each_func_safe(obj, func, tmp_func) { in __klp_free_funcs()
619 if (nops_only && !func->nop) in __klp_free_funcs()
622 list_del(&func->node); in __klp_free_funcs()
623 kobject_put(&func->kobj); in __klp_free_funcs()
630 struct klp_func *func; in klp_free_object_loaded() local
634 klp_for_each_func(obj, func) { in klp_free_object_loaded()
635 func->old_func = NULL; in klp_free_object_loaded()
637 if (func->nop) in klp_free_object_loaded()
638 func->new_func = NULL; in klp_free_object_loaded()
736 static int klp_init_func(struct klp_object *obj, struct klp_func *func) in klp_init_func() argument
738 if (!func->old_name) in klp_init_func()
745 if (!func->new_func && !func->nop) in klp_init_func()
748 if (strlen(func->old_name) >= KSYM_NAME_LEN) in klp_init_func()
751 INIT_LIST_HEAD(&func->stack_node); in klp_init_func()
752 func->patched = false; in klp_init_func()
753 func->transition = false; in klp_init_func()
760 return kobject_add(&func->kobj, &obj->kobj, "%s,%lu", in klp_init_func()
761 func->old_name, in klp_init_func()
762 func->old_sympos ? func->old_sympos : 1); in klp_init_func()
792 struct klp_func *func; in klp_init_object_loaded() local
807 klp_for_each_func(obj, func) { in klp_init_object_loaded()
808 ret = klp_find_object_symbol(obj->name, func->old_name, in klp_init_object_loaded()
809 func->old_sympos, in klp_init_object_loaded()
810 (unsigned long *)&func->old_func); in klp_init_object_loaded()
814 ret = kallsyms_lookup_size_offset((unsigned long)func->old_func, in klp_init_object_loaded()
815 &func->old_size, NULL); in klp_init_object_loaded()
818 func->old_name); in klp_init_object_loaded()
822 if (func->nop) in klp_init_object_loaded()
823 func->new_func = func->old_func; in klp_init_object_loaded()
825 ret = kallsyms_lookup_size_offset((unsigned long)func->new_func, in klp_init_object_loaded()
826 &func->new_size, NULL); in klp_init_object_loaded()
829 func->old_name); in klp_init_object_loaded()
839 struct klp_func *func; in klp_init_object() local
856 klp_for_each_func(obj, func) { in klp_init_object()
857 ret = klp_init_func(obj, func); in klp_init_object()
869 struct klp_func *func) in klp_init_func_early() argument
871 kobject_init(&func->kobj, &klp_ktype_func); in klp_init_func_early()
872 list_add_tail(&func->node, &obj->func_list); in klp_init_func_early()
886 struct klp_func *func; in klp_init_patch_early() local
899 klp_for_each_func_static(obj, func) { in klp_init_patch_early()
900 klp_init_func_early(obj, func); in klp_init_patch_early()