亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产高清无密码一区二区三区| 免费av成人在线| 91麻豆精品国产91久久久久久| 国产成人av自拍| 石原莉奈在线亚洲二区| 国产精品视频线看| 精品国产3级a| 欧美日韩国产乱码电影| av色综合久久天堂av综合| 亚洲一区二区三区四区不卡| 久久一二三国产| 欧美精品日韩一本| 99久久精品免费看国产免费软件| 久久超碰97中文字幕| 亚洲第一激情av| 亚洲婷婷综合久久一本伊一区| 欧美va天堂va视频va在线| 色久综合一二码| 国产黄色成人av| 日韩电影一二三区| 亚洲一区影音先锋| 亚洲视频在线观看三级| 国产日本欧美一区二区| 日韩欧美综合在线| 91精品国产综合久久久久久久 | 成人免费一区二区三区视频| 久久久久久久一区| 欧美大片日本大片免费观看| 欧美高清视频不卡网| 91福利小视频| 91福利精品第一导航| 成人黄色在线网站| 成人精品视频一区二区三区| 国产91精品精华液一区二区三区| 久久爱另类一区二区小说| 另类人妖一区二区av| 另类欧美日韩国产在线| 免费成人美女在线观看| 欧美a级理论片| 日本亚洲视频在线| 人人精品人人爱| 蜜臀av性久久久久蜜臀aⅴ四虎 | 91精品国产高清一区二区三区蜜臀| 在线观看中文字幕不卡| 色成人在线视频| 在线观看日产精品| 欧美在线视频你懂得| 欧美岛国在线观看| 久久免费视频一区| 国产视频一区在线播放| 亚洲国产精品成人综合色在线婷婷| 精品久久人人做人人爽| 国产色产综合色产在线视频| 国产精品天天摸av网| 中文字幕制服丝袜成人av| 亚洲免费高清视频在线| 亚洲一区成人在线| 免费av网站大全久久| 国产一区二区三区在线观看精品| 高清国产午夜精品久久久久久| 成人av手机在线观看| 91激情在线视频| 日韩一区二区在线看片| 久久免费美女视频| 亚洲男人的天堂一区二区| 亚洲国产成人高清精品| 久久国产精品色| 成人av在线一区二区三区| 91论坛在线播放| 91精品久久久久久久99蜜桃| 精品国产乱码久久久久久夜甘婷婷| 久久久亚洲精品石原莉奈| 一区精品在线播放| 五月婷婷久久丁香| 风间由美性色一区二区三区| 93久久精品日日躁夜夜躁欧美| 欧美疯狂性受xxxxx喷水图片| 精品国产一区二区三区久久久蜜月| 中文av一区二区| 午夜精品爽啪视频| 成人一区二区三区中文字幕| 欧美午夜精品电影| 久久久影视传媒| 亚洲永久免费av| 国内精品伊人久久久久影院对白| 91视频在线观看免费| 91精品国产一区二区三区| 亚洲国产精品精华液2区45| 午夜欧美视频在线观看| 国产成人免费视频精品含羞草妖精| 在线视频国内一区二区| 久久久久久久久久久电影| 一区二区三区加勒比av| 国产精品综合二区| 欧美日韩亚洲综合在线| 中文字幕av一区二区三区免费看 | 国产不卡免费视频| 91精品国产色综合久久不卡蜜臀| 欧美国产激情二区三区| 日韩成人免费电影| 色综合网色综合| 国产调教视频一区| 免费的成人av| 欧日韩精品视频| 国产精品国产精品国产专区不蜜| 久久成人久久爱| 欧美一区二区在线观看| 亚洲精品日日夜夜| av午夜精品一区二区三区| 国产亚洲精品免费| 久久精品国产亚洲aⅴ| 欧美日韩一区三区| 亚洲男同性视频| 成人精品视频一区| 国产亚洲成av人在线观看导航| 青青草97国产精品免费观看 | 久久久亚洲精华液精华液精华液| 婷婷六月综合网| 91福利资源站| 亚洲精品日韩一| 91污片在线观看| 国产精品美女久久久久av爽李琼 | 日韩精品一区第一页| 91极品美女在线| 一区二区在线观看免费| 91麻豆精品视频| 中文字幕制服丝袜成人av| av亚洲精华国产精华| 亚洲欧洲美洲综合色网| 成人免费的视频| 国产欧美一区二区精品婷婷 | 亚洲午夜一区二区| 色av成人天堂桃色av| 亚洲欧美日韩人成在线播放| 99精品热视频| 亚洲视频免费观看| 色综合久久天天| 亚洲美女屁股眼交| 色94色欧美sute亚洲线路一ni| 亚洲裸体xxx| 欧美中文字幕不卡| 天天影视网天天综合色在线播放| 欧美色老头old∨ideo| 午夜一区二区三区在线观看| 欧美性生活久久| 蜜桃精品视频在线观看| 欧美成人激情免费网| 韩国av一区二区三区在线观看| 久久精品亚洲精品国产欧美| 国产超碰在线一区| 亚洲欧美区自拍先锋| 欧美中文一区二区三区| 日本欧美在线观看| 精品99一区二区| 丁香另类激情小说| 亚洲九九爱视频| 717成人午夜免费福利电影| 日本欧洲一区二区| 久久久久高清精品| 99国产精品国产精品毛片| 午夜欧美2019年伦理| 日韩亚洲电影在线| 成人午夜在线免费| 一区二区三区在线看| 91超碰这里只有精品国产| 看电影不卡的网站| 17c精品麻豆一区二区免费| 欧美午夜在线一二页| 裸体在线国模精品偷拍| 欧美激情综合五月色丁香| 91黄色免费网站| 另类综合日韩欧美亚洲| 亚洲国产精品精华液ab| 中文字幕成人网| 欧美三级电影网站| 国产中文字幕一区| 一区二区三区免费观看| 欧美xxxx在线观看| 色狠狠av一区二区三区| 麻豆免费看一区二区三区| 亚洲欧洲性图库| 日韩一区二区三区在线| 91美女在线视频| 久久不见久久见中文字幕免费| 亚洲色图第一区| 精品国产一区a| 欧美亚洲禁片免费| 丁香网亚洲国际| 日韩1区2区3区| 亚洲日本韩国一区| 2021国产精品久久精品| 欧美午夜在线观看| 成人免费视频视频在线观看免费| 丝袜诱惑亚洲看片| 成人欧美一区二区三区白人| 欧美不卡一二三| 欧美日韩大陆在线| 97精品电影院| 国产成人免费高清| 美日韩黄色大片|