[STYLE] Code-style fix
authorAlexander Aksenov <a.aksenov@samsung.com>
Sun, 14 Jul 2013 13:01:03 +0000 (17:01 +0400)
committerAlexander Aksenov <a.aksenov@samsung.com>
Sun, 14 Jul 2013 13:01:03 +0000 (17:01 +0400)
buffer/swap_buffer_module.c
driver_new/device_driver.c
driver_new/device_driver.h
driver_new/driver_to_buffer.c
driver_new/driver_to_buffer.h
driver_new/swap_driver_module.c
driver_new/swap_ioctl.h
sampler/kernel_operations.h
sampler/swap_sampler_module.c

index 3e72af4..ec474e0 100644 (file)
@@ -268,3 +268,6 @@ static void __exit swap_buffer_module_exit(void)
 module_init(swap_buffer_module_init);
 module_exit(swap_buffer_module_exit);
 
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SWAP buffer module");
+MODULE_AUTHOR("Aksenov A.S.");
index 188919a..de3007a 100644 (file)
@@ -124,8 +124,6 @@ int swap_device_init(void)
                goto init_fail;
        }
 
-       print_debug("Device with major num %d allocated\n", MAJOR(swap_device_no));
-
        /* Creating device class. Using IS_ERR, because class_create returns ERR_PTR
         * on error. */
        swap_device_class = class_create(THIS_MODULE, SWAP_DEVICE_NAME);
@@ -203,7 +201,6 @@ void swap_device_exit(void)
        cdev_del(swap_device_cdev);
        class_destroy(swap_device_class);
        unregister_chrdev_region(swap_device_no, 1);
-       print_debug("Device unregistered\n");
 }
 
 static int swap_device_open(struct inode *inode, struct file *filp)
@@ -303,7 +300,6 @@ static long swap_device_ioctl(struct file *filp, unsigned int cmd,
        switch(cmd) {
                case SWAP_DRIVER_BUFFER_INITIALIZE:
                {
-                       print_debug("SWAP_DRIVER_BUFFER_INITIALIZE\n");
                        struct buffer_initialize initialize_struct;
 
                        result = copy_from_user(&initialize_struct, (void*)arg,
@@ -324,7 +320,6 @@ static long swap_device_ioctl(struct file *filp, unsigned int cmd,
                }
                case SWAP_DRIVER_BUFFER_UNINITIALIZE:
                {
-                       print_debug("SWAP_DRIVER_BUFFER_UNINITIALIZE\n");
                        result = driver_to_buffer_uninitialize();
                        if (result < 0)
                        print_err("Buffer uninitialization failed %d\n", result);
@@ -333,7 +328,6 @@ static long swap_device_ioctl(struct file *filp, unsigned int cmd,
                }
                case SWAP_DRIVER_NEXT_BUFFER_TO_READ:
                {
-                       print_debug("SWAP_DRIVER_NEXT_BUFFER_TO_READ\n");
                        /* Use this carefully */
                        result = driver_to_buffer_next_buffer_to_read();
                        if (result == E_SD_NO_DATA_TO_READ) {
@@ -344,7 +338,6 @@ static long swap_device_ioctl(struct file *filp, unsigned int cmd,
                }
                case SWAP_DRIVER_FLUSH_BUFFER:
                {
-                       print_debug("SWAP_DRIVER_FLUSH_BUFFER\n");
                        result = driver_to_buffer_flush();
                        break;
                }
index d809e1b..09a254d 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ *  SWAP driver
+ *  modules/driver_new/device_driver.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 device driver implement
+ *
+ */
+
 #ifndef __SWAP_DRIVER_DEVICE_DRIVER_H__
 #define __SWAP_DRIVER_DEVICE_DRIVER_H__
 
index 7ae7e42..bc4b5ed 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ *  SWAP driver
+ *  modules/driver_new/driver_to_buffer.c
+ *
+ * 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 device driver implement
+ *
+ */
+
 #include <linux/string.h>
 #include <linux/slab.h>
 #include <linux/splice.h>
@@ -25,129 +49,127 @@ static int pages_per_buffer = 0;
 /* TODO Get subbuffer for reading */
 static size_t driver_to_buffer_get(void)
 {
-    int result;
-
-    /* If there is no readable buffers, return error */
-    result = swap_buffer_get(&busy_buffer);
-    if (result == -E_SB_NO_READABLE_BUFFERS) {
-        busy_buffer = NULL;
-        return -E_SD_NO_DATA_TO_READ;
-    } else if (result < 0) {
-        print_err("swap_buffer_get unhandle error %d\n", result);
-        return -E_SD_BUFFER_ERROR;
-    }
-
-    return busy_buffer->full_buffer_part;
+       int result;
+
+       /* If there is no readable buffers, return error */
+       result = swap_buffer_get(&busy_buffer);
+       if (result == -E_SB_NO_READABLE_BUFFERS) {
+               busy_buffer = NULL;
+               return -E_SD_NO_DATA_TO_READ;
+       } else if (result < 0) {
+               print_err("swap_buffer_get unhandle error %d\n", result);
+               return -E_SD_BUFFER_ERROR;
+       }
+
+       return busy_buffer->full_buffer_part;
 }
 
 /* TODO Release subbuffer */
 static int driver_to_buffer_release(void)
 {
-    int result;
+       int result;
 
-    if (!busy_buffer)
-        return -E_SD_NO_BUSY_SUBBUFFER;
+       if (!busy_buffer)
+               return -E_SD_NO_BUSY_SUBBUFFER;
 
-    result = swap_buffer_release(&busy_buffer);
-    if (result == -E_SB_NO_SUBBUFFER_IN_BUSY) {
-        return -E_SD_WRONG_SUBBUFFER_PTR;
-    } else if (result < 0) {
-        print_err("swap_buffer_release unhandle error %d\n", result);
-        return -E_SD_BUFFER_ERROR;
-    }
+       result = swap_buffer_release(&busy_buffer);
+       if (result == -E_SB_NO_SUBBUFFER_IN_BUSY) {
+               return -E_SD_WRONG_SUBBUFFER_PTR;
+       } else if (result < 0) {
+               print_err("swap_buffer_release unhandle error %d\n", result);
+               return -E_SD_BUFFER_ERROR;
+       }
 
-    busy_buffer = NULL;
+       busy_buffer = NULL;
 
-    return E_SD_SUCCESS;
+       return E_SD_SUCCESS;
 }
 
 /* Buffers callback function */
 int driver_to_buffer_callback(void)
 {
 //XXX: Think of sync with get next
-    int result;
+       int result;
 
-    /* Increment buffers_to_read counter */
-    buffers_to_read++;
-    swap_device_wake_up_process();
+       /* Increment buffers_to_read counter */
+       buffers_to_read++;
+       swap_device_wake_up_process();
 
-    return E_SD_SUCCESS;
+       return E_SD_SUCCESS;
 }
 
 /* Write to buffers */
 ssize_t driver_to_buffer_write(size_t size, void* data)
 {
-    ssize_t result;
-
-    result = us_msg(data);
-//    result = swap_buffer_write(data, size);
-    if (result == -E_SB_IS_STOPPED) {
-        print_err("Buffer is not run! Initialize it before writing\n");
-        return -E_SD_WRITE_ERROR;
-    } else if (result < 0) {
-        print_err("swap_buffer_write error %d\n", result);
-        return -E_SD_WRITE_ERROR;
-    }
-    print_debug("swap_buffer writed %d\n", result);
-
-    return result;
+       ssize_t result;
+
+       result = us_msg(data);
+       if (result == -E_SB_IS_STOPPED) {
+               print_err("Buffer is not run! Initialize it before writing\n");
+               return -E_SD_WRITE_ERROR;
+       } else if (result < 0) {
+               print_err("swap_buffer_write error %d\n", result);
+               return -E_SD_WRITE_ERROR;
+       }
+
+       return result;
 }
 
 /* Read buffers */
 ssize_t driver_to_buffer_read(char __user *buf, size_t count)
 {
-    size_t bytes_to_copy;
-    size_t bytes_to_read = 0;
-    int page_counter = 0;
-
-    /* Reading from swap_device means reading only current busy_buffer. So, if
-     * there is no busy_buffer, we don't get next to read, we just read nothing.
-     * In this case, or if there is nothing to read from busy_buffer - return
-     * -E_SD_NO_DATA_TO_READ. It should be correctly handled in device_driver */
-    if (!busy_buffer || !busy_buffer->full_buffer_part)
-        return -E_SD_NO_DATA_TO_READ;
-
-    /* Bytes count that we're going to copy to user buffer is equal to user
-     * buffer size or to subbuffer readable size whichever is less */
-    bytes_to_copy = (count > busy_buffer->full_buffer_part) ?
-                    busy_buffer->full_buffer_part : count;
-
-    /* Copy data from each page to buffer */
-    while(bytes_to_copy > 0) {
-        /* Get size that should be copied from current page */
-        size_t read_from_this_page = (bytes_to_copy > PAGE_SIZE) ? PAGE_SIZE
-                                                                 : bytes_to_copy;
-
-        /* Copy and add size to copied bytes count */
-
-        // TODO Check with more than one page
-        bytes_to_read += read_from_this_page -
-                         copy_to_user(buf, page_address(busy_buffer->data_buffer) +
-                                                        (sizeof(struct page*) *
-                                                         page_counter),
-                                                        read_from_this_page);
-        bytes_to_copy -= read_from_this_page;
-        page_counter++;
-    }
-
-    return bytes_to_read;
+       size_t bytes_to_copy;
+       size_t bytes_to_read = 0;
+       int page_counter = 0;
+
+       /* Reading from swap_device means reading only current busy_buffer. So, if
+        * there is no busy_buffer, we don't get next to read, we just read nothing.
+        * In this case, or if there is nothing to read from busy_buffer - return
+        * -E_SD_NO_DATA_TO_READ. It should be correctly handled in device_driver */
+       if (!busy_buffer || !busy_buffer->full_buffer_part)
+               return -E_SD_NO_DATA_TO_READ;
+
+       /* Bytes count that we're going to copy to user buffer is equal to user
+        * buffer size or to subbuffer readable size whichever is less */
+       bytes_to_copy = (count > busy_buffer->full_buffer_part) ?
+                   busy_buffer->full_buffer_part : count;
+
+       /* Copy data from each page to buffer */
+       while(bytes_to_copy > 0) {
+               /* Get size that should be copied from current page */
+               size_t read_from_this_page = (bytes_to_copy > PAGE_SIZE) ? PAGE_SIZE
+                                                                : bytes_to_copy;
+
+               /* Copy and add size to copied bytes count */
+
+               // TODO Check with more than one page
+               bytes_to_read += read_from_this_page -
+                        copy_to_user(buf, page_address(busy_buffer->data_buffer) +
+                                                       (sizeof(struct page*) *
+                                                        page_counter),
+                                                       read_from_this_page);
+               bytes_to_copy -= read_from_this_page;
+               page_counter++;
+       }
+
+       return bytes_to_read;
 }
 
 /* Flush swap_buffer */
 int driver_to_buffer_flush(void)
 {
-    int result;
+       int result;
 
-    result = swap_buffer_flush();
+       result = swap_buffer_flush();
 
-    if (result >= 0)
-        buffers_to_read = result;
-    else if (result < 0)
-        return -E_SD_BUFFER_ERROR;
+       if (result >= 0)
+               buffers_to_read = result;
+       else if (result < 0)
+               return -E_SD_BUFFER_ERROR;
 
-    swap_device_wake_up_process();
+       swap_device_wake_up_process();
 
-    return E_SD_SUCCESS;
+       return E_SD_SUCCESS;
 }
 
 /* Fills spd structure */
@@ -168,8 +190,8 @@ int driver_to_buffer_fill_spd(struct splice_pipe_desc *spd)
 
                /* FIXME: maybe there is more efficient way */
                memcpy(page_address(pages[spd->nr_pages]),
-                      page_address(&busy_buffer->data_buffer[spd->nr_pages]),
-                      read_from_current_page);
+              page_address(&busy_buffer->data_buffer[spd->nr_pages]),
+              read_from_current_page);
 
                /* Always beginning of the page */
                partial[spd->nr_pages].offset = 0;
@@ -185,103 +207,103 @@ int driver_to_buffer_fill_spd(struct splice_pipe_desc *spd)
                /* if (spd->nr_pages == pipe->buffers) { */
                /*      break; */
                /* } */
-    }
-    return 0;
+       }
+       return 0;
 }
 
 /* Check for subbuffers ready to be read */
 int driver_to_buffer_buffer_to_read(void)
 {
-    return busy_buffer ? 1 : 0;
+       return busy_buffer ? 1 : 0;
 }
 
 /* Set buffers size and count */
 int driver_to_buffer_initialize(size_t size, unsigned int count)
 {
-    int result;
-
-    if (size == 0 && count == 0) {
-        return -E_SD_WRONG_ARGS;
-    }
-
-    result = swap_buffer_init(size, count, (void*)&driver_to_buffer_callback);
-    if (result == -E_SB_NO_MEM_QUEUE_BUSY
-        || result == -E_SB_NO_MEM_BUFFER_STRUCT) {
-        return -E_SD_NO_MEMORY;
-    }
-
-    // TODO Race condition: buffer can be used in other thread till we're in
-    // this func
-    /* Initialize driver_to_buffer variables */
-    pages_per_buffer = result;
-    busy_buffer = NULL;
-    buffers_to_read = 0;
-
-    return E_SD_SUCCESS;
+       int result;
+
+       if (size == 0 && count == 0) {
+               return -E_SD_WRONG_ARGS;
+       }
+
+       result = swap_buffer_init(size, count, (void*)&driver_to_buffer_callback);
+       if (result == -E_SB_NO_MEM_QUEUE_BUSY
+               || result == -E_SB_NO_MEM_BUFFER_STRUCT) {
+               return -E_SD_NO_MEMORY;
+       }
+
+       // TODO Race condition: buffer can be used in other thread till we're in
+       // this func
+       /* Initialize driver_to_buffer variables */
+       pages_per_buffer = result;
+       busy_buffer = NULL;
+       buffers_to_read = 0;
+
+       return E_SD_SUCCESS;
 }
 
 /* Uninitialize buffer */
 int driver_to_buffer_uninitialize(void)
 {
-    int result;
-
-    /* Release occupied buffer */
-    if (busy_buffer) {
-        result = driver_to_buffer_release();
-        // TODO Maybe release anyway
-        if (result < 0) {
-            return result;
-        }
-        busy_buffer = NULL;
-    }
-
-    result = swap_buffer_uninit();
-    if (result == -E_SB_UNRELEASED_BUFFERS) {
-        print_err("Can't uninit buffer! There are busy subbuffers!\n");
-        result = -E_SD_BUFFER_ERROR;
-    } else if (result < 0) {
-        print_err("swap_buffer_uninit error %d\n", result);
-        result = -E_SD_BUFFER_ERROR;
-    } else {
-        result = E_SD_SUCCESS;
-    }
-
-    /* Reinit driver_to_buffer vars */
-    buffers_to_read = 0;
-    pages_per_buffer = 0;
-
-    return result;
+       int result;
+
+       /* Release occupied buffer */
+       if (busy_buffer) {
+               result = driver_to_buffer_release();
+               // TODO Maybe release anyway
+               if (result < 0) {
+                       return result;
+               }
+               busy_buffer = NULL;
+       }
+
+       result = swap_buffer_uninit();
+       if (result == -E_SB_UNRELEASED_BUFFERS) {
+               print_err("Can't uninit buffer! There are busy subbuffers!\n");
+               result = -E_SD_BUFFER_ERROR;
+       } else if (result < 0) {
+               print_err("swap_buffer_uninit error %d\n", result);
+               result = -E_SD_BUFFER_ERROR;
+       } else {
+               result = E_SD_SUCCESS;
+       }
+
+       /* Reinit driver_to_buffer vars */
+       buffers_to_read = 0;
+       pages_per_buffer = 0;
+
+       return result;
 }
 
 /* Get next buffer to read */
 int driver_to_buffer_next_buffer_to_read(void)
 {
 //XXX: Think of sync with callback
-    int result;
-
-    /* If there is busy_buffer first release it */
-    if (busy_buffer) {
-        result = driver_to_buffer_release();
-        if (result)
-            return result;
-    }
-
-    /* If there is no buffers to read, return E_SD_NO_DATA_TO_READ.
-     * SHOULD BE POSITIVE, cause there is no real error. */
-    if (!buffers_to_read) {
-        return E_SD_NO_DATA_TO_READ;
-    }
-
-    /* Get next buffer to read */
-    result = driver_to_buffer_get();
-    if (result < 0) {
-        print_err("buffer_to_reads > 0, but there are no buffers to read\n");
-        return result;
-    }
-
-    /* Decrement buffers_to_read counter */
-    buffers_to_read--;
-
-    return E_SD_SUCCESS;
+       int result;
+
+       /* If there is busy_buffer first release it */
+       if (busy_buffer) {
+               result = driver_to_buffer_release();
+               if (result)
+                       return result;
+       }
+
+       /* If there is no buffers to read, return E_SD_NO_DATA_TO_READ.
+        * SHOULD BE POSITIVE, cause there is no real error. */
+       if (!buffers_to_read) {
+               return E_SD_NO_DATA_TO_READ;
+       }
+
+       /* Get next buffer to read */
+       result = driver_to_buffer_get();
+       if (result < 0) {
+               print_err("buffer_to_reads > 0, but there are no buffers to read\n");
+               return result;
+       }
+
+       /* Decrement buffers_to_read counter */
+       buffers_to_read--;
+
+       return E_SD_SUCCESS;
 }
 
index 337791b..b566230 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ *  SWAP driver
+ *  modules/driver_new/driver_to_buffer.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 device driver implement
+ *
+ */
+
 #ifndef __SWAP_DRIVER_DRIVER_TO_BUFFER__
 #define __SWAP_DRIVER_DRIVER_TO_BUFFER__
 
index 9581128..d0ef7fe 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ *  SWAP driver
+ *  modules/driver_new/swap_driver_module.c
+ *
+ * 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 device driver implement
+ *
+ */
+
 #include <linux/module.h>
 
 #include "driver_defs.h"
@@ -6,7 +30,7 @@
 static int __init swap_driver_init(void)
 {
        swap_device_init();
-    print_msg("Driver module initialized\n");
+       print_msg("Driver module initialized\n");
 
        return 0;
 }
@@ -14,10 +38,12 @@ static int __init swap_driver_init(void)
 static void __exit swap_driver_exit(void)
 {
        swap_device_exit();
-    print_msg("Driver module uninitialized\n");
+       print_msg("Driver module uninitialized\n");
 }
 
 module_init(swap_driver_init);
 module_exit(swap_driver_exit);
 
 MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SWAP device driver");
+MODULE_AUTHOR("Aksenov A.S.");
index fe313f2..a478d43 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ *  SWAP driver
+ *  modules/driver_new/swap_ioctl.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 device driver implement
+ *
+ */
+
 #ifndef __SWAP_IOCTL_H__
 #define __SWAP_IOCTL_H__
 
@@ -5,8 +29,6 @@
 
 #define SWAP_DRIVER_IOC_MAGIC 0xAF
 
-/* TODO: Think about magic num */
-
 struct buffer_initialize {
        size_t size;
        unsigned int count;
index 5170d36..859e893 100644 (file)
@@ -1,3 +1,31 @@
+/*
+ *  SWAP sampler
+ *  modules/sampler/kernel_operations.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 samler kernel
+ *                                                  operations implement
+ *
+ */
+
+#ifndef __KERNEL_OPERATIONS_H__
+#define __KERNEL_OPERATIONS_H__
+
 #include <linux/kernel.h>
 
 #define print_debug(msg, args...) \
@@ -10,3 +38,5 @@
        printk(KERN_ERR "SWAP_SAMPLER ERROR : " msg, ##args)
 #define print_crit(msg, args...)  \
        printk(KERN_CRIT "SWAP_SAMPLER CRITICAL : " msg, ##args)
+
+#endif /* __KERNEL_OPERATIONS_H__ */
index 2bcd8cf..d2c9413 100644 (file)
@@ -1,3 +1,28 @@
+/*
+ *  SWAP sampler
+ *  modules/sampler/swap_sampler_module.c
+ *
+ * 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
+ *
+ * 2012  Andreev S.V.: SWAP Sampler implementation
+ * 2013         Alexander Aksenov <a.aksenov@samsung.com>: SWAP sampler porting
+ *
+ */
+
 #include <linux/timer.h>
 #include <asm/ptrace.h>
 #include <asm/processor.h>