2 * @file kprobe/swap_slots.h
3 * @author Alexey Gerenkov <a.gerenkov@samsung.com> User-Space Probes initial implementation;
4 * Support x86/ARM/MIPS for both user and kernel spaces.
5 * @author Ekaterina Gorelkina <e.gorelkina@samsung.com>: redesign module for separating core and arch parts
6 * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com> new memory allocator for slots
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 * Copyright (C) IBM Corporation, 2002, 2004
27 * Copyright (C) Samsung Electronics, 2006-2010
29 * @section DESCRIPTION
31 * SWAP slots interface declaration.
37 #include <linux/types.h>
40 * @struct slot_manager
41 * @brief Manage slots.
42 * @var slot_manager::slot_size
44 * @var slot_manager::alloc
45 * Memory allocation callback.
46 * @var slot_manager::free
47 * Memory release callback.
48 * @var slot_manager::page_list
50 * @var slot_manager::data
51 * Slot manager data. task_struct pointer usually stored here.
54 unsigned long slot_size; /* FIXME: allocated in long (4 byte) */
55 void *(*alloc)(struct slot_manager *sm);
56 void (*free)(struct slot_manager *sm, void *ptr);
57 struct hlist_head page_list;
61 void *swap_slot_alloc(struct slot_manager *sm);
62 void swap_slot_free(struct slot_manager *sm, void *slot);
64 #endif /* _SWAP_SLOTS_H */