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