#define __NO_VERSION__
#include <linux/module.h>
#include <linux/version.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/ioctl.h>
#include <linux/proc_fs.h>
#include <linux/wrapper.h>
#include <asm/io.h>


typedef int sint32_t;

char kernel_version[]= UTS_RELEASE;

uint8_t        *pu8_buffer;

int init_module (void)
{
    dma_addr_t      str_phys_addr;

    printk ("Init module\n");

    pu8_buffer = consistent_alloc (GFP_KERNEL, 0x200000, &str_phys_addr);

    if (pu8_buffer == NULL)
    {
        printk ("Could not allocate memory\n");

        return 0;
    }

    printk ("Physical address = 0x%x\n", str_phys_addr);
    printk ("Virtual address = 0x%x\n", (uint32_t) pu8_buffer);

    return 0;
}

void cleanup_module (void)
{
    printk ("Freeing )x%x\n", (uint32_t) pu8_buffer);

    consistent_free (pu8_buffer);

    return;
}
