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

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

?? pci-x86_64.c

?? linux-2.4.29操作系統的源碼
?? C
字號:
/* *	Low-Level PCI Access for x86-64 machines * * Copyright 1993, 1994 Drew Eckhardt *      Visionary Computing *      (Unix and Linux consulting and custom programming) *      Drew@Colorado.EDU *      +1 (303) 786-7975 * * Drew's work was sponsored by: *	iX Multiuser Multitasking Magazine *	Hannover, Germany *	hm@ix.de * * Copyright 1997--2000 Martin Mares <mj@ucw.cz> * * For more information, please consult the following manuals (look at * http://www.pcisig.com/ for how to get them): * * PCI BIOS Specification * PCI Local Bus Specification * PCI to PCI Bridge Specification * PCI System Design Guide * * * CHANGELOG : * Jun 17, 1994 : Modified to accommodate the broken pre-PCI BIOS SPECIFICATION *	Revision 2.0 present on <thys@dennis.ee.up.ac.za>'s ASUS mainboard. * * Jan 5,  1995 : Modified to probe PCI hardware at boot time by Frederic *     Potter, potter@cao-vlsi.ibp.fr * * Jan 10, 1995 : Modified to store the information about configured pci *      devices into a list, which can be accessed via /proc/pci by *      Curtis Varner, cvarner@cs.ucr.edu * * Jan 12, 1995 : CPU-PCI bridge optimization support by Frederic Potter. *	Alpha version. Intel & UMC chipset support only. * * Apr 16, 1995 : Source merge with the DEC Alpha PCI support. Most of the code *	moved to drivers/pci/pci.c. * * Dec 7, 1996  : Added support for direct configuration access of boards *      with Intel compatible access schemes (tsbogend@alpha.franken.de) * * Feb 3, 1997  : Set internal functions to static, save/restore flags *	avoid dead locks reading broken PCI BIOS, werner@suse.de  * * Apr 26, 1997 : Fixed case when there is BIOS32, but not PCI BIOS *	(mj@atrey.karlin.mff.cuni.cz) * * May 7,  1997 : Added some missing cli()'s. [mj] *  * Jun 20, 1997 : Corrected problems in "conf1" type accesses. *      (paubert@iram.es) * * Aug 2,  1997 : Split to PCI BIOS handling and direct PCI access parts *	and cleaned it up...     Martin Mares <mj@atrey.karlin.mff.cuni.cz> * * Feb 6,  1998 : No longer using BIOS to find devices and device classes. [mj] * * May 1,  1998 : Support for peer host bridges. [mj] * * Jun 19, 1998 : Changed to use spinlocks, so that PCI configuration space *	can be accessed from interrupts even on SMP systems. [mj] * * August  1998 : Better support for peer host bridges and more paranoid *	checks for direct hardware access. Ugh, this file starts to look as *	a large gallery of common hardware bug workarounds (watch the comments) *	-- the PCI specs themselves are sane, but most implementors should be *	hit hard with \hammer scaled \magstep5. [mj] * * Jan 23, 1999 : More improvements to peer host bridge logic. i450NX fixup. [mj] * * Feb 8,  1999 : Added UM8886BF I/O address fixup. [mj] * * August  1999 : New resource management and configuration access stuff. [mj] * * Sep 19, 1999 : Use PCI IRQ routing tables for detection of peer host bridges. *		  Based on ideas by Chris Frantz and David Hinds. [mj] * * Sep 28, 1999 : Handle unreported/unassigned IRQs. Thanks to Shuu Yamaguchi *		  for a lot of patience during testing. [mj] * * Oct  8, 1999 : Split to pci-i386.c, pci-pc.c and pci-visws.c. [mj] */#include <linux/types.h>#include <linux/kernel.h>#include <linux/pci.h>#include <linux/init.h>#include <linux/ioport.h>#include <linux/errno.h>#include "pci-x86_64.h"voidpcibios_update_resource(struct pci_dev *dev, struct resource *root,			struct resource *res, int resource){	u32 new, check;	int reg;	new = res->start | (res->flags & PCI_REGION_FLAG_MASK);	if (resource < 6) {		reg = PCI_BASE_ADDRESS_0 + 4*resource;	} else if (resource == PCI_ROM_RESOURCE) {		res->flags |= PCI_ROM_ADDRESS_ENABLE;		new |= PCI_ROM_ADDRESS_ENABLE;		reg = dev->rom_base_reg;	} else {		/* Somebody might have asked allocation of a non-standard resource */		return;	}		pci_write_config_dword(dev, reg, new);	pci_read_config_dword(dev, reg, &check);	if ((new ^ check) & ((new & PCI_BASE_ADDRESS_SPACE_IO) ? PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK)) {		printk(KERN_ERR "PCI: Error while updating region "		       "%s/%d (%08x != %08x)\n", dev->slot_name, resource,		       new, check);	}}/* * We need to avoid collisions with `mirrored' VGA ports * and other strange ISA hardware, so we always want the * addresses to be allocated in the 0x000-0x0ff region * modulo 0x400. * * Why? Because some silly external IO cards only decode * the low 10 bits of the IO address. The 0x00-0xff region * is reserved for motherboard devices that decode all 16 * bits, so it's ok to allocate at, say, 0x2800-0x28ff, * but we want to try to avoid allocating at 0x2900-0x2bff * which might have be mirrored at 0x0100-0x03ff.. */voidpcibios_align_resource(void *data, struct resource *res, unsigned long size, unsigned long align){	if (res->flags & IORESOURCE_IO) {		unsigned long start = res->start;		if (start & 0x300) {			start = (start + 0x3ff) & ~0x3ff;			res->start = start;		}	}}/* *  Handle resources of PCI devices.  If the world were perfect, we could *  just allocate all the resource regions and do nothing more.  It isn't. *  On the other hand, we cannot just re-allocate all devices, as it would *  require us to know lots of host bridge internals.  So we attempt to *  keep as much of the original configuration as possible, but tweak it *  when it's found to be wrong. * *  Known BIOS problems we have to work around: *	- I/O or memory regions not configured *	- regions configured, but not enabled in the command register *	- bogus I/O addresses above 64K used *	- expansion ROMs left enabled (this may sound harmless, but given *	  the fact the PCI specs explicitly allow address decoders to be *	  shared between expansion ROMs and other resource regions, it's *	  at least dangerous) * *  Our solution: *	(1) Allocate resources for all buses behind PCI-to-PCI bridges. *	    This gives us fixed barriers on where we can allocate. *	(2) Allocate resources for all enabled devices.  If there is *	    a collision, just mark the resource as unallocated. Also *	    disable expansion ROMs during this step. *	(3) Try to allocate resources for disabled devices.  If the *	    resources were assigned correctly, everything goes well, *	    if they weren't, they won't disturb allocation of other *	    resources. *	(4) Assign new addresses to resources which were either *	    not configured at all or misconfigured.  If explicitly *	    requested by the user, configure expansion ROM address *	    as well. */static void __init pcibios_allocate_bus_resources(struct list_head *bus_list){	struct list_head *ln;	struct pci_bus *bus;	struct pci_dev *dev;	int idx;	struct resource *r, *pr;	/* Depth-First Search on bus tree */	for (ln=bus_list->next; ln != bus_list; ln=ln->next) {		bus = pci_bus_b(ln);		if ((dev = bus->self)) {			for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {				r = &dev->resource[idx];				if (!r->start)					continue;				pr = pci_find_parent_resource(dev, r);				if (!pr || request_resource(pr, r) < 0)					printk(KERN_ERR "PCI: Cannot allocate resource region %d of bridge %s\n", idx, dev->slot_name);			}		}		pcibios_allocate_bus_resources(&bus->children);	}}static void __init pcibios_allocate_resources(int pass){	struct pci_dev *dev;	int idx, disabled;	u16 command;	struct resource *r, *pr;	pci_for_each_dev(dev) {		pci_read_config_word(dev, PCI_COMMAND, &command);		for(idx = 0; idx < 6; idx++) {			r = &dev->resource[idx];			if (r->parent)		/* Already allocated */				continue;			if (!r->start)		/* Address not assigned at all */				continue;			if (r->flags & IORESOURCE_IO)				disabled = !(command & PCI_COMMAND_IO);			else				disabled = !(command & PCI_COMMAND_MEMORY);			if (pass == disabled) {				DBG("PCI: Resource %08lx-%08lx (f=%lx, d=%d, p=%d)\n",				    r->start, r->end, r->flags, disabled, pass);				pr = pci_find_parent_resource(dev, r);				if (!pr || request_resource(pr, r) < 0) {					printk(KERN_ERR "PCI: Cannot allocate resource region %d of device %s\n", idx, dev->slot_name);					/* We'll assign a new address later */					r->end -= r->start;					r->start = 0;				}			}		}		if (!pass) {			r = &dev->resource[PCI_ROM_RESOURCE];			if (r->flags & PCI_ROM_ADDRESS_ENABLE) {				/* Turn the ROM off, leave the resource region, but keep it unregistered. */				u32 reg;				DBG("PCI: Switching off ROM of %s\n", dev->slot_name);				r->flags &= ~PCI_ROM_ADDRESS_ENABLE;				pci_read_config_dword(dev, dev->rom_base_reg, &reg);				pci_write_config_dword(dev, dev->rom_base_reg, reg & ~PCI_ROM_ADDRESS_ENABLE);			}		}	}}static void __init pcibios_assign_resources(void){	struct pci_dev *dev;	int idx;	struct resource *r;	pci_for_each_dev(dev) {		int class = dev->class >> 8;		/* Don't touch classless devices and host bridges */		if (!class || class == PCI_CLASS_BRIDGE_HOST)			continue;		for(idx=0; idx<6; idx++) {			r = &dev->resource[idx];			/*			 *  Don't touch IDE controllers and I/O ports of video cards!			 */			if ((class == PCI_CLASS_STORAGE_IDE && idx < 4) ||			    (class == PCI_CLASS_DISPLAY_VGA && (r->flags & IORESOURCE_IO)))				continue;			/*			 *  We shall assign a new address to this resource, either because			 *  the BIOS forgot to do so or because we have decided the old			 *  address was unusable for some reason.			 */			if (!r->start && r->end)				pci_assign_resource(dev, idx);		}		if (pci_probe & PCI_ASSIGN_ROMS) {			r = &dev->resource[PCI_ROM_RESOURCE];			r->end -= r->start;			r->start = 0;			if (r->end)				pci_assign_resource(dev, PCI_ROM_RESOURCE);		}	}}void __init pcibios_set_cacheline_size(void){	struct cpuinfo_x86 *c = &boot_cpu_data;	pci_cache_line_size = 32 >> 2;	if (c->x86 >= 6 && c->x86_vendor == X86_VENDOR_AMD)		pci_cache_line_size = 64 >> 2;	/* K7 & K8 */	else if (c->x86 > 6 && c->x86_vendor == X86_VENDOR_INTEL)		pci_cache_line_size = 128 >> 2;	/* P4 */}void __init pcibios_resource_survey(void){	DBG("PCI: Allocating resources\n");	pcibios_allocate_bus_resources(&pci_root_buses);	pcibios_allocate_resources(0);	pcibios_allocate_resources(1);	pcibios_assign_resources();}int pcibios_enable_resources(struct pci_dev *dev, int mask){	u16 cmd, old_cmd;	int idx;	struct resource *r;	pci_read_config_word(dev, PCI_COMMAND, &cmd);	old_cmd = cmd;	for(idx=0; idx<6; idx++) {		r = &dev->resource[idx];		if (!(mask & (1<<idx)))			continue;		if (!r->start && r->end) {			printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", dev->slot_name);			return -EINVAL;		}		if (r->flags & IORESOURCE_IO)			cmd |= PCI_COMMAND_IO;		if (r->flags & IORESOURCE_MEM)			cmd |= PCI_COMMAND_MEMORY;	}	if (dev->resource[PCI_ROM_RESOURCE].start)		cmd |= PCI_COMMAND_MEMORY;	if (cmd != old_cmd) {		printk("PCI: Enabling device %s (%04x -> %04x)\n", dev->slot_name, old_cmd, cmd);		pci_write_config_word(dev, PCI_COMMAND, cmd);	}	return 0;}/* *  If we set up a device for bus mastering, we need to check the latency *  timer as certain crappy BIOSes forget to set it properly. */unsigned int pcibios_max_latency = 255;void pcibios_set_master(struct pci_dev *dev){	u8 lat;	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);	if (lat < 16)		lat = (64 <= pcibios_max_latency) ? 64 : pcibios_max_latency;	else if (lat > pcibios_max_latency)		lat = pcibios_max_latency;	else		return;	printk("PCI: Setting latency timer of device %s to %d\n", dev->slot_name, lat);	pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);}int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,			enum pci_mmap_state mmap_state, int write_combine){	unsigned long prot;	/* I/O space cannot be accessed via normal processor loads and	 * stores on this platform.	 */	if (mmap_state == pci_mmap_io)		return -EINVAL;	/* Leave vm_pgoff as-is, the PCI space address is the physical	 * address on this platform.	 */	vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO);	prot = pgprot_val(vma->vm_page_prot);	if (boot_cpu_data.x86 > 3)		prot |= _PAGE_PCD | _PAGE_PWT;	vma->vm_page_prot = __pgprot(prot);	/* Write-combine setting is ignored, it is changed via the mtrr	 * interfaces on this platform.	 */	if (remap_page_range(vma->vm_start, vma->vm_pgoff << PAGE_SHIFT,			     vma->vm_end - vma->vm_start,			     vma->vm_page_prot))		return -EAGAIN;	return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲福利视频一区| 国模冰冰炮一区二区| 精品少妇一区二区三区在线播放| 国产精品99久久久久久似苏梦涵 | 精品午夜久久福利影院| 一区二区中文字幕在线| 91精品国模一区二区三区| 99视频精品全部免费在线| 久久精品国产99久久6| 一区二区久久久| 欧美激情中文不卡| 精品国产伦一区二区三区观看方式 | 亚洲一区二区三区爽爽爽爽爽| 欧美精品一区二区久久婷婷| 欧美性大战久久久久久久蜜臀| 国产99久久久久久免费看农村| 亚洲第一会所有码转帖| 亚洲男人电影天堂| 国产欧美va欧美不卡在线| 日韩精品在线网站| 欧美一区二区三区免费| 欧美系列在线观看| 色哟哟国产精品| 99久久精品免费看国产 | 91在线观看视频| 成人一区在线看| 国产精品18久久久久久久网站| 视频一区二区中文字幕| 亚洲高清免费视频| 亚洲影视在线观看| 一区二区三区四区蜜桃 | 美女在线观看视频一区二区| 丝袜诱惑亚洲看片| 日日骚欧美日韩| 午夜欧美电影在线观看| 亚洲国产精品视频| 亚洲国产精品视频| 亚洲成人午夜影院| 亚洲国产日韩综合久久精品| 亚洲一区二区欧美| 亚洲福利一区二区| 肉丝袜脚交视频一区二区| 丝袜美腿亚洲一区二区图片| 天堂蜜桃一区二区三区| 蜜臀精品久久久久久蜜臀| 麻豆精品一区二区| 国产麻豆一精品一av一免费 | 国产精品三级久久久久三级| 中文字幕不卡在线观看| 国产精品久久久久精k8| 亚洲视频中文字幕| 一区二区三区电影在线播| 亚洲一区二区在线免费观看视频| 一区二区高清免费观看影视大全| 一区二区欧美精品| 丝袜脚交一区二区| 久88久久88久久久| 成人免费视频视频在线观看免费| 国产99精品国产| 色综合婷婷久久| 欧美经典一区二区| 国产精品福利一区二区三区| 亚洲精品水蜜桃| 婷婷六月综合网| 国产综合成人久久大片91| 成人三级伦理片| 欧美日韩日日骚| 欧美videos中文字幕| 国产精品色呦呦| 亚洲国产va精品久久久不卡综合| 免费精品视频在线| 成人黄色片在线观看| 色美美综合视频| 日韩欧美另类在线| 中文字幕日韩欧美一区二区三区| 一区二区三区美女视频| 麻豆成人在线观看| av亚洲精华国产精华精| 欧美美女直播网站| 国产午夜精品一区二区| 一卡二卡三卡日韩欧美| 加勒比av一区二区| 欧洲精品一区二区| 久久久亚洲午夜电影| 亚洲黄色尤物视频| 国精品**一区二区三区在线蜜桃| 成人国产电影网| 欧美一区二区三区日韩视频| 国产日韩欧美激情| 日韩二区在线观看| 99久久99精品久久久久久| 91精品国产一区二区三区| 久久久久久久精| 婷婷中文字幕综合| av不卡免费电影| 欧美mv和日韩mv的网站| 夜夜爽夜夜爽精品视频| 国产精品一区二区三区99| 欧美人伦禁忌dvd放荡欲情| 中文字幕精品一区二区精品绿巨人 | 国产69精品久久777的优势| 欧美日韩国产三级| 自拍偷拍欧美激情| 国产精品综合二区| 欧美一区二区三区四区五区| 亚洲欧美视频一区| 成人伦理片在线| 日韩久久精品一区| 五月激情综合网| 色天使色偷偷av一区二区| 久久久激情视频| 青娱乐精品视频在线| 91国模大尺度私拍在线视频| 国产精品美女久久久久久2018| 精品综合久久久久久8888| 欧美精品一级二级三级| 亚洲自拍都市欧美小说| av在线一区二区三区| 国产精品三级视频| 国产成人亚洲综合a∨猫咪| 日韩精品一区二区在线| 石原莉奈在线亚洲三区| 欧美日韩mp4| 亚洲一区二区中文在线| 色八戒一区二区三区| 中文字幕一区二区在线观看| 成人中文字幕合集| 日本一区二区不卡视频| 国产成人精品免费网站| 久久久99久久| 国产高清无密码一区二区三区| 欧美videos大乳护士334| 麻豆精品一区二区av白丝在线 | 国产精品美女久久久久久久久 | 色综合中文字幕国产| 国产日产精品一区| 粉嫩蜜臀av国产精品网站| 欧美国产欧美亚州国产日韩mv天天看完整| 精品中文字幕一区二区| 精品国产免费一区二区三区香蕉 | 丁香网亚洲国际| 久久久精品影视| 成人在线综合网| 最新热久久免费视频| 色94色欧美sute亚洲线路一ni| 亚洲视频网在线直播| 在线观看欧美黄色| 婷婷综合另类小说色区| 日韩精品一区二区在线观看| 国产伦理精品不卡| 国产精品成人免费| 欧美亚洲国产一区二区三区va| 香蕉加勒比综合久久| 日韩欧美在线一区二区三区| 国产一区二区三区久久悠悠色av| 久久精品人人做人人爽97| 波多野结衣中文字幕一区二区三区| 中文字幕av不卡| 色猫猫国产区一区二在线视频| 性欧美大战久久久久久久久| 日韩一区二区三区观看| 国产福利一区二区| 亚洲精品视频一区| 91精品一区二区三区久久久久久 | 精品日韩一区二区三区| 国产91在线观看丝袜| 亚洲精品一卡二卡| 91精品国产免费久久综合| 国产电影一区二区三区| 亚洲乱码国产乱码精品精可以看 | 精品1区2区3区| 国产一区二区三区观看| 亚洲欧美日韩久久精品| 欧美一卡在线观看| 丁香五精品蜜臀久久久久99网站 | 中文幕一区二区三区久久蜜桃| 一本色道**综合亚洲精品蜜桃冫| 亚洲mv在线观看| 国产日韩精品视频一区| 欧美日韩一区在线观看| 国产精品99久久久久久宅男| 亚洲国产wwwccc36天堂| 亚洲国产精品成人综合 | 国产欧美一区二区精品性色| 欧美羞羞免费网站| 国产成人精品影视| 成人av小说网| 水蜜桃久久夜色精品一区的特点| 国产亚洲综合在线| 欧美精品免费视频| 成人av动漫网站| 麻豆成人在线观看| 亚洲综合一区在线| 国产精品网曝门| 欧美一区二区三区系列电影| 91麻豆视频网站| 国产麻豆精品在线| 青青国产91久久久久久| 亚洲你懂的在线视频| 欧美韩日一区二区三区|