}
EXPORT_SYMBOL_GPL(get_ret_addr);
-/*function call removes all OTG-probes installed in library "lib_to_delete"*/
-void otg_probe_list_clean(char* lib_to_delete)
-{
- struct task_struct *task = current->group_leader;
- struct mm_struct *mm;
- struct vm_area_struct *vma = 0;
- char *filename = "";
- char *buf = "";
- unsigned long int addr_max = 0;
- unsigned long int addr_min = 0;
- int err;
- us_proc_otg_ip_t *p;
- struct dentry *delete_dentry = get_dentry(lib_to_delete);
-
- mm = task->active_mm;
-/*find in process space map file with name "lib_to_delete" and flag VM_EXEC
-and save address borders of this file*/
- if (mm) {
- vma = mm->mmap;
- while (vma) {
- if(vma->vm_file) {
- if(vma->vm_file->f_dentry) {
- if ((delete_dentry == vma->vm_file->f_dentry) && (vma->vm_flags & VM_EXEC)) {
- addr_min = vma->vm_start;
- addr_max = vma->vm_end;
- break;
- }
- }
- }
- vma = vma->vm_next;
- }
- }
-
-/*remove OTG-probe if its address is between addr_min and addr_max*/
- list_for_each_entry_rcu (p, &otg_us_proc_info, list) {
- if (!p->ip.installed) {
- continue;
- }
- if ( ((unsigned long)p->ip.jprobe.kp.addr < addr_max) &&
- ((unsigned long)p->ip.jprobe.kp.addr >= addr_min) ) {
- err = unregister_usprobe(task, &p->ip, 1);
- if (err != 0) {
- EPRINTF("failed to uninstall IP at %p. Error %d!",
- p->ip.jprobe.kp.addr, err);
- continue;
- }
- p->ip.installed = 0;
- remove_otg_probe_from_list(p->ip.offset);
- }
- }
-}
-EXPORT_SYMBOL_GPL(otg_probe_list_clean);
/* Detects when IPs are really loaded into phy mem and installs probes. */
extern void do_page_fault_ret_pre_code (void);
-extern void otg_probe_list_clean(char*);
/* Detects when target process exits. */
extern void do_exit_probe_pre_code (void);