compat_ioctl.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright (C) 1999 Jeff Hartmann
  3. * Copyright (C) 1999 Precision Insight, Inc.
  4. * Copyright (C) 1999 Xi Graphics, Inc.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the "Software"),
  8. * to deal in the Software without restriction, including without limitation
  9. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10. * and/or sell copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included
  14. * in all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
  20. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  22. * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. *
  24. */
  25. #ifndef _AGP_COMPAT_IOCTL_H
  26. #define _AGP_COMPAT_IOCTL_H
  27. #include <linux/compat.h>
  28. #include <linux/agpgart.h>
  29. #define AGPIOC_INFO32 _IOR (AGPIOC_BASE, 0, compat_uptr_t)
  30. #define AGPIOC_ACQUIRE32 _IO (AGPIOC_BASE, 1)
  31. #define AGPIOC_RELEASE32 _IO (AGPIOC_BASE, 2)
  32. #define AGPIOC_SETUP32 _IOW (AGPIOC_BASE, 3, compat_uptr_t)
  33. #define AGPIOC_RESERVE32 _IOW (AGPIOC_BASE, 4, compat_uptr_t)
  34. #define AGPIOC_PROTECT32 _IOW (AGPIOC_BASE, 5, compat_uptr_t)
  35. #define AGPIOC_ALLOCATE32 _IOWR(AGPIOC_BASE, 6, compat_uptr_t)
  36. #define AGPIOC_DEALLOCATE32 _IOW (AGPIOC_BASE, 7, compat_int_t)
  37. #define AGPIOC_BIND32 _IOW (AGPIOC_BASE, 8, compat_uptr_t)
  38. #define AGPIOC_UNBIND32 _IOW (AGPIOC_BASE, 9, compat_uptr_t)
  39. struct agp_info32 {
  40. struct agp_version version; /* version of the driver */
  41. u32 bridge_id; /* bridge vendor/device */
  42. u32 agp_mode; /* mode info of bridge */
  43. compat_long_t aper_base; /* base of aperture */
  44. compat_size_t aper_size; /* size of aperture */
  45. compat_size_t pg_total; /* max pages (swap + system) */
  46. compat_size_t pg_system; /* max pages (system) */
  47. compat_size_t pg_used; /* current pages used */
  48. };
  49. /*
  50. * The "prot" down below needs still a "sleep" flag somehow ...
  51. */
  52. struct agp_segment32 {
  53. compat_off_t pg_start; /* starting page to populate */
  54. compat_size_t pg_count; /* number of pages */
  55. compat_int_t prot; /* prot flags for mmap */
  56. };
  57. struct agp_region32 {
  58. compat_pid_t pid; /* pid of process */
  59. compat_size_t seg_count; /* number of segments */
  60. struct agp_segment32 *seg_list;
  61. };
  62. struct agp_allocate32 {
  63. compat_int_t key; /* tag of allocation */
  64. compat_size_t pg_count; /* number of pages */
  65. u32 type; /* 0 == normal, other devspec */
  66. u32 physical; /* device specific (some devices
  67. * need a phys address of the
  68. * actual page behind the gatt
  69. * table) */
  70. };
  71. struct agp_bind32 {
  72. compat_int_t key; /* tag of allocation */
  73. compat_off_t pg_start; /* starting page to populate */
  74. };
  75. struct agp_unbind32 {
  76. compat_int_t key; /* tag of allocation */
  77. u32 priority; /* priority for paging out */
  78. };
  79. extern struct agp_front_data agp_fe;
  80. int agpioc_acquire_wrap(struct agp_file_private *priv);
  81. int agpioc_release_wrap(struct agp_file_private *priv);
  82. int agpioc_protect_wrap(struct agp_file_private *priv);
  83. int agpioc_setup_wrap(struct agp_file_private *priv, void __user *arg);
  84. int agpioc_deallocate_wrap(struct agp_file_private *priv, int arg);
  85. struct agp_file_private *agp_find_private(pid_t pid);
  86. struct agp_client *agp_create_client(pid_t id);
  87. int agp_remove_client(pid_t id);
  88. int agp_create_segment(struct agp_client *client, struct agp_region *region);
  89. void agp_free_memory_wrap(struct agp_memory *memory);
  90. struct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type);
  91. struct agp_memory *agp_find_mem_by_key(int key);
  92. struct agp_client *agp_find_client_by_pid(pid_t id);
  93. #endif /* _AGP_COMPAT_H */