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

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

?? pci.c

?? linux-2.4.29操作系統的源碼
?? 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/string.h>#include <linux/pci.h>#include <linux/init.h>#include <linux/ioport.h>#include <linux/kernel.h>#include <linux/bootmem.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. */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_eisa_bridge(struct pci_dev *dev){	dev->class = PCI_CLASS_BRIDGE_EISA << 8;}static void __initquirk_isa_bridge(struct pci_dev *dev){	dev->class = PCI_CLASS_BRIDGE_ISA << 8;}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 entire 0xfff00000-0xffffffff region.  */	else if (dev->class >> 8 == PCI_CLASS_BRIDGE_ISA) {		if (__direct_map_base + __direct_map_size >= 0xfff00000)			__direct_map_size = 0xfff00000 - __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 >= 0xfff00000)				pci->size = 0xfff00000 - pci->dma_base;		}	}}struct pci_fixup pcibios_fixups[] __initdata = {	{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82375,	  quirk_eisa_bridge },	{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82378,	  quirk_isa_bridge },	{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693,	  quirk_cypress },	{ 0 }};#define MAX(val1, val2)		((val1) > (val2) ? (val1) : (val2))#define ALIGN(val,align)	(((val) + ((align) - 1)) & ~((align) - 1))#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(0x1000, 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 MAX#undef ALIGN#undef KB#undef MB#undef GBvoid __initpcibios_init(void){	if (!alpha_mv.init_pci)		return;	alpha_mv.init_pci();}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, tmp->regs);	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, tmp->regs);	}}#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){	/* Propogate hose info into the subordinate devices.  */	struct pci_controller *hose = bus->sysdata;	struct list_head *ln;	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);	} 	for (ln = bus->devices.next; ln != &bus->devices; ln = ln->next) {		struct pci_dev *dev = pci_dev_b(ln);		pdev_save_srm_config(dev);		if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)			pcibios_fixup_device_resources(dev, bus);	}}voidpcibios_update_resource(struct pci_dev *dev, struct resource *root,			struct resource *res, int resource){	struct pci_controller *hose = dev->sysdata;	int where;	u32 reg;	if (resource < PCI_ROM_RESOURCE) 		where = PCI_BASE_ADDRESS_0 + (resource * 4);	else if (resource == PCI_ROM_RESOURCE)		where = dev->rom_base_reg;	else {		return; /* Don't update non-standard resources here. */	}	/* Point root at the hose root. */	if (res->flags & IORESOURCE_IO)		root = hose->io_space;	if (res->flags & IORESOURCE_MEM)		root = hose->mem_space;	reg = (res->start - root->start) | (res->flags & 0xf);	pci_write_config_dword(dev, where, reg);	if ((res->flags & (PCI_BASE_ADDRESS_SPACE			   | PCI_BASE_ADDRESS_MEM_TYPE_MASK))	    == (PCI_BASE_ADDRESS_SPACE_MEMORY		| PCI_BASE_ADDRESS_MEM_TYPE_64)) {		pci_write_config_dword(dev, where+4, 0);		printk(KERN_WARNING "PCI: dev %s type 64-bit\n", dev->name);	}	/* ??? FIXME -- record old value for shutdown.  */}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){	struct pci_controller *hose = dev->sysdata;	if (dev->bus->number != hose->first_busno) {		u8 pin = *pinp;		do {			pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));			/* Move up the chain of bridges. */			dev = dev->bus->self;		} while (dev->bus->parent);		*pinp = pin;		/* The slot is the slot of the last bridge. */	}	return PCI_SLOT(dev->devfn);}void __initpcibios_fixup_pbus_ranges(struct pci_bus * bus,			  struct pbus_set_ranges_data * ranges){	struct pci_controller *hose = (struct pci_controller *)bus->sysdata;	ranges->io_start -= hose->io_space->start;	ranges->io_end -= hose->io_space->start;	ranges->mem_start -= hose->mem_space->start;	ranges->mem_end -= hose->mem_space->start;/* FIXME: On older alphas we could use dense memory space	  to access prefetchable resources. */	ranges->prefetch_start -= hose->mem_space->start;	ranges->prefetch_end -= hose->mem_space->start;}intpcibios_enable_device(struct pci_dev *dev, int mask){	/* Nothing to do, since we enable all devices at startup.  */	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",							dev->slot_name);	pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64);}static void __initpcibios_claim_one_bus(struct pci_bus *b){	struct list_head *ld;	struct pci_bus *child_bus;	for (ld = b->devices.next; ld != &b->devices; ld = ld->next) {		struct pci_dev *dev = pci_dev_b(ld);		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 list_head *lb;	for(lb = pci_root_buses.next; lb != &pci_root_buses; lb = lb->next) {		struct pci_bus *b = pci_bus_b(lb);		pcibios_claim_one_bus(b);	}}void __initcommon_init_pci(void){	struct pci_controller *hose;	struct pci_bus *bus;	int next_busno;	/* Scan all of the recorded PCI controllers.  */	for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {		hose->first_busno = next_busno;		hose->last_busno = 0xff;		bus = pci_scan_bus(next_busno, alpha_mv.pci_ops, hose);		hose->bus = bus;		next_busno = hose->last_busno = bus->subordinate;		next_busno += 1;	}	if (pci_probe_only)		pcibios_claim_console_setup();	else	/* FIXME: `else' will be removed when		   pci_assign_unassigned_resources() is able to work		   correctly with [partially] allocated PCI tree. */		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;}/* Return the index of the PCI controller for device PDEV. */intpci_controller_num(struct pci_dev *pdev){        struct pci_controller *hose = pdev->sysdata;	return (hose ? hose->index : -ENXIO);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本高清无吗v一区| 久久一日本道色综合| 日韩欧美国产小视频| 中文字幕一区二区三区四区不卡| 日本不卡一二三| 9人人澡人人爽人人精品| 久久―日本道色综合久久| 亚洲自拍都市欧美小说| 成人国产精品免费观看视频| 日韩一区二区在线观看| 亚洲综合成人在线视频| 成人网在线免费视频| 日韩精品一区二区三区三区免费 | 91亚洲国产成人精品一区二三 | 日韩电影免费在线| 在线观看成人小视频| 国产精品久久午夜夜伦鲁鲁| 国模冰冰炮一区二区| 4438x成人网最大色成网站| 亚洲狠狠丁香婷婷综合久久久| 成人妖精视频yjsp地址| 久久久精品国产免大香伊| 麻豆精品一区二区| 欧美videos中文字幕| 美国毛片一区二区| 日韩欧美在线网站| 久久97超碰色| 欧美va亚洲va| 国产精品自拍三区| 久久久久久久综合狠狠综合| 国内精品不卡在线| 国产午夜精品一区二区三区视频| 国产在线国偷精品免费看| 2023国产一二三区日本精品2022| 国产在线国偷精品产拍免费yy| 精品国精品国产| 国产一区二区调教| 国产精品卡一卡二| 91丨porny丨在线| 一区二区三区在线视频播放| 日本韩国精品在线| 婷婷亚洲久悠悠色悠在线播放| 欧美精品日韩综合在线| 麻豆成人在线观看| 久久久久久久综合色一本| 粉嫩av亚洲一区二区图片| 日韩理论片一区二区| 一本高清dvd不卡在线观看| 亚洲一区在线观看视频| 在线播放一区二区三区| 久久国产精品99久久人人澡| 国产午夜精品一区二区| 色悠悠亚洲一区二区| 亚洲成在人线在线播放| 精品日本一线二线三线不卡| 国产成人免费在线观看| 亚洲免费资源在线播放| 日韩一区二区三区四区五区六区| 国产在线精品一区二区三区不卡 | ...中文天堂在线一区| 欧美性感一区二区三区| 久久精品99国产精品| 国产精品天天看| 欧美日韩精品一区二区三区蜜桃 | 日韩欧美激情在线| 成人黄页毛片网站| 日韩电影免费在线观看网站| 国产欧美日韩在线看| 欧美日本一区二区三区四区| 韩国v欧美v亚洲v日本v| 一区二区三区国产精品| 精品国产一区二区国模嫣然| 色综合久久久网| 久久国产精品99久久久久久老狼| 日韩一区在线免费观看| 欧美一二三四在线| 91精品福利在线| 国产河南妇女毛片精品久久久| 亚洲福利一区二区三区| 中文欧美字幕免费| 欧美一区二区三区小说| 99久久精品免费精品国产| 老司机精品视频线观看86| 一区二区久久久| 中文字幕免费一区| 日韩免费一区二区三区在线播放| 一本高清dvd不卡在线观看| 国产精品一区不卡| 日本欧美一区二区| 亚洲国产综合91精品麻豆| 中文字幕欧美国产| 久久久三级国产网站| 欧美一区二区三区视频免费| 在线一区二区三区| 成人黄色av网站在线| 国内精品嫩模私拍在线| 日本最新不卡在线| 亚洲一级二级三级在线免费观看| 中文字幕中文字幕一区| 国产视频不卡一区| 久久这里只有精品视频网| 日韩亚洲欧美综合| 日韩一卡二卡三卡四卡| 欧美欧美欧美欧美首页| 在线精品国精品国产尤物884a| av一区二区久久| av成人动漫在线观看| 成人亚洲一区二区一| 国产成人啪免费观看软件| 国产乱人伦精品一区二区在线观看| 日本视频一区二区三区| 免费在线观看成人| 美女视频黄 久久| 久久国产精品色婷婷| 精品一区二区三区视频在线观看| 蜜桃av一区二区| 精品在线观看视频| 国产精品中文有码| 懂色av一区二区三区蜜臀| 成人自拍视频在线| 91在线国产福利| 91福利小视频| 91精品欧美一区二区三区综合在| 9191成人精品久久| 精品久久久久一区| 国产无一区二区| 最好看的中文字幕久久| 亚洲精品福利视频网站| 日韩精品欧美成人高清一区二区| 奇米色777欧美一区二区| 麻豆传媒一区二区三区| 粉嫩av一区二区三区粉嫩| 一本一本大道香蕉久在线精品| 欧美在线色视频| 日韩女优制服丝袜电影| 中文字幕国产一区二区| 亚洲精品欧美专区| 蜜桃av一区二区| 成人一区二区三区视频在线观看| 日本韩国一区二区三区| 欧美一级爆毛片| 国产精品麻豆久久久| 一区二区三国产精华液| 精品中文字幕一区二区小辣椒| 成人小视频在线| 欧美蜜桃一区二区三区| 欧美精彩视频一区二区三区| 亚洲品质自拍视频| 久久精品久久精品| 99精品国产99久久久久久白柏| 欧美日韩一级片在线观看| 精品国偷自产国产一区| 亚洲色图视频网站| 麻豆成人久久精品二区三区小说| 99久久婷婷国产综合精品电影| 欧美精品色一区二区三区| 国产精品美女久久久久久久久 | 欧美色图12p| 久久综合色天天久久综合图片| 一区二区在线观看不卡| 国产综合久久久久影院| 一本高清dvd不卡在线观看| 欧美精品一区二区久久婷婷| 一区二区在线电影| 丁香天五香天堂综合| 51精品秘密在线观看| 亚洲美女视频一区| 国产一区二区三区| 日韩一区二区三区三四区视频在线观看 | 91女神在线视频| 精品国精品国产| 日韩精品久久久久久| 91麻豆.com| 国产精品视频一区二区三区不卡| 免费视频一区二区| 欧美日韩二区三区| 一区二区三区在线看| 成人av动漫在线| 久久久久国产精品免费免费搜索| 日本不卡视频一二三区| 欧美三级视频在线观看| 亚洲少妇中出一区| 99re视频精品| 国产精品久久久久影院亚瑟| 国产电影精品久久禁18| 精品久久久久一区二区国产| 日产欧产美韩系列久久99| 欧美日韩激情一区二区| 亚洲国产精品综合小说图片区| caoporn国产精品| 国产精品久久久久久久久搜平片| 国产精品综合二区| 国产亚洲综合色| 国产传媒一区在线| 欧美激情中文字幕一区二区| 国产成人自拍网| 国产精品污污网站在线观看| 成人免费视频一区| 亚洲三级在线观看| 91福利在线观看|