agpgart.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * AGPGART module version 0.99
  3. * Copyright (C) 1999 Jeff Hartmann
  4. * Copyright (C) 1999 Precision Insight, Inc.
  5. * Copyright (C) 1999 Xi Graphics, Inc.
  6. *
  7. * Permission is hereby granted, free of charge, to any person obtaining a
  8. * copy of this software and associated documentation files (the "Software"),
  9. * to deal in the Software without restriction, including without limitation
  10. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  11. * and/or sell copies of the Software, and to permit persons to whom the
  12. * Software is furnished to do so, subject to the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be included
  15. * in all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  20. * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
  21. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  22. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
  23. * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24. *
  25. */
  26. #ifndef _UAPI_AGP_H
  27. #define _UAPI_AGP_H
  28. #define AGPIOC_BASE 'A'
  29. #define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
  30. #define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
  31. #define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
  32. #define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*)
  33. #define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*)
  34. #define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*)
  35. #define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
  36. #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
  37. #define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
  38. #define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
  39. #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
  40. #define AGP_DEVICE "/dev/agpgart"
  41. #ifndef TRUE
  42. #define TRUE 1
  43. #endif
  44. #ifndef FALSE
  45. #define FALSE 0
  46. #endif
  47. #ifndef __KERNEL__
  48. #include <linux/types.h>
  49. struct agp_version {
  50. __u16 major;
  51. __u16 minor;
  52. };
  53. typedef struct _agp_info {
  54. struct agp_version version; /* version of the driver */
  55. __u32 bridge_id; /* bridge vendor/device */
  56. __u32 agp_mode; /* mode info of bridge */
  57. unsigned long aper_base;/* base of aperture */
  58. size_t aper_size; /* size of aperture */
  59. size_t pg_total; /* max pages (swap + system) */
  60. size_t pg_system; /* max pages (system) */
  61. size_t pg_used; /* current pages used */
  62. } agp_info;
  63. typedef struct _agp_setup {
  64. __u32 agp_mode; /* mode info of bridge */
  65. } agp_setup;
  66. /*
  67. * The "prot" down below needs still a "sleep" flag somehow ...
  68. */
  69. typedef struct _agp_segment {
  70. __kernel_off_t pg_start; /* starting page to populate */
  71. __kernel_size_t pg_count; /* number of pages */
  72. int prot; /* prot flags for mmap */
  73. } agp_segment;
  74. typedef struct _agp_region {
  75. __kernel_pid_t pid; /* pid of process */
  76. __kernel_size_t seg_count; /* number of segments */
  77. struct _agp_segment *seg_list;
  78. } agp_region;
  79. typedef struct _agp_allocate {
  80. int key; /* tag of allocation */
  81. __kernel_size_t pg_count;/* number of pages */
  82. __u32 type; /* 0 == normal, other devspec */
  83. __u32 physical; /* device specific (some devices
  84. * need a phys address of the
  85. * actual page behind the gatt
  86. * table) */
  87. } agp_allocate;
  88. typedef struct _agp_bind {
  89. int key; /* tag of allocation */
  90. __kernel_off_t pg_start;/* starting page to populate */
  91. } agp_bind;
  92. typedef struct _agp_unbind {
  93. int key; /* tag of allocation */
  94. __u32 priority; /* priority for paging out */
  95. } agp_unbind;
  96. #endif /* __KERNEL__ */
  97. #endif /* _UAPI_AGP_H */