summaryrefslogtreecommitdiff
path: root/linux-core/i830_dma.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-04-22 12:41:43 +0000
committerDave Airlie <airlied@linux.ie>2004-04-22 12:41:43 +0000
commitd40443534c3cab2ea1435556c85ef38503eb63ac (patch)
tree2007a9ed5ef48690568010687ab373057606fc8c /linux-core/i830_dma.c
parent87812e82f45d5ca81fd0603d6bd54854831c9174 (diff)
Add __user annotations from kernel
Diffstat (limited to 'linux-core/i830_dma.c')
-rw-r--r--linux-core/i830_dma.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/linux-core/i830_dma.c b/linux-core/i830_dma.c
index c2fd8c26..48c6ef51 100644
--- a/linux-core/i830_dma.c
+++ b/linux-core/i830_dma.c
@@ -40,6 +40,7 @@
#include <linux/interrupt.h> /* For task queue support */
#include <linux/pagemap.h> /* For FASTCALL on unlock_page() */
#include <linux/delay.h>
+#include <asm/uaccess.h>
#ifdef DO_MUNMAP_4_ARGS
#define DO_MUNMAP(m, a, l) do_munmap(m, a, l, 1)
@@ -167,7 +168,7 @@ static int i830_map_buffer(drm_buf_t *buf, struct file *filp)
old_fops = filp->f_op;
filp->f_op = &i830_buffer_fops;
dev_priv->mmap_buffer = buf;
- buf_priv->virtual = (void *)do_mmap(filp, 0, buf->total,
+ buf_priv->virtual = (void __user *)do_mmap(filp, 0, buf->total,
PROT_READ|PROT_WRITE,
MAP_SHARED,
buf->bus_address);
@@ -469,7 +470,7 @@ static int i830_dma_initialize(drm_device_t *dev,
}
int i830_dma_init(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
+ unsigned int cmd, unsigned long __user arg)
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -477,7 +478,7 @@ int i830_dma_init(struct inode *inode, struct file *filp,
drm_i830_init_t init;
int retcode = 0;
- if (copy_from_user(&init, (drm_i830_init_t *)arg, sizeof(init)))
+ if (copy_from_user(&init, (void __user *)arg, sizeof(init)))
return -EFAULT;
switch(init.func) {
@@ -1321,7 +1322,7 @@ void i830_reclaim_buffers( struct file *filp )
}
int i830_flush_ioctl(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
+ unsigned int cmd, unsigned long __user arg)
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -1336,7 +1337,7 @@ int i830_flush_ioctl(struct inode *inode, struct file *filp,
}
int i830_dma_vertex(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
+ unsigned int cmd, unsigned long __user arg)
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -1347,7 +1348,7 @@ int i830_dma_vertex(struct inode *inode, struct file *filp,
dev_priv->sarea_priv;
drm_i830_vertex_t vertex;
- if (copy_from_user(&vertex, (drm_i830_vertex_t *)arg, sizeof(vertex)))
+ if (copy_from_user(&vertex, (drm_i830_vertex_t __user *)arg, sizeof(vertex)))
return -EFAULT;
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1371,13 +1372,13 @@ int i830_dma_vertex(struct inode *inode, struct file *filp,
}
int i830_clear_bufs(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
+ unsigned int cmd, unsigned long __user arg)
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_i830_clear_t clear;
- if (copy_from_user(&clear, (drm_i830_clear_t *)arg, sizeof(clear)))
+ if (copy_from_user(&clear, (drm_i830_clear_t __user *)arg, sizeof(clear)))
return -EFAULT;
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1398,7 +1399,7 @@ int i830_clear_bufs(struct inode *inode, struct file *filp,
}
int i830_swap_bufs(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
+ unsigned int cmd, unsigned long __user arg)
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -1462,7 +1463,7 @@ int i830_flip_bufs(struct inode *inode, struct file *filp,
}
int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
+ unsigned long __user arg)
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -1476,7 +1477,7 @@ int i830_getage(struct inode *inode, struct file *filp, unsigned int cmd,
}
int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
+ unsigned long __user arg)
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -1488,7 +1489,7 @@ int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
dev_priv->sarea_priv;
DRM_DEBUG("getbuf\n");
- if (copy_from_user(&d, (drm_i830_dma_t *)arg, sizeof(d)))
+ if (copy_from_user(&d, (drm_i830_dma_t __user *)arg, sizeof(d)))
return -EFAULT;
if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
@@ -1503,7 +1504,7 @@ int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
DRM_DEBUG("i830_dma: %d returning %d, granted = %d\n",
current->pid, retcode, d.granted);
- if (copy_to_user((drm_dma_t *)arg, &d, sizeof(d)))
+ if (copy_to_user((drm_dma_t __user *)arg, &d, sizeof(d)))
return -EFAULT;
sarea_priv->last_dispatch = (int) hw_status[5];
@@ -1513,7 +1514,7 @@ int i830_getbuf(struct inode *inode, struct file *filp, unsigned int cmd,
int i830_copybuf(struct inode *inode,
struct file *filp,
unsigned int cmd,
- unsigned long arg)
+ unsigned long __user arg)
{
/* Never copy - 2.4.x doesn't need it */
return 0;
@@ -1528,7 +1529,7 @@ int i830_docopy(struct inode *inode, struct file *filp, unsigned int cmd,
int i830_getparam( struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg )
+ unsigned long __user arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -1541,7 +1542,7 @@ int i830_getparam( struct inode *inode, struct file *filp, unsigned int cmd,
return -EINVAL;
}
- if (copy_from_user(&param, (drm_i830_getparam_t *)arg, sizeof(param) ))
+ if (copy_from_user(&param, (drm_i830_getparam_t __user *)arg, sizeof(param) ))
return -EFAULT;
switch( param.param ) {
@@ -1562,7 +1563,7 @@ int i830_getparam( struct inode *inode, struct file *filp, unsigned int cmd,
int i830_setparam( struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg )
+ unsigned long __user arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
@@ -1574,7 +1575,7 @@ int i830_setparam( struct inode *inode, struct file *filp, unsigned int cmd,
return -EINVAL;
}
- if (copy_from_user(&param, (drm_i830_setparam_t *)arg, sizeof(param) ))
+ if (copy_from_user(&param, (drm_i830_setparam_t __user *)arg, sizeof(param) ))
return -EFAULT;
switch( param.param ) {