2 * @file buffer/buffer_queue.h
3 * @author Alexander Aksenov <a.aksenov@samsung.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * Copyright (C) Samsung Electronics, 2013
25 * @section DESCRIPTION
27 * Represents buffers queues interface
30 /* SWAP Buffer queues interface */
32 #ifndef __BUFFER_QUEUE_H__
33 #define __BUFFER_QUEUE_H__
35 #include <linux/types.h>
36 #include "buffer_description.h"
38 int buffer_queue_allocation(size_t subbuffer_size,
39 unsigned int subbuffers_count);
40 void buffer_queue_free(void);
41 int buffer_queue_reset(void);
42 void buffer_queue_flush(void);
43 struct swap_subbuffer *get_from_write_list(size_t size, void **ptr_to_write,
45 struct swap_subbuffer *get_from_read_list(void);
46 void add_to_write_list(struct swap_subbuffer *subbuffer);
47 void add_to_read_list(struct swap_subbuffer *subbuffer);
48 void add_to_busy_list(struct swap_subbuffer *subbuffer);
49 int remove_from_busy_list(struct swap_subbuffer *subbuffer);
51 unsigned int get_readable_buf_cnt(void);
52 unsigned int get_writable_buf_cnt(void);
53 int get_busy_buffers_count(void);
54 int get_pages_count_in_subbuffer(void);
56 #endif /* __BUFFER_QUEUE_H__ */