[STYLE] Kprobe: doxygen comments
[kernel/swap-modules.git] / kprobe / swap_slots.h
1 /**
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
7  *
8  * @section LICENSE
9  *
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.
14  *
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.
19  *
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.
23  *
24  * @section COPYRIGHT
25  *
26  * Copyright (C) IBM Corporation, 2002, 2004
27  * Copyright (C) Samsung Electronics, 2006-2010
28  *
29  * @section DESCRIPTION
30  *
31  * SWAP slots interface declaration.
32  */
33
34 #ifndef _SWAP_SLOTS_H
35 #define _SWAP_SLOTS_H
36
37 #include <linux/types.h>
38
39 /**
40  * @struct slot_manager
41  * @brief Manage slots.
42  * @var slot_manager::slot_size
43  * Size of the slot.
44  * @var slot_manager::alloc
45  * Memory allocation callback.
46  * @var slot_manager::free
47  * Memory release callback.
48  * @var slot_manager::page_list
49  * List of pages.
50  * @var slot_manager::data
51  * Slot manager data. task_struct pointer usually stored here.
52  */
53 struct slot_manager {
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;
58         void *data;
59 };
60
61 void *swap_slot_alloc(struct slot_manager *sm);
62 void swap_slot_free(struct slot_manager *sm, void *slot);
63
64 #endif /* _SWAP_SLOTS_H */