compat_ioctl.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. #define AGPIOC_CHIPSET_FLUSH32 _IO (AGPIOC_BASE, 10)
  40. struct agp_info32 {
  41. struct agp_version version; /* version of the driver */
  42. u32 bridge_id; /* bridge vendor/device */
  43. u32 agp_mode; /* mode info of bridge */
  44. compat_long_t aper_base; /* base of aperture */
  45. compat_size_t aper_size; /* size of aperture */
  46. compat_size_t pg_total; /* max pages (swap + system) */
  47. compat_size_t pg_system; /* max pages (system) */
  48. compat_size_t pg_used; /* current pages used */
  49. };
  50. /*
  51. * The "prot" down below needs still a "sleep" flag somehow ...
  52. */
  53. struct agp_segment32 {
  54. compat_off_t pg_start; /* starting page to populate */
  55. compat_size_t pg_count; /* number of pages */
  56. compat_int_t prot; /* prot flags for mmap */
  57. };
  58. struct agp_region32 {
  59. compat_pid_t pid; /* pid of process */
  60. compat_size_t seg_count; /* number of segments */
  61. struct agp_segment32 *seg_list;
  62. };
  63. struct agp_allocate32 {
  64. compat_int_t key; /* tag of allocation */
  65. compat_size_t pg_count; /* number of pages */
  66. u32 type; /* 0 == normal, other devspec */
  67. u32 physical; /* device specific (some devices
  68. * need a phys address of the
  69. * actual page behind the gatt
  70. * table) */
  71. };
  72. struct agp_bind32 {
  73. compat_int_t key; /* tag of allocation */
  74. compat_off_t pg_start; /* starting page to populate */
  75. };
  76. struct agp_unbind32 {
  77. compat_int_t key; /* tag of allocation */
  78. u32 priority; /* priority for paging out */
  79. };
  80. extern struct agp_front_data agp_fe;
  81. int agpioc_acquire_wrap(struct agp_file_private *priv);
  82. int agpioc_release_wrap(struct agp_file_private *priv);
  83. int agpioc_protect_wrap(struct agp_file_private *priv);
  84. int agpioc_setup_wrap(struct agp_file_private *priv, void __user *arg);
  85. int agpioc_deallocate_wrap(struct agp_file_private *priv, int arg);
  86. struct agp_file_private *agp_find_private(pid_t pid);
  87. struct agp_client *agp_create_client(pid_t id);
  88. int agp_remove_client(pid_t id);
  89. int agp_create_segment(struct agp_client *client, struct agp_region *region);
  90. void agp_free_memory_wrap(struct agp_memory *memory);
  91. struct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type);
  92. struct agp_memory *agp_find_mem_by_key(int key);
  93. struct agp_client *agp_find_client_by_pid(pid_t id);
  94. #endif /* _AGP_COMPAT_H */