0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030 #ifndef _AGP_BACKEND_H
0031 #define _AGP_BACKEND_H 1
0032
0033 #include <linux/list.h>
0034
0035 enum chipset_type {
0036 NOT_SUPPORTED,
0037 SUPPORTED,
0038 };
0039
0040 struct agp_version {
0041 u16 major;
0042 u16 minor;
0043 };
0044
0045 struct agp_kern_info {
0046 struct agp_version version;
0047 struct pci_dev *device;
0048 enum chipset_type chipset;
0049 unsigned long mode;
0050 unsigned long aper_base;
0051 size_t aper_size;
0052 int max_memory;
0053 int current_memory;
0054 bool cant_use_aperture;
0055 unsigned long page_mask;
0056 const struct vm_operations_struct *vm_ops;
0057 };
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 struct agp_bridge_data;
0068
0069 struct agp_memory {
0070 struct agp_memory *next;
0071 struct agp_memory *prev;
0072 struct agp_bridge_data *bridge;
0073 struct page **pages;
0074 size_t page_count;
0075 int key;
0076 int num_scratch_pages;
0077 off_t pg_start;
0078 u32 type;
0079 u32 physical;
0080 bool is_bound;
0081 bool is_flushed;
0082
0083 struct list_head mapped_list;
0084
0085 struct scatterlist *sg_list;
0086 int num_sg;
0087 };
0088
0089 #define AGP_NORMAL_MEMORY 0
0090
0091 #define AGP_USER_TYPES (1 << 16)
0092 #define AGP_USER_MEMORY (AGP_USER_TYPES)
0093 #define AGP_USER_CACHED_MEMORY (AGP_USER_TYPES + 1)
0094
0095 extern struct agp_bridge_data *agp_bridge;
0096 extern struct list_head agp_bridges;
0097
0098 extern struct agp_bridge_data *(*agp_find_bridge)(struct pci_dev *);
0099
0100 extern void agp_free_memory(struct agp_memory *);
0101 extern struct agp_memory *agp_allocate_memory(struct agp_bridge_data *, size_t, u32);
0102 extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *);
0103 extern int agp_bind_memory(struct agp_memory *, off_t);
0104 extern int agp_unbind_memory(struct agp_memory *);
0105 extern void agp_enable(struct agp_bridge_data *, u32);
0106 extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *);
0107 extern void agp_backend_release(struct agp_bridge_data *);
0108
0109 #endif