/* * AGPGART module version 0.99 * Copyright (C) 1999 Jeff Hartmann * Copyright (C) 1999 Precision Insight, Inc. * Copyright (C) 1999 Xi Graphics, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */#ifndef _AGP_H#define _AGP_H 1#include<linux/mutex.h>#include<linux/agp_backend.h>#include<uapi/linux/agpgart.h>#define AGPGART_MINOR 175structagp_info{structagp_versionversion;/* version of the driver */u32bridge_id;/* bridge vendor/device */u32agp_mode;/* mode info of bridge */unsignedlongaper_base;/* base of aperture */size_taper_size;/* size of aperture */size_tpg_total;/* max pages (swap + system) */size_tpg_system;/* max pages (system) */size_tpg_used;/* current pages used */};structagp_setup{u32agp_mode;/* mode info of bridge */};/* * The "prot" down below needs still a "sleep" flag somehow ... */structagp_segment{off_tpg_start;/* starting page to populate */size_tpg_count;/* number of pages */intprot;/* prot flags for mmap */};structagp_segment_priv{off_tpg_start;size_tpg_count;pgprot_tprot;};structagp_region{pid_tpid;/* pid of process */size_tseg_count;/* number of segments */structagp_segment*seg_list;};structagp_allocate{intkey;/* tag of allocation */size_tpg_count;/* number of pages */u32type;/* 0 == normal, other devspec */u32physical;/* device specific (some devices * need a phys address of the * actual page behind the gatt * table) */};structagp_bind{intkey;/* tag of allocation */off_tpg_start;/* starting page to populate */};structagp_unbind{intkey;/* tag of allocation */u32priority;/* priority for paging out */};structagp_client{structagp_client*next;structagp_client*prev;pid_tpid;intnum_segments;structagp_segment_priv**segments;};structagp_controller{structagp_controller*next;structagp_controller*prev;pid_tpid;intnum_clients;structagp_memory*pool;structagp_client*clients;};#define AGP_FF_ALLOW_CLIENT 0#define AGP_FF_ALLOW_CONTROLLER 1#define AGP_FF_IS_CLIENT 2#define AGP_FF_IS_CONTROLLER 3#define AGP_FF_IS_VALID 4structagp_file_private{structagp_file_private*next;structagp_file_private*prev;pid_tmy_pid;unsignedlongaccess_flags;/* long req'd for set_bit --RR */};structagp_front_data{structmutexagp_mutex;structagp_controller*current_controller;structagp_controller*controllers;structagp_file_private*file_priv_list;boolused_by_controller;boolbackend_acquired;};#endif /* _AGP_H */