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

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

?? dptarget.c

?? Vxworks OS source code
?? 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一区二区三区免费野_久草精品视频
最新不卡av在线| 天堂午夜影视日韩欧美一区二区| 成人丝袜视频网| 欧美国产一区视频在线观看| 成人在线视频一区| 国产精品萝li| 久草热8精品视频在线观看| 337p粉嫩大胆噜噜噜噜噜91av| 国内外精品视频| 久久精品夜色噜噜亚洲aⅴ| 国产真实乱子伦精品视频| 2019国产精品| av激情成人网| 亚洲精品大片www| 精品视频在线看| 蜜桃久久精品一区二区| 欧美精品一区二区三区蜜桃| 美国毛片一区二区| 精品日产卡一卡二卡麻豆| 国产一区二三区| 欧美国产日韩在线观看| 91麻豆产精品久久久久久| 亚洲欧美日韩国产成人精品影院| 欧美日韩亚洲不卡| 久久国产夜色精品鲁鲁99| 国产欧美日韩亚州综合| 91碰在线视频| 亚洲成a人在线观看| 精品奇米国产一区二区三区| 国产v综合v亚洲欧| 日韩欧美一卡二卡| 99麻豆久久久国产精品免费| 91色porny| 99国产精品一区| 成人午夜av影视| 成人免费视频免费观看| 国产在线一区观看| 国产精品99久久不卡二区| 国产成人免费在线| 国产一区二三区| gogo大胆日本视频一区| 国产伦精品一区二区三区视频青涩 | 欧美久久久久久蜜桃| 精品一区二区三区香蕉蜜桃| 亚洲欧洲国产日韩| 欧美日韩不卡视频| 风间由美一区二区三区在线观看 | 韩国精品一区二区| 亚洲免费在线视频| 精品成人一区二区| 欧美三级韩国三级日本一级| 国产成人午夜99999| 亚洲一区二区三区中文字幕| 亚洲午夜久久久久| 中文久久乱码一区二区| 日韩一区二区三区在线| 一本色道久久综合亚洲精品按摩| 精品一区二区免费| 午夜激情久久久| 亚洲欧洲日韩综合一区二区| 亚洲精品在线电影| 欧美美女一区二区在线观看| 99国产精品久久久久久久久久| 激情小说欧美图片| 亚洲午夜在线观看视频在线| 亚洲欧美综合另类在线卡通| xnxx国产精品| 欧美一级视频精品观看| 欧洲激情一区二区| 成a人片国产精品| 国产在线精品免费| 日本在线播放一区二区三区| 亚洲影院免费观看| 一区精品在线播放| 久久中文字幕电影| 日韩一区二区免费在线观看| 欧美日韩综合一区| 色综合咪咪久久| 成人h动漫精品一区二区| 国产一区二区三区最好精华液| 日韩成人伦理电影在线观看| 亚洲综合激情小说| 综合久久综合久久| 国产精品久久久一区麻豆最新章节| 精品福利一二区| 91精品国产乱码久久蜜臀| 在线免费亚洲电影| 91亚洲男人天堂| 成人aa视频在线观看| 国产一区二区福利| 精品一区二区三区免费| 久久精品99国产精品日本| 奇米精品一区二区三区在线观看 | 蜜桃av噜噜一区二区三区小说| 性做久久久久久免费观看| 一区二区三区中文免费| 亚洲人午夜精品天堂一二香蕉| 国产精品免费久久| 国产精品视频看| 国产精品久久毛片a| 国产精品久久久一本精品 | 日本最新不卡在线| 日本三级韩国三级欧美三级| 午夜a成v人精品| 婷婷亚洲久悠悠色悠在线播放| 亚洲成a人v欧美综合天堂下载 | 国产精品对白交换视频| 国产精品伦一区| 国产精品黄色在线观看| 欧美激情中文不卡| 国产精品网站在线| 国产精品伦一区| 亚洲人成网站影音先锋播放| 亚洲精选视频在线| 亚洲一区二区三区四区五区中文| 一区二区三区资源| 亚洲一级在线观看| 亚洲综合色区另类av| 婷婷丁香激情综合| 日本免费在线视频不卡一不卡二| 久久精品国产99| 国产美女精品一区二区三区| 成人精品小蝌蚪| 99国产精品久| 色婷婷亚洲综合| 欧美日韩你懂的| 日韩免费性生活视频播放| 久久亚洲春色中文字幕久久久| 国产视频在线观看一区二区三区| 国产女人水真多18毛片18精品视频| 亚洲欧洲日韩一区二区三区| 亚洲精品伦理在线| 亚洲成人自拍一区| 日本麻豆一区二区三区视频| 国内成人精品2018免费看| 成人18视频日本| 日本韩国一区二区| 91精品国产全国免费观看| ww亚洲ww在线观看国产| 中文字幕日本不卡| 亚洲福中文字幕伊人影院| 青青草国产精品97视觉盛宴 | 国产精品一区二区不卡| 99在线热播精品免费| 欧美日韩不卡一区二区| 久久一区二区视频| ...xxx性欧美| 日韩黄色小视频| 国产精品亚洲人在线观看| 99久久精品国产毛片| 欧美日本一区二区| 久久婷婷色综合| 亚洲精品久久久蜜桃| 婷婷国产v国产偷v亚洲高清| 国产精品亚洲专一区二区三区 | 狠狠久久亚洲欧美| 色婷婷精品大在线视频| 日韩午夜小视频| 国产精品毛片a∨一区二区三区| 亚洲高清视频中文字幕| 国产黄色精品网站| 欧美视频一区在线| 国产清纯白嫩初高生在线观看91 | 欧美日韩国产一级片| 2欧美一区二区三区在线观看视频| 亚洲色图视频网| 美国十次了思思久久精品导航| 99精品久久只有精品| 欧美一区二区视频观看视频| 国产精品无遮挡| 免费高清在线视频一区·| 91啦中文在线观看| 精品国产乱码久久久久久久久| 亚洲女同ⅹxx女同tv| 麻豆91精品91久久久的内涵| 色婷婷久久综合| 国产亚洲一二三区| 亚洲综合在线免费观看| 国产电影精品久久禁18| 欧美精品黑人性xxxx| 国产精品动漫网站| 精品一区二区在线看| 在线免费精品视频| 久久久国产精品午夜一区ai换脸| 亚洲成av人片在线观看| jlzzjlzz亚洲女人18| 欧美草草影院在线视频| 亚洲一区影音先锋| 成人精品国产免费网站| 日韩欧美综合一区| 亚洲第一主播视频| 92精品国产成人观看免费| 久久久蜜桃精品| 日本成人在线视频网站| 色av一区二区| 国产精品每日更新| 国产一区二区电影| 日韩欧美国产麻豆| 亚洲成av人片在线观看| 91行情网站电视在线观看高清版|