agp.h

来自「linux-2.4.29操作系统的源码」· C头文件 代码 · 共 572 行 · 第 1/2 页

H
572
字号
/* * 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_BACKEND_PRIV_H#define _AGP_BACKEND_PRIV_H 1enum aper_size_type {	U8_APER_SIZE,	U16_APER_SIZE,	U32_APER_SIZE,	LVL2_APER_SIZE,	FIXED_APER_SIZE};typedef struct _gatt_mask {	unsigned long mask;	u32 type;	/* totally device specific, for integrated chipsets that 	 * might have different types of memory masks.  For other	 * devices this will probably be ignored */} gatt_mask;typedef struct _aper_size_info_8 {	int size;	int num_entries;	int page_order;	u8 size_value;} aper_size_info_8;typedef struct _aper_size_info_16 {	int size;	int num_entries;	int page_order;	u16 size_value;} aper_size_info_16;typedef struct _aper_size_info_32 {	int size;	int num_entries;	int page_order;	u32 size_value;} aper_size_info_32;typedef struct _aper_size_info_lvl2 {	int size;	int num_entries;	u32 size_value;} aper_size_info_lvl2;typedef struct _aper_size_info_fixed {	int size;	int num_entries;	int page_order;} aper_size_info_fixed;struct agp_bridge_data {	agp_version *version;	void *aperture_sizes;	void *previous_size;	void *current_size;	void *dev_private_data;	struct pci_dev *dev;	gatt_mask *masks;	u32 *gatt_table;	u32 *gatt_table_real;	unsigned long scratch_page;	unsigned long scratch_page_real;	unsigned long gart_bus_addr;	unsigned long gatt_bus_addr;	u32 mode;	enum chipset_type type;	enum aper_size_type size_type;	unsigned long *key_list;	atomic_t current_memory_agp;	atomic_t agp_in_use;	int max_memory_agp;	/* in number of pages */	int needs_scratch_page;	int aperture_size_idx;	int num_aperture_sizes;	int capndx;	int cant_use_aperture;	/* Links to driver specific functions */	int (*fetch_size) (void);	int (*configure) (void);	void (*agp_enable) (u32);	void (*cleanup) (void);	void (*tlb_flush) (agp_memory *);	unsigned long (*mask_memory) (unsigned long, int);	void (*cache_flush) (void);	int (*create_gatt_table) (void);	int (*free_gatt_table) (void);	int (*insert_memory) (agp_memory *, off_t, int);	int (*remove_memory) (agp_memory *, off_t, int);	agp_memory *(*alloc_by_type) (size_t, int);	void (*free_by_type) (agp_memory *);	unsigned long (*agp_alloc_page) (void);	void (*agp_destroy_page) (unsigned long);	int (*suspend)(void);	void (*resume)(void);	};#define OUTREG64(mmap, addr, val)   __raw_writeq((val), (mmap)+(addr))#define OUTREG32(mmap, addr, val)   __raw_writel((val), (mmap)+(addr))#define OUTREG16(mmap, addr, val)   __raw_writew((val), (mmap)+(addr))#define OUTREG8(mmap, addr, val)   __raw_writeb((val), (mmap)+(addr))#define INREG64(mmap, addr)         __raw_readq((mmap)+(addr))#define INREG32(mmap, addr)         __raw_readl((mmap)+(addr))#define INREG16(mmap, addr)         __raw_readw((mmap)+(addr))#define INREG8(mmap, addr)         __raw_readb((mmap)+(addr))#define KB(x) ((x) * 1024)#define MB(x) (KB (KB (x)))#define GB(x) (MB (KB (x)))#define CACHE_FLUSH	agp_bridge.cache_flush#define A_SIZE_8(x)	((aper_size_info_8 *) x)#define A_SIZE_16(x)	((aper_size_info_16 *) x)#define A_SIZE_32(x)	((aper_size_info_32 *) x)#define A_SIZE_LVL2(x)  ((aper_size_info_lvl2 *) x)#define A_SIZE_FIX(x)	((aper_size_info_fixed *) x)#define A_IDX8()	(A_SIZE_8(agp_bridge.aperture_sizes) + i)#define A_IDX16()	(A_SIZE_16(agp_bridge.aperture_sizes) + i)#define A_IDX32()	(A_SIZE_32(agp_bridge.aperture_sizes) + i)#define A_IDXLVL2()	(A_SIZE_LVL2(agp_bridge.aperture_sizes) + i)#define A_IDXFIX()	(A_SIZE_FIX(agp_bridge.aperture_sizes) + i)#define MAXKEY		(4096 * 32)#define AGPGART_MODULE_NAME	"agpgart"#define PFX			AGPGART_MODULE_NAME ": "#define PGE_EMPTY(p) (!(p) || (p) == (unsigned long) agp_bridge.scratch_page)#ifndef PCI_DEVICE_ID_VIA_82C691_0#define PCI_DEVICE_ID_VIA_82C691_0      0x0691#endif#ifndef PCI_DEVICE_ID_VIA_8371_0#define PCI_DEVICE_ID_VIA_8371_0      0x0391#endif#ifndef PCI_DEVICE_ID_VIA_8363_0#define PCI_DEVICE_ID_VIA_8363_0      0x0305#endif#ifndef PCI_DEVICE_ID_VIA_8601_0#define PCI_DEVICE_ID_VIA_8601_0      0x0601#endif#ifndef PCI_DEVICE_ID_VIA_82C694X_0#define PCI_DEVICE_ID_VIA_82C694X_0      0x0605#endif#ifndef PCI_DEVICE_ID_VIA_8380_0#define PCI_DEVICE_ID_VIA_8380_0	0x0204#endif#ifndef PCI_DEVICE_ID_VIA_8385_0#define PCI_DEVICE_ID_VIA_8385_0	0x3188#endif #ifndef PCI_DEVICE_ID_INTEL_810_0#define PCI_DEVICE_ID_INTEL_810_0       0x7120#endif#ifndef PCI_DEVICE_ID_INTEL_845_G_0#define PCI_DEVICE_ID_INTEL_845_G_0	0x2560#endif#ifndef PCI_DEVICE_ID_INTEL_845_G_1#define PCI_DEVICE_ID_INTEL_845_G_1     0x2562#endif#ifndef PCI_DEVICE_ID_INTEL_830_M_0#define PCI_DEVICE_ID_INTEL_830_M_0	0x3575#endif#ifndef PCI_DEVICE_ID_INTEL_830_M_1#define PCI_DEVICE_ID_INTEL_830_M_1     0x3577#endif#ifndef PCI_DEVICE_ID_INTEL_855_GM_0#define PCI_DEVICE_ID_INTEL_855_GM_0	0x3580#endif#ifndef PCI_DEVICE_ID_INTEL_855_GM_1#define PCI_DEVICE_ID_INTEL_855_GM_1	0x3582#endif#ifndef PCI_DEVICE_ID_INTEL_855_PM_0#define PCI_DEVICE_ID_INTEL_855_PM_0	0x3340#endif#ifndef PCI_DEVICE_ID_INTEL_855_PM_1#define PCI_DEVICE_ID_INTEL_855_PM_1	0x3342#endif#ifndef PCI_DEVICE_ID_INTEL_865_G_0#define PCI_DEVICE_ID_INTEL_865_G_0	0x2570#endif#ifndef PCI_DEVICE_ID_INTEL_865_G_1#define PCI_DEVICE_ID_INTEL_865_G_1	0x2572#endif#ifndef PCI_DEVICE_ID_INTEL_915_G_0#define PCI_DEVICE_ID_INTEL_915_G_0	0x2580#endif#ifndef PCI_DEVICE_ID_INTEL_915_G_1#define PCI_DEVICE_ID_INTEL_915_G_1	0x2582#endif#ifndef PCI_DEVICE_ID_INTEL_820_0#define PCI_DEVICE_ID_INTEL_820_0       0x2500#endif#ifndef PCI_DEVICE_ID_INTEL_820_UP_0#define PCI_DEVICE_ID_INTEL_820_UP_0    0x2501#endif#ifndef PCI_DEVICE_ID_INTEL_840_0#define PCI_DEVICE_ID_INTEL_840_0		0x1a21#endif#ifndef PCI_DEVICE_ID_INTEL_845_0#define PCI_DEVICE_ID_INTEL_845_0     0x1a30#endif#ifndef PCI_DEVICE_ID_INTEL_850_0#define PCI_DEVICE_ID_INTEL_850_0     0x2530#endif#ifndef PCI_DEVICE_ID_INTEL_860_0#define PCI_DEVICE_ID_INTEL_860_0     0x2531#endif#ifndef PCI_DEVICE_ID_INTEL_7205_0#define PCI_DEVICE_ID_INTEL_7205_0     0x255d#endif#ifndef PCI_DEVICE_ID_INTEL_7505_0#define PCI_DEVICE_ID_INTEL_7505_0     0x2550#endif#ifndef PCI_DEVICE_ID_INTEL_810_DC100_0#define PCI_DEVICE_ID_INTEL_810_DC100_0 0x7122#endif#ifndef PCI_DEVICE_ID_INTEL_810_E_0#define PCI_DEVICE_ID_INTEL_810_E_0     0x7124#endif#ifndef PCI_DEVICE_ID_INTEL_82443GX_0#define PCI_DEVICE_ID_INTEL_82443GX_0   0x71a0#endif#ifndef PCI_DEVICE_ID_INTEL_810_1#define PCI_DEVICE_ID_INTEL_810_1       0x7121#endif#ifndef PCI_DEVICE_ID_INTEL_810_DC100_1#define PCI_DEVICE_ID_INTEL_810_DC100_1 0x7123#endif#ifndef PCI_DEVICE_ID_INTEL_810_E_1#define PCI_DEVICE_ID_INTEL_810_E_1     0x7125#endif#ifndef PCI_DEVICE_ID_INTEL_815_0#define PCI_DEVICE_ID_INTEL_815_0       0x1130#endif#ifndef PCI_DEVICE_ID_INTEL_815_1#define PCI_DEVICE_ID_INTEL_815_1       0x1132#endif#ifndef PCI_DEVICE_ID_INTEL_82443GX_1#define PCI_DEVICE_ID_INTEL_82443GX_1   0x71a1#endif#ifndef PCI_DEVICE_ID_INTEL_460GX#define PCI_DEVICE_ID_INTEL_460GX       0x84ea#endif#ifndef PCI_DEVICE_ID_AMD_IRONGATE_0#define PCI_DEVICE_ID_AMD_IRONGATE_0    0x7006#endif#ifndef PCI_DEVICE_ID_AMD_761_0#define PCI_DEVICE_ID_AMD_761_0         0x700e#endif#ifndef PCI_DEVICE_ID_AMD_762_0#define PCI_DEVICE_ID_AMD_762_0		0x700C#endif#ifndef PCI_DEVICE_ID_AMD_8151_0#define PCI_DEVICE_ID_AMD_8151_0	0x7454#endif#ifndef PCI_VENDOR_ID_AL

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?