亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aperture.c

?? linux2.6.16版本
?? C
字號:
/*  * Firmware replacement code. *  * Work around broken BIOSes that don't set an aperture or only set the * aperture in the AGP bridge.  * If all fails map the aperture over some low memory.  This is cheaper than  * doing bounce buffering. The memory is lost. This is done at early boot  * because only the bootmem allocator can allocate 32+MB.  *  * Copyright 2002 Andi Kleen, SuSE Labs. * $Id: aperture.c,v 1.7 2003/08/01 03:36:18 ak Exp $ */#include <linux/config.h>#include <linux/kernel.h>#include <linux/types.h>#include <linux/init.h>#include <linux/bootmem.h>#include <linux/mmzone.h>#include <linux/pci_ids.h>#include <linux/pci.h>#include <linux/bitops.h>#include <asm/e820.h>#include <asm/io.h>#include <asm/proto.h>#include <asm/pci-direct.h>#include <asm/dma.h>int iommu_aperture;int iommu_aperture_disabled __initdata = 0;int iommu_aperture_allowed __initdata = 0;int fallback_aper_order __initdata = 1; /* 64MB */int fallback_aper_force __initdata = 0; int fix_aperture __initdata = 1;/* This code runs before the PCI subsystem is initialized, so just   access the northbridge directly. */#define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16))static u32 __init allocate_aperture(void) {	pg_data_t *nd0 = NODE_DATA(0);	u32 aper_size;	void *p; 	if (fallback_aper_order > 7) 		fallback_aper_order = 7; 	aper_size = (32 * 1024 * 1024) << fallback_aper_order; 	/* 	 * Aperture has to be naturally aligned. This means an 2GB aperture won't	 * have much chances to find a place in the lower 4GB of memory.	 * Unfortunately we cannot move it up because that would make the	 * IOMMU useless.	 */	p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0); 	if (!p || __pa(p)+aper_size > 0xffffffff) {		printk("Cannot allocate aperture memory hole (%p,%uK)\n",		       p, aper_size>>10);		if (p)			free_bootmem_node(nd0, (unsigned long)p, aper_size); 		return 0;	}	printk("Mapping aperture over %d KB of RAM @ %lx\n",	       aper_size >> 10, __pa(p)); 	return (u32)__pa(p); }static int __init aperture_valid(char *name, u64 aper_base, u32 aper_size) { 	if (!aper_base) 		return 0;	if (aper_size < 64*1024*1024) { 		printk("Aperture from %s too small (%d MB)\n", name, aper_size>>20); 		return 0;	}	if (aper_base + aper_size >= 0xffffffff) { 		printk("Aperture from %s beyond 4GB. Ignoring.\n",name);		return 0; 	}	if (e820_mapped(aper_base, aper_base + aper_size, E820_RAM)) {  		printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name);		return 0; 	} 	return 1;} /* Find a PCI capability */static __u32 __init find_cap(int num, int slot, int func, int cap) { 	u8 pos;	int bytes;	if (!(read_pci_config_16(num,slot,func,PCI_STATUS) & PCI_STATUS_CAP_LIST))		return 0;	pos = read_pci_config_byte(num,slot,func,PCI_CAPABILITY_LIST);	for (bytes = 0; bytes < 48 && pos >= 0x40; bytes++) { 		u8 id;		pos &= ~3; 		id = read_pci_config_byte(num,slot,func,pos+PCI_CAP_LIST_ID);		if (id == 0xff)			break;		if (id == cap) 			return pos; 		pos = read_pci_config_byte(num,slot,func,pos+PCI_CAP_LIST_NEXT); 	} 	return 0;} /* Read a standard AGPv3 bridge header */static __u32 __init read_agp(int num, int slot, int func, int cap, u32 *order){ 	u32 apsize;	u32 apsizereg;	int nbits;	u32 aper_low, aper_hi;	u64 aper;	printk("AGP bridge at %02x:%02x:%02x\n", num, slot, func);	apsizereg = read_pci_config_16(num,slot,func, cap + 0x14);	if (apsizereg == 0xffffffff) {		printk("APSIZE in AGP bridge unreadable\n");		return 0;	}	apsize = apsizereg & 0xfff;	/* Some BIOS use weird encodings not in the AGPv3 table. */	if (apsize & 0xff) 		apsize |= 0xf00; 	nbits = hweight16(apsize);	*order = 7 - nbits;	if ((int)*order < 0) /* < 32MB */		*order = 0;		aper_low = read_pci_config(num,slot,func, 0x10);	aper_hi = read_pci_config(num,slot,func,0x14);	aper = (aper_low & ~((1<<22)-1)) | ((u64)aper_hi << 32);	printk("Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", 	       aper, 32 << *order, apsizereg);	if (!aperture_valid("AGP bridge", aper, (32*1024*1024) << *order))	    return 0;	return (u32)aper; } /* Look for an AGP bridge. Windows only expects the aperture in the   AGP bridge and some BIOS forget to initialize the Northbridge too.   Work around this here.    Do an PCI bus scan by hand because we're running before the PCI   subsystem.    All K8 AGP bridges are AGPv3 compliant, so we can do this scan   generically. It's probably overkill to always scan all slots because   the AGP bridges should be always an own bus on the HT hierarchy,    but do it here for future safety. */static __u32 __init search_agp_bridge(u32 *order, int *valid_agp){	int num, slot, func;	/* Poor man's PCI discovery */	for (num = 0; num < 32; num++) { 		for (slot = 0; slot < 32; slot++) { 			for (func = 0; func < 8; func++) { 				u32 class, cap;				u8 type;				class = read_pci_config(num,slot,func,							PCI_CLASS_REVISION);				if (class == 0xffffffff)					break; 								switch (class >> 16) { 				case PCI_CLASS_BRIDGE_HOST:				case PCI_CLASS_BRIDGE_OTHER: /* needed? */					/* AGP bridge? */					cap = find_cap(num,slot,func,PCI_CAP_ID_AGP);					if (!cap)						break;					*valid_agp = 1; 					return read_agp(num,slot,func,cap,order);				} 								/* No multi-function device? */				type = read_pci_config_byte(num,slot,func,							       PCI_HEADER_TYPE);				if (!(type & 0x80))					break;			} 		} 	}	printk("No AGP bridge found\n"); 	return 0;}void __init iommu_hole_init(void) { 	int fix, num; 	u32 aper_size, aper_alloc = 0, aper_order = 0, last_aper_order = 0;	u64 aper_base, last_aper_base = 0;	int valid_agp = 0;	if (iommu_aperture_disabled || !fix_aperture)		return;	printk("Checking aperture...\n"); 	fix = 0;	for (num = 24; num < 32; num++) {				char name[30];		if (read_pci_config(0, num, 3, 0x00) != NB_ID_3) 			continue;			iommu_aperture = 1; 		aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7; 		aper_size = (32 * 1024 * 1024) << aper_order; 		aper_base = read_pci_config(0, num, 3, 0x94) & 0x7fff;		aper_base <<= 25; 		printk("CPU %d: aperture @ %Lx size %u MB\n", num-24, 		       aper_base, aper_size>>20);				sprintf(name, "northbridge cpu %d", num-24); 		if (!aperture_valid(name, aper_base, aper_size)) { 			fix = 1; 			break; 		}		if ((last_aper_order && aper_order != last_aper_order) ||		    (last_aper_base && aper_base != last_aper_base)) {			fix = 1;			break;		}		last_aper_order = aper_order;		last_aper_base = aper_base;	} 	if (!fix && !fallback_aper_force) 		return; 	if (!fallback_aper_force)		aper_alloc = search_agp_bridge(&aper_order, &valid_agp); 			if (aper_alloc) { 		/* Got the aperture from the AGP bridge */	} else if (swiotlb && !valid_agp) {		/* Do nothing */	} else if ((!no_iommu && end_pfn > MAX_DMA32_PFN) ||		   force_iommu ||		   valid_agp ||		   fallback_aper_force) { 		printk("Your BIOS doesn't leave a aperture memory hole\n");		printk("Please enable the IOMMU option in the BIOS setup\n");		printk("This costs you %d MB of RAM\n",		       32 << fallback_aper_order);		aper_order = fallback_aper_order;		aper_alloc = allocate_aperture();		if (!aper_alloc) { 			/* Could disable AGP and IOMMU here, but it's probably			   not worth it. But the later users cannot deal with			   bad apertures and turning on the aperture over memory			   causes very strange problems, so it's better to 			   panic early. */			panic("Not enough memory for aperture");		}	} else { 		return; 	} 	/* Fix up the north bridges */	for (num = 24; num < 32; num++) { 				if (read_pci_config(0, num, 3, 0x00) != NB_ID_3) 			continue;			/* Don't enable translation yet. That is done later. 		   Assume this BIOS didn't initialise the GART so 		   just overwrite all previous bits */ 		write_pci_config(0, num, 3, 0x90, aper_order<<1); 		write_pci_config(0, num, 3, 0x94, aper_alloc>>25); 	} } 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲老妇xxxxxx| 2017欧美狠狠色| 色噜噜夜夜夜综合网| 成人毛片老司机大片| 国产乱对白刺激视频不卡| 久久99国产精品免费网站| 久久国产精品区| 蜜桃视频在线观看一区| 激情深爱一区二区| 成人激情av网| 一本久道中文字幕精品亚洲嫩| 色天使色偷偷av一区二区| 色狠狠综合天天综合综合| 欧美日韩一卡二卡| 日韩视频免费观看高清在线视频| 欧美一激情一区二区三区| 精品日韩99亚洲| 中文一区二区在线观看| 亚洲免费三区一区二区| 天天影视色香欲综合网老头| 韩国理伦片一区二区三区在线播放| 国产激情91久久精品导航| www.成人网.com| 欧美日韩mp4| 久久免费视频一区| 亚洲日穴在线视频| 日韩国产高清影视| 国产精品一区免费视频| 91久久精品一区二区三| 日韩免费视频一区二区| 国产精品日韩成人| 日韩高清在线电影| 成人高清视频免费观看| 欧美美女一区二区在线观看| 国产午夜亚洲精品午夜鲁丝片 | 欧美一区二区性放荡片| 精品av久久707| 亚洲一区二区四区蜜桃| 国产一区美女在线| 欧美日韩另类一区| 国产精品高潮久久久久无| 日本伊人午夜精品| 91香蕉视频在线| 久久久午夜精品| 天天射综合影视| 99在线视频精品| 久久新电视剧免费观看| 亚洲国产欧美在线| 不卡的电视剧免费网站有什么| 日韩一区二区三区免费观看| 一区二区三区中文字幕精品精品| 国产精品亚洲午夜一区二区三区| 欧美日韩中文一区| 亚洲视频资源在线| 国产91在线|亚洲| 精品国产一区a| 秋霞电影一区二区| 欧美三级视频在线播放| 亚洲人成网站精品片在线观看| 久草中文综合在线| 欧美一区二区女人| 性久久久久久久| 欧美午夜精品电影| 亚洲黄色小视频| 99精品桃花视频在线观看| 国产精品二三区| 成人免费看片app下载| 精品处破学生在线二十三| 日韩电影免费一区| 欧美精选一区二区| 亚洲 欧美综合在线网络| 国产美女精品人人做人人爽| 欧美va亚洲va国产综合| 蜜桃传媒麻豆第一区在线观看| 欧美色图天堂网| 图片区日韩欧美亚洲| 欧美日韩成人在线| 蜜桃久久精品一区二区| 精品国产一区二区三区四区四| 激情六月婷婷综合| wwww国产精品欧美| 国产成人av资源| 综合婷婷亚洲小说| 欧美韩日一区二区三区| 亚洲国产精品v| 精品一区二区三区在线视频| 欧美肥妇free| 日韩电影免费一区| 久久婷婷久久一区二区三区| 极品少妇xxxx精品少妇偷拍| 久久久久国产一区二区三区四区| 国产精品一二三四| 亚洲视频中文字幕| 欧美精三区欧美精三区| 久久精品国产一区二区三| 久久久99免费| 一本色道久久综合精品竹菊| 性久久久久久久久久久久 | 国产精品久久久久国产精品日日| 99视频有精品| 日韩精品1区2区3区| 久久久久久久免费视频了| 成人av在线资源网| 香港成人在线视频| 精品国产免费人成在线观看| 国产91在线看| 日韩精品欧美精品| 国产欧美精品一区二区色综合| 91久久精品一区二区三区| 美女一区二区视频| 国产精品福利影院| 日韩免费成人网| 9人人澡人人爽人人精品| 亚洲成a人v欧美综合天堂| 欧美精品一区二区三区高清aⅴ| 99久久久精品| 久久福利资源站| ...av二区三区久久精品| 日韩视频在线你懂得| 精品一区二区三区在线观看国产| 一区二区三区波多野结衣在线观看| 日韩欧美中文字幕一区| 色综合天天综合网天天狠天天| 一区二区三区产品免费精品久久75| 欧美日韩国产首页| 97精品视频在线观看自产线路二| 日韩高清不卡一区| 樱桃视频在线观看一区| 久久久99久久精品欧美| 91精品国产全国免费观看| 91香蕉视频污在线| 国产传媒欧美日韩成人| 亚洲一区二区四区蜜桃| 国产婷婷精品av在线| 欧美一卡二卡在线| 色先锋久久av资源部| 风间由美一区二区三区在线观看 | 中文字幕 久热精品 视频在线| 日韩一区二区三区视频| 国产精品久久夜| 欧美一区二区人人喊爽| 成人av网址在线| 美腿丝袜亚洲三区| 午夜免费欧美电影| 亚洲国产视频a| 亚洲免费电影在线| 亚洲免费在线观看视频| 亚洲美女电影在线| 亚洲乱码中文字幕| 亚洲精品久久嫩草网站秘色| 国产精品天美传媒| 亚洲欧洲在线观看av| 亚洲日本va午夜在线影院| 欧美激情综合在线| 国产欧美日韩视频在线观看| 久久久久成人黄色影片| 欧美激情一区二区三区在线| 国产午夜精品一区二区三区视频| 精品欧美乱码久久久久久 | 国产一区二区三区免费| 经典三级视频一区| 国产精品一区在线观看你懂的| 国产白丝网站精品污在线入口| 国产大陆精品国产| 91亚洲精品一区二区乱码| 色88888久久久久久影院按摩 | 日韩成人一区二区三区在线观看| 天堂一区二区在线| 久久成人综合网| 丁香五精品蜜臀久久久久99网站| 不卡区在线中文字幕| 色一情一伦一子一伦一区| 欧美裸体bbwbbwbbw| 久久日一线二线三线suv| 久久久国产精品不卡| 日韩一区在线免费观看| 亚洲国产成人av| 黑人巨大精品欧美一区| 成人免费视频一区| 色8久久人人97超碰香蕉987| 日韩亚洲欧美中文三级| 国产欧美日韩在线| 亚洲高清免费视频| 美女国产一区二区三区| 99久久国产综合精品麻豆| 在线播放91灌醉迷j高跟美女| 欧美v亚洲v综合ⅴ国产v| 亚洲女同女同女同女同女同69| 日本免费新一区视频| 99久久综合国产精品| 欧美日韩国产色站一区二区三区| 久久综合国产精品| 亚洲国产精品久久不卡毛片| 国产精品18久久久久久久久久久久| 色婷婷精品大视频在线蜜桃视频 | 91影视在线播放| 日韩欧美一级在线播放| 国产精品成人在线观看| 麻豆久久久久久久| 在线观看日韩毛片|