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