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

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

?? dptarget.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/***  File:     dptarget.c**  Version:  1.0.1****  Description: Target-side driver functions for NR5xx****      Copyright (c) 1996 Applied Microsystems Corporation**                          All Rights Reserved****  Modification History:**       10/04/96, MPH...Created from nrdrive.c**       01/20/97, MPH...Fixed nr_ReadBuf and nr_ProcessMsgs for PPC603**       02/04/97, MS....fixed numerous compiler warnings*/#include "wdb/amc500/dpconfig.h"#include "wdb/amc500/dptarget.h"#include "wdb/amc500/dualport.h"/* Local definitions */#define DEBUG_ON False  /* Optional: Include nr_TestComm() if True */#ifndef	NULL#define NULL  0#endif/* Private routines */STATIC void   nr_WriteInt     ( uInt16, uInt32, uInt16 );STATIC uInt16 nr_ReadInt      ( uInt16, uInt32 );STATIC void   nr_WriteBuf     ( uInt16, uChar*, uInt32, uInt16 );STATIC void   nr_ReadBuf      ( uInt16, uInt32, volatile uChar*, Int16 );STATIC Int16  nr_ProcessMsgs  ( uInt16 );STATIC Int16  nr_PutOOBMsg    ( uInt16, uInt16, char*, uInt16 );STATIC void   nr_Wait         ( DpChannel* );STATIC void   nr_WaitEnd      ( void );   /* Global data */STATIC DpChannel channels[DP_MAXCHANNELS];STATIC volatile  uChar RR_dummy; /* See dptarget.h for explanation */STATIC volatile  uChar dummy;  STATIC uChar     wait_ftn_buf[MAX_WAIT_FTN_SIZE]; /* For RAM-based wait ftn */STATIC Int16     emoffonwrite_set;/***     Function:  nr_ReadByte**  Description:  Reads a byte from DP RAM**         Note:  With caching, we need to use a function**                Without caching, we can use a (faster) macro**      Warning:  Assumes 'cp' is valid****  Parameters:**    cp          pointer-to-channel to read from**    addr        address for read****  Returns:**     uChar from DP RAM*/#if( nr_HasCache == True )uChar nr_ReadByte(DpChannel *cp, uInt32 addr){  register uChar ch;  nr_DataCacheOff();  ch = NR_READ_BYTE( (cp), (addr) );  nr_DataCacheOn();  return ch;}#else /* nr_HasCache == True */#define nr_ReadByte(cp,addr) NR_READ_BYTE( (cp), (addr) )#endif /* nr_HasCache == True *//***     Function:  nr_WriteByte**  Description:  Writes a byte to DP RAM**         Note:  With caching, we need to use a function**                Without caching, we can use a (faster) macro**      Warning:  Assumes 'cp' is valid****  Parameters:**    cp          pointer-to-channel to write to**    addr        address for write****  Returns:**     note*/#if( nr_HasCache == True )voidnr_WriteByte(DpChannel *cp, uInt32 addr, uInt16 val){  nr_DataCacheOff();  NR_WRITE_BYTE( (cp), (addr), (val) );  nr_DataCacheOn();}#else /* nr_HasCache == True */#define nr_WriteByte\(cp, addr, val) { NR_WRITE_BYTE((cp), (uInt32)(addr), (uInt16)(val)); }#endif /* nr_HasCache == True *//***  Macro: nr_InROM**  Description: Determines if an address is w/in NR emulation RAM**  Note: ROMSTART and ROMEND are defined in dpconfig.h**  Evaluates to TRUE if address is within NetROM overlay, otherwise FALSE*/#define nr_InROM(adr) ((adr) >= (uInt32)ROMSTART && (adr) < (uInt32)ROMEND)/***  Function: nr_ConfigDP**  Description: Configure dualport RAM communication structures****  Parameters:**    base        First address of dualport RAM **    width       Width of ROM(s) emulated: 1-8 bits 2-16 bits 4-32 bits**    index       Location of pod0 within podgroup****  Returns:**   Err_BadLength   If MAX_WAIT_FTN_SIZE is too small to hold nr_Wait()**   Err_NoError     Otherwise*/Int16nr_ConfigDP( uInt32 base, Int16 width, Int16 index ){    DpChannel *cp;    Int16 chan;    uInt32 tmp, pWait, wait_ftn_size;     /* Calc size of nr_Wait for copy to RAM...will it fit? */    /* 'wait_ftn_size+3' because of 32bit align code, below */    wait_ftn_size = (uInt32)((uInt32)nr_WaitEnd - (uInt32)nr_Wait);    if( wait_ftn_size+3 > MAX_WAIT_FTN_SIZE )      return Err_BadLength;    if( wait_ftn_size < 10 )  /* Sanity check */      return Err_BadLength;    /* Copy nr_Wait routine to RAM */    pWait = (uInt32)wait_ftn_buf;    tmp = (uInt32) wait_ftn_buf & 0x03; /* force 32bit align */    if(tmp != 0)  pWait += (4 - tmp);    memcpy( (uChar*)pWait, (uChar*)nr_Wait, wait_ftn_size );    /* Load channel structs */    for( chan = 0; chan < DP_MAXCHANNELS; chan++ ) {      /* get a pointer to the channel */      cp = &channels[chan];      /* set the addresses for dualport ram */      cp->dpbase = base + chan * DP_CHAN_SIZE * width;      cp->dpbase_plus_index = cp->dpbase + index;  /* Time saver const */      cp->width = width;      cp->index = index;      /* rr_data_offset includes "index" to speed up RR_xxx macros */      /* For writes to Pods0-2, rr_data_offset will cause us to read */      /* from the next Pod.  For pod3, we'll read from pod0 area */      /* This is to avoid reading addresses that the hardware is */      /* latching for the RR protocol. */      if( 3 == chan ) {	cp->rr_enable  = base + index + RR_ENABLE_ADR  * width;	cp->rr_disable = base + index + RR_DISABLE_ADR * width;      }      else {	cp->rr_enable  =  cp->dpbase                        + index + RR_ENABLE_ADR  * width;	cp->rr_disable =  cp->dpbase + DP_CHAN_SIZE * width                       + index + RR_DISABLE_ADR * width;      }      /* initialize the buffer system */      cp->txbuf.bufsize = 0;      cp->txbuf.index = 0;      cp->rxbuf.bufsize = 0;      cp->rxbuf.index = (-1);      /*      cp->numaccess = numaccesses; */      /* initialize the ack counter */      cp->rxackval = 0;      /* we can both read and write dualport */      cp->chanflags = CF_TXVALID | CF_RXVALID | CF_NOWAITIO;      /* start the receive area after the status/control area */      cp->rxbase = cp->rxlim = DP_MSGBASE;      cp->rx = (-1);      /* start the transmit area after the receive area */      cp->txbase = cp->tx = (DP_REC_MSGS + 1) * DPM_MSGSIZE;      cp->oobthresh = 0; /* xxx */      /* Points to RAM-based wait ftn; used w/ nr_SetMem() */      cp->wait_nr_done_ptr = (void (*)()) pWait;    }     emoffonwrite_set = True;  /* Set emulate off on write */    /* This function will hang on the following line until the     ** communication channel is up.  If you find that the code    ** is hanging here, either 1) NetROM is not configured correctly for    ** this debug channel; 2) config_dpram() was called with the wrong    ** parameters; or 3) the telnet session is not connecting to the     ** NetROM debug port.    */    while( !nr_ChanReady(chan) ) {}    /* Request that NetROM synchronize comm buffers with the target */    nr_Resync(0);  return Err_NoError;}/***  Function: nr_SetBlockIO**  Description:  This ftn affects nr_Getch(), nr_Putch() and nr_GetMsg()**                val == 0 --> non-blocking I/O**                val != 0 --> blocking I/O****  Parameters:**    chan       channel to configure, 0-3**     val       0 for non-blocking, non-zero for blocking****  Returns:**   Err_BadChan   if the chan is invalid (0,1,2,3 are valid on NR5xx)**   Err_NoError   otherwise*/Int16nr_SetBlockIO( uInt16 chan, uInt16 val ){    register DpChannel *cp;    if( chan >= DP_MAXCHANNELS )  /* Invalid channel! */      return Err_BadChan;    /* get a pointer to the channel */    cp = &channels[chan];    if(val == 0) {        cp->chanflags |= CF_NOWAITIO;    } else {        cp->chanflags &= ~CF_NOWAITIO;    }    return Err_NoError;}/***  Function: nr_ChanReady**  Description:  Test to see if a chan is ready to transmit & receive****  Parameters:**    chan       channel to test, 0-3****  Returns:**   Err_BadChan   if chan is invalid (0,1,2,3 are valid on NR5xx)**   True          if the channel is ready**   False         if the channel is not ready*/Int16nr_ChanReady( uInt16 chan ){  uChar val;  register DpChannel *cp;  if( chan >= DP_MAXCHANNELS )  /* Invalid channel! */    return Err_BadChan;  /* get a pointer to the channel */  cp = &channels[chan];  /* check that the RX channel is active */  val = nr_ReadByte(cp, DP_RX);  if(val != nr_ReadByte(cp, DP_RX)) {    return False;  } else if(val != 1) {    return False;  }  /* check that the TX channel is active */  val = nr_ReadByte(cp, DP_TX);  if(val != nr_ReadByte(cp, DP_TX)){    return False;  } else if(val != 1) {    return False;  }  /* Channel is ready */  return True;}/***  Function: nr_Poll**  Description: check if a character is waiting at the channel****  Parameters:**    chan       channel to poll, 0-3****  Returns:**    True          if there is a character waiting**    False         if there is NOT a character waiting**    Err_BadChan   if the chan is invalid (0,1,2,3 are valid on NR5xx)*/Int16nr_Poll( uInt16 chan ){    DpChannel *cp;    BufIo *bp;    Int16 retval;    if( chan >= DP_MAXCHANNELS )  /* Invalid channel! */      return Err_BadChan;    /* get a pointer to the channel */    cp = &channels[chan];    bp = &cp->rxbuf;    /* see if there is a character in this buffer */    if(bp->index < 0) {      /* poll for new buffers */      nr_ProcessMsgs(chan);      /* no, check for a new buffer arriving */      if(cp->rx !=  (-1) ) {	retval = True;      } else {	retval = False;      }    } else {      retval = True;    }    return(retval);}/***  Function: nr_Getch**  Description: Gets one char from channel****  Parameters:**    chan       channel to read from, 0-3****  Returns:**   Err_WouldBlock   if channel is non-blocking and there is no char**   Err_BadChan      if the chan is invalid**   char             otherwise*/Int16nr_Getch( uInt16 chan ){    DpChannel *cp;    BufIo *bp;    Int16 ch;    if( chan >= DP_MAXCHANNELS )  /* Invalid channel! */      return Err_BadChan;    /* get a pointer to the channel */    cp = &channels[chan];    bp = &cp->rxbuf;    /* see if there is a character in this buffer */    if(bp->index < 0) {        /* wait for the buffer to become valid */        while(cp->rx ==  (-1) ) {            /* poll for new buffers */            nr_ProcessMsgs(chan);	    /* did we get a message? */	    if(cp->rx ==  (-1) ) {		if(cp->chanflags & CF_NOWAITIO) return Err_WouldBlock;		nr_YieldCPU();	    }        }        /* make sure that the message is ready by reading the flags byte 	 * of the next receive msg.  */        bp->flags = nr_ReadInt(chan, cp->rx + DPM_FLAGS);	/* Re-read the flags because the NetROM may have been modifying 	 * them while we read them. */        if(bp->flags != nr_ReadInt(chan, cp->rx + DPM_FLAGS)) {            /* read failed on the verify, NetROM must be writing */            bp->flags = nr_ReadInt(chan, cp->rx + DPM_FLAGS);        }        if((bp->flags & DPMSG_READY) == 0) {            return(Err_WouldBlock);        }        /* set up the i/o buffer for the message */        bp->bufsize = nr_ReadInt(chan, cp->rx + DPM_SIZE);        if(bp->bufsize > DP_DATA_SIZE) {            bp->bufsize = DP_DATA_SIZE;        }        nr_ReadBuf( chan, 		    cp->rx + DPM_DATA, 		    bp->buf, 		    (Int16)(bp->bufsize) );        bp->index = 0;        /* return the buffer */        nr_WriteInt(chan,cp->rx+DPM_FLAGS,(uInt16)bp->flags & ~DPMSG_READY);        /* advance the read pointer */        if(bp->flags & DPMSG_WRAP) {            cp->rx = cp->rxbase;        } else {            cp->rx += DPM_MSGSIZE;        }        /* see if there are more messages waiting */        if(cp->rx == cp->rxlim) {            cp->rx = (-1);        }    }    /* extract the character */    ch = (Int16)bp->buf[bp->index++];    /* check whether we finished the buffer */    if(bp->index == bp->bufsize) {        /* invalidate the buffer */        bp->index = (-1);    }    return(ch);}/***  Function: nr_Putch**  Description: send one character via dp protocol****  Parameters:**    chan       channel to write to, 0-3****  Returns:**    Err_NoError      if the char was sent successfully**    Err_WouldBlock   if we can't send the char**    Err_BadChan      if the chan is invalid*/Int16nr_Putch( uInt16 chan, char ch ){    DpChannel *cp;    BufIo *bp;    if( chan >= DP_MAXCHANNELS )  /* Invalid channel! */      return Err_BadChan;    /* get a pointer to the channel */    cp = &channels[chan];    bp = &cp->txbuf;    /* if the current tx channel is owned by the target, wait for it */    bp->flags = nr_ReadInt(chan, cp->tx + DPM_FLAGS);    if(bp->flags & DPMSG_READY) {        /* wait for the buffer */        while(1) {            bp->flags = nr_ReadInt(chan, cp->tx + DPM_FLAGS);            if(bp->flags != nr_ReadInt(chan, cp->tx + DPM_FLAGS)) {                /* read failed on the verify, NetROM must be writing */                continue;            }            if((bp->flags & DPMSG_READY) == 0) break;            if(cp->chanflags & CF_NOWAITIO) return( Err_WouldBlock );            nr_YieldCPU();        }        /* initialize the buffer structure */        bp->index = 0;        bp->bufsize = 0;    }    /* write the character into the buffer */    bp->buf[bp->index++] = ch;    bp->bufsize++;    /* if the buffer is full, send it */    if(bp->index == DP_DATA_SIZE) {        nr_FlushTX(chan);    }    return Err_NoError;}/***  Function: nr_FlushTX**  Description: Transmits any chars pending in this channel****  Parameters:**    chan       channel to flush, 0-3****  Returns:**   Err_NoError   if successful**   Err_BadChan   if the chan is invalid*/Int16nr_FlushTX( uInt16 chan ){    DpChannel *cp;    BufIo *bp;    if( chan >= DP_MAXCHANNELS )  /* Invalid channel! */      return Err_BadChan;    /* get a pointer to the channel */    cp = &channels[chan];    bp = &cp->txbuf;    /* if we don't own the message or there's nothing in it, just return */    bp->flags = nr_ReadInt(chan, cp->tx + DPM_FLAGS);    if((bp->flags & DPMSG_READY) != 0 || bp->index == 0) {        return Err_NoError;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一级日本不卡的影视| 亚洲欧美日韩成人高清在线一区| 国产欧美日韩亚州综合 | 精品一区二区久久久| 成人免费va视频| 欧美一区二区三区免费大片| 136国产福利精品导航| 日韩av电影免费观看高清完整版| 91麻豆免费视频| 国产亚洲一区二区三区四区 | 亚洲午夜激情网页| 懂色av一区二区三区免费看| 欧美一级精品在线| 亚洲成人免费电影| 99久久精品一区二区| 国产亚洲污的网站| 国产精品一区二区三区乱码| 欧美一区二区三区视频| 亚洲v精品v日韩v欧美v专区| 91麻豆免费在线观看| 国产精品剧情在线亚洲| 国产suv精品一区二区三区| 欧美xxxx老人做受| 国产主播一区二区| www日韩大片| 国产一区二区三区免费播放| 欧美哺乳videos| 免费成人美女在线观看| 91精品午夜视频| 日韩高清欧美激情| 日韩精品一区二区三区在线观看| 天堂一区二区在线| 6080日韩午夜伦伦午夜伦| 午夜久久电影网| 日韩一级二级三级| 精品一区二区久久| 国产三级精品视频| 国产suv精品一区二区6| 中文字幕不卡在线| 色综合网色综合| 一区二区三区蜜桃| 欧美日韩国产美女| 日本伊人色综合网| 欧美精品一区二区三区久久久| 精品无人区卡一卡二卡三乱码免费卡| 日韩三区在线观看| 国产福利一区在线| 中文字幕一区免费在线观看| 91国产成人在线| 免费成人在线影院| 国产午夜精品一区二区三区视频 | 在线播放日韩导航| 蜜桃视频一区二区| 国产亲近乱来精品视频| 成人免费高清视频| 丝瓜av网站精品一区二区| 欧美成人国产一区二区| 豆国产96在线|亚洲| 一区二区三区资源| 日韩视频123| 94-欧美-setu| 免费观看久久久4p| 国产精品美女久久福利网站 | 91色乱码一区二区三区| 亚洲第一激情av| 久久久久久久久97黄色工厂| 色婷婷一区二区| 国产做a爰片久久毛片| 亚洲女厕所小便bbb| 日韩一区二区不卡| 99国产精品久久久久久久久久| 天天色天天爱天天射综合| 日本一区二区不卡视频| 欧美日韩精品一区二区三区四区 | 欧美精品黑人性xxxx| 国产在线精品视频| 亚洲午夜免费视频| 欧美国产日韩一二三区| 欧美乱妇15p| 99在线精品观看| 国产精品99久久久久久久vr| 午夜精品久久久久| 一区二区三区在线影院| 久久蜜臀精品av| 欧美精品粉嫩高潮一区二区| 国产91在线|亚洲| 奇米影视在线99精品| 亚洲小说春色综合另类电影| 中文字幕久久午夜不卡| 日韩精品一区二区三区视频播放| 94-欧美-setu| 丁香桃色午夜亚洲一区二区三区| 日韩精品国产精品| 午夜视频在线观看一区二区三区| 亚洲素人一区二区| 国产欧美日韩精品a在线观看| 日韩一级在线观看| 欧美三日本三级三级在线播放| 成人精品鲁一区一区二区| 国产一区二区三区久久悠悠色av| 日韩电影免费一区| 日韩精品一级二级| 亚洲大型综合色站| 亚洲午夜精品网| 亚洲午夜在线视频| 亚洲成va人在线观看| 天堂精品中文字幕在线| 亚洲一区二区在线免费看| 亚洲色图视频免费播放| 日本一区二区三区免费乱视频 | 在线播放亚洲一区| 欧美色区777第一页| 欧美在线制服丝袜| 欧美优质美女网站| 在线播放欧美女士性生活| 欧美精品一级二级| 制服丝袜亚洲网站| 日韩一级高清毛片| 久久综合九色综合97婷婷| 久久网这里都是精品| 久久亚洲私人国产精品va媚药| 精品国产乱码久久久久久免费| 久久久五月婷婷| 国产日韩精品一区| 亚洲婷婷在线视频| 亚洲午夜视频在线| 久久精品国产色蜜蜜麻豆| 国产精品一区二区x88av| 国产成人精品免费一区二区| 99久久夜色精品国产网站| 一本大道综合伊人精品热热| 欧美日韩一区在线观看| 日韩一级二级三级精品视频| 久久久久久久久岛国免费| 亚洲欧美偷拍三级| 亚洲1区2区3区视频| 捆绑调教一区二区三区| 国产成人8x视频一区二区| 色综合婷婷久久| 欧美一区二区三区公司| 久久久av毛片精品| 亚洲精品视频在线| 日本不卡视频在线观看| 国产成人亚洲综合a∨婷婷 | 一区二区三区丝袜| 日本成人中文字幕在线视频| 国产又黄又大久久| 欧美视频一区二| 亚洲精品一区二区三区影院| 亚洲日本乱码在线观看| 美女一区二区在线观看| 成人免费视频caoporn| 欧美日韩电影在线| 日本一区二区免费在线观看视频| 玉米视频成人免费看| 精品在线播放午夜| 91精品福利视频| 久久久亚洲国产美女国产盗摄 | 中文字幕乱码日本亚洲一区二区 | 欧美福利视频导航| 久久精品夜色噜噜亚洲a∨| 一区二区三区在线免费视频| 国产综合色精品一区二区三区| 91在线观看污| 亚洲精品一区二区三区香蕉| 性感美女极品91精品| 成人午夜电影网站| 欧美成人video| 亚洲国产你懂的| 成人黄色免费短视频| 欧美一区二区三区男人的天堂| 亚洲欧美视频在线观看视频| 国产一区二区导航在线播放| 欧美夫妻性生活| 玉足女爽爽91| 99精品视频在线观看| 久久美女艺术照精彩视频福利播放 | 午夜欧美在线一二页| 91浏览器在线视频| 日本一区二区成人| 国产成人在线视频免费播放| 日韩一区二区免费高清| 天天综合色天天综合色h| 91蜜桃免费观看视频| 国产精品色在线观看| 国产精品亚洲一区二区三区在线 | 欧美在线影院一区二区| 1区2区3区国产精品| 国产精品一区二区三区四区 | 亚洲精品日日夜夜| 成人av网在线| 国产精品女同一区二区三区| 欧美三级韩国三级日本一级| 一区二区三区免费网站| 色婷婷综合激情| 亚洲制服丝袜av| 91久久人澡人人添人人爽欧美 | 在线看国产日韩| 一区二区三区四区不卡视频| 日本电影欧美片|