Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174482
b: refs/heads/master
c: 156822f
h: refs/heads/master
v: v3
  • Loading branch information
Andres Salomon authored and Dave Airlie committed Nov 18, 2009
1 parent 0f53900 commit b58dc9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 420a457088669e055e767dfb8468909cd1799cf9
refs/heads/master: 156822f7175d9ceb9d7e808502d3c5de8841e047
12 changes: 12 additions & 0 deletions trunk/drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,18 @@ static void __exit drm_core_exit(void)
module_init(drm_core_init);
module_exit(drm_core_exit);

/**
* Copy and IOCTL return string to user space
*/
#define DRM_COPY(name, value) \
len = strlen(value); \
if (len > name##_len) len = name##_len; \
name##_len = strlen(value); \
if (len && name) { \
if (copy_to_user(name, value, len)) \
return -EFAULT; \
}

/**
* Get version information
*
Expand Down
23 changes: 0 additions & 23 deletions trunk/include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,19 +255,8 @@ extern void drm_ut_debug_printk(unsigned int request_level,

#define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1))
#define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
#define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist)

#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
/**
* Get the private SAREA mapping.
*
* \param _dev DRM device.
* \param _ctx context number.
* \param _map output mapping.
*/
#define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do { \
(_map) = (_dev)->context_sareas[_ctx]; \
} while(0)

/**
* Test that the hardware lock is held by the caller, returning otherwise.
Expand All @@ -286,18 +275,6 @@ do { \
} \
} while (0)

/**
* Copy and IOCTL return string to user space
*/
#define DRM_COPY( name, value ) \
len = strlen( value ); \
if ( len > name##_len ) len = name##_len; \
name##_len = strlen( value ); \
if ( len && name ) { \
if ( copy_to_user( name, value, len ) ) \
return -EFAULT; \
}

/**
* Ioctl function type.
*
Expand Down

0 comments on commit b58dc9a

Please sign in to comment.