Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


agpgart.h
001: /*
002:  * AGPGART module version 0.99
003:  * Copyright (C) 1999 Jeff Hartmann
004:  * Copyright (C) 1999 Precision Insight, Inc.
005:  * Copyright (C) 1999 Xi Graphics, Inc.
006:  *
007:  * Permission is hereby granted, free of charge, to any person obtaining a
008:  * copy of this software and associated documentation files (the "Software"),
009:  * to deal in the Software without restriction, including without limitation
010:  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
011:  * and/or sell copies of the Software, and to permit persons to whom the
012:  * Software is furnished to do so, subject to the following conditions:
013:  *
014:  * The above copyright notice and this permission notice shall be included
015:  * in all copies or substantial portions of the Software.
016:  *
017:  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
018:  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
019:  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
020:  * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
021:  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
022:  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
023:  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
024:  *
025:  */
026: 
027: #ifndef _AGP_H
028: #define _AGP_H 1
029: 
030: #define AGPIOC_BASE       'A'
031: #define AGPIOC_INFO       _IOR (AGPIOC_BASE, 0, struct agp_info*)
032: #define AGPIOC_ACQUIRE    _IO  (AGPIOC_BASE, 1)
033: #define AGPIOC_RELEASE    _IO  (AGPIOC_BASE, 2)
034: #define AGPIOC_SETUP      _IOW (AGPIOC_BASE, 3, struct agp_setup*)
035: #define AGPIOC_RESERVE    _IOW (AGPIOC_BASE, 4, struct agp_region*)
036: #define AGPIOC_PROTECT    _IOW (AGPIOC_BASE, 5, struct agp_region*)
037: #define AGPIOC_ALLOCATE   _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
038: #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
039: #define AGPIOC_BIND       _IOW (AGPIOC_BASE, 8, struct agp_bind*)
040: #define AGPIOC_UNBIND     _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
041: #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
042: 
043: #define AGP_DEVICE      "/dev/agpgart"
044: 
045: #ifndef TRUE
046: #define TRUE 1
047: #endif
048: 
049: #ifndef FALSE
050: #define FALSE 0
051: #endif
052: 
053: #include <linux/types.h>
054: 
055: struct agp_version {
056:         __u16 major;
057:         __u16 minor;
058: };
059: 
060: typedef struct _agp_info {
061:         struct agp_version version;     /* version of the driver        */
062:         __u32 bridge_id;        /* bridge vendor/device         */
063:         __u32 agp_mode;         /* mode info of bridge          */
064:         unsigned long aper_base;/* base of aperture             */
065:         size_t aper_size;       /* size of aperture             */
066:         size_t pg_total;        /* max pages (swap + system)    */
067:         size_t pg_system;       /* max pages (system)           */
068:         size_t pg_used;         /* current pages used           */
069: } agp_info;
070: 
071: typedef struct _agp_setup {
072:         __u32 agp_mode;         /* mode info of bridge          */
073: } agp_setup;
074: 
075: /*
076:  * The "prot" down below needs still a "sleep" flag somehow ...
077:  */
078: typedef struct _agp_segment {
079:         __kernel_off_t pg_start;        /* starting page to populate    */
080:         __kernel_size_t pg_count;       /* number of pages              */
081:         int prot;                       /* prot flags for mmap          */
082: } agp_segment;
083: 
084: typedef struct _agp_region {
085:         __kernel_pid_t pid;             /* pid of process       */
086:         __kernel_size_t seg_count;      /* number of segments   */
087:         struct _agp_segment *seg_list;
088: } agp_region;
089: 
090: typedef struct _agp_allocate {
091:         int key;                /* tag of allocation            */
092:         __kernel_size_t pg_count;/* number of pages             */
093:         __u32 type;             /* 0 == normal, other devspec   */
094:         __u32 physical;         /* device specific (some devices  
095:                                  * need a phys address of the     
096:                                  * actual page behind the gatt    
097:                                  * table)                        */
098: } agp_allocate;
099: 
100: typedef struct _agp_bind {
101:         int key;                /* tag of allocation            */
102:         __kernel_off_t pg_start;/* starting page to populate    */
103: } agp_bind;
104: 
105: typedef struct _agp_unbind {
106:         int key;                /* tag of allocation            */
107:         __u32 priority;         /* priority for paging out      */
108: } agp_unbind;
109: 
110: 
111: #endif                          /* _AGP_H */
112: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/