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

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

?? if_bp.c

?? IXP425的BSP代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
    u_char 	bs_ivec;#endif	/* UNIX */    } BP_SOFTC;#ifdef	UNIXextern struct mb_driver bpdriver;struct mb_device *bpinfo[NBP];LOCAL BP_SOFTC bp_softc [NBP];#define	BP_SOFTC_P	&bp_softc#define	dbgprintf	printf#define	sysProcNumGet()	(bp_procnum)FUNCPTR bpProbeType;LOCAL char *cpudesc_vaddr [MAXCPU];#else	/* UNIX *//* bpPollTask parameters */int bpPollTaskId;int bpPollTaskOptions	= VX_SUPERVISOR_MODE | VX_UNBREAKABLE;int bpPollTaskStackSize	= 2000;int bpPollTaskPriority	= 250;LOCAL BP_SOFTC *bp_softc[NBP];#define	BP_SOFTC_P	bp_softc#define	dbgprintf	logMsgint bpProbeType;#endif	/* UNIX */LOCAL  BOOL vxTasac ();/* * the default TAS, use undef if you dont like it */#define TAS(x) 	(bpTasOK ? sysBusTas (x) : vxTasac (x))#if     (CPU_FAMILY==MIPS)#define TAS_CLEAR(x)    (bpTasOK ? sysBusClearTas (&(x)) : ((x)=0))#endif  /* CPU_FAMILY==MIPS */#if 	CPU_FAMILY==SPARCIMPORT BOOL vxTas ();IMPORT BOOL sysBusTas ();FUNCPTR         bpTasRtn = vxTasac;  /* Test-and-Set Routine */#undef TAS(x)#define TAS(x)  (*bpTasRtn)(x)/********************************************************************************* bpTas - determine backplane test-and-set macro TAS(x)** NOMANUAL*/void bpTas (bp_tas, bp_off_board, bp_target)    BOOL bp_tas;	/* BP_TAS */    BOOL bp_off_board;	/* BP_OFF_BOARD */    int  bp_target;	/* target id */    {    if (!bp_tas)      bpTasRtn = vxTasac;       /* software TAS */    else	{	/* hardware TAS */	if (bp_target == 0x1E)	    {	    /* Sun-1E */	    if (bp_off_board)		bpTasRtn = vxTas;	    else		bpTasRtn = sysBusTas;	    }	else	    {	    if (bp_off_board)		bpTasRtn = sysBusTas;	    else		bpTasRtn = vxTas;	    }	}    }#endif	/* CPU_FAMILY==SPARC */#ifdef	UNIX#define intLock		spl7#define intUnlock	splx#endif	/* UNIX */#define	DELAY_COUNT	5000	/* how high to count when waiting on TAS */#ifdef	UNIXIMPORT int bpParity;IMPORT int bpDebug;	/* flags: 1-usage, 2-dropped packets */#else	/* UNIX */int bpParity = FALSE;int bpDebug;		/* flags: 1-usage, 2-dropped packets */#endif	/* UNIX */#define	DEBUG_OPTION_1	(bpDebug & 0x1)#define	DEBUG_OPTION_2	(bpDebug & 0x2)#define	DEBUG_OPTION_3	(bpDebug & 0x4)#define	DEBUG_OPTION_4	(bpDebug & 0x8)#define DEBUG_OPTION_5	(bpDebug & 0x10)			/*  0, 0, 0, 0, unit, host */u_char bpEnetAdrs [6]	= { 0, 0, 0, 0, 0, 0 };/* local variables */LOCAL BOOL bpTasOK;		/* whether hardward can do test-and-set */LOCAL int bpHeartbeatRate;int bpBitBucket;		/* spare change *//* forward declarations */void bpPollTask ();void bpintr ();/* forward static functions */static void bpReset (int unit);static STATUS bpAlive (BP_SOFTC *bs);static STATUS bpIfInit (int unit);static void bpReadAll (int unit);static STATUS bpRead (BP_SOFTC *bs, BUF_NODE *pBufNode, BUF_NODE		*pBufNodeOrig);#if defined BSD43_DRIVER || defined (UNIX)static void bpStart (int unit);static int bpOutput (struct ifnet *ifp, struct mbuf *m0, struct sockaddr		*dst);#elsestatic void bpStart (BP_SOFTC * 	bs);#endifstatic STATUS bpPut (BP_SOFTC *bs, struct mbuf *m);static void bpXmit (BP_SOFTC *bs, BUF_NODE *pBufNode, int destProcNum, int		srcProcNum);static void bpIntAck (BP_SOFTC *bs);static STATUS bpConnect (BP_SOFTC *bs, int unit);static STATUS bpIntEnable (BP_SOFTC *bs);static void bpIntGen (CPU_DESC *pCpu, int srcProcNum);static void bpHeartbeat (BP_ANCHOR *pAnchor);static int bpSizeMem (caddr_t memAdrs, int memSize);static int bpIoctl (struct ifnet *ifp, int cmd, caddr_t data);static void ringinit (RING *rp, short size);#if CPU==R3000static int ringput ();static int ringget ();#elsestatic int ringput (RING *rp, int v);static int ringget (RING *rp);#endifstatic int ringcount (RING *pRing);static BOOL vxTasac (char *address);#ifdef	UNIXLOCAL void	bpRead ();#else	/* UNIX */LOCAL STATUS	bpRead ();#endif	/* UNIX */#ifdef	UNIX/********************************************************************************* bpattach - attach the `bp' interface to the network** Make the `bp' interface available by filling in the network interface record.* The system will initialize the interface when it is ready to accept packets.** RETURNS: N/A** NOMANUAL*/void bpattach (md)    struct mb_device *md;    {    int unit          = md->md_unit;    FAST BP_SOFTC *bs = BP_SOFTC_P [unit];    struct ifnet *ifp = &bs->bs_if;    bs->bs_procNum = bp_procnum;    bs->bs_intType = bp_int_type;    bs->bs_intArg1 = bp_int_arg1;    bs->bs_intArg2 = bp_int_arg2;    bs->bs_intArg3 = bp_int_arg3;    bs->bs_addr = md->md_addr;    bs->bs_ivec = md->md_intr->v_vec;    ether_attach (ifp, unit, "bp", bpIfInit, bpIoctl, bpOutput,                  (FUNCPTR)bpReset);    ifp->if_mtu = bp_mtu;    bzero ((char*) cpudesc_vaddr, sizeof (cpudesc_vaddr));    }/********************************************************************************* bpPoke - map in physical memory and write value to address** This routine is used to map in CPU boards' mailboxes.* An array up to MAXCPU is kept so that a mailbox is* only mapped in once per CPU.*/LOCAL void bpPoke (addr, type, value, cpuNum)    char *addr;		/* physical address */    int type;		/* mailbox size + read/write */    int value;		/* value to write */    int cpuNum;		/* which CPU */    {    char *vaddr;		/* virtual address */    int kmx;			/* kernel map index */    int numClicks;    /* int numBytes; */    int addrOffset;    if (cpuNum < 0 && cpuNum > MAXCPU)	{	printf ("bp: bpPoke invalid cpu #%d\n", cpuNum);	return;	}    if ((vaddr = cpudesc_vaddr [cpuNum]) == 0)	{	numClicks = btoc (sizeof (int));	/* numBytes = ctob (numClicks); */	addrOffset = (int)(addr - ptob (btop (addr)));	/* get some virtual address space */	if ((kmx = rmalloc (kernelmap, numClicks)) == 0)	    {	    printf ("bp: no kernelmap for bp mailbox\n");	    panic ("bpPoke");	    }	vaddr = (char *)kmxtob (kmx);	mapin (&Usrptmap [kmx], btop (vaddr), btop (addr) | PGT_VME_D16,		numClicks, PG_V | PG_KW);	cpudesc_vaddr [cpuNum] = vaddr += addrOffset;	if (DEBUG_OPTION_1)	    printf ("\nbp: cpu #%d mailbox addr = 0x%x, vaddr = 0x%x\n",		    cpuNum, (int)addr, (int)vaddr);	}    switch (type)	{	case BP_INT_MAILBOX_1: *(char  *) vaddr = value; break;	case BP_INT_MAILBOX_2: *(short *) vaddr = value; break;	case BP_INT_MAILBOX_4: *(long  *) vaddr = value; break;	case BP_INT_MAILBOX_R1: value = *(char  *) vaddr; break;	case BP_INT_MAILBOX_R2: value = *(short *) vaddr; break;	case BP_INT_MAILBOX_R4: value = *(long  *) vaddr; break;	default: printf ("bp: bpPoke - bad mailbox type 0x%x\n", type); break;	}#ifdef	MAP_OUT    /* example of mapping out memory */    cpudesc_vaddr [cpuNum] = 0;    mapout (&Usrptmap [kmx], numClicks, kmx);    rmfree (kernelmap, numClicks, kmx);#endif	/* MAP_OUT */    }/********************************************************************************* bpProbe - probe for backplane memory** RETURNS:* The amount of memory available, or 0 if error.** NOMANUAL*/int bpProbe (addr, unit)    caddr_t addr;	/* address of backplane memory */    int unit;		/* device number */    {    int memSize = bp_mem_size;    FAST BP_SOFTC *bs = BP_SOFTC_P [unit];    extern int peek (), pokec ();    if (BP_MASTER)	bpProbeType = bpParity ? pokec : peek;    else	bpProbeType = peek;    if (DEBUG_OPTION_1)	printf ("bp%d: debugging on (level = 0x%x)\n", unit, bpDebug);    /* anchor is at the start of shared memory */    bs->bs_pAnchor = (BP_ANCHOR *) addr;    if ((*bpProbeType) (addr, 0) == -1)	{	printf ("bp%d: shared memory not present at 0x%x (0x%x)\n",		unit, (int)bs->bs_pAnchor,(int)vir2phys((char*)bs->bs_pAnchor));	return (0);	}    if (BP_MASTER &&	bpInit ((char*)bs->bs_pAnchor, addr, memSize, bp_tas) == ERROR)	{	printf ("bp%d: bpProbe cannot initialize anchor!\n", unit);	return (0);	}    if (DEBUG_OPTION_1)	printf ("bp%d: shared memory size is %d bytes, at 0x%x (0x%x)\n", unit,	     memSize,(int)bs->bs_pAnchor, (int)vir2phys((char*)bs->bs_pAnchor));    return (memSize);    }#else	/* UNIX *//********************************************************************************* bpattach - publish the `bp' network interface and initialize the driver and device** This routine attaches a `bp' interface to the network, if the* interface exists.  This routine makes the interface available by filling in* the network interface record.  The system will initialize the interface* when it is ready to accept packets.** RETURN: OK or ERROR.*/STATUS bpattach    (    int unit,           /* backplane unit number */    char *pAnchor,      /* bus pointer to bp anchor */    int procNum,        /* processor number in backplane */    int intType,        /* interrupt type: poll, bus, mailbox */    int intArg1,        /* as per interrupt type */    int intArg2,        /* as per interrupt type */    int intArg3         /* as per interrupt type */    )    {    FAST BP_SOFTC *bs;    FAST struct ifnet *ifp;    FAST BP_ANCHOR *pBpAnchor = (BP_ANCHOR *) pAnchor;    if (procNum == 0)	bpProbeType = bpParity ? O_WRONLY : O_RDONLY;    else	bpProbeType = O_RDONLY;    /* allocate bp_softc structure */    if ((bs = (BP_SOFTC *) malloc (sizeof (BP_SOFTC))) == NULL)	return (ERROR);    bp_softc [unit] = bs;	/* XXX check if non-zero for re-attach? */    ifp = &bs->bs_if;    /* initialize the interface structure */    bzero ((char *) bs, sizeof (BP_SOFTC));    bs->bs_pAnchor = pBpAnchor;    bs->bs_procNum = procNum;    bs->bs_intType = intType;    bs->bs_intArg1 = intArg1;    bs->bs_intArg2 = intArg2;    bs->bs_intArg3 = intArg3;    /* wait for shared memory to be initialized; master CPU does sanity check */    if (bpAlive (bs) == ERROR)	{	(void) free ((void *) bs);	return (ERROR);	}    if (bpDebug != 0)	{	printf ("bp%d: debugging on (level = 0x%x)\n", unit, bpDebug);	printf ("bpattach: anchor CPU can%s do real TAS.\n",		bpTasOK ? "" : "not");	}#ifdef BSD43_DRIVER    ether_attach (ifp, unit, "bp", bpIfInit, bpIoctl, bpOutput,                  (FUNCPTR)bpReset);#else    ether_attach (                 ifp,                 unit,                 "bp",                 (FUNCPTR) bpIfInit,                 (FUNCPTR) bpIoctl,                 (FUNCPTR) ether_output,                 (FUNCPTR) bpReset                 );    ifp->if_start = (FUNCPTR)bpStart;#endif    ifp->if_mtu = bp_mtu;    if (bpIfInit (unit) == ERROR)        {        (void) free ((void *) bs);        return (ERROR);        }    return (OK);    }#endif	/* UNIX *//********************************************************************************* bpInit - initialize the backplane anchor** This routine initializes the backplane anchor.  Typically, <pAnchor> and* <pMem> both point to the same block of shared memory.  If the first* processor is dual-porting its memory, then, by convention, the anchor is* at 0x600 (only 16 bytes are required) and the start of memory <pMem> is* dynamically allocated by using the value NONE (-1).  <memSize> should be at* least 64 Kbytes.  The <tasOK> parameter is provided for CPUs that do* not support the test-and-set instruction.  If the system includes any* test-and-set deficient CPUs, then all CPUs must use the software* "test-and-set".** RETURNS:* OK, or ERROR if data structures cannot be set up or memory is insufficient.*/STATUS bpInit    (    FAST char *pAnchor, /* backplane anchor address */    FAST char *pMem,    /* start of backplane shared memory, NONE = alloc */    int memSize,        /* no. bytes in bp shared memory, 0 = 0x100000 */    BOOL tasOK          /* TRUE = hardware can do test-and-set */    )    {    FAST BP_ANCHOR *pBpAnchor = (BP_ANCHOR *) pAnchor;    FAST RING *pFreeRing;    FAST int ix;    FAST char *pMemEnd;	/* end of backplane shared memory */    FAST CPU_DESC *pCpu;    FAST BP_HEADER *pHdr;    int npackets = 0;    memSize = (memSize == 0) ? 0x100000 : memSize;    bpTasOK = tasOK;    /* if bp header specified, probe it, otherwise malloc it */    if (pMem != (char *) NONE)	{	memSize = min (memSize, bpSizeMem (pMem, memSize));	if (memSize == 0)	    {	    printf ("bp: no shared memory at address 0x%x\n", (int)pMem);	    return (ERROR);	    }	/* if anchor is at start of shared region, skip over it */	if (pMem == pAnchor)	    {	    pMem    += sizeof (BP_ANCHOR);	    memSize -= sizeof (BP_ANCHOR);	    }	}    else	{#ifndef	UNIX#if	((CPU_FAMILY==MIPS) || (CPU_FAMILY==SH))	if ((pMem = (char *) cacheDmaMalloc ((unsigned) memSize)) == NULL)#else	/* CPU_FAMILY==MIPS || CPU_FAMILY==SH */        if ((pMem = (char *) malloc ((unsigned) memSize)) == NULL)#endif	/* CPU_FAMILY==MIPS || CPU_FAMILY==SH */#endif	/* UNIX */	    {	    printf ("bp: can't allocate shared memory\n");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品一区二区三区| av一区二区三区| 国产麻豆视频精品| 色综合久久久久网| 91精品国产美女浴室洗澡无遮挡| 国产欧美一区在线| 亚洲成精国产精品女| 懂色av一区二区夜夜嗨| 日韩亚洲欧美在线观看| 一区二区免费视频| 成人精品视频一区二区三区| 欧美电视剧在线看免费| 亚洲高清久久久| 91一区在线观看| 久久精品男人天堂av| 久久国产精品99精品国产| 在线视频一区二区免费| 最新日韩av在线| 成人天堂资源www在线| 欧美成人一区二区三区在线观看| 亚洲一级二级三级在线免费观看| 不卡一区二区三区四区| 337p粉嫩大胆噜噜噜噜噜91av| 五月婷婷另类国产| 在线欧美日韩精品| 一区二区三区在线影院| av中文字幕不卡| 亚洲国产高清aⅴ视频| 国产精品123| 国产偷v国产偷v亚洲高清| 麻豆一区二区三区| 日韩精品资源二区在线| 日韩黄色免费电影| 日本精品免费观看高清观看| 国产精品国产精品国产专区不蜜 | xvideos.蜜桃一区二区| 天天综合日日夜夜精品| 欧美男女性生活在线直播观看| 亚洲电影一级片| 欧美日韩一区在线| 天天综合天天做天天综合| 欧美制服丝袜第一页| 亚洲高清三级视频| 日韩一区二区在线看| 日韩av高清在线观看| 欧美三级蜜桃2在线观看| 亚洲成人精品在线观看| 欧美日韩国产综合草草| 午夜在线成人av| 欧美成人精品福利| 国产精品1区2区3区| 亚洲国产成人一区二区三区| av不卡免费电影| 一区二区三区欧美视频| 欧美日韩另类一区| 久久99国内精品| 欧美国产一区在线| 91成人免费在线| 奇米综合一区二区三区精品视频 | 国产欧美日韩精品a在线观看| 国产传媒久久文化传媒| 国产精品高潮呻吟| 欧美日韩在线观看一区二区| 石原莉奈一区二区三区在线观看| 日韩三区在线观看| 成人午夜免费视频| 一区二区三区四区av| 日韩视频在线你懂得| 国产suv精品一区二区三区| 亚洲激情自拍视频| 日韩欧美高清dvd碟片| 成人午夜视频在线| 日韩精品每日更新| 欧美国产丝袜视频| 欧美男人的天堂一二区| 国产成人无遮挡在线视频| 亚洲欧美欧美一区二区三区| 日韩欧美久久久| 色综合久久久久网| 激情小说亚洲一区| 亚洲一区二区3| 久久精品日产第一区二区三区高清版| 91在线码无精品| 另类综合日韩欧美亚洲| 亚洲天堂a在线| xf在线a精品一区二区视频网站| 91热门视频在线观看| 久久精品国产亚洲5555| 亚洲精品亚洲人成人网| 久久久久久亚洲综合| 欧美性三三影院| 91亚洲精品乱码久久久久久蜜桃| 日本欧美一区二区三区| 亚洲欧美另类久久久精品2019| 精品日韩欧美在线| 欧美美女激情18p| 色一情一乱一乱一91av| 风流少妇一区二区| 久久99九九99精品| 秋霞影院一区二区| 亚洲chinese男男1069| 中文字幕在线不卡视频| 久久久www成人免费毛片麻豆 | 91麻豆6部合集magnet| 国产一区二区三区四区五区美女| 视频一区中文字幕| 一区二区三区精品| 亚洲欧美偷拍另类a∨色屁股| 久久久久久一二三区| 亚洲精品一线二线三线无人区| 欧美亚洲一区二区在线观看| 99久久婷婷国产综合精品| 国产一区二区不卡在线 | 午夜精品久久久久久久久| 亚洲免费观看在线观看| 国产精品对白交换视频| 2024国产精品视频| 欧美精品一区二区在线观看| 日韩免费福利电影在线观看| 日韩欧美中文一区二区| 欧美一级片免费看| 日韩午夜激情av| 久久奇米777| 国产日韩高清在线| 中文一区在线播放| 亚洲欧洲三级电影| 一区二区成人在线| 午夜视黄欧洲亚洲| 激情欧美日韩一区二区| 国产成都精品91一区二区三| 成人国产精品免费| 日本久久一区二区三区| 欧美日韩国产一级片| 日韩亚洲欧美一区二区三区| 欧美成人vps| 中文字幕第一区| 日韩一区欧美小说| 亚洲成av人**亚洲成av**| 水野朝阳av一区二区三区| 蜜桃视频第一区免费观看| 国产麻豆精品在线| 99久久精品国产导航| 色av综合在线| 欧美一区二区视频在线观看2020| 精品国产一区二区三区久久影院| 久久精品视频在线看| 亚洲免费高清视频在线| 日韩精品成人一区二区在线| 久久成人免费网| 99re成人在线| 欧美日韩黄视频| 久久人人爽人人爽| 亚洲图片欧美综合| 国模套图日韩精品一区二区| 99精品久久99久久久久| 欧美精品久久久久久久多人混战| 久久亚洲精品小早川怜子| 亚洲日本护士毛茸茸| 日产国产欧美视频一区精品| 国产成人精品亚洲日本在线桃色 | 亚洲自拍偷拍网站| 久久超碰97人人做人人爱| 99国产精品一区| 欧美第一区第二区| 亚洲精品v日韩精品| 国产美女在线观看一区| 欧美日本在线看| 国产精品福利影院| 国产一区二区三区久久悠悠色av| 欧美制服丝袜第一页| 久久综合av免费| 偷窥少妇高潮呻吟av久久免费| 成人福利视频网站| 精品欧美一区二区在线观看| 亚洲国产日韩精品| 成人免费高清在线观看| 日韩一区二区电影网| 亚洲一本大道在线| 波多野结衣在线一区| 精品国产91洋老外米糕| 午夜电影久久久| 欧美网站大全在线观看| 国产精品天干天干在观线| 久久精品国产亚洲一区二区三区| 在线观看av一区二区| 一区在线观看视频| 国产精品亚洲午夜一区二区三区 | 日本在线不卡一区| 在线观看欧美日本| 亚洲人快播电影网| 国产91丝袜在线18| 久久久久久久一区| 狠狠色丁香久久婷婷综| 日韩欧美在线1卡| 青青草原综合久久大伊人精品优势| 欧美中文字幕一区二区三区 | 国内外精品视频| 日韩欧美一区二区免费| 视频一区欧美日韩| 欧美一区二区在线观看|