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

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

?? pci.c

?? 優龍2410linux2.6.8內核源代碼
?? C
字號:
/* * pci.c - Low-Level PCI Access in IA-64 * * Derived from bios32.c of i386 tree. * * Copyright (C) 2002 Hewlett-Packard Co *	David Mosberger-Tang <davidm@hpl.hp.com> *	Bjorn Helgaas <bjorn_helgaas@hp.com> * * Note: Above list of copyright holders is incomplete... */#include <linux/config.h>#include <linux/acpi.h>#include <linux/types.h>#include <linux/kernel.h>#include <linux/pci.h>#include <linux/init.h>#include <linux/ioport.h>#include <linux/slab.h>#include <linux/smp_lock.h>#include <linux/spinlock.h>#include <asm/machvec.h>#include <asm/page.h>#include <asm/segment.h>#include <asm/system.h>#include <asm/io.h>#include <asm/sal.h>#ifdef CONFIG_SMP# include <asm/smp.h>#endif#include <asm/irq.h>#include <asm/hw_irq.h>#undef DEBUG#define DEBUG#ifdef DEBUG#define DBG(x...) printk(x)#else#define DBG(x...)#endifstruct pci_fixup pcibios_fixups[1];/* * Low-level SAL-based PCI configuration access functions. Note that SAL * calls are already serialized (via sal_lock), so we don't need another * synchronization mechanism here. */#define PCI_SAL_ADDRESS(seg, bus, devfn, reg)	\	((u64)(seg << 24) | (u64)(bus << 16) |	\	 (u64)(devfn << 8) | (u64)(reg))/* SAL 3.2 adds support for extended config space. */#define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg)	\	((u64)(seg << 28) | (u64)(bus << 20) |		\	 (u64)(devfn << 12) | (u64)(reg))static intpci_sal_read (int seg, int bus, int devfn, int reg, int len, u32 *value){	u64 addr, mode, data = 0;	int result = 0;	if ((seg > 255) || (bus > 255) || (devfn > 255) || (reg > 4095))		return -EINVAL;	if ((seg | reg) <= 255) {		addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg);		mode = 0;	} else {		addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg);		mode = 1;	}	result = ia64_sal_pci_config_read(addr, mode, len, &data);	*value = (u32) data;	return result;}static intpci_sal_write (int seg, int bus, int devfn, int reg, int len, u32 value){	u64 addr, mode;	if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095))		return -EINVAL;	if ((seg | reg) <= 255) {		addr = PCI_SAL_ADDRESS(seg, bus, devfn, reg);		mode = 0;	} else {		addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg);		mode = 1;	}	return ia64_sal_pci_config_write(addr, mode, len, value);}static struct pci_raw_ops pci_sal_ops = {	.read = 	pci_sal_read,	.write =	pci_sal_write};struct pci_raw_ops *raw_pci_ops = &pci_sal_ops;static intpci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value){	return raw_pci_ops->read(pci_domain_nr(bus), bus->number,				 devfn, where, size, value);}static intpci_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value){	return raw_pci_ops->write(pci_domain_nr(bus), bus->number,				  devfn, where, size, value);}static struct pci_ops pci_root_ops = {	.read = pci_read,	.write = pci_write,};static int __initpci_acpi_init (void){	struct pci_dev *dev = NULL;	printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");	/*	 * PCI IRQ routing is set up by pci_enable_device(), but we	 * also do it here in case there are still broken drivers that	 * don't use pci_enable_device().	 */	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL)		acpi_pci_irq_enable(dev);	return 0;}subsys_initcall(pci_acpi_init);/* Called by ACPI when it finds a new root bus.  */static struct pci_controller * __devinitalloc_pci_controller (int seg){	struct pci_controller *controller;	controller = kmalloc(sizeof(*controller), GFP_KERNEL);	if (!controller)		return NULL;	memset(controller, 0, sizeof(*controller));	controller->segment = seg;	return controller;}static int __devinitalloc_resource (char *name, struct resource *root, unsigned long start, unsigned long end,		unsigned long flags){	struct resource *res;	res = kmalloc(sizeof(*res), GFP_KERNEL);	if (!res)		return -ENOMEM;	memset(res, 0, sizeof(*res));	res->name = name;	res->start = start;	res->end = end;	res->flags = flags;	if (insert_resource(root, res))	{		kfree(res);		return -EBUSY;	}	return 0;}static u64 __devinitadd_io_space (struct acpi_resource_address64 *addr){	u64 offset;	int sparse = 0;	int i;	if (addr->address_translation_offset == 0)		return IO_SPACE_BASE(0);	/* part of legacy IO space */	if (addr->attribute.io.translation_attribute == ACPI_SPARSE_TRANSLATION)		sparse = 1;	offset = (u64) ioremap(addr->address_translation_offset, 0);	for (i = 0; i < num_io_spaces; i++)		if (io_space[i].mmio_base == offset &&		    io_space[i].sparse == sparse)			return IO_SPACE_BASE(i);	if (num_io_spaces == MAX_IO_SPACES) {		printk("Too many IO port spaces\n");		return ~0;	}	i = num_io_spaces++;	io_space[i].mmio_base = offset;	io_space[i].sparse = sparse;	return IO_SPACE_BASE(i);}static acpi_status __devinitcount_window (struct acpi_resource *resource, void *data){	unsigned int *windows = (unsigned int *) data;	struct acpi_resource_address64 addr;	acpi_status status;	status = acpi_resource_to_address64(resource, &addr);	if (ACPI_SUCCESS(status))		if (addr.resource_type == ACPI_MEMORY_RANGE ||		    addr.resource_type == ACPI_IO_RANGE)			(*windows)++;	return AE_OK;}struct pci_root_info {	struct pci_controller *controller;	char *name;};static acpi_status __devinitadd_window (struct acpi_resource *res, void *data){	struct pci_root_info *info = (struct pci_root_info *) data;	struct pci_window *window;	struct acpi_resource_address64 addr;	acpi_status status;	unsigned long flags, offset = 0;	struct resource *root;	status = acpi_resource_to_address64(res, &addr);	if (ACPI_SUCCESS(status)) {		if (!addr.address_length)			return AE_OK;		if (addr.resource_type == ACPI_MEMORY_RANGE) {			flags = IORESOURCE_MEM;			root = &iomem_resource;			offset = addr.address_translation_offset;		} else if (addr.resource_type == ACPI_IO_RANGE) {			flags = IORESOURCE_IO;			root = &ioport_resource;			offset = add_io_space(&addr);			if (offset == ~0)				return AE_OK;		} else			return AE_OK;		window = &info->controller->window[info->controller->windows++];		window->resource.flags |= flags;		window->resource.start  = addr.min_address_range;		window->resource.end    = addr.max_address_range;		window->offset		= offset;		if (alloc_resource(info->name, root, addr.min_address_range + offset,			addr.max_address_range + offset, flags))			printk(KERN_ERR "alloc 0x%lx-0x%lx from %s for %s failed\n",				addr.min_address_range + offset, addr.max_address_range + offset,				root->name, info->name);	}	return AE_OK;}struct pci_bus * __devinitpci_acpi_scan_root (struct acpi_device *device, int domain, int bus){	struct pci_root_info info;	struct pci_controller *controller;	unsigned int windows = 0;	char *name;	controller = alloc_pci_controller(domain);	if (!controller)		goto out1;	controller->acpi_handle = device->handle;	acpi_walk_resources(device->handle, METHOD_NAME__CRS, count_window, &windows);	controller->window = kmalloc(sizeof(*controller->window) * windows, GFP_KERNEL);	if (!controller->window)		goto out2;	name = kmalloc(16, GFP_KERNEL);	if (!name)		goto out3;	sprintf(name, "PCI Bus %04x:%02x", domain, bus);	info.controller = controller;	info.name = name;	acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window, &info);	return pci_scan_bus(bus, &pci_root_ops, controller);out3:	kfree(controller->window);out2:	kfree(controller);out1:	return NULL;}void __initpcibios_fixup_device_resources (struct pci_dev *dev, struct pci_bus *bus){	struct pci_controller *controller = PCI_CONTROLLER(dev);	struct pci_window *window;	int i, j;	int limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? \		PCI_ROM_RESOURCE : PCI_NUM_RESOURCES;	for (i = 0; i < limit; i++) {		if (!dev->resource[i].start)			continue;#define contains(win, res)	((res)->start >= (win)->start && \				 (res)->end   <= (win)->end)		for (j = 0; j < controller->windows; j++) {			window = &controller->window[j];			if (((dev->resource[i].flags & IORESOURCE_MEM &&			      window->resource.flags & IORESOURCE_MEM) ||			     (dev->resource[i].flags & IORESOURCE_IO &&			      window->resource.flags & IORESOURCE_IO)) &&			    contains(&window->resource, &dev->resource[i])) {				dev->resource[i].start += window->offset;				dev->resource[i].end   += window->offset;			}		}		pci_claim_resource(dev, i);	}}/* *  Called after each bus is probed, but before its children are examined. */void __devinitpcibios_fixup_bus (struct pci_bus *b){	struct list_head *ln;	for (ln = b->devices.next; ln != &b->devices; ln = ln->next)		pcibios_fixup_device_resources(pci_dev_b(ln), b);	return;}void __devinitpcibios_update_irq (struct pci_dev *dev, int irq){	pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);	/* ??? FIXME -- record old value for shutdown.  */}static inline intpcibios_enable_resources (struct pci_dev *dev, int mask){	u16 cmd, old_cmd;	int idx;	struct resource *r;	if (!dev)		return -EINVAL;	pci_read_config_word(dev, PCI_COMMAND, &cmd);	old_cmd = cmd;	for (idx=0; idx<6; idx++) {		/* Only set up the desired resources.  */		if (!(mask & (1 << idx)))			continue;		r = &dev->resource[idx];		if (!r->start && r->end) {			printk(KERN_ERR			       "PCI: Device %s not available because of resource collisions\n",			       pci_name(dev));			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", pci_name(dev), old_cmd, cmd);		pci_write_config_word(dev, PCI_COMMAND, cmd);	}	return 0;}intpcibios_enable_device (struct pci_dev *dev, int mask){	int ret;	ret = pcibios_enable_resources(dev, mask);	if (ret < 0)		return ret;	return acpi_pci_irq_enable(dev);}voidpcibios_align_resource (void *data, struct resource *res,		        unsigned long size, unsigned long align){}/* * PCI BIOS setup, always defaults to SAL interface */char * __initpcibios_setup (char *str){	return NULL;}intpci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,		     enum pci_mmap_state mmap_state, int write_combine){	/*	 * I/O space cannot be accessed via normal processor loads and stores on this	 * platform.	 */	if (mmap_state == pci_mmap_io)		/*		 * XXX we could relax this for I/O spaces for which ACPI indicates that		 * the space is 1-to-1 mapped.  But at the moment, we don't support		 * multiple PCI address spaces and the legacy I/O space is not 1-to-1		 * mapped, so this is moot.		 */		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);	if (write_combine)		vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);	else		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);	if (remap_page_range(vma, vma->vm_start, vma->vm_pgoff << PAGE_SHIFT,			     vma->vm_end - vma->vm_start, vma->vm_page_prot))		return -EAGAIN;	return 0;}/** * pci_cacheline_size - determine cacheline size for PCI devices * @dev: void * * We want to use the line-size of the outer-most cache.  We assume * that this line-size is the same for all CPUs. * * Code mostly taken from arch/ia64/kernel/palinfo.c:cache_info(). * * RETURNS: An appropriate -ERRNO error value on eror, or zero for success. */static unsigned longpci_cacheline_size (void){	u64 levels, unique_caches;	s64 status;	pal_cache_config_info_t cci;	static u8 cacheline_size;	if (cacheline_size)		return cacheline_size;	status = ia64_pal_cache_summary(&levels, &unique_caches);	if (status != 0) {		printk(KERN_ERR "%s: ia64_pal_cache_summary() failed (status=%ld)\n",		       __FUNCTION__, status);		return SMP_CACHE_BYTES;	}	status = ia64_pal_cache_config_info(levels - 1, /* cache_type (data_or_unified)= */ 2,					    &cci);	if (status != 0) {		printk(KERN_ERR "%s: ia64_pal_cache_config_info() failed (status=%ld)\n",		       __FUNCTION__, status);		return SMP_CACHE_BYTES;	}	cacheline_size = 1 << cci.pcci_line_size;	return cacheline_size;}/** * pcibios_prep_mwi - helper function for drivers/pci/pci.c:pci_set_mwi() * @dev: the PCI device for which MWI is enabled * * For ia64, we can get the cacheline sizes from PAL. * * RETURNS: An appropriate -ERRNO error value on eror, or zero for success. */intpcibios_prep_mwi (struct pci_dev *dev){	unsigned long desired_linesize, current_linesize;	int rc = 0;	u8 pci_linesize;	desired_linesize = pci_cacheline_size();	pci_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &pci_linesize);	current_linesize = 4 * pci_linesize;	if (desired_linesize != current_linesize) {		printk(KERN_WARNING "PCI: slot %s has incorrect PCI cache line size of %lu bytes,",		       pci_name(dev), current_linesize);		if (current_linesize > desired_linesize) {			printk(" expected %lu bytes instead\n", desired_linesize);			rc = -EINVAL;		} else {			printk(" correcting to %lu\n", desired_linesize);			pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, desired_linesize / 4);		}	}	return rc;}int pci_vector_resources(int last, int nr_released){	int count = nr_released; 	count += (IA64_LAST_DEVICE_VECTOR - last);	return count;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色哟哟在线观看一区二区三区| 欧美精品少妇一区二区三区 | 亚洲欧美自拍偷拍| 亚洲女人****多毛耸耸8| 天天综合色天天| proumb性欧美在线观看| 日韩视频一区二区| 亚洲五码中文字幕| www.视频一区| 久久亚洲精品国产精品紫薇| 天堂成人国产精品一区| 色综合中文综合网| 久久99精品国产| 欧美伊人久久久久久久久影院| 久久久99久久| 日韩专区欧美专区| 色屁屁一区二区| 国产精品不卡在线| 国产a区久久久| 亚洲精品一区二区三区精华液| 亚洲高清在线视频| 欧美日韩综合在线| 亚洲婷婷综合色高清在线| 国产呦萝稀缺另类资源| 日韩一级精品视频在线观看| 亚洲国产aⅴ天堂久久| 在线视频观看一区| 亚洲激情av在线| 在线视频中文字幕一区二区| 亚洲激情在线激情| 欧美午夜宅男影院| 亚洲一区在线播放| 欧美影视一区在线| 亚洲国产一区视频| 欧美探花视频资源| 亚洲国产综合色| 欧美性做爰猛烈叫床潮| 亚洲福利视频一区| 91精品一区二区三区久久久久久| 美腿丝袜在线亚洲一区| 欧美mv日韩mv国产网站| 国产在线不卡一卡二卡三卡四卡| 精品成人免费观看| 国产一区二区h| 欧美国产视频在线| 一本一道久久a久久精品综合蜜臀| 亚洲另类春色校园小说| 欧美熟乱第一页| 热久久免费视频| 国产网站一区二区| 99re热视频这里只精品| 亚洲午夜三级在线| 日韩美一区二区三区| 国产在线精品视频| 亚洲欧洲成人精品av97| 欧美日韩精品欧美日韩精品一综合| 日韩av成人高清| 久久精品亚洲麻豆av一区二区| 成人一区二区三区中文字幕| 亚洲欧美日韩国产另类专区| 欧美日韩电影在线播放| 国产一区二区三区不卡在线观看| 日本一区二区三区在线观看| 欧美性做爰猛烈叫床潮| 国产剧情在线观看一区二区| 国产精品久久久久久久久免费桃花| 欧美视频在线观看一区| 国产精品一卡二卡| 亚洲成人激情av| 国产亚洲精品免费| 欧美日韩精品专区| 成人午夜av电影| 奇米精品一区二区三区在线观看 | 蜜桃久久久久久久| 国产精品福利一区| 欧美成人综合网站| 色综合久久综合中文综合网| 麻豆精品一二三| 亚洲欧美日韩国产中文在线| www亚洲一区| 欧美喷水一区二区| 丁香啪啪综合成人亚洲小说| 欧美aaaaaa午夜精品| 亚洲精品日韩综合观看成人91| 日韩精品一区二区三区中文不卡 | 欧美性生交片4| 国产成人精品三级麻豆| 亚洲成人av中文| 国产精品久久久久久亚洲毛片| 67194成人在线观看| 91激情五月电影| 成人午夜在线免费| 国产一区久久久| 男女男精品视频| 亚洲成国产人片在线观看| 中文字幕亚洲欧美在线不卡| 久久九九久久九九| 亚洲精品一区在线观看| 欧美一级二级在线观看| 欧美日韩国产中文| 欧美色图在线观看| 欧美中文字幕久久| 色婷婷av一区二区三区之一色屋| 丁香婷婷综合网| 国产精品18久久久久久久久久久久| 日日欢夜夜爽一区| 无吗不卡中文字幕| 亚洲bt欧美bt精品777| 一区二区在线观看免费| 日韩美女视频19| 国产精品视频一二| 亚洲欧美自拍偷拍色图| 18涩涩午夜精品.www| 亚洲人妖av一区二区| 亚洲欧洲日产国产综合网| 中文天堂在线一区| 国产精品成人免费精品自在线观看 | 欧美日韩精品欧美日韩精品一| 91国产丝袜在线播放| 欧美日韩在线播放三区四区| 色综合夜色一区| 欧美日韩国产首页在线观看| 欧美裸体bbwbbwbbw| 欧美一区二区三区免费视频 | 91.xcao| 日韩免费在线观看| 久久综合视频网| 国产亚洲短视频| 亚洲欧美日韩国产另类专区| 亚洲大型综合色站| 日韩国产精品91| 国产精品1区2区| 97se亚洲国产综合自在线| 色综合天天性综合| 欧美日韩中文精品| 日韩女优av电影| 国产精品伦一区| 亚洲高清免费视频| 国产综合色在线| 成人激情开心网| 精品视频一区二区不卡| 日韩一级欧美一级| 中文字幕制服丝袜一区二区三区| 夜夜夜精品看看| 精品在线免费视频| av电影在线观看完整版一区二区| 欧美亚洲国产bt| 精品sm捆绑视频| 亚洲色图制服丝袜| 蜜臀av在线播放一区二区三区| 国产精品2024| 欧美日韩在线播放三区| 国产色婷婷亚洲99精品小说| 亚洲一区二区高清| 国产999精品久久| 欧美日韩情趣电影| 日本一二三不卡| 日本伊人色综合网| 色诱亚洲精品久久久久久| 欧美xxx久久| 亚洲综合免费观看高清在线观看| 国产一区二区在线观看视频| 欧美中文字幕久久| 国产蜜臀97一区二区三区| 日韩高清一级片| 色综合天天综合给合国产| 久久久亚洲精品一区二区三区 | 久久国产生活片100| 在线看日韩精品电影| 国产视频一区二区在线| 日韩激情视频网站| 99精品一区二区三区| 久久色成人在线| 日本午夜一区二区| 在线免费视频一区二区| 国产亚洲欧美色| 蜜桃av噜噜一区| 欧美日韩黄色影视| 亚洲精品免费一二三区| 国产成人高清在线| 久久亚洲精精品中文字幕早川悠里| 亚洲电影一级黄| 一本久久精品一区二区| 国产精品视频看| 国产一区二区三区视频在线播放| 7777女厕盗摄久久久| 午夜精品福利一区二区三区蜜桃| 色中色一区二区| 亚洲另类中文字| 91视频91自| 亚洲精品自拍动漫在线| 99在线热播精品免费| 国产婷婷色一区二区三区| 国产一区美女在线| 久久一夜天堂av一区二区三区| 青椒成人免费视频| 91精品国产一区二区人妖| 天天色 色综合| 欧美日韩在线综合| 日本不卡1234视频|