Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * AGPGART module version 0.99
0003  * Copyright (C) 1999 Jeff Hartmann
0004  * Copyright (C) 1999 Precision Insight, Inc.
0005  * Copyright (C) 1999 Xi Graphics, Inc.
0006  *
0007  * Permission is hereby granted, free of charge, to any person obtaining a
0008  * copy of this software and associated documentation files (the "Software"),
0009  * to deal in the Software without restriction, including without limitation
0010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0011  * and/or sell copies of the Software, and to permit persons to whom the
0012  * Software is furnished to do so, subject to the following conditions:
0013  *
0014  * The above copyright notice and this permission notice shall be included
0015  * in all copies or substantial portions of the Software.
0016  *
0017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
0018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0020  * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
0021  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
0022  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
0023  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0024  *
0025  */
0026 
0027 #ifndef _UAPI_AGP_H
0028 #define _UAPI_AGP_H
0029 
0030 #define AGPIOC_BASE       'A'
0031 #define AGPIOC_INFO       _IOR (AGPIOC_BASE, 0, struct agp_info*)
0032 #define AGPIOC_ACQUIRE    _IO  (AGPIOC_BASE, 1)
0033 #define AGPIOC_RELEASE    _IO  (AGPIOC_BASE, 2)
0034 #define AGPIOC_SETUP      _IOW (AGPIOC_BASE, 3, struct agp_setup*)
0035 #define AGPIOC_RESERVE    _IOW (AGPIOC_BASE, 4, struct agp_region*)
0036 #define AGPIOC_PROTECT    _IOW (AGPIOC_BASE, 5, struct agp_region*)
0037 #define AGPIOC_ALLOCATE   _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
0038 #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
0039 #define AGPIOC_BIND       _IOW (AGPIOC_BASE, 8, struct agp_bind*)
0040 #define AGPIOC_UNBIND     _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
0041 #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
0042 
0043 #define AGP_DEVICE      "/dev/agpgart"
0044 
0045 #ifndef TRUE
0046 #define TRUE 1
0047 #endif
0048 
0049 #ifndef FALSE
0050 #define FALSE 0
0051 #endif
0052 
0053 #ifndef __KERNEL__
0054 #include <linux/types.h>
0055 
0056 struct agp_version {
0057     __u16 major;
0058     __u16 minor;
0059 };
0060 
0061 typedef struct _agp_info {
0062     struct agp_version version; /* version of the driver        */
0063     __u32 bridge_id;    /* bridge vendor/device         */
0064     __u32 agp_mode;     /* mode info of bridge          */
0065     unsigned long aper_base;/* base of aperture             */
0066     __kernel_size_t aper_size;  /* size of aperture             */
0067     __kernel_size_t pg_total;   /* max pages (swap + system)    */
0068     __kernel_size_t pg_system;  /* max pages (system)           */
0069     __kernel_size_t pg_used;    /* current pages used           */
0070 } agp_info;
0071 
0072 typedef struct _agp_setup {
0073     __u32 agp_mode;     /* mode info of bridge          */
0074 } agp_setup;
0075 
0076 /*
0077  * The "prot" down below needs still a "sleep" flag somehow ...
0078  */
0079 typedef struct _agp_segment {
0080     __kernel_off_t pg_start;    /* starting page to populate    */
0081     __kernel_size_t pg_count;   /* number of pages              */
0082     int prot;           /* prot flags for mmap          */
0083 } agp_segment;
0084 
0085 typedef struct _agp_region {
0086     __kernel_pid_t pid;     /* pid of process       */
0087     __kernel_size_t seg_count;  /* number of segments   */
0088     struct _agp_segment *seg_list;
0089 } agp_region;
0090 
0091 typedef struct _agp_allocate {
0092     int key;        /* tag of allocation            */
0093     __kernel_size_t pg_count;/* number of pages             */
0094     __u32 type;     /* 0 == normal, other devspec   */
0095     __u32 physical;         /* device specific (some devices  
0096                  * need a phys address of the     
0097                  * actual page behind the gatt    
0098                  * table)                        */
0099 } agp_allocate;
0100 
0101 typedef struct _agp_bind {
0102     int key;        /* tag of allocation            */
0103     __kernel_off_t pg_start;/* starting page to populate    */
0104 } agp_bind;
0105 
0106 typedef struct _agp_unbind {
0107     int key;        /* tag of allocation            */
0108     __u32 priority;     /* priority for paging out      */
0109 } agp_unbind;
0110 
0111 #endif              /* __KERNEL__ */
0112 
0113 #endif /* _UAPI_AGP_H */