Release 4.14 arch/um/drivers/mmapper_kern.c
/*
* arch/um/drivers/mmapper_kern.c
*
* BRIEF MODULE DESCRIPTION
*
* Copyright (C) 2000 RidgeRun, Inc.
* Author: RidgeRun, Inc.
* Greg Lonnon glonnon@ridgerun.com or info@ridgerun.com
*
*/
#include <linux/stddef.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/uaccess.h>
#include <mem_user.h>
/* These are set in mmapper_init, which is called at boot time */
static unsigned long mmapper_size;
static unsigned long p_buf;
static char *v_buf;
static ssize_t mmapper_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos)
{
return simple_read_from_buffer(buf, count, ppos, v_buf, mmapper_size);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 30 | 81.08% | 1 | 50.00% |
Al Viro | 7 | 18.92% | 1 | 50.00% |
Total | 37 | 100.00% | 2 | 100.00% |
static ssize_t mmapper_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
if (*ppos > mmapper_size)
return -EINVAL;
return simple_write_to_buffer(v_buf, mmapper_size, ppos, buf, count);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 43 | 87.76% | 1 | 33.33% |
Akinobu Mita | 5 | 10.20% | 1 | 33.33% |
Al Viro | 1 | 2.04% | 1 | 33.33% |
Total | 49 | 100.00% | 3 | 100.00% |
static long mmapper_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
return -ENOIOCTLCMD;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 22 | 95.65% | 1 | 50.00% |
Arnd Bergmann | 1 | 4.35% | 1 | 50.00% |
Total | 23 | 100.00% | 2 | 100.00% |
static int mmapper_mmap(struct file *file, struct vm_area_struct *vma)
{
int ret = -EINVAL;
int size;
if (vma->vm_pgoff != 0)
goto out;
size = vma->vm_end - vma->vm_start;
if (size > mmapper_size)
return -EFAULT;
/*
* XXX A comment above remap_pfn_range says it should only be
* called when the mm semaphore is held
*/
if (remap_pfn_range(vma, vma->vm_start, p_buf >> PAGE_SHIFT, size,
vma->vm_page_prot))
goto out;
ret = 0;
out:
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 87 | 96.67% | 2 | 66.67% |
William Lee Irwin III | 3 | 3.33% | 1 | 33.33% |
Total | 90 | 100.00% | 3 | 100.00% |
static int mmapper_open(struct inode *inode, struct file *file)
{
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
static int mmapper_release(struct inode *inode, struct file *file)
{
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
static const struct file_operations mmapper_fops = {
.owner = THIS_MODULE,
.read = mmapper_read,
.write = mmapper_write,
.unlocked_ioctl = mmapper_ioctl,
.mmap = mmapper_mmap,
.open = mmapper_open,
.release = mmapper_release,
.llseek = default_llseek,
};
/*
* No locking needed - only used (and modified) by below initcall and exitcall.
*/
static struct miscdevice mmapper_dev = {
.minor = MISC_DYNAMIC_MINOR,
.name = "mmapper",
.fops = &mmapper_fops
};
static int __init mmapper_init(void)
{
int err;
printk(KERN_INFO "Mapper v0.1\n");
v_buf = (char *) find_iomem("mmapper", &mmapper_size);
if (mmapper_size == 0) {
printk(KERN_ERR "mmapper_init - find_iomem failed\n");
return -ENODEV;
}
p_buf = __pa(v_buf);
err = misc_register(&mmapper_dev);
if (err) {
printk(KERN_ERR "mmapper - misc_register failed, err = %d\n",
err);
return err;
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 62 | 72.94% | 2 | 40.00% |
Thomas Gleixner | 14 | 16.47% | 1 | 20.00% |
Paolo 'Blaisorblade' Giarrusso | 8 | 9.41% | 1 | 20.00% |
Andrew Morton | 1 | 1.18% | 1 | 20.00% |
Total | 85 | 100.00% | 5 | 100.00% |
static void mmapper_exit(void)
{
misc_deregister(&mmapper_dev);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 14 | 100.00% | 2 | 100.00% |
Total | 14 | 100.00% | 2 | 100.00% |
module_init(mmapper_init);
module_exit(mmapper_exit);
MODULE_AUTHOR("Greg Lonnon <glonnon@ridgerun.com>");
MODULE_DESCRIPTION("DSPLinux simulator mmapper driver");
MODULE_LICENSE("GPL");
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Jeff Dike | 422 | 88.47% | 6 | 33.33% |
Thomas Gleixner | 14 | 2.94% | 1 | 5.56% |
Al Viro | 9 | 1.89% | 2 | 11.11% |
Paolo 'Blaisorblade' Giarrusso | 8 | 1.68% | 1 | 5.56% |
Arnd Bergmann | 7 | 1.47% | 2 | 11.11% |
Randy Dunlap | 5 | 1.05% | 1 | 5.56% |
Akinobu Mita | 5 | 1.05% | 1 | 5.56% |
William Lee Irwin III | 3 | 0.63% | 1 | 5.56% |
Alexey Dobriyan | 2 | 0.42% | 1 | 5.56% |
Andrew Morton | 1 | 0.21% | 1 | 5.56% |
Linus Torvalds | 1 | 0.21% | 1 | 5.56% |
Total | 477 | 100.00% | 18 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.