18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (C) 1999 Jeff Hartmann
38c2ecf20Sopenharmony_ci * Copyright (C) 1999 Precision Insight, Inc.
48c2ecf20Sopenharmony_ci * Copyright (C) 1999 Xi Graphics, Inc.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
78c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
88c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
98c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
108c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
118c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included
148c2ecf20Sopenharmony_ci * in all copies or substantial portions of the Software.
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
178c2ecf20Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
188c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
198c2ecf20Sopenharmony_ci * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
208c2ecf20Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
218c2ecf20Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
228c2ecf20Sopenharmony_ci * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#ifndef _AGP_COMPAT_IOCTL_H
278c2ecf20Sopenharmony_ci#define _AGP_COMPAT_IOCTL_H
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#include <linux/compat.h>
308c2ecf20Sopenharmony_ci#include <linux/agpgart.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define AGPIOC_INFO32       _IOR (AGPIOC_BASE, 0, compat_uptr_t)
338c2ecf20Sopenharmony_ci#define AGPIOC_ACQUIRE32    _IO  (AGPIOC_BASE, 1)
348c2ecf20Sopenharmony_ci#define AGPIOC_RELEASE32    _IO  (AGPIOC_BASE, 2)
358c2ecf20Sopenharmony_ci#define AGPIOC_SETUP32      _IOW (AGPIOC_BASE, 3, compat_uptr_t)
368c2ecf20Sopenharmony_ci#define AGPIOC_RESERVE32    _IOW (AGPIOC_BASE, 4, compat_uptr_t)
378c2ecf20Sopenharmony_ci#define AGPIOC_PROTECT32    _IOW (AGPIOC_BASE, 5, compat_uptr_t)
388c2ecf20Sopenharmony_ci#define AGPIOC_ALLOCATE32   _IOWR(AGPIOC_BASE, 6, compat_uptr_t)
398c2ecf20Sopenharmony_ci#define AGPIOC_DEALLOCATE32 _IOW (AGPIOC_BASE, 7, compat_int_t)
408c2ecf20Sopenharmony_ci#define AGPIOC_BIND32       _IOW (AGPIOC_BASE, 8, compat_uptr_t)
418c2ecf20Sopenharmony_ci#define AGPIOC_UNBIND32     _IOW (AGPIOC_BASE, 9, compat_uptr_t)
428c2ecf20Sopenharmony_ci#define AGPIOC_CHIPSET_FLUSH32 _IO (AGPIOC_BASE, 10)
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_cistruct agp_info32 {
458c2ecf20Sopenharmony_ci	struct agp_version version;	/* version of the driver        */
468c2ecf20Sopenharmony_ci	u32 bridge_id;		/* bridge vendor/device         */
478c2ecf20Sopenharmony_ci	u32 agp_mode;		/* mode info of bridge          */
488c2ecf20Sopenharmony_ci	compat_long_t aper_base;	/* base of aperture             */
498c2ecf20Sopenharmony_ci	compat_size_t aper_size;	/* size of aperture             */
508c2ecf20Sopenharmony_ci	compat_size_t pg_total;	/* max pages (swap + system)    */
518c2ecf20Sopenharmony_ci	compat_size_t pg_system;	/* max pages (system)           */
528c2ecf20Sopenharmony_ci	compat_size_t pg_used;		/* current pages used           */
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/*
568c2ecf20Sopenharmony_ci * The "prot" down below needs still a "sleep" flag somehow ...
578c2ecf20Sopenharmony_ci */
588c2ecf20Sopenharmony_cistruct agp_segment32 {
598c2ecf20Sopenharmony_ci	compat_off_t pg_start;		/* starting page to populate    */
608c2ecf20Sopenharmony_ci	compat_size_t pg_count;	/* number of pages              */
618c2ecf20Sopenharmony_ci	compat_int_t prot;		/* prot flags for mmap          */
628c2ecf20Sopenharmony_ci};
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_cistruct agp_region32 {
658c2ecf20Sopenharmony_ci	compat_pid_t pid;		/* pid of process               */
668c2ecf20Sopenharmony_ci	compat_size_t seg_count;	/* number of segments           */
678c2ecf20Sopenharmony_ci	struct agp_segment32 *seg_list;
688c2ecf20Sopenharmony_ci};
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_cistruct agp_allocate32 {
718c2ecf20Sopenharmony_ci	compat_int_t key;		/* tag of allocation            */
728c2ecf20Sopenharmony_ci	compat_size_t pg_count;	/* number of pages              */
738c2ecf20Sopenharmony_ci	u32 type;		/* 0 == normal, other devspec   */
748c2ecf20Sopenharmony_ci	u32 physical;           /* device specific (some devices
758c2ecf20Sopenharmony_ci				 * need a phys address of the
768c2ecf20Sopenharmony_ci				 * actual page behind the gatt
778c2ecf20Sopenharmony_ci				 * table)                        */
788c2ecf20Sopenharmony_ci};
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_cistruct agp_bind32 {
818c2ecf20Sopenharmony_ci	compat_int_t key;		/* tag of allocation            */
828c2ecf20Sopenharmony_ci	compat_off_t pg_start;		/* starting page to populate    */
838c2ecf20Sopenharmony_ci};
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_cistruct agp_unbind32 {
868c2ecf20Sopenharmony_ci	compat_int_t key;		/* tag of allocation            */
878c2ecf20Sopenharmony_ci	u32 priority;		/* priority for paging out      */
888c2ecf20Sopenharmony_ci};
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ciextern struct agp_front_data agp_fe;
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ciint agpioc_acquire_wrap(struct agp_file_private *priv);
938c2ecf20Sopenharmony_ciint agpioc_release_wrap(struct agp_file_private *priv);
948c2ecf20Sopenharmony_ciint agpioc_protect_wrap(struct agp_file_private *priv);
958c2ecf20Sopenharmony_ciint agpioc_setup_wrap(struct agp_file_private *priv, void __user *arg);
968c2ecf20Sopenharmony_ciint agpioc_deallocate_wrap(struct agp_file_private *priv, int arg);
978c2ecf20Sopenharmony_cistruct agp_file_private *agp_find_private(pid_t pid);
988c2ecf20Sopenharmony_cistruct agp_client *agp_create_client(pid_t id);
998c2ecf20Sopenharmony_ciint agp_remove_client(pid_t id);
1008c2ecf20Sopenharmony_ciint agp_create_segment(struct agp_client *client, struct agp_region *region);
1018c2ecf20Sopenharmony_civoid agp_free_memory_wrap(struct agp_memory *memory);
1028c2ecf20Sopenharmony_cistruct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type);
1038c2ecf20Sopenharmony_cistruct agp_memory *agp_find_mem_by_key(int key);
1048c2ecf20Sopenharmony_cistruct agp_client *agp_find_client_by_pid(pid_t id);
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#endif /* _AGP_COMPAT_H */
107