aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-07-15 23:53:57 -0400
committerDave Airlie <airlied@linux.ie>2007-07-15 23:53:57 -0400
commitff4135aeb1f9a0201f8e22400ebc1d570df9016e (patch)
tree1853a01925988d067244a4a97b02895c67b072fd /drivers/char/drm
parentbd63cb52c05bbb154f539369cae4fb9c9b6277da (diff)
drm: remove core typedefs from the ioc32 wrappers
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r--drivers/char/drm/drm_ioc32.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/drivers/char/drm/drm_ioc32.c b/drivers/char/drm/drm_ioc32.c
index fafeb34f89d5..462f46f2049a 100644
--- a/drivers/char/drm/drm_ioc32.c
+++ b/drivers/char/drm/drm_ioc32.c
@@ -82,7 +82,7 @@ static int compat_drm_version(struct file *file, unsigned int cmd,
82 unsigned long arg) 82 unsigned long arg)
83{ 83{
84 drm_version32_t v32; 84 drm_version32_t v32;
85 drm_version_t __user *version; 85 struct drm_version __user *version;
86 int err; 86 int err;
87 87
88 if (copy_from_user(&v32, (void __user *)arg, sizeof(v32))) 88 if (copy_from_user(&v32, (void __user *)arg, sizeof(v32)))
@@ -129,7 +129,7 @@ static int compat_drm_getunique(struct file *file, unsigned int cmd,
129 unsigned long arg) 129 unsigned long arg)
130{ 130{
131 drm_unique32_t uq32; 131 drm_unique32_t uq32;
132 drm_unique_t __user *u; 132 struct drm_unique __user *u;
133 int err; 133 int err;
134 134
135 if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32))) 135 if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32)))
@@ -159,7 +159,7 @@ static int compat_drm_setunique(struct file *file, unsigned int cmd,
159 unsigned long arg) 159 unsigned long arg)
160{ 160{
161 drm_unique32_t uq32; 161 drm_unique32_t uq32;
162 drm_unique_t __user *u; 162 struct drm_unique __user *u;
163 163
164 if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32))) 164 if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32)))
165 return -EFAULT; 165 return -EFAULT;
@@ -179,8 +179,8 @@ static int compat_drm_setunique(struct file *file, unsigned int cmd,
179typedef struct drm_map32 { 179typedef struct drm_map32 {
180 u32 offset; /**< Requested physical address (0 for SAREA)*/ 180 u32 offset; /**< Requested physical address (0 for SAREA)*/
181 u32 size; /**< Requested physical size (bytes) */ 181 u32 size; /**< Requested physical size (bytes) */
182 drm_map_type_t type; /**< Type of memory to map */ 182 enum drm_map_type type; /**< Type of memory to map */
183 drm_map_flags_t flags; /**< Flags */ 183 enum drm_map_flags flags; /**< Flags */
184 u32 handle; /**< User-space: "Handle" to pass to mmap() */ 184 u32 handle; /**< User-space: "Handle" to pass to mmap() */
185 int mtrr; /**< MTRR slot used */ 185 int mtrr; /**< MTRR slot used */
186} drm_map32_t; 186} drm_map32_t;
@@ -190,7 +190,7 @@ static int compat_drm_getmap(struct file *file, unsigned int cmd,
190{ 190{
191 drm_map32_t __user *argp = (void __user *)arg; 191 drm_map32_t __user *argp = (void __user *)arg;
192 drm_map32_t m32; 192 drm_map32_t m32;
193 drm_map_t __user *map; 193 struct drm_map __user *map;
194 int idx, err; 194 int idx, err;
195 void *handle; 195 void *handle;
196 196
@@ -228,7 +228,7 @@ static int compat_drm_addmap(struct file *file, unsigned int cmd,
228{ 228{
229 drm_map32_t __user *argp = (void __user *)arg; 229 drm_map32_t __user *argp = (void __user *)arg;
230 drm_map32_t m32; 230 drm_map32_t m32;
231 drm_map_t __user *map; 231 struct drm_map __user *map;
232 int err; 232 int err;
233 void *handle; 233 void *handle;
234 234
@@ -270,7 +270,7 @@ static int compat_drm_rmmap(struct file *file, unsigned int cmd,
270 unsigned long arg) 270 unsigned long arg)
271{ 271{
272 drm_map32_t __user *argp = (void __user *)arg; 272 drm_map32_t __user *argp = (void __user *)arg;
273 drm_map_t __user *map; 273 struct drm_map __user *map;
274 u32 handle; 274 u32 handle;
275 275
276 if (get_user(handle, &argp->handle)) 276 if (get_user(handle, &argp->handle))
@@ -300,7 +300,7 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd,
300{ 300{
301 drm_client32_t c32; 301 drm_client32_t c32;
302 drm_client32_t __user *argp = (void __user *)arg; 302 drm_client32_t __user *argp = (void __user *)arg;
303 drm_client_t __user *client; 303 struct drm_client __user *client;
304 int idx, err; 304 int idx, err;
305 305
306 if (get_user(idx, &argp->idx)) 306 if (get_user(idx, &argp->idx))
@@ -333,7 +333,7 @@ typedef struct drm_stats32 {
333 u32 count; 333 u32 count;
334 struct { 334 struct {
335 u32 value; 335 u32 value;
336 drm_stat_type_t type; 336 enum drm_stat_type type;
337 } data[15]; 337 } data[15];
338} drm_stats32_t; 338} drm_stats32_t;
339 339
@@ -342,7 +342,7 @@ static int compat_drm_getstats(struct file *file, unsigned int cmd,
342{ 342{
343 drm_stats32_t s32; 343 drm_stats32_t s32;
344 drm_stats32_t __user *argp = (void __user *)arg; 344 drm_stats32_t __user *argp = (void __user *)arg;
345 drm_stats_t __user *stats; 345 struct drm_stats __user *stats;
346 int i, err; 346 int i, err;
347 347
348 stats = compat_alloc_user_space(sizeof(*stats)); 348 stats = compat_alloc_user_space(sizeof(*stats));
@@ -379,7 +379,7 @@ static int compat_drm_addbufs(struct file *file, unsigned int cmd,
379 unsigned long arg) 379 unsigned long arg)
380{ 380{
381 drm_buf_desc32_t __user *argp = (void __user *)arg; 381 drm_buf_desc32_t __user *argp = (void __user *)arg;
382 drm_buf_desc_t __user *buf; 382 struct drm_buf_desc __user *buf;
383 int err; 383 int err;
384 unsigned long agp_start; 384 unsigned long agp_start;
385 385
@@ -411,7 +411,7 @@ static int compat_drm_markbufs(struct file *file, unsigned int cmd,
411{ 411{
412 drm_buf_desc32_t b32; 412 drm_buf_desc32_t b32;
413 drm_buf_desc32_t __user *argp = (void __user *)arg; 413 drm_buf_desc32_t __user *argp = (void __user *)arg;
414 drm_buf_desc_t __user *buf; 414 struct drm_buf_desc __user *buf;
415 415
416 if (copy_from_user(&b32, argp, sizeof(b32))) 416 if (copy_from_user(&b32, argp, sizeof(b32)))
417 return -EFAULT; 417 return -EFAULT;
@@ -440,8 +440,8 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd,
440 drm_buf_info32_t req32; 440 drm_buf_info32_t req32;
441 drm_buf_info32_t __user *argp = (void __user *)arg; 441 drm_buf_info32_t __user *argp = (void __user *)arg;
442 drm_buf_desc32_t __user *to; 442 drm_buf_desc32_t __user *to;
443 drm_buf_info_t __user *request; 443 struct drm_buf_info __user *request;
444 drm_buf_desc_t __user *list; 444 struct drm_buf_desc __user *list;
445 size_t nbytes; 445 size_t nbytes;
446 int i, err; 446 int i, err;
447 int count, actual; 447 int count, actual;
@@ -457,11 +457,11 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd,
457 && !access_ok(VERIFY_WRITE, to, count * sizeof(drm_buf_desc32_t))) 457 && !access_ok(VERIFY_WRITE, to, count * sizeof(drm_buf_desc32_t)))
458 return -EFAULT; 458 return -EFAULT;
459 459
460 nbytes = sizeof(*request) + count * sizeof(drm_buf_desc_t); 460 nbytes = sizeof(*request) + count * sizeof(struct drm_buf_desc);
461 request = compat_alloc_user_space(nbytes); 461 request = compat_alloc_user_space(nbytes);
462 if (!access_ok(VERIFY_WRITE, request, nbytes)) 462 if (!access_ok(VERIFY_WRITE, request, nbytes))
463 return -EFAULT; 463 return -EFAULT;
464 list = (drm_buf_desc_t *) (request + 1); 464 list = (struct drm_buf_desc *) (request + 1);
465 465
466 if (__put_user(count, &request->count) 466 if (__put_user(count, &request->count)
467 || __put_user(list, &request->list)) 467 || __put_user(list, &request->list))
@@ -477,7 +477,7 @@ static int compat_drm_infobufs(struct file *file, unsigned int cmd,
477 if (count >= actual) 477 if (count >= actual)
478 for (i = 0; i < actual; ++i) 478 for (i = 0; i < actual; ++i)
479 if (__copy_in_user(&to[i], &list[i], 479 if (__copy_in_user(&to[i], &list[i],
480 offsetof(drm_buf_desc_t, flags))) 480 offsetof(struct drm_buf_desc, flags)))
481 return -EFAULT; 481 return -EFAULT;
482 482
483 if (__put_user(actual, &argp->count)) 483 if (__put_user(actual, &argp->count))
@@ -505,8 +505,8 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
505 drm_buf_map32_t __user *argp = (void __user *)arg; 505 drm_buf_map32_t __user *argp = (void __user *)arg;
506 drm_buf_map32_t req32; 506 drm_buf_map32_t req32;
507 drm_buf_pub32_t __user *list32; 507 drm_buf_pub32_t __user *list32;
508 drm_buf_map_t __user *request; 508 struct drm_buf_map __user *request;
509 drm_buf_pub_t __user *list; 509 struct drm_buf_pub __user *list;
510 int i, err; 510 int i, err;
511 int count, actual; 511 int count, actual;
512 size_t nbytes; 512 size_t nbytes;
@@ -519,11 +519,11 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
519 519
520 if (count < 0) 520 if (count < 0)
521 return -EINVAL; 521 return -EINVAL;
522 nbytes = sizeof(*request) + count * sizeof(drm_buf_pub_t); 522 nbytes = sizeof(*request) + count * sizeof(struct drm_buf_pub);
523 request = compat_alloc_user_space(nbytes); 523 request = compat_alloc_user_space(nbytes);
524 if (!access_ok(VERIFY_WRITE, request, nbytes)) 524 if (!access_ok(VERIFY_WRITE, request, nbytes))
525 return -EFAULT; 525 return -EFAULT;
526 list = (drm_buf_pub_t *) (request + 1); 526 list = (struct drm_buf_pub *) (request + 1);
527 527
528 if (__put_user(count, &request->count) 528 if (__put_user(count, &request->count)
529 || __put_user(list, &request->list)) 529 || __put_user(list, &request->list))
@@ -539,7 +539,7 @@ static int compat_drm_mapbufs(struct file *file, unsigned int cmd,
539 if (count >= actual) 539 if (count >= actual)
540 for (i = 0; i < actual; ++i) 540 for (i = 0; i < actual; ++i)
541 if (__copy_in_user(&list32[i], &list[i], 541 if (__copy_in_user(&list32[i], &list[i],
542 offsetof(drm_buf_pub_t, address)) 542 offsetof(struct drm_buf_pub, address))
543 || __get_user(addr, &list[i].address) 543 || __get_user(addr, &list[i].address)
544 || __put_user((unsigned long)addr, 544 || __put_user((unsigned long)addr,
545 &list32[i].address)) 545 &list32[i].address))
@@ -562,7 +562,7 @@ static int compat_drm_freebufs(struct file *file, unsigned int cmd,
562 unsigned long arg) 562 unsigned long arg)
563{ 563{
564 drm_buf_free32_t req32; 564 drm_buf_free32_t req32;
565 drm_buf_free_t __user *request; 565 struct drm_buf_free __user *request;
566 drm_buf_free32_t __user *argp = (void __user *)arg; 566 drm_buf_free32_t __user *argp = (void __user *)arg;
567 567
568 if (copy_from_user(&req32, argp, sizeof(req32))) 568 if (copy_from_user(&req32, argp, sizeof(req32)))
@@ -589,7 +589,7 @@ static int compat_drm_setsareactx(struct file *file, unsigned int cmd,
589 unsigned long arg) 589 unsigned long arg)
590{ 590{
591 drm_ctx_priv_map32_t req32; 591 drm_ctx_priv_map32_t req32;
592 drm_ctx_priv_map_t __user *request; 592 struct drm_ctx_priv_map __user *request;
593 drm_ctx_priv_map32_t __user *argp = (void __user *)arg; 593 drm_ctx_priv_map32_t __user *argp = (void __user *)arg;
594 594
595 if (copy_from_user(&req32, argp, sizeof(req32))) 595 if (copy_from_user(&req32, argp, sizeof(req32)))
@@ -610,7 +610,7 @@ static int compat_drm_setsareactx(struct file *file, unsigned int cmd,
610static int compat_drm_getsareactx(struct file *file, unsigned int cmd, 610static int compat_drm_getsareactx(struct file *file, unsigned int cmd,
611 unsigned long arg) 611 unsigned long arg)
612{ 612{
613 drm_ctx_priv_map_t __user *request; 613 struct drm_ctx_priv_map __user *request;
614 drm_ctx_priv_map32_t __user *argp = (void __user *)arg; 614 drm_ctx_priv_map32_t __user *argp = (void __user *)arg;
615 int err; 615 int err;
616 unsigned int ctx_id; 616 unsigned int ctx_id;
@@ -648,7 +648,7 @@ static int compat_drm_resctx(struct file *file, unsigned int cmd,
648{ 648{
649 drm_ctx_res32_t __user *argp = (void __user *)arg; 649 drm_ctx_res32_t __user *argp = (void __user *)arg;
650 drm_ctx_res32_t res32; 650 drm_ctx_res32_t res32;
651 drm_ctx_res_t __user *res; 651 struct drm_ctx_res __user *res;
652 int err; 652 int err;
653 653
654 if (copy_from_user(&res32, argp, sizeof(res32))) 654 if (copy_from_user(&res32, argp, sizeof(res32)))
@@ -658,7 +658,7 @@ static int compat_drm_resctx(struct file *file, unsigned int cmd,
658 if (!access_ok(VERIFY_WRITE, res, sizeof(*res))) 658 if (!access_ok(VERIFY_WRITE, res, sizeof(*res)))
659 return -EFAULT; 659 return -EFAULT;
660 if (__put_user(res32.count, &res->count) 660 if (__put_user(res32.count, &res->count)
661 || __put_user((drm_ctx_t __user *) (unsigned long)res32.contexts, 661 || __put_user((struct drm_ctx __user *) (unsigned long)res32.contexts,
662 &res->contexts)) 662 &res->contexts))
663 return -EFAULT; 663 return -EFAULT;
664 664
@@ -679,7 +679,7 @@ typedef struct drm_dma32 {
679 int send_count; /**< Number of buffers to send */ 679 int send_count; /**< Number of buffers to send */
680 u32 send_indices; /**< List of handles to buffers */ 680 u32 send_indices; /**< List of handles to buffers */
681 u32 send_sizes; /**< Lengths of data to send */ 681 u32 send_sizes; /**< Lengths of data to send */
682 drm_dma_flags_t flags; /**< Flags */ 682 enum drm_dma_flags flags; /**< Flags */
683 int request_count; /**< Number of buffers requested */ 683 int request_count; /**< Number of buffers requested */
684 int request_size; /**< Desired size for buffers */ 684 int request_size; /**< Desired size for buffers */
685 u32 request_indices; /**< Buffer information */ 685 u32 request_indices; /**< Buffer information */
@@ -692,7 +692,7 @@ static int compat_drm_dma(struct file *file, unsigned int cmd,
692{ 692{
693 drm_dma32_t d32; 693 drm_dma32_t d32;
694 drm_dma32_t __user *argp = (void __user *)arg; 694 drm_dma32_t __user *argp = (void __user *)arg;
695 drm_dma_t __user *d; 695 struct drm_dma __user *d;
696 int err; 696 int err;
697 697
698 if (copy_from_user(&d32, argp, sizeof(d32))) 698 if (copy_from_user(&d32, argp, sizeof(d32)))
@@ -740,7 +740,7 @@ static int compat_drm_agp_enable(struct file *file, unsigned int cmd,
740{ 740{
741 drm_agp_mode32_t __user *argp = (void __user *)arg; 741 drm_agp_mode32_t __user *argp = (void __user *)arg;
742 drm_agp_mode32_t m32; 742 drm_agp_mode32_t m32;
743 drm_agp_mode_t __user *mode; 743 struct drm_agp_mode __user *mode;
744 744
745 if (get_user(m32.mode, &argp->mode)) 745 if (get_user(m32.mode, &argp->mode))
746 return -EFAULT; 746 return -EFAULT;
@@ -772,7 +772,7 @@ static int compat_drm_agp_info(struct file *file, unsigned int cmd,
772{ 772{
773 drm_agp_info32_t __user *argp = (void __user *)arg; 773 drm_agp_info32_t __user *argp = (void __user *)arg;
774 drm_agp_info32_t i32; 774 drm_agp_info32_t i32;
775 drm_agp_info_t __user *info; 775 struct drm_agp_info __user *info;
776 int err; 776 int err;
777 777
778 info = compat_alloc_user_space(sizeof(*info)); 778 info = compat_alloc_user_space(sizeof(*info));
@@ -813,7 +813,7 @@ static int compat_drm_agp_alloc(struct file *file, unsigned int cmd,
813{ 813{
814 drm_agp_buffer32_t __user *argp = (void __user *)arg; 814 drm_agp_buffer32_t __user *argp = (void __user *)arg;
815 drm_agp_buffer32_t req32; 815 drm_agp_buffer32_t req32;
816 drm_agp_buffer_t __user *request; 816 struct drm_agp_buffer __user *request;
817 int err; 817 int err;
818 818
819 if (copy_from_user(&req32, argp, sizeof(req32))) 819 if (copy_from_user(&req32, argp, sizeof(req32)))
@@ -845,7 +845,7 @@ static int compat_drm_agp_free(struct file *file, unsigned int cmd,
845 unsigned long arg) 845 unsigned long arg)
846{ 846{
847 drm_agp_buffer32_t __user *argp = (void __user *)arg; 847 drm_agp_buffer32_t __user *argp = (void __user *)arg;
848 drm_agp_buffer_t __user *request; 848 struct drm_agp_buffer __user *request;
849 u32 handle; 849 u32 handle;
850 850
851 request = compat_alloc_user_space(sizeof(*request)); 851 request = compat_alloc_user_space(sizeof(*request));
@@ -868,7 +868,7 @@ static int compat_drm_agp_bind(struct file *file, unsigned int cmd,
868{ 868{
869 drm_agp_binding32_t __user *argp = (void __user *)arg; 869 drm_agp_binding32_t __user *argp = (void __user *)arg;
870 drm_agp_binding32_t req32; 870 drm_agp_binding32_t req32;
871 drm_agp_binding_t __user *request; 871 struct drm_agp_binding __user *request;
872 872
873 if (copy_from_user(&req32, argp, sizeof(req32))) 873 if (copy_from_user(&req32, argp, sizeof(req32)))
874 return -EFAULT; 874 return -EFAULT;
@@ -887,7 +887,7 @@ static int compat_drm_agp_unbind(struct file *file, unsigned int cmd,
887 unsigned long arg) 887 unsigned long arg)
888{ 888{
889 drm_agp_binding32_t __user *argp = (void __user *)arg; 889 drm_agp_binding32_t __user *argp = (void __user *)arg;
890 drm_agp_binding_t __user *request; 890 struct drm_agp_binding __user *request;
891 u32 handle; 891 u32 handle;
892 892
893 request = compat_alloc_user_space(sizeof(*request)); 893 request = compat_alloc_user_space(sizeof(*request));
@@ -910,7 +910,7 @@ static int compat_drm_sg_alloc(struct file *file, unsigned int cmd,
910 unsigned long arg) 910 unsigned long arg)
911{ 911{
912 drm_scatter_gather32_t __user *argp = (void __user *)arg; 912 drm_scatter_gather32_t __user *argp = (void __user *)arg;
913 drm_scatter_gather_t __user *request; 913 struct drm_scatter_gather __user *request;
914 int err; 914 int err;
915 unsigned long x; 915 unsigned long x;
916 916
@@ -938,7 +938,7 @@ static int compat_drm_sg_free(struct file *file, unsigned int cmd,
938 unsigned long arg) 938 unsigned long arg)
939{ 939{
940 drm_scatter_gather32_t __user *argp = (void __user *)arg; 940 drm_scatter_gather32_t __user *argp = (void __user *)arg;
941 drm_scatter_gather_t __user *request; 941 struct drm_scatter_gather __user *request;
942 unsigned long x; 942 unsigned long x;
943 943
944 request = compat_alloc_user_space(sizeof(*request)); 944 request = compat_alloc_user_space(sizeof(*request));
@@ -953,13 +953,13 @@ static int compat_drm_sg_free(struct file *file, unsigned int cmd,
953} 953}
954 954
955struct drm_wait_vblank_request32 { 955struct drm_wait_vblank_request32 {
956 drm_vblank_seq_type_t type; 956 enum drm_vblank_seq_type type;
957 unsigned int sequence; 957 unsigned int sequence;
958 u32 signal; 958 u32 signal;
959}; 959};
960 960
961struct drm_wait_vblank_reply32 { 961struct drm_wait_vblank_reply32 {
962 drm_vblank_seq_type_t type; 962 enum drm_vblank_seq_type type;
963 unsigned int sequence; 963 unsigned int sequence;
964 s32 tval_sec; 964 s32 tval_sec;
965 s32 tval_usec; 965 s32 tval_usec;
@@ -975,7 +975,7 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd,
975{ 975{
976 drm_wait_vblank32_t __user *argp = (void __user *)arg; 976 drm_wait_vblank32_t __user *argp = (void __user *)arg;
977 drm_wait_vblank32_t req32; 977 drm_wait_vblank32_t req32;
978 drm_wait_vblank_t __user *request; 978 union drm_wait_vblank __user *request;
979 int err; 979 int err;
980 980
981 if (copy_from_user(&req32, argp, sizeof(req32))) 981 if (copy_from_user(&req32, argp, sizeof(req32)))