Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (C) 1999 Jeff Hartmann
0003  * Copyright (C) 1999 Precision Insight, Inc.
0004  * Copyright (C) 1999 Xi Graphics, Inc.
0005  *
0006  * Permission is hereby granted, free of charge, to any person obtaining a
0007  * copy of this software and associated documentation files (the "Software"),
0008  * to deal in the Software without restriction, including without limitation
0009  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0010  * and/or sell copies of the Software, and to permit persons to whom the
0011  * Software is furnished to do so, subject to the following conditions:
0012  *
0013  * The above copyright notice and this permission notice shall be included
0014  * in all copies or substantial portions of the Software.
0015  *
0016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
0017  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0018  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0019  * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
0020  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
0021  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
0022  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0023  *
0024  */
0025 
0026 #ifndef _AGP_COMPAT_IOCTL_H
0027 #define _AGP_COMPAT_IOCTL_H
0028 
0029 #include <linux/compat.h>
0030 #include <linux/agpgart.h>
0031 
0032 #define AGPIOC_INFO32       _IOR (AGPIOC_BASE, 0, compat_uptr_t)
0033 #define AGPIOC_ACQUIRE32    _IO  (AGPIOC_BASE, 1)
0034 #define AGPIOC_RELEASE32    _IO  (AGPIOC_BASE, 2)
0035 #define AGPIOC_SETUP32      _IOW (AGPIOC_BASE, 3, compat_uptr_t)
0036 #define AGPIOC_RESERVE32    _IOW (AGPIOC_BASE, 4, compat_uptr_t)
0037 #define AGPIOC_PROTECT32    _IOW (AGPIOC_BASE, 5, compat_uptr_t)
0038 #define AGPIOC_ALLOCATE32   _IOWR(AGPIOC_BASE, 6, compat_uptr_t)
0039 #define AGPIOC_DEALLOCATE32 _IOW (AGPIOC_BASE, 7, compat_int_t)
0040 #define AGPIOC_BIND32       _IOW (AGPIOC_BASE, 8, compat_uptr_t)
0041 #define AGPIOC_UNBIND32     _IOW (AGPIOC_BASE, 9, compat_uptr_t)
0042 #define AGPIOC_CHIPSET_FLUSH32 _IO (AGPIOC_BASE, 10)
0043 
0044 struct agp_info32 {
0045     struct agp_version version; /* version of the driver        */
0046     u32 bridge_id;      /* bridge vendor/device         */
0047     u32 agp_mode;       /* mode info of bridge          */
0048     compat_long_t aper_base;    /* base of aperture             */
0049     compat_size_t aper_size;    /* size of aperture             */
0050     compat_size_t pg_total; /* max pages (swap + system)    */
0051     compat_size_t pg_system;    /* max pages (system)           */
0052     compat_size_t pg_used;      /* current pages used           */
0053 };
0054 
0055 /*
0056  * The "prot" down below needs still a "sleep" flag somehow ...
0057  */
0058 struct agp_segment32 {
0059     compat_off_t pg_start;      /* starting page to populate    */
0060     compat_size_t pg_count; /* number of pages              */
0061     compat_int_t prot;      /* prot flags for mmap          */
0062 };
0063 
0064 struct agp_region32 {
0065     compat_pid_t pid;       /* pid of process               */
0066     compat_size_t seg_count;    /* number of segments           */
0067     struct agp_segment32 *seg_list;
0068 };
0069 
0070 struct agp_allocate32 {
0071     compat_int_t key;       /* tag of allocation            */
0072     compat_size_t pg_count; /* number of pages              */
0073     u32 type;       /* 0 == normal, other devspec   */
0074     u32 physical;           /* device specific (some devices
0075                  * need a phys address of the
0076                  * actual page behind the gatt
0077                  * table)                        */
0078 };
0079 
0080 struct agp_bind32 {
0081     compat_int_t key;       /* tag of allocation            */
0082     compat_off_t pg_start;      /* starting page to populate    */
0083 };
0084 
0085 struct agp_unbind32 {
0086     compat_int_t key;       /* tag of allocation            */
0087     u32 priority;       /* priority for paging out      */
0088 };
0089 
0090 extern struct agp_front_data agp_fe;
0091 
0092 int agpioc_acquire_wrap(struct agp_file_private *priv);
0093 int agpioc_release_wrap(struct agp_file_private *priv);
0094 int agpioc_protect_wrap(struct agp_file_private *priv);
0095 int agpioc_setup_wrap(struct agp_file_private *priv, void __user *arg);
0096 int agpioc_deallocate_wrap(struct agp_file_private *priv, int arg);
0097 struct agp_file_private *agp_find_private(pid_t pid);
0098 struct agp_client *agp_create_client(pid_t id);
0099 int agp_remove_client(pid_t id);
0100 int agp_create_segment(struct agp_client *client, struct agp_region *region);
0101 void agp_free_memory_wrap(struct agp_memory *memory);
0102 struct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type);
0103 struct agp_memory *agp_find_mem_by_key(int key);
0104 struct agp_client *agp_find_client_by_pid(pid_t id);
0105 
0106 #endif /* _AGP_COMPAT_H */