3 * modules/us_manager/img/img_ip.c
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 * Copyright (C) Samsung Electronics, 2013
21 * 2013 Vyacheslav Cherkashin: SWAP us_manager implement
27 #include <us_manager/probes/use_probes.h>
28 #include <linux/slab.h>
31 * @brief Create img_ip struct
33 * @param addr Function address
34 * @param probe_i Pointer to the probe info data.
35 * @return Pointer to the created img_ip struct
37 struct img_ip *create_img_ip(unsigned long addr, struct probe_info *info)
41 ip = kmalloc(sizeof(*ip), GFP_ATOMIC);
43 struct probe_info *info_new;
45 info_new = probe_info_dup(info);
46 if (info_new == NULL) {
51 probe_info_copy(info, info_new);
53 INIT_LIST_HEAD(&ip->list);
62 * @brief Remove img_ip struct
64 * @param ip remove object
67 void free_img_ip(struct img_ip *ip)
69 probe_info_cleanup(ip->info);
70 probe_info_free(ip->info);
77 * @param ip Pointer to the img_ip struct
82 void img_ip_print(struct img_ip *ip)
84 if (ip->info->probe_type == SWAP_RETPROBE)
85 printk(KERN_INFO "### addr=8%lx, args=%s\n",
86 ip->addr, ip->info->rp_i.args);