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

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

?? ixp425pciconfiglib.c

?? INTEL IXP425的VXWORKS BSP
?? 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;       extern void printfxu(char *ptr);extern void printpxu(char *nameptr, unsigned int value);/******************************************************************************** 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)	    {	    	printfxu("\r\n  Get a PCI device.");		printpxu("\r\n     The value of ix", ix);			printpxu("\r\n     Vendor ID of device", vendor_id);		printpxu("\r\n     Device ID of device", device_id);		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 ((16 + 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 ((16 + 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 ((16 + deviceNo)) | (funcNo << PCI_NP_AD_FUNCSL) |  (offset & ~3);					/*from 12 by alex */			    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 ((16 + deviceNo)) | (funcNo << PCI_NP_AD_FUNCSL) |  (offset & ~3);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费视频网站在线观看| 亚洲成人精品一区| 日韩三级精品电影久久久 | 欧美一区二区免费视频| 欧美日韩亚洲国产综合| 欧美影院精品一区| 欧美久久久久久久久中文字幕| 欧美精品第1页| 91精品国产美女浴室洗澡无遮挡| 日韩片之四级片| 久久新电视剧免费观看| 国产欧美日韩在线视频| 亚洲人成在线观看一区二区| 亚洲一区中文在线| 免费成人小视频| 丁香婷婷综合激情五月色| 成人免费av网站| 色欧美88888久久久久久影院| 欧美三级日韩三级国产三级| 欧美电影精品一区二区| 中文字幕免费不卡| 亚洲综合一二区| 免费成人在线影院| jizz一区二区| 日韩久久免费av| 日韩一区欧美一区| 日韩精品一级二级| 国产福利一区二区三区在线视频| 成+人+亚洲+综合天堂| 在线观看国产91| 久久免费电影网| 亚洲一区二区三区四区的| 捆绑变态av一区二区三区| 成人av电影在线播放| 3d动漫精品啪啪| 中文字幕亚洲一区二区va在线| 亚洲电影中文字幕在线观看| 国模无码大尺度一区二区三区| 日本伦理一区二区| 久久久精品天堂| 五月天久久比比资源色| 成人小视频在线| 日韩欧美一区中文| 亚洲欧美自拍偷拍| 国产东北露脸精品视频| 欧美日韩国产bt| 1024成人网| 国产精品一区一区三区| 7777女厕盗摄久久久| 欧美精品一区在线观看| 日韩av电影天堂| 91黄色在线观看| 日韩美女精品在线| 黄色精品一二区| 3atv一区二区三区| 亚洲国产精品一区二区久久 | 一区二区三区日韩在线观看| 精彩视频一区二区三区| 欧美一级一区二区| 日韩经典中文字幕一区| 欧美亚洲尤物久久| 亚洲精品日日夜夜| 91免费视频大全| 亚洲天堂精品在线观看| 国v精品久久久网| 国产欧美日韩麻豆91| 国产精品99久| 日本一区二区三区视频视频| 国产一区视频网站| 久久久久国产成人精品亚洲午夜| 久久99精品一区二区三区三区| 制服.丝袜.亚洲.中文.综合| 亚洲bt欧美bt精品| 51午夜精品国产| 日韩av电影免费观看高清完整版 | 欧美日韩精品欧美日韩精品 | 人人超碰91尤物精品国产| 欧美日韩一本到| 日韩av高清在线观看| 欧美一区二区美女| 另类小说欧美激情| 久久九九99视频| 国产成人高清视频| 亚洲欧洲99久久| 欧洲av在线精品| 色哟哟在线观看一区二区三区| 欧美一卡二卡在线| 麻豆成人免费电影| 国产女人aaa级久久久级| 丁香婷婷综合五月| 一区二区三区四区亚洲| 欧美精品一卡二卡| 国产乱码精品一区二区三区忘忧草| 色av综合在线| 亚洲二区在线观看| 日韩欧美在线123| 风间由美中文字幕在线看视频国产欧美| 精品国产乱码久久久久久夜甘婷婷| 久久成人免费网| 国产精品久久久久久久第一福利 | 亚洲国产色一区| 欧美一区二区三区视频免费播放| 久久成人免费网| 亚洲摸摸操操av| 欧美r级在线观看| 色综合天天天天做夜夜夜夜做| 亚洲国产人成综合网站| 亚洲精品一区二区三区影院| 色综合久久综合| 麻豆91小视频| 亚洲综合在线观看视频| 精品国产三级电影在线观看| 99久久精品免费看国产免费软件| 爽爽淫人综合网网站| 国产日韩欧美一区二区三区乱码| 欧美日韩和欧美的一区二区| 懂色av一区二区三区蜜臀| 丝瓜av网站精品一区二区| 国产精品黄色在线观看| 欧美日韩电影在线播放| 国产成人8x视频一区二区| 亚洲大片精品永久免费| ww久久中文字幕| 欧美午夜一区二区三区免费大片| 国产成人免费网站| 久久国产精品第一页| 国产精品福利在线播放| 精品三级在线观看| 欧美午夜电影在线播放| 99久久精品国产一区二区三区 | 国产欧美精品一区| 欧美高清视频一二三区 | 欧美一级爆毛片| 在线观看亚洲一区| 99久久综合精品| 国产suv精品一区二区883| 美女免费视频一区| 亚洲成人动漫一区| 一区二区三区色| 亚洲日本韩国一区| 亚洲视频在线一区二区| 国产欧美va欧美不卡在线| 精品福利在线导航| 欧美成人一区二区三区片免费 | 91免费版pro下载短视频| 久久国产精品一区二区| 美女久久久精品| 日本欧美肥老太交大片| 天天亚洲美女在线视频| 偷拍日韩校园综合在线| 性欧美疯狂xxxxbbbb| 亚洲综合免费观看高清完整版| 中文字幕在线一区二区三区| 欧美高清在线一区| 中文字幕的久久| 国产精品久久久久久久久久久免费看| 国产精品美女久久久久高潮| 国产精品国产三级国产普通话蜜臀 | 26uuu亚洲综合色欧美| 日韩欧美国产三级| www精品美女久久久tv| 久久久综合激的五月天| 国产日韩欧美精品一区| 国产精品久久久久久久久动漫| ...中文天堂在线一区| 亚洲精品国产精华液| 午夜精品久久久久久久久| 欧美a级理论片| 国产91丝袜在线观看| 91免费看片在线观看| 5858s免费视频成人| 欧美大白屁股肥臀xxxxxx| 久久久久久久av麻豆果冻| 国产精品久久久99| 亚洲gay无套男同| 国产一区二区三区在线观看精品| 成人黄页在线观看| 欧美性受xxxx| 精品国产乱子伦一区| 自拍av一区二区三区| 亚洲bt欧美bt精品| 国产成人av在线影院| 欧美日韩一区二区三区不卡| 日韩欧美国产精品| 亚洲免费观看高清完整| 九九热在线视频观看这里只有精品| 国产成人精品三级| 欧美日韩亚洲丝袜制服| 欧美激情一区二区三区不卡| 亚洲国产欧美在线| 成人免费看视频| 日韩一区二区三免费高清| 日本一区二区综合亚洲| 亚洲成a人v欧美综合天堂| 成人三级在线视频| 日韩一区二区三| 亚洲一区二区四区蜜桃| 国产电影精品久久禁18| 欧美日本在线视频| 亚洲精品视频在线|