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

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

?? pci.c

?? 底層驅動開發
?? C
字號:
/* *	linux/arch/alpha/kernel/pci.c * * Extruded from code written by *	Dave Rusling (david.rusling@reo.mts.dec.com) *	David Mosberger (davidm@cs.arizona.edu) *//* 2.3.x PCI/resources, 1999 Andrea Arcangeli <andrea@suse.de> *//* * Nov 2000, Ivan Kokshaysky <ink@jurassic.park.msu.ru> *	     PCI-PCI bridges cleanup */#include <linux/config.h>#include <linux/string.h>#include <linux/pci.h>#include <linux/init.h>#include <linux/ioport.h>#include <linux/kernel.h>#include <linux/bootmem.h>#include <linux/module.h>#include <linux/cache.h>#include <linux/slab.h>#include <asm/machvec.h>#include "proto.h"#include "pci_impl.h"/* * Some string constants used by the various core logics.  */const char *const pci_io_names[] = {  "PCI IO bus 0", "PCI IO bus 1", "PCI IO bus 2", "PCI IO bus 3",  "PCI IO bus 4", "PCI IO bus 5", "PCI IO bus 6", "PCI IO bus 7"};const char *const pci_mem_names[] = {  "PCI mem bus 0", "PCI mem bus 1", "PCI mem bus 2", "PCI mem bus 3",  "PCI mem bus 4", "PCI mem bus 5", "PCI mem bus 6", "PCI mem bus 7"};const char pci_hae0_name[] = "HAE0";/* Indicate whether we respect the PCI setup left by console. *//* * Make this long-lived  so that we know when shutting down * whether we probed only or not. */int pci_probe_only;/* * The PCI controller list. */struct pci_controller *hose_head, **hose_tail = &hose_head;struct pci_controller *pci_isa_hose;/* * Quirks. */static void __initquirk_isa_bridge(struct pci_dev *dev){	dev->class = PCI_CLASS_BRIDGE_ISA << 8;}DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378, quirk_isa_bridge);static void __initquirk_cypress(struct pci_dev *dev){	/* The Notorious Cy82C693 chip.  */	/* The Cypress IDE controller doesn't support native mode, but it	   has programmable addresses of IDE command/control registers.	   This violates PCI specifications, confuses the IDE subsystem and	   causes resource conflicts between the primary HD_CMD register and	   the floppy controller.  Ugh.  Fix that.  */	if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE) {		dev->resource[0].flags = 0;		dev->resource[1].flags = 0;	}	/* The Cypress bridge responds on the PCI bus in the address range	   0xffff0000-0xffffffff (conventional x86 BIOS ROM).  There is no	   way to turn this off.  The bridge also supports several extended	   BIOS ranges (disabled after power-up), and some consoles do turn	   them on.  So if we use a large direct-map window, or a large SG	   window, we must avoid the entire 0xfff00000-0xffffffff region.  */	else if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA) {		if (__direct_map_base + __direct_map_size >= 0xfff00000UL)			__direct_map_size = 0xfff00000UL - __direct_map_base;		else {			struct pci_controller *hose = dev->sysdata;			struct pci_iommu_arena *pci = hose->sg_pci;			if (pci && pci->dma_base + pci->size >= 0xfff00000UL)				pci->size = 0xfff00000UL - pci->dma_base;		}	}}DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, quirk_cypress);/* Called for each device after PCI setup is done. */static void __initpcibios_fixup_final(struct pci_dev *dev){	unsigned int class = dev->class >> 8;	if (class == PCI_CLASS_BRIDGE_ISA || class == PCI_CLASS_BRIDGE_EISA) {		dev->dma_mask = MAX_ISA_DMA_ADDRESS - 1;		isa_bridge = dev;	}}DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);/* Just declaring that the power-of-ten prefixes are actually the   power-of-two ones doesn't make it true :) */#define KB			1024#define MB			(1024*KB)#define GB			(1024*MB)voidpcibios_align_resource(void *data, struct resource *res,		       unsigned long size, unsigned long align){	struct pci_dev *dev = data;	struct pci_controller *hose = dev->sysdata;	unsigned long alignto;	unsigned long start = res->start;	if (res->flags & IORESOURCE_IO) {		/* Make sure we start at our min on all hoses */		if (start - hose->io_space->start < PCIBIOS_MIN_IO)			start = PCIBIOS_MIN_IO + hose->io_space->start;		/*		 * Put everything into 0x00-0xff region modulo 0x400		 */		if (start & 0x300)			start = (start + 0x3ff) & ~0x3ff;	}	else if	(res->flags & IORESOURCE_MEM) {		/* Make sure we start at our min on all hoses */		if (start - hose->mem_space->start < PCIBIOS_MIN_MEM)			start = PCIBIOS_MIN_MEM + hose->mem_space->start;		/*		 * The following holds at least for the Low Cost		 * Alpha implementation of the PCI interface:		 *		 * In sparse memory address space, the first		 * octant (16MB) of every 128MB segment is		 * aliased to the very first 16 MB of the		 * address space (i.e., it aliases the ISA		 * memory address space).  Thus, we try to		 * avoid allocating PCI devices in that range.		 * Can be allocated in 2nd-7th octant only.		 * Devices that need more than 112MB of		 * address space must be accessed through		 * dense memory space only!		 */		/* Align to multiple of size of minimum base.  */		alignto = max(0x1000UL, align);		start = ALIGN(start, alignto);		if (hose->sparse_mem_base && size <= 7 * 16*MB) {			if (((start / (16*MB)) & 0x7) == 0) {				start &= ~(128*MB - 1);				start += 16*MB;				start  = ALIGN(start, alignto);			}			if (start/(128*MB) != (start + size - 1)/(128*MB)) {				start &= ~(128*MB - 1);				start += (128 + 16)*MB;				start  = ALIGN(start, alignto);			}		}	}	res->start = start;}#undef KB#undef MB#undef GBstatic int __initpcibios_init(void){	if (alpha_mv.init_pci)		alpha_mv.init_pci();	return 0;}subsys_initcall(pcibios_init);char * __initpcibios_setup(char *str){	return str;}#ifdef ALPHA_RESTORE_SRM_SETUPstatic struct pdev_srm_saved_conf *srm_saved_configs;void __initpdev_save_srm_config(struct pci_dev *dev){	struct pdev_srm_saved_conf *tmp;	static int printed = 0;	if (!alpha_using_srm || pci_probe_only)		return;	if (!printed) {		printk(KERN_INFO "pci: enabling save/restore of SRM state\n");		printed = 1;	}	tmp = kmalloc(sizeof(*tmp), GFP_KERNEL);	if (!tmp) {		printk(KERN_ERR "%s: kmalloc() failed!\n", __FUNCTION__);		return;	}	tmp->next = srm_saved_configs;	tmp->dev = dev;	pci_save_state(dev);	srm_saved_configs = tmp;}voidpci_restore_srm_config(void){	struct pdev_srm_saved_conf *tmp;	/* No need to restore if probed only. */	if (pci_probe_only)		return;	/* Restore SRM config. */	for (tmp = srm_saved_configs; tmp; tmp = tmp->next) {		pci_restore_state(tmp->dev);	}}#endifvoid __initpcibios_fixup_resource(struct resource *res, struct resource *root){	res->start += root->start;	res->end += root->start;}void __initpcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus){	/* Update device resources.  */	struct pci_controller *hose = (struct pci_controller *)bus->sysdata;	int i;	for (i = 0; i < PCI_NUM_RESOURCES; i++) {		if (!dev->resource[i].start)			continue;		if (dev->resource[i].flags & IORESOURCE_IO)			pcibios_fixup_resource(&dev->resource[i],					       hose->io_space);		else if (dev->resource[i].flags & IORESOURCE_MEM)			pcibios_fixup_resource(&dev->resource[i],					       hose->mem_space);	}}void __initpcibios_fixup_bus(struct pci_bus *bus){	/* Propagate hose info into the subordinate devices.  */	struct pci_controller *hose = bus->sysdata;	struct pci_dev *dev = bus->self;	if (!dev) {		/* Root bus. */		u32 pci_mem_end;		u32 sg_base = hose->sg_pci ? hose->sg_pci->dma_base : ~0;		unsigned long end;		bus->resource[0] = hose->io_space;		bus->resource[1] = hose->mem_space;		/* Adjust hose mem_space limit to prevent PCI allocations		   in the iommu windows. */		pci_mem_end = min((u32)__direct_map_base, sg_base) - 1;		end = hose->mem_space->start + pci_mem_end;		if (hose->mem_space->end > end)			hose->mem_space->end = end; 	} else if (pci_probe_only && 		   (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) { 		pci_read_bridge_bases(bus); 		pcibios_fixup_device_resources(dev, bus);	} 	list_for_each_entry(dev, &bus->devices, bus_list) {		pdev_save_srm_config(dev);		if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)			pcibios_fixup_device_resources(dev, bus);	}}void __initpcibios_update_irq(struct pci_dev *dev, int irq){	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);}/* Most Alphas have straight-forward swizzling needs.  */u8 __initcommon_swizzle(struct pci_dev *dev, u8 *pinp){	u8 pin = *pinp;	while (dev->bus->parent) {		pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));		/* Move up the chain of bridges. */		dev = dev->bus->self;        }	*pinp = pin;	/* The slot is the slot of the last bridge. */	return PCI_SLOT(dev->devfn);}void __devinitpcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,			 struct resource *res){	struct pci_controller *hose = (struct pci_controller *)dev->sysdata;	unsigned long offset = 0;	if (res->flags & IORESOURCE_IO)		offset = hose->io_space->start;	else if (res->flags & IORESOURCE_MEM)		offset = hose->mem_space->start;	region->start = res->start - offset;	region->end = res->end - offset;}void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,			     struct pci_bus_region *region){	struct pci_controller *hose = (struct pci_controller *)dev->sysdata;	unsigned long offset = 0;	if (res->flags & IORESOURCE_IO)		offset = hose->io_space->start;	else if (res->flags & IORESOURCE_MEM)		offset = hose->mem_space->start;	res->start = region->start + offset;	res->end = region->end + offset;}#ifdef CONFIG_HOTPLUGEXPORT_SYMBOL(pcibios_resource_to_bus);EXPORT_SYMBOL(pcibios_bus_to_resource);#endifintpcibios_enable_device(struct pci_dev *dev, int mask){	u16 cmd, oldcmd;	int i;	pci_read_config_word(dev, PCI_COMMAND, &cmd);	oldcmd = cmd;	for (i = 0; i < PCI_NUM_RESOURCES; i++) {		struct resource *res = &dev->resource[i];		if (res->flags & IORESOURCE_IO)			cmd |= PCI_COMMAND_IO;		else if (res->flags & IORESOURCE_MEM)			cmd |= PCI_COMMAND_MEMORY;	}	if (cmd != oldcmd) {		printk(KERN_DEBUG "PCI: Enabling device: (%s), cmd %x\n",		       pci_name(dev), cmd);		/* Enable the appropriate bits in the PCI command register.  */		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 firmware forgets to set it properly, as seen *  on SX164 and LX164 with SRM. */voidpcibios_set_master(struct pci_dev *dev){	u8 lat;	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);	if (lat >= 16) return;	printk("PCI: Setting latency timer of device %s to 64\n",							pci_name(dev));	pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);}static void __initpcibios_claim_one_bus(struct pci_bus *b){	struct pci_dev *dev;	struct pci_bus *child_bus;	list_for_each_entry(dev, &b->devices, bus_list) {		int i;		for (i = 0; i < PCI_NUM_RESOURCES; i++) {			struct resource *r = &dev->resource[i];			if (r->parent || !r->start || !r->flags)				continue;			pci_claim_resource(dev, i);		}	}	list_for_each_entry(child_bus, &b->children, node)		pcibios_claim_one_bus(child_bus);}static void __initpcibios_claim_console_setup(void){	struct pci_bus *b;	list_for_each_entry(b, &pci_root_buses, node)		pcibios_claim_one_bus(b);}void __initcommon_init_pci(void){	struct pci_controller *hose;	struct pci_bus *bus;	int next_busno;	int need_domain_info = 0;	/* Scan all of the recorded PCI controllers.  */	for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {		bus = pci_scan_bus(next_busno, alpha_mv.pci_ops, hose);		hose->bus = bus;		hose->need_domain_info = need_domain_info;		next_busno = bus->subordinate + 1;		/* Don't allow 8-bit bus number overflow inside the hose -		   reserve some space for bridges. */ 		if (next_busno > 224) {			next_busno = 0;			need_domain_info = 1;		}	}	if (pci_probe_only)		pcibios_claim_console_setup();	pci_assign_unassigned_resources();	pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);}struct pci_controller * __initalloc_pci_controller(void){	struct pci_controller *hose;	hose = alloc_bootmem(sizeof(*hose));	*hose_tail = hose;	hose_tail = &hose->next;	return hose;}struct resource * __initalloc_resource(void){	struct resource *res;	res = alloc_bootmem(sizeof(*res));	return res;}/* Provide information on locations of various I/O regions in physical   memory.  Do this on a per-card basis so that we choose the right hose.  */asmlinkage longsys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn){	struct pci_controller *hose;	struct pci_dev *dev;	/* from hose or from bus.devfn */	if (which & IOBASE_FROM_HOSE) {		for(hose = hose_head; hose; hose = hose->next) 			if (hose->index == bus) break;		if (!hose) return -ENODEV;	} else {		/* Special hook for ISA access.  */		if (bus == 0 && dfn == 0) {			hose = pci_isa_hose;		} else {			dev = pci_find_slot(bus, dfn);			if (!dev)				return -ENODEV;			hose = dev->sysdata;		}	}	switch (which & ~IOBASE_FROM_HOSE) {	case IOBASE_HOSE:		return hose->index;	case IOBASE_SPARSE_MEM:		return hose->sparse_mem_base;	case IOBASE_DENSE_MEM:		return hose->dense_mem_base;	case IOBASE_SPARSE_IO:		return hose->sparse_io_base;	case IOBASE_DENSE_IO:		return hose->dense_io_base;	case IOBASE_ROOT_BUS:		return hose->bus->number;	}	return -EOPNOTSUPP;}/* Create an __iomem token from a PCI BAR.  Copied from lib/iomap.c with   no changes, since we don't want the other things in that object file.  */void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen){	unsigned long start = pci_resource_start(dev, bar);	unsigned long len = pci_resource_len(dev, bar);	unsigned long flags = pci_resource_flags(dev, bar);	if (!len || !start)		return NULL;	if (maxlen && len > maxlen)		len = maxlen;	if (flags & IORESOURCE_IO)		return ioport_map(start, len);	if (flags & IORESOURCE_MEM) {		/* Not checking IORESOURCE_CACHEABLE because alpha does		   not distinguish between ioremap and ioremap_nocache.  */		return ioremap(start, len);	}	return NULL;}/* Destroy that token.  Not copied from lib/iomap.c.  */void pci_iounmap(struct pci_dev *dev, void __iomem * addr){	if (__is_mmio(addr))		iounmap(addr);}EXPORT_SYMBOL(pci_iomap);EXPORT_SYMBOL(pci_iounmap);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合色天天鬼久久鬼色| 色婷婷精品大视频在线蜜桃视频| 91精品国产综合久久精品性色| 亚洲一区二区三区小说| 欧美日韩一级大片网址| 日韩精品免费视频人成| 欧美一区二区三区精品| 久久国产欧美日韩精品| 国产亚洲一区二区三区四区| 白白色亚洲国产精品| 亚洲午夜在线观看视频在线| 欧美人狂配大交3d怪物一区| 久久超碰97中文字幕| 国产精品久久久久国产精品日日| 一本色道亚洲精品aⅴ| 视频一区欧美精品| 国产三级精品视频| 日本久久电影网| 捆绑调教一区二区三区| 国产精品丝袜在线| 欧美无砖砖区免费| 极品美女销魂一区二区三区免费| 中文字幕在线免费不卡| 欧美日韩国产一级| 国产成人av电影在线| 亚洲国产视频a| 久久久久久99久久久精品网站| 91免费版在线看| 免费成人美女在线观看| 国产精品美女久久久久av爽李琼| 欧美日韩一区二区三区四区五区| 国产激情91久久精品导航| 亚洲免费色视频| ww久久中文字幕| 欧洲一区二区三区免费视频| 国产一区二区日韩精品| 亚洲综合免费观看高清在线观看| 久久久国产午夜精品| 欧美日韩激情在线| 99九九99九九九视频精品| 九九国产精品视频| 亚洲一区二区高清| 国产精品久久久久9999吃药| 一个色综合av| 久久久久久久综合色一本| 欧美日韩国产另类一区| 不卡视频一二三四| 精品一区二区三区影院在线午夜| 亚洲一区二区三区美女| 国产精品高清亚洲| 久久精品一区八戒影视| 69精品人人人人| 在线免费观看不卡av| 国产+成+人+亚洲欧洲自线| 男人操女人的视频在线观看欧美 | 久久人人超碰精品| 欧美日韩一级黄| 在线观看亚洲精品| 91欧美一区二区| 成人av午夜影院| 国产高清成人在线| 久久99国产精品久久| 日韩国产高清在线| 亚洲777理论| 亚洲一区二区欧美激情| 一区二区三区毛片| 亚洲色图视频网| 自拍偷在线精品自拍偷无码专区| 中文字幕av资源一区| 久久久国产精华| 亚洲国产精品国自产拍av| 久久久国产午夜精品| 久久久久9999亚洲精品| wwwwww.欧美系列| 久久一区二区三区国产精品| 精品国免费一区二区三区| 精品国产1区2区3区| 亚洲精品在线免费播放| 精品国产乱码久久久久久蜜臀| 精品国产乱码久久久久久图片 | 久久精品99国产精品| 日韩精品亚洲一区| 麻豆国产精品777777在线| 久久精品国产秦先生| 久久电影网电视剧免费观看| 国产又黄又大久久| 国产精品99久久久久久久女警 | 久久精品亚洲精品国产欧美kt∨| 国产亚洲成年网址在线观看| 国产精品免费看片| 亚洲一区二区视频在线观看| 日韩成人一区二区| 国产在线日韩欧美| 波多野结衣中文字幕一区 | 91婷婷韩国欧美一区二区| 色8久久精品久久久久久蜜| 欧美私人免费视频| 正在播放一区二区| 久久综合久久鬼色| 国产精品视频一二三| 樱桃国产成人精品视频| 美女视频一区二区三区| 国产成人免费视频网站| 在线观看日韩高清av| 日韩一区二区三区视频在线| 久久久久久久综合狠狠综合| 亚洲欧美在线高清| 免费在线视频一区| 成人a级免费电影| 欧美人与z0zoxxxx视频| 久久精品网站免费观看| 亚洲精品中文在线影院| 久久爱www久久做| av色综合久久天堂av综合| 欧美一区二区在线免费观看| 国产精品久久久99| 日韩avvvv在线播放| 99久久精品国产网站| 欧美一区二区三区性视频| 国产精品视频麻豆| 偷拍日韩校园综合在线| 成人妖精视频yjsp地址| 欧美情侣在线播放| 亚洲欧洲美洲综合色网| 蜜桃视频一区二区| 色偷偷一区二区三区| 26uuu亚洲综合色欧美| 亚洲综合成人在线| 高清在线成人网| 日韩欧美一区中文| 一二三四区精品视频| 福利一区二区在线观看| 91精品婷婷国产综合久久竹菊| 中文字幕av免费专区久久| 人人狠狠综合久久亚洲| 日本精品一区二区三区高清| 久久久国产精品不卡| 老司机精品视频在线| 欧美日韩一级黄| 亚洲免费看黄网站| 成人黄色电影在线 | 色妞www精品视频| 国产欧美日韩不卡免费| 色综合色狠狠天天综合色| 亚洲精品一区二区三区99| 无吗不卡中文字幕| 欧美影院午夜播放| 亚洲天堂免费在线观看视频| 风间由美一区二区av101| 欧美成人aa大片| 日本欧美韩国一区三区| 欧美日韩国产精品自在自线| 亚洲精品日产精品乱码不卡| 成人av动漫网站| 欧美激情一区二区三区| 国产精品99久久久久| 久久综合久久鬼色中文字| 激情伊人五月天久久综合| 日韩精品自拍偷拍| 青青草成人在线观看| 制服丝袜亚洲色图| 午夜精品久久久久久久99樱桃| 在线观看国产日韩| 亚洲成人免费视| 欧美日本免费一区二区三区| 亚洲国产精品尤物yw在线观看| 一本到不卡精品视频在线观看| 国产精品电影一区二区| www.爱久久.com| 一区二区高清免费观看影视大全 | 国产日产欧美精品一区二区三区| 久久不见久久见免费视频7| 2021久久国产精品不只是精品| 久久国产精品99久久人人澡| 久久久一区二区三区捆绑**| 国产99精品国产| 亚洲欧美日韩国产中文在线| 91国内精品野花午夜精品| 亚洲激情成人在线| 欧美日韩一区国产| 麻豆成人久久精品二区三区小说| 日韩三级高清在线| 国产成人免费在线视频| 亚洲三级久久久| 欧美日韩国产123区| 久草在线在线精品观看| 欧美国产精品一区二区| 色一情一乱一乱一91av| 日韩成人一级大片| 国产婷婷一区二区| 色av成人天堂桃色av| 五月天激情综合网| www日韩大片| 色哟哟国产精品免费观看| 日韩精品三区四区| 中文字幕+乱码+中文字幕一区| 在线精品视频小说1| 久久激情综合网| 亚洲激情男女视频| 亚洲精品一区二区三区蜜桃下载|