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

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

?? aperture.c

?? linux-2.6.15.6
?? 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>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 >= 0xffffffff>>PAGE_SHIFT) ||		   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一区二区三区免费野_久草精品视频
韩日精品视频一区| 日韩激情一区二区| 成人h动漫精品一区二区| 欧美精品一区二区不卡 | 精品国产自在久精品国产| 日韩电影在线看| 欧美成人一区二区三区在线观看 | 成人做爰69片免费看网站| 中文字幕中文字幕一区二区| 91女人视频在线观看| 亚洲福中文字幕伊人影院| 日韩网站在线看片你懂的| 国产剧情一区在线| 一区二区三区不卡视频| 欧美一级高清大全免费观看| 顶级嫩模精品视频在线看| 亚洲精品一二三| 欧美成人欧美edvon| youjizz久久| 日韩精品一级中文字幕精品视频免费观看 | 日本伊人色综合网| 久久亚洲一区二区三区明星换脸| 成人一区在线观看| 午夜视频一区二区| 国产色爱av资源综合区| 欧美日韩午夜精品| 国产一区二区视频在线播放| 亚洲精品免费看| 日韩免费一区二区| 91视频观看免费| 九九九久久久精品| 一区二区三区中文字幕电影| 精品人伦一区二区色婷婷| 99re视频精品| 韩国三级中文字幕hd久久精品| 国产精品久久久99| 欧美一区二区不卡视频| av成人动漫在线观看| 蜜桃久久av一区| 一区二区三区视频在线看| 久久夜色精品国产噜噜av| 欧美日韩一区二区三区在线| 国产精品18久久久久久久网站| 亚洲国产wwwccc36天堂| 中文字幕中文字幕中文字幕亚洲无线| 欧美一级一区二区| 欧美性受极品xxxx喷水| 成人97人人超碰人人99| 国产一区二区剧情av在线| 亚洲国产日韩综合久久精品| 国产精品国产馆在线真实露脸| 精品日韩一区二区| 这里只有精品电影| 欧美午夜在线一二页| eeuss鲁片一区二区三区在线看| 奇米色777欧美一区二区| 亚洲一区二区影院| 亚洲美女区一区| 国产精品乱人伦| 国产日韩欧美综合一区| 精品国产一区二区三区久久久蜜月 | 亚洲激情av在线| 国产精品高清亚洲| 欧美经典一区二区| 久久久777精品电影网影网| 精品国产一区二区三区忘忧草| 69av一区二区三区| 欧美日韩一级片在线观看| 色哟哟一区二区| 色综合 综合色| 91视频国产资源| 色狠狠桃花综合| 欧美三级日韩三级国产三级| 欧美中文字幕一二三区视频| 欧美伊人精品成人久久综合97| 99精品欧美一区二区蜜桃免费 | 久久先锋影音av| 2021国产精品久久精品| 久久久亚洲综合| 国产三级欧美三级日产三级99| 欧美大片免费久久精品三p| 欧美一区二区三区人| 91精品国产综合久久小美女| 久久九九全国免费| 久久精品亚洲乱码伦伦中文| 久久久久99精品国产片| 欧美激情一区二区三区四区| 中文字幕第一区二区| 日韩毛片一二三区| 亚洲黄色尤物视频| 天堂av在线一区| 看电视剧不卡顿的网站| 国产一区二区三区精品欧美日韩一区二区三区| 蜜桃精品在线观看| 春色校园综合激情亚洲| 99久久精品免费观看| 欧美伊人精品成人久久综合97| 欧美美女bb生活片| 日韩精品一区在线| 国产亚洲一区二区在线观看| 亚洲国产经典视频| 亚洲无人区一区| 久久精品国产一区二区| 国产精品一区二区在线观看不卡| 成人黄色在线看| 欧美三级视频在线观看| 久久欧美一区二区| 亚洲图片欧美激情| 免费人成在线不卡| 丁香网亚洲国际| 欧美精品xxxxbbbb| 久久青草欧美一区二区三区| 亚洲欧美日韩系列| 麻豆精品视频在线观看视频| 成人avav在线| 日韩一级免费观看| 中文字幕日本不卡| 日本欧美加勒比视频| a亚洲天堂av| 欧美草草影院在线视频| 成人免费小视频| 久久精品国产澳门| 色综合色综合色综合| 久久久三级国产网站| 亚洲二区在线观看| 国产不卡视频在线观看| 欧美乱妇15p| 亚洲伦在线观看| 国内久久精品视频| 欧美日韩一级二级三级| 国产精品久久综合| 国产在线不卡视频| 欧美日韩国产一级二级| ...xxx性欧美| 国产激情精品久久久第一区二区| 欧美三级日本三级少妇99| 中文字幕免费不卡| 激情另类小说区图片区视频区| 欧美午夜在线一二页| 日韩理论在线观看| 国产成人一区在线| 欧美成人乱码一区二区三区| 亚洲国产婷婷综合在线精品| 91在线看国产| 国产欧美日韩视频一区二区| 美女视频黄频大全不卡视频在线播放| 色偷偷久久一区二区三区| 国产精品不卡在线| 粉嫩嫩av羞羞动漫久久久| 26uuu精品一区二区在线观看| 三级不卡在线观看| 在线国产电影不卡| 伊人色综合久久天天| 91免费观看视频在线| 最新国产精品久久精品| 不卡av在线网| 欧美国产精品中文字幕| 国产剧情一区二区三区| 欧美精品一区二区三区久久久 | 91在线国内视频| 国产精品久久久久久久久免费樱桃| 激情亚洲综合在线| 精品国产99国产精品| 国产综合色在线| 久久蜜桃av一区精品变态类天堂| 精品一区二区成人精品| 欧美精品一区二区三区蜜桃视频| 久久国产乱子精品免费女| 精品免费日韩av| 国产成人精品三级| 国产精品久久午夜夜伦鲁鲁| 成人综合激情网| 亚洲欧美另类小说| 欧美色图激情小说| 奇米色777欧美一区二区| 精品国产免费一区二区三区香蕉 | 中文字幕二三区不卡| 99久久精品免费看国产| 亚洲一区二区三区影院| 91精品国产91久久久久久最新毛片| 天天操天天干天天综合网| 欧美一区二区在线看| 经典三级视频一区| 欧美激情一区二区三区不卡| 91蜜桃传媒精品久久久一区二区| 一区二区三区加勒比av| 911国产精品| 国产成a人亚洲| 一区二区三区在线不卡| 欧美一级二级三级蜜桃| 国产精品996| 亚洲午夜在线视频| 日韩欧美一级精品久久| 丁香天五香天堂综合| 亚洲一二三四区不卡| 精品对白一区国产伦| 成人高清免费观看| 五月天欧美精品| 精品国产123| 91在线观看视频|