#include "buffer_queue.h"
#include "swap_buffer_to_buffer_queue.h"
#include "swap_buffer_errors.h"
+#include "kernel_operations.h"
/* Queue structure. Consist of pointers to the first and the last elements of
* queue. */
--- /dev/null
+/*
+ * SWAP Buffer Module
+ * modules/buffer/data_types.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright (C) Samsung Electronics, 2013
+ *
+ * 2013 Alexander Aksenov <a.aksenov@samsung.com>: SWAP Buffer implement
+ *
+ */
+
+#ifndef __DATA_TYPES_H__
+#define __DATA_TYPES_H__
+
+
+#include <linux/spinlock.h>
+
+
+struct page;
+
+/* Using spinlocks as sync primitives */
+struct sync_t {
+ spinlock_t spinlock;
+ unsigned long flags;
+};
+
+/* swap_subbuffer_ptr points to the first memory page of the subbuffer */
+typedef struct page *swap_subbuffer_ptr;
+
+#endif /* __DATA_TYPES_H__ */
#include <linux/gfp.h>
#include <linux/mm.h>
+#include "data_types.h"
/* MESSAGES */
/* LOCKS */
-/* Using spinlocks as sync primitives */
-struct sync_t {
- spinlock_t spinlock;
- unsigned long flags;
-};
-
/* Spinlocks initialization */
static inline void sync_init(struct sync_t *buffer_sync)
{
/* SWAP SUBBUFER */
-/* swap_subbuffer_ptr points to the first memory page of the subbuffer */
-typedef struct page *swap_subbuffer_ptr;
/* We alloc memory for swap_subbuffer structures with common kmalloc */
#define memory_allocation(memory_size) kmalloc(memory_size, GFP_KERNEL)
#include "buffer_queue.h"
#include "buffer_description.h"
#include "swap_buffer_errors.h"
+#include "kernel_operations.h"
/* Bitwise mask for buffer status */
enum _swap_buffer_status_mask {