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

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

?? pci_map.c

?? 國產CPU-龍芯(loongson)BIOS源代碼
?? C
字號:
/*      $OpenBSD: pci_map.c,v 1.6 2001/06/13 08:25:25 niklas Exp $     *//*	$NetBSD: pci_map.c,v 1.7 2000/05/10 16:58:42 thorpej Exp $	*//*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Charles M. Hannum; by William R. Studenmund; by Jason R. Thorpe. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *        This product includes software developed by the NetBSD *        Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its *    contributors may be used to endorse or promote products derived *    from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *//* * PCI device mapping. */#include <sys/param.h>#include <sys/systm.h>#include <sys/device.h>#include <dev/pci/pcireg.h>#include <dev/pci/pcivar.h>static int nbsd_pci_io_find __P((pci_chipset_tag_t, pcitag_t, int, pcireg_t,    bus_addr_t *, bus_size_t *, int *));static int nbsd_pci_mem_find __P((pci_chipset_tag_t, pcitag_t, int, pcireg_t,    bus_addr_t *, bus_size_t *, int *));static intnbsd_pci_io_find(pc, tag, reg, type, basep, sizep, flagsp)	pci_chipset_tag_t pc;	pcitag_t tag;	int reg;	pcireg_t type;	bus_addr_t *basep;	bus_size_t *sizep;	int *flagsp;{	pcireg_t address, mask;	int s;	if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3))		panic("pci_io_find: bad request");	/*	 * Section 6.2.5.1, `Address Maps', tells us that:	 *	 * 1) The builtin software should have already mapped the device in a	 * reasonable way.	 *	 * 2) A device which wants 2^n bytes of memory will hardwire the bottom	 * n bits of the address to 0.  As recommended, we write all 1s and see	 * what we get back.	 */	s = splhigh();	address = pci_conf_read(pc, tag, reg);	//printf("tag=%x,reg=%x,value=%x\n",tag,reg,address);	pci_conf_write(pc, tag, reg, 0xffffffff);	mask = pci_conf_read(pc, tag, reg);	pci_conf_write(pc, tag, reg, address);	splx(s);	if (PCI_MAPREG_TYPE(address) != PCI_MAPREG_TYPE_IO) {		printf("pci_io_find: expected type i/o, found mem\n");		return (1);	}	if (PCI_MAPREG_IO_SIZE(mask) == 0) {		printf("pci_io_find: void region\n");		return (1);	}	if (basep != 0)		*basep = PCI_MAPREG_IO_ADDR(address);	if (sizep != 0)		*sizep = PCI_MAPREG_IO_SIZE(mask);	if (flagsp != 0)		*flagsp = 0;	return (0);}static intnbsd_pci_mem_find(pc, tag, reg, type, basep, sizep, flagsp)	pci_chipset_tag_t pc;	pcitag_t tag;	int reg;	pcireg_t type;	bus_addr_t *basep;	bus_size_t *sizep;	int *flagsp;{	pcireg_t address, mask, address1 = 0, mask1 = 0xffffffff;	u_int64_t waddress, wmask;	int s, is64bit;	is64bit = (PCI_MAPREG_MEM_TYPE(type) == PCI_MAPREG_MEM_TYPE_64BIT);	if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3))		panic("pci_mem_find: bad request");	if (is64bit && (reg + 4) >= PCI_MAPREG_END)		panic("pci_mem_find: bad 64-bit request");	/*	 * Section 6.2.5.1, `Address Maps', tells us that:	 *	 * 1) The builtin software should have already mapped the device in a	 * reasonable way.	 *	 * 2) A device which wants 2^n bytes of memory will hardwire the bottom	 * n bits of the address to 0.  As recommended, we write all 1s and see	 * what we get back.	 */	s = splhigh();	address = pci_conf_read(pc, tag, reg);	pci_conf_write(pc, tag, reg, 0xffffffff);	mask = pci_conf_read(pc, tag, reg);	pci_conf_write(pc, tag, reg, address);	if (is64bit) {		address1 = pci_conf_read(pc, tag, reg + 4);		pci_conf_write(pc, tag, reg + 4, 0xffffffff);		mask1 = pci_conf_read(pc, tag, reg + 4);		pci_conf_write(pc, tag, reg + 4, address1);	}	splx(s);	if (PCI_MAPREG_TYPE(address) != PCI_MAPREG_TYPE_MEM) {		printf("pci_mem_find: expected type mem, found i/o\n");		return (1);	}	if (type != -1 && 	    PCI_MAPREG_MEM_TYPE(address) != PCI_MAPREG_MEM_TYPE(type)) {		printf("pci_mem_find: expected mem type %08x, found %08x\n",		    PCI_MAPREG_MEM_TYPE(type),		    PCI_MAPREG_MEM_TYPE(address));		return (1);	}	waddress = (u_int64_t)address1 << 32UL | address;	wmask = (u_int64_t)mask1 << 32UL | mask;	if (PCI_MAPREG_MEM64_SIZE(wmask) == 0) {		printf("pci_mem_find: void region\n");		return (1);	}	switch (PCI_MAPREG_MEM_TYPE(address)) {	case PCI_MAPREG_MEM_TYPE_32BIT:	case PCI_MAPREG_MEM_TYPE_32BIT_1M:		break;	case PCI_MAPREG_MEM_TYPE_64BIT:		/*		 * Handle the case of a 64-bit memory register on a		 * platform with 32-bit addressing.  Make sure that		 * the address assigned and the device's memory size		 * fit in 32 bits.  We implicitly assume that if		 * bus_addr_t is 64-bit, then so is bus_size_t.		 */		if (sizeof(u_int64_t) > sizeof(bus_addr_t) &&		    (address1 != 0 || mask1 != 0xffffffff)) {			printf("pci_mem_find: 64-bit memory map which is "			    "inaccessible on a 32-bit platform\n");			return (1);		}		break;	default:		printf("pci_mem_find: reserved mapping register type\n");		return (1);	}	if (sizeof(u_int64_t) > sizeof(bus_addr_t)) {		if (basep != 0)			*basep = PCI_MAPREG_MEM_ADDR(address);		if (sizep != 0)			*sizep = PCI_MAPREG_MEM_SIZE(mask);	} else {		if (basep != 0)			*basep = PCI_MAPREG_MEM64_ADDR(waddress);		if (sizep != 0)			*sizep = PCI_MAPREG_MEM64_SIZE(wmask);	}	if (flagsp != 0)		*flagsp = PCI_MAPREG_MEM_CACHEABLE(address)#ifndef __OpenBSD__		    ? BUS_SPACE_MAP_CACHEABLE : 0#endif		  ;	return (0);}intpci_io_find(pc, pcitag, reg, iobasep, iosizep)	pci_chipset_tag_t pc;	pcitag_t pcitag;	int reg;	bus_addr_t *iobasep;	bus_size_t *iosizep;{	return (nbsd_pci_io_find(pc, pcitag, reg, 0, iobasep, iosizep, 0));}intpci_mem_find(pc, pcitag, reg, membasep, memsizep, cacheablep)	pci_chipset_tag_t pc;	pcitag_t pcitag;	int reg;	bus_addr_t *membasep;	bus_size_t *memsizep;	int *cacheablep;{	return (nbsd_pci_mem_find(pc, pcitag, reg, -1, membasep, memsizep,				  cacheablep));}pcireg_tpci_mapreg_type(pc, tag, reg)	pci_chipset_tag_t pc;	pcitag_t tag;	int reg;{	pcireg_t rv;	rv = pci_conf_read(pc, tag, reg);	if (PCI_MAPREG_TYPE(rv) == PCI_MAPREG_TYPE_IO)		rv &= PCI_MAPREG_TYPE_MASK;	else		rv &= PCI_MAPREG_TYPE_MASK|PCI_MAPREG_MEM_TYPE_MASK;	return (rv);}intpci_mapreg_info(pc, tag, reg, type, basep, sizep, flagsp)	pci_chipset_tag_t pc;	pcitag_t tag;	int reg;	pcireg_t type;	bus_addr_t *basep;	bus_size_t *sizep;	int *flagsp;{	if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO)		return (nbsd_pci_io_find(pc, tag, reg, type, basep, sizep,		    flagsp));	else		return (nbsd_pci_mem_find(pc, tag, reg, type, basep, sizep,		    flagsp));}intpci_mapreg_map(pa, reg, type, busflags, tagp, handlep, basep, sizep, maxsize)	struct pci_attach_args *pa;	int reg, busflags;	pcireg_t type;	bus_space_tag_t *tagp;	bus_space_handle_t *handlep;	bus_addr_t *basep;	bus_size_t *sizep;	bus_size_t maxsize;{	bus_space_tag_t tag;	bus_space_handle_t handle;	bus_addr_t base;	bus_size_t size;	int flags;	if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {		if ((pa->pa_flags & PCI_FLAGS_IO_ENABLED) == 0)			return (1);		if (nbsd_pci_io_find(pa->pa_pc, pa->pa_tag, reg, type, &base,				     &size, &flags))			return (1);		tag = pa->pa_iot;	} else {		if ((pa->pa_flags & PCI_FLAGS_MEM_ENABLED) == 0)			return (1);		if (nbsd_pci_mem_find(pa->pa_pc, pa->pa_tag, reg, type, &base,				      &size, &flags))			return (1);		tag = pa->pa_memt;	}	/* The caller can request limitation of the mapping's size. */	if (maxsize != 0 && size > maxsize) {#ifdef DEBUG		printf("pci_mapreg_map: limited PCI mapping from %lx to %lx\n",		    (u_long)size, (u_long)maxsize);#endif		size = maxsize;	}	if (bus_space_map(tag, base, size, busflags | flags, &handle))		return (1);	if (tagp != NULL)		*tagp = tag;	if (handlep != NULL)		*handlep = handle;	if (basep != NULL)		*basep = base;	if (sizep != NULL)		*sizep = size;	return (0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久天天做天天爱综合色| 亚洲欧洲日韩av| 91在线免费视频观看| 亚洲亚洲精品在线观看| 国产精品视频九色porn| 91精品欧美久久久久久动漫| 99re这里只有精品首页| 久久99国产精品久久99果冻传媒| 亚洲免费av高清| 久久精品亚洲麻豆av一区二区| 欧美丝袜第三区| 波多野结衣欧美| 久久精品国产精品亚洲红杏| 亚洲综合激情网| 中文字幕亚洲一区二区av在线| 精品嫩草影院久久| 欧美日韩激情在线| 91成人网在线| 色综合视频一区二区三区高清| 国产一区二区三区不卡在线观看| 日韩主播视频在线| 亚洲最大色网站| 亚洲你懂的在线视频| 国产精品久久久久永久免费观看| 精品国产91久久久久久久妲己| 51精品视频一区二区三区| 91精品福利视频| 色久综合一二码| www..com久久爱| 国产69精品久久99不卡| 国产一区999| 黑人精品欧美一区二区蜜桃 | 国产精品福利一区| 国产午夜亚洲精品理论片色戒| 日韩欧美国产系列| 日韩欧美一级二级三级久久久| 欧美一区二区三区日韩视频| 777xxx欧美| 91精品国产91久久久久久最新毛片 | 亚洲女女做受ⅹxx高潮| 亚洲视频在线一区观看| 国产亚洲一区字幕| 国产亚洲一区二区在线观看| 久久婷婷成人综合色| 国产亚洲综合色| 国产精品亲子伦对白| 欧美国产一区视频在线观看| 欧美韩国日本不卡| 亚洲婷婷综合久久一本伊一区 | 亚洲香肠在线观看| 丝袜美腿亚洲色图| 麻豆精品在线观看| 九九**精品视频免费播放| 狠狠色狠狠色综合| 成人精品国产福利| 99re成人精品视频| 91精品福利在线| 日韩午夜激情av| 精品国产麻豆免费人成网站| 久久久久久99精品| 亚洲美女淫视频| 青青草国产成人av片免费| 精品一区二区三区免费视频| 国产麻豆成人传媒免费观看| 国产91在线观看| 欧洲激情一区二区| 日韩精品中文字幕一区二区三区| 久久精品夜色噜噜亚洲a∨| 中文字幕一区av| 人人超碰91尤物精品国产| 国产一区二区三区四区在线观看| 成人高清视频免费观看| 欧美日韩在线播放三区四区| 日韩欧美电影一二三| 国产精品素人一区二区| 亚洲午夜电影网| 国产精品中文字幕一区二区三区| 91丝袜美女网| 欧美大片一区二区| 自拍偷拍欧美激情| 青娱乐精品视频在线| 成人激情图片网| 欧美一区二区三区四区五区| 国产精品毛片大码女人| 亚洲成a天堂v人片| 成人免费视频一区| 91精品国产综合久久小美女| 国产精品嫩草99a| 日韩高清一区在线| 色噜噜狠狠成人网p站| 国产亚洲成aⅴ人片在线观看 | 久久婷婷国产综合精品青草| 亚洲乱码日产精品bd| 美女网站色91| 在线精品视频一区二区三四| 精品av久久707| 亚洲永久精品大片| 成人免费毛片aaaaa**| 日韩一级免费观看| 亚洲综合区在线| 成人午夜在线免费| 精品久久久久99| 午夜精品福利视频网站| www.激情成人| 久久蜜桃av一区精品变态类天堂| 日韩国产欧美三级| 欧美性大战久久久久久久| 欧美激情一二三区| 精品写真视频在线观看| 在线不卡免费av| 亚洲人妖av一区二区| 国产一区二区在线影院| 欧美一区二区三区人| 亚洲自拍偷拍麻豆| 色婷婷国产精品| 国产精品久久久久久一区二区三区| 精品一区二区三区视频| 日韩欧美一区二区视频| 天堂蜜桃91精品| 欧美情侣在线播放| 亚洲妇熟xx妇色黄| 色婷婷av一区二区三区gif| 亚洲国产精品v| 国产精品99久久久久久似苏梦涵 | 色激情天天射综合网| 亚洲视频一二三| 成人中文字幕合集| 中文字幕乱码日本亚洲一区二区 | 7777精品伊人久久久大香线蕉超级流畅 | 亚洲伦理在线免费看| 91麻豆文化传媒在线观看| 国产精品久久久久久久久晋中| 国产丶欧美丶日本不卡视频| www国产亚洲精品久久麻豆| 捆绑调教美女网站视频一区| 69av一区二区三区| 日韩精品乱码免费| 欧美一区二区在线看| 日本不卡一区二区三区高清视频| 91精品国产综合久久小美女| 奇米精品一区二区三区在线观看| 69堂国产成人免费视频| 免费看欧美女人艹b| 精品理论电影在线观看| 国产在线观看免费一区| 久久九九99视频| 成人av电影观看| 亚洲欧美在线高清| 欧美性感一区二区三区| 亚洲va在线va天堂| 日韩欧美一区二区三区在线| 国产乱色国产精品免费视频| 国产精品网友自拍| av中文字幕在线不卡| 一区二区三区中文在线| 51精品国自产在线| 国产露脸91国语对白| 国产精品久久久久久久久免费桃花| 91美女精品福利| 日韩福利视频网| 中文字幕精品一区| 色狠狠色噜噜噜综合网| 秋霞av亚洲一区二区三| 国产亚洲人成网站| 色综合天天综合色综合av| 五月天激情综合网| 久久久久久久久久久电影| 91蜜桃网址入口| 奇米影视在线99精品| 国产亚洲一区二区在线观看| 在线观看成人小视频| 久久99热国产| 国产精品久线在线观看| 欧美日韩精品福利| 高清不卡在线观看| 香蕉成人啪国产精品视频综合网| 久久久久久久国产精品影院| 色婷婷久久一区二区三区麻豆| 蜜桃一区二区三区在线观看| 国产精品理论在线观看| 欧美一区二区人人喊爽| 成人免费黄色大片| 青娱乐精品视频| 亚洲欧美激情插| 精品久久久久久最新网址| 91视频免费观看| 韩国一区二区视频| 亚洲一区二区三区中文字幕| 久久九九全国免费| 欧美一区午夜精品| 91麻豆视频网站| 国产乱码精品一区二区三区忘忧草 | 亚洲va欧美va人人爽| 国产精品拍天天在线| 欧美变态tickling挠脚心| 在线中文字幕不卡| 成人午夜看片网址| 蜜桃视频在线观看一区| 亚洲成在线观看| 一区二区三区四区高清精品免费观看|