xref: /openbmc/linux/drivers/char/agp/compat_ioctl.h (revision f050a8ab)
10316fe83SZwane Mwaikambo /*
20316fe83SZwane Mwaikambo  * Copyright (C) 1999 Jeff Hartmann
30316fe83SZwane Mwaikambo  * Copyright (C) 1999 Precision Insight, Inc.
40316fe83SZwane Mwaikambo  * Copyright (C) 1999 Xi Graphics, Inc.
50316fe83SZwane Mwaikambo  *
60316fe83SZwane Mwaikambo  * Permission is hereby granted, free of charge, to any person obtaining a
70316fe83SZwane Mwaikambo  * copy of this software and associated documentation files (the "Software"),
80316fe83SZwane Mwaikambo  * to deal in the Software without restriction, including without limitation
90316fe83SZwane Mwaikambo  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
100316fe83SZwane Mwaikambo  * and/or sell copies of the Software, and to permit persons to whom the
110316fe83SZwane Mwaikambo  * Software is furnished to do so, subject to the following conditions:
120316fe83SZwane Mwaikambo  *
130316fe83SZwane Mwaikambo  * The above copyright notice and this permission notice shall be included
140316fe83SZwane Mwaikambo  * in all copies or substantial portions of the Software.
150316fe83SZwane Mwaikambo  *
160316fe83SZwane Mwaikambo  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
170316fe83SZwane Mwaikambo  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
180316fe83SZwane Mwaikambo  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
190316fe83SZwane Mwaikambo  * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
200316fe83SZwane Mwaikambo  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
210316fe83SZwane Mwaikambo  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
220316fe83SZwane Mwaikambo  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
230316fe83SZwane Mwaikambo  *
240316fe83SZwane Mwaikambo  */
250316fe83SZwane Mwaikambo 
260316fe83SZwane Mwaikambo #ifndef _AGP_COMPAT_IOCTL_H
270316fe83SZwane Mwaikambo #define _AGP_COMPAT_IOCTL_H
280316fe83SZwane Mwaikambo 
290316fe83SZwane Mwaikambo #include <linux/compat.h>
300316fe83SZwane Mwaikambo #include <linux/agpgart.h>
310316fe83SZwane Mwaikambo 
320316fe83SZwane Mwaikambo #define AGPIOC_INFO32       _IOR (AGPIOC_BASE, 0, compat_uptr_t)
330316fe83SZwane Mwaikambo #define AGPIOC_ACQUIRE32    _IO  (AGPIOC_BASE, 1)
340316fe83SZwane Mwaikambo #define AGPIOC_RELEASE32    _IO  (AGPIOC_BASE, 2)
350316fe83SZwane Mwaikambo #define AGPIOC_SETUP32      _IOW (AGPIOC_BASE, 3, compat_uptr_t)
360316fe83SZwane Mwaikambo #define AGPIOC_RESERVE32    _IOW (AGPIOC_BASE, 4, compat_uptr_t)
370316fe83SZwane Mwaikambo #define AGPIOC_PROTECT32    _IOW (AGPIOC_BASE, 5, compat_uptr_t)
380316fe83SZwane Mwaikambo #define AGPIOC_ALLOCATE32   _IOWR(AGPIOC_BASE, 6, compat_uptr_t)
390316fe83SZwane Mwaikambo #define AGPIOC_DEALLOCATE32 _IOW (AGPIOC_BASE, 7, compat_int_t)
400316fe83SZwane Mwaikambo #define AGPIOC_BIND32       _IOW (AGPIOC_BASE, 8, compat_uptr_t)
410316fe83SZwane Mwaikambo #define AGPIOC_UNBIND32     _IOW (AGPIOC_BASE, 9, compat_uptr_t)
42a13af4b4SDave Airlie #define AGPIOC_CHIPSET_FLUSH32 _IO (AGPIOC_BASE, 10)
430316fe83SZwane Mwaikambo 
440316fe83SZwane Mwaikambo struct agp_info32 {
450316fe83SZwane Mwaikambo 	struct agp_version version;	/* version of the driver        */
460316fe83SZwane Mwaikambo 	u32 bridge_id;		/* bridge vendor/device         */
470316fe83SZwane Mwaikambo 	u32 agp_mode;		/* mode info of bridge          */
480316fe83SZwane Mwaikambo 	compat_long_t aper_base;	/* base of aperture             */
490316fe83SZwane Mwaikambo 	compat_size_t aper_size;	/* size of aperture             */
500316fe83SZwane Mwaikambo 	compat_size_t pg_total;	/* max pages (swap + system)    */
510316fe83SZwane Mwaikambo 	compat_size_t pg_system;	/* max pages (system)           */
520316fe83SZwane Mwaikambo 	compat_size_t pg_used;		/* current pages used           */
530316fe83SZwane Mwaikambo };
540316fe83SZwane Mwaikambo 
550316fe83SZwane Mwaikambo /*
560316fe83SZwane Mwaikambo  * The "prot" down below needs still a "sleep" flag somehow ...
570316fe83SZwane Mwaikambo  */
580316fe83SZwane Mwaikambo struct agp_segment32 {
590316fe83SZwane Mwaikambo 	compat_off_t pg_start;		/* starting page to populate    */
600316fe83SZwane Mwaikambo 	compat_size_t pg_count;	/* number of pages              */
610316fe83SZwane Mwaikambo 	compat_int_t prot;		/* prot flags for mmap          */
620316fe83SZwane Mwaikambo };
630316fe83SZwane Mwaikambo 
640316fe83SZwane Mwaikambo struct agp_region32 {
650316fe83SZwane Mwaikambo 	compat_pid_t pid;		/* pid of process               */
660316fe83SZwane Mwaikambo 	compat_size_t seg_count;	/* number of segments           */
670316fe83SZwane Mwaikambo 	struct agp_segment32 *seg_list;
680316fe83SZwane Mwaikambo };
690316fe83SZwane Mwaikambo 
700316fe83SZwane Mwaikambo struct agp_allocate32 {
710316fe83SZwane Mwaikambo 	compat_int_t key;		/* tag of allocation            */
720316fe83SZwane Mwaikambo 	compat_size_t pg_count;	/* number of pages              */
730316fe83SZwane Mwaikambo 	u32 type;		/* 0 == normal, other devspec   */
740316fe83SZwane Mwaikambo 	u32 physical;           /* device specific (some devices
750316fe83SZwane Mwaikambo 				 * need a phys address of the
760316fe83SZwane Mwaikambo 				 * actual page behind the gatt
770316fe83SZwane Mwaikambo 				 * table)                        */
780316fe83SZwane Mwaikambo };
790316fe83SZwane Mwaikambo 
800316fe83SZwane Mwaikambo struct agp_bind32 {
810316fe83SZwane Mwaikambo 	compat_int_t key;		/* tag of allocation            */
820316fe83SZwane Mwaikambo 	compat_off_t pg_start;		/* starting page to populate    */
830316fe83SZwane Mwaikambo };
840316fe83SZwane Mwaikambo 
850316fe83SZwane Mwaikambo struct agp_unbind32 {
860316fe83SZwane Mwaikambo 	compat_int_t key;		/* tag of allocation            */
870316fe83SZwane Mwaikambo 	u32 priority;		/* priority for paging out      */
880316fe83SZwane Mwaikambo };
890316fe83SZwane Mwaikambo 
900316fe83SZwane Mwaikambo extern struct agp_front_data agp_fe;
910316fe83SZwane Mwaikambo 
920316fe83SZwane Mwaikambo int agpioc_acquire_wrap(struct agp_file_private *priv);
930316fe83SZwane Mwaikambo int agpioc_release_wrap(struct agp_file_private *priv);
940316fe83SZwane Mwaikambo int agpioc_protect_wrap(struct agp_file_private *priv);
950316fe83SZwane Mwaikambo int agpioc_setup_wrap(struct agp_file_private *priv, void __user *arg);
960316fe83SZwane Mwaikambo int agpioc_deallocate_wrap(struct agp_file_private *priv, int arg);
970316fe83SZwane Mwaikambo struct agp_file_private *agp_find_private(pid_t pid);
980316fe83SZwane Mwaikambo struct agp_client *agp_create_client(pid_t id);
990316fe83SZwane Mwaikambo int agp_remove_client(pid_t id);
1000316fe83SZwane Mwaikambo int agp_create_segment(struct agp_client *client, struct agp_region *region);
1010316fe83SZwane Mwaikambo void agp_free_memory_wrap(struct agp_memory *memory);
1020316fe83SZwane Mwaikambo struct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type);
1030316fe83SZwane Mwaikambo struct agp_memory *agp_find_mem_by_key(int key);
1040316fe83SZwane Mwaikambo struct agp_client *agp_find_client_by_pid(pid_t id);
1050316fe83SZwane Mwaikambo 
1060316fe83SZwane Mwaikambo #endif /* _AGP_COMPAT_H */
107