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

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

?? ixp425pciconfiglib.c

?? ixp425 bsp for vxworks
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* ixp425PciConfigLib.c - PCI Configuration driver for the IXP425 *//* Copyright 2002 Wind River Systems, Inc. *//*modification history--------------------01a,05jun02,jb  initial version...*//*DESCRIPTIONThis module provides services to enable the generation of configuration cycles on the PCI bus. PCI device drivers will use this code to configure and manage the devices they control. The standard configuration routines are pciConfigInxxx and pciConfigOutxxx. In addition to these we have provided routines for generating IO reads and writes and memory reads and writes.In order for the functionality defined herein to be available, INCLUDE_PCI must be defined in config.h.SH INITIALIZATIONThe function sysPciInit() should be called fromsysHwInit() to initialize the PCI unit on the IXP425.The function sysPciAssignAddrs() should be called from sysHwInit() after the call to sysPciInit to initialise devices on the PCI bus.INCLUDE FILES:ixp425Pci.h ixp425Pci_p.hSEE ALSO:.I "PCI Local Bus Specification, Revision 2.2, December 18, 1998"ixp425Pci.c*/#include "vxWorks.h"#include "config.h" #include "ixp425Pci.h"#include "ixp425Pci_p.h"extern STATUS pciLibInitStatus;       /******************************************************************************** pciDeviceExists - checks whether a device is present** This function checks the specified bus, device and function number* to verify whether a device is actually present on the PCI bus at that* location** RETURNS: TRUE if a device is found, FALSE otherwise*/BOOL pciDeviceExists (UINT32 busNo,		 UINT32 deviceNo,		 UINT32 funcNo){    UINT32 vendorId;    UINT32 regval;    UINT32 key;    /*we need to lock interrupts here because if we do not, the PCC internal ISR      (if enabled) will be invoked in the event that we try to read from a non-existent       device, the ISR will clear the PFE indicator before we get to read it.*/    key=intLock();    pciConfigInLong (busNo, deviceNo, funcNo, PCI_CFG_VENDOR_ID, &vendorId);    /* There are two ways to find out an empty device.     *   1. check Master Abort bit after the access.     *   2. check whether the vendor id read back is 0x0.     */    REG_READ (PCI_CSR_BASE, PCI_ISR_OFFSET, regval);    if ( (vendorId != 0x0) && ((regval & PCI_ISR_PFE)==0))    {	intUnlock(key);	return TRUE;    }    /*no device present, make sure that the master abort bit is reset*/        REG_WRITE (PCI_CSR_BASE, PCI_ISR_OFFSET,  PCI_ISR_PFE );    intUnlock(key);    return FALSE;}/******************************************************************************** pciInfoGet - Retrieves PCI device information** This function retrieves the PCI assignments of the specified device. * It returns a pointer to a PciDevice structure.** RETURNS: Pointer to PCI device information, or NULL*/PciDevice *pciInfoGet (UINT16 device){    if (device >= nDevices)    {	return (NULL);    }    return (&devices[device]);}/******************************************************************************** pciDeviceGet - Retrieves PCI device information** This function returns a pointer to the n'th instance of a specified device.* If the entry is not found, NULL is returned. Devices are numbered starting* at zero.** RETURNS: Pointer to PCI device information, or NULL*/PciDevice *pciDeviceGet (UINT32 vendor_id, 	      UINT32 device_id, 	      UINT32 count){    UINT32 ix;    UINT32 cnt = 0;        for (ix = 0; ix < IXP425_PCI_MAX_FUNC_ON_BUS; ix++)    {        if (devices[ix].vendor_id == vendor_id &&	     devices[ix].device_id == device_id)	{            if (cnt == count)	    {		return (&devices[ix]);	    }            else	    {	                cnt++;	    }	}    }        return ((PciDevice *)NULL);}/********************************************************************************* pciFindDevice - find the nth device with the given device & vendor ID** This routine finds the nth device with the given device & vendor ID.** RETURNS:* OK, or ERROR if the deviceId and vendorId didn't match.**/STATUS pciFindDevice (UINT32 vendorId, 	       UINT32 deviceId, 	       UINT32 index, 	       UINT32 * pBusNo, 	       UINT32 * pDeviceNo,  	       UINT32 * pFuncNo){    UINT32 busNo;    UINT32 deviceNo;    UINT32 funcNo;    UINT32 devdidvid;    UINT32 didvid;    UINT32 cnt=0;        if (pciLibInitStatus != OK)		    {        return ERROR;    }        didvid = ((deviceId << 16 ) & IXP425_PCI_TOP_WORD_OF_LONG_MASK) | 	(vendorId & IXP425_PCI_BOTTOM_WORD_OF_LONG_MASK);    for (busNo = 0; busNo < IXP425_PCI_MAX_BUS; busNo++)    {	for (deviceNo = 0; deviceNo < IXP425_PCI_MAX_DEV; deviceNo++)	{	    for (funcNo = 0; funcNo < IXP425_PCI_MAX_FUNC; funcNo++)	    {						pciConfigInLong (busNo, deviceNo, funcNo, PCI_CFG_VENDOR_ID,				 &devdidvid);		if (devdidvid == didvid)		{		    if (cnt == index)		    {			*pBusNo	= busNo;			*pDeviceNo = deviceNo;			*pFuncNo   = funcNo;			return OK;		    }		    else		    {			cnt++;		    }		}		    			    }	}    }    return ERROR;}/********************************************************************************* pciFindClass - find the nth occurence of a device by PCI class code.** This routine finds the nth device with the given 24-bit PCI class code** RETURNS:* OK, or ERROR if the class didn't match.**/STATUS pciFindClass (UINT32 classCode, 	      UINT32 index,     	      UINT32 *pBusNo,   	      UINT32 *pDeviceNo,	      UINT32 *pFuncNo)  {    UINT32 busNo;    UINT32 deviceNo;    UINT32 funcNo;    UINT32 classCodeReg;      UINT32 cnt=0;    if (pciLibInitStatus != OK)    {	return ERROR;    }        for (busNo = 0; busNo < IXP425_PCI_MAX_BUS; busNo++)    {        for (deviceNo = 0; deviceNo < IXP425_PCI_MAX_DEV; deviceNo++)	{            for (funcNo = 0; funcNo < IXP425_PCI_MAX_FUNC; funcNo++)	    {				pciConfigInLong (busNo, deviceNo, funcNo, PCI_CFG_REVISION,				 &classCodeReg);				if ((((classCodeReg >> 8) & IXP425_PCI_BOTTOM_TRIBYTES_OF_LONG_MASK) == classCode))		{		    if (cnt == index)		    {			*pBusNo	= busNo;			*pDeviceNo	= deviceNo;			*pFuncNo	= funcNo;			return OK;		    }		    else		    {			cnt++;		    }		}	    	    }	}    }    return ERROR;}/* All PCI non-prefetch (single data phase) reads and writes go *  through the following access functions.*/LOCAL void nonPrefetchRead (UINT32 addr, 		 UINT32 cmd, 		 UINT32 *data){    UINT32 key;      key = intLock ();				/* mutual exclusion start */        REG_WRITE (PCI_CSR_BASE, PCI_NP_AD_OFFSET, addr);        /*set up and execute the read*/        REG_WRITE (PCI_CSR_BASE, PCI_NP_CBE_OFFSET, cmd);    /*The result of the read is now in np_rdata*/    REG_READ (PCI_CSR_BASE, PCI_NP_RDATA_OFFSET, *data);     intUnlock (key);				/* mutual exclusion stop */    return;}LOCAL void nonPrefetchWrite (UINT32 addr, 		  UINT32 cmd, 		  UINT32 data){    UINT32 key;    key = intLock ();				/* mutual exclusion start */        REG_WRITE (PCI_CSR_BASE, PCI_NP_AD_OFFSET, addr);    /*set up the write*/    REG_WRITE (PCI_CSR_BASE, PCI_NP_CBE_OFFSET, cmd);    /*Execute the write by writing to NP_WDATA*/    REG_WRITE (PCI_CSR_BASE, PCI_NP_WDATA_OFFSET, data);        intUnlock (key);				/* mutual exclusion stop */    return;}/********************************************************************************* pciConfigInByte - read one byte from the PCI configuration space** This routine reads one byte from the PCI configuration space** RETURNS:* OK, or ERROR if this library is not initialized.**/STATUS pciConfigInByte (UINT32 busNo,    /* bus number */		 UINT32 deviceNo, /* device number */		 UINT32 funcNo,   /* function number */		 UINT32 offset,   /* offset into the configuration space */		 UINT8 * pData)   /* data read from the offset */    {    UINT32 retval;    UINT32 n;    UINT32 byteEnables;    UINT32 addr;        if (pciLibInitStatus != OK)    {        return (ERROR);    }        n = offset % 4;        /*byte enables are 4 bits, active low, the position of each      bit maps to the byte that it enables*/    byteEnables = (~BIT (n)) & IXP425_PCI_BOTTOM_NIBBLE_OF_LONG_MASK;     byteEnables = byteEnables << PCI_NP_CBE_BESL;        /*address bits 31:28 specify the device, 10:8 specify the function*/        /*Set the address to be read*/    addr = BIT ((31 - deviceNo)) | (funcNo << PCI_NP_AD_FUNCSL) | (offset & ~3);    nonPrefetchRead (addr, byteEnables | NP_CMD_CONFIGREAD, &retval);    /*Pick out the byte we are interested in*/    *pData = (retval >> (8*n));           return (OK);}/********************************************************************************* pciConfigInWord - read one word from the PCI configuration space** This routine reads one word from the PCI configuration space** RETURNS:* OK, or ERROR if this library is not initialized.**/STATUS pciConfigInWord (UINT32 busNo,    /* bus number */		 UINT32 deviceNo, /* device number */		 UINT32 funcNo,   /* function number */		 UINT32 offset,   /* offset into configuration space */		 UINT16 *pData)	  /* data read from the offset */    {    UINT32 n;    UINT32 retval;    UINT32 addr;    UINT32 byteEnables;    if (pciLibInitStatus != OK)    {	return (ERROR);    }    n = offset % 4;    /*byte enables are 4 bits active low, the position of each      bit maps to the byte that it enables*/    byteEnables = (~(BIT (n) | BIT ((n+1)))) & IXP425_PCI_BOTTOM_NIBBLE_OF_LONG_MASK;     byteEnables = byteEnables << PCI_NP_CBE_BESL;    /*address bits 31:28 specify the device 10:8 specify the function*/    /*Set the address to be read*/    addr = BIT ((31 - deviceNo)) | (funcNo << PCI_NP_AD_FUNCSL) |  (offset & ~3);    nonPrefetchRead (addr, byteEnables | NP_CMD_CONFIGREAD, &retval);        /*Pick out the word we are interested in*/    *pData = (retval >> (8*n));            return (OK);}/********************************************************************************* pciConfigInLong - read one longword from the PCI configuration space** This routine reads one longword from the PCI configuration space** RETURNS:* OK, or ERROR if this library is not initialized.**/STATUS pciConfigInLong (UINT32 busNo,    /* bus number */		 UINT32 deviceNo, /* device number */		 UINT32 funcNo,   /* function number */		 UINT32 offset,   /* offset into configuration space */		 UINT32 *pData)   /* data read from the offset */    {    UINT32 retval;    UINT32 addr;    if (pciLibInitStatus != OK)	    {        return (ERROR);    }    /*address bits 31:28 specify the device 10:8 specify the function*/    /*Set the address to be read*/    addr = BIT ((31 - deviceNo)) | (funcNo << PCI_NP_AD_FUNCSL) |  (offset & ~3);    nonPrefetchRead (addr, NP_CMD_CONFIGREAD, &retval);    *pData = retval;    return (OK);}/********************************************************************************* pciConfigOutByte - write one byte to the PCI configuration space** This routine writes one byte to the PCI configuration space.** RETURNS:* OK, or ERROR if this library is not initialized.**/STATUS pciConfigOutByte (UINT32 busNo,    /* bus number */		  UINT32 deviceNo, /* device number */		  UINT32 funcNo,   /* function number */		  UINT32 offset,   /* offset into configuration space */		  UINT8 data)      /* data written to the offset */    {    UINT32 addr;    UINT32 byteEnables;    UINT32 n;    UINT32 ldata;        if (pciLibInitStatus != OK)    {        return (ERROR);    }    n = offset % 4;    /*byte enables are 4 bits active low, the position of each      bit maps to the byte that it enables*/    byteEnables = (~BIT (n)) & IXP425_PCI_BOTTOM_NIBBLE_OF_LONG_MASK;     byteEnables = byteEnables << PCI_NP_CBE_BESL;    ldata = data << (8*n);    /*address bits 31:28 specify the device 10:8 specify the function*/    /*Set the address to be written*/    addr = BIT ((31 - deviceNo)) | (funcNo << PCI_NP_AD_FUNCSL) |  (offset & ~3);    nonPrefetchWrite (addr, byteEnables | NP_CMD_CONFIGWRITE, ldata );            return (OK);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产成人国产三级| 亚洲视频你懂的| 在线播放中文字幕一区| 欧美性欧美巨大黑白大战| 在线一区二区视频| 欧美日韩国产美女| 欧美一区二区在线不卡| 67194成人在线观看| 日韩视频免费观看高清在线视频| 欧美一激情一区二区三区| 日韩美一区二区三区| 日韩精品一区二区三区swag | 亚洲日本在线a| 亚洲天堂精品视频| 亚洲电影中文字幕在线观看| 丝袜美腿成人在线| 久久99深爱久久99精品| 粉嫩av一区二区三区| 在线观看亚洲精品| 日韩精品在线一区二区| 国产精品入口麻豆原神| 亚洲成av人片观看| 国产一区二区三区久久久| 91同城在线观看| 欧美精品777| 国产视频亚洲色图| 一区二区三区四区视频精品免费 | 精品亚洲成av人在线观看| 国产乱码精品1区2区3区| 91在线码无精品| 日韩你懂的电影在线观看| 国产精品久久久一本精品| 日韩精品91亚洲二区在线观看| 国产精品一品二品| 欧美体内she精视频| 久久日韩精品一区二区五区| 亚洲欧美日韩国产综合| 久久国产精品第一页| 色噜噜狠狠成人中文综合| 精品国产不卡一区二区三区| 亚洲午夜羞羞片| 高清国产一区二区| 3atv在线一区二区三区| 亚洲三级久久久| 色欧美乱欧美15图片| 欧美成人欧美edvon| 曰韩精品一区二区| 国产精品一区二区三区99| 欧美久久婷婷综合色| 亚洲视频在线一区| 国产成人三级在线观看| 日韩欧美国产系列| 日本一区中文字幕| 91福利视频久久久久| 国产精品免费久久久久| 国产真实乱对白精彩久久| 欧美精品日韩一本| 亚洲大片在线观看| 欧美影片第一页| 一区二区三区在线视频免费观看| 成人免费视频国产在线观看| 精品久久一二三区| 久久99精品久久久久久国产越南 | 精品亚洲成a人在线观看| 欧美精品色综合| 一区二区三区成人| 日本道色综合久久| 亚洲天堂久久久久久久| av在线不卡免费看| 国产精品高潮呻吟| av不卡免费在线观看| 国产精品色哟哟网站| www.激情成人| 亚洲精品第1页| 欧美亚日韩国产aⅴ精品中极品| 亚洲欧美日韩小说| 欧美性受xxxx| 日韩国产在线观看一区| 欧美一区国产二区| 激情五月婷婷综合网| 久久综合国产精品| 成人免费观看av| 亚洲男人的天堂在线观看| 一本一道久久a久久精品综合蜜臀| 日韩毛片一二三区| 欧美在线制服丝袜| 秋霞午夜鲁丝一区二区老狼| 日韩一区二区三区电影 | 欧美三级视频在线播放| 午夜精品免费在线观看| 欧美一区二区三区白人| 国产精品 欧美精品| 亚洲丝袜自拍清纯另类| 欧美日本一道本在线视频| 蜜芽一区二区三区| 日本一区二区久久| 欧美日韩一卡二卡| 捆绑调教美女网站视频一区| 国产精品美女一区二区| 欧美色图第一页| 免费在线欧美视频| 日本一区二区三区在线观看| 欧美亚洲日本国产| 久色婷婷小香蕉久久| 日韩理论片一区二区| 欧美高清一级片在线| 国产.精品.日韩.另类.中文.在线.播放| 国产精品毛片久久久久久| 欧美人狂配大交3d怪物一区| 国产精品一二三四五| 亚洲成人一区二区在线观看| 日本一区二区三区国色天香 | 精品一区二区三区免费观看| 日本欧美大码aⅴ在线播放| 欧美国产日韩a欧美在线观看| 欧美日本不卡视频| 91网站视频在线观看| 激情欧美一区二区| 一区二区三区蜜桃网| 国产精品无遮挡| 日韩一区二区三区免费观看| 在线亚洲免费视频| 风间由美一区二区三区在线观看 | 91色|porny| 韩国毛片一区二区三区| 视频在线观看一区二区三区| 国产精品女主播在线观看| 日韩免费一区二区| 欧美日韩国产影片| 色狠狠桃花综合| 懂色av一区二区三区免费观看| 日韩精品欧美成人高清一区二区| 一区在线观看视频| 久久亚洲一级片| 日韩免费福利电影在线观看| 欧美久久久久久蜜桃| 欧美在线一区二区三区| 色综合久久久久| 99免费精品在线观看| 成人激情文学综合网| 国产福利一区二区| 国产成人精品网址| 国产精品一区二区三区乱码 | 亚洲综合在线观看视频| 国产精品国产三级国产普通话99| 久久久久久综合| 久久久蜜臀国产一区二区| 26uuu亚洲| 国产日韩欧美高清在线| 久久久久久9999| 国产拍揄自揄精品视频麻豆| 久久久精品国产免大香伊| 国产色91在线| 久久久精品影视| 国产精品免费视频网站| 亚洲视频在线观看三级| 一区二区高清在线| 五月天视频一区| 久久99精品久久久| 国产乱人伦偷精品视频免下载| 国产一区二区精品在线观看| 国产一区二区精品久久99| 福利一区二区在线| 色呦呦日韩精品| 91精品午夜视频| 久久精品视频免费观看| 国产精品伦理一区二区| 怡红院av一区二区三区| 日韩中文字幕91| 国产电影一区二区三区| 色综合天天做天天爱| 欧美日韩三级一区| 日韩欧美一区二区久久婷婷| 久久精子c满五个校花| 亚洲摸摸操操av| 秋霞电影一区二区| 国产成人精品免费看| 欧洲精品中文字幕| 2014亚洲片线观看视频免费| 亚洲女厕所小便bbb| 麻豆精品视频在线观看| 成人黄色av电影| 884aa四虎影成人精品一区| 国产女人水真多18毛片18精品视频| 一区二区三区在线观看网站| 国产在线精品一区二区不卡了 | 色综合av在线| 精品国产欧美一区二区| 国产尤物一区二区| 一本色道久久综合亚洲aⅴ蜜桃| 欧美一区二区成人6969| 成人欧美一区二区三区白人| 免费一级欧美片在线观看| 99久久精品国产观看| 日韩精品中文字幕在线不卡尤物| 亚洲欧美一区二区三区国产精品| 激情五月播播久久久精品| 欧美三级资源在线| 中文字幕日本不卡| 国产一区不卡在线|