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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? l1.c

?? 根據(jù)添加了fs2410平臺的arch目錄
?? C
?? 第 1 頁 / 共 5 頁
字號:
    /* some error in UART */    if( *c < 0 ) {	*result = BRL1_LINK;	return 0;    }    /* everything's fine */    *result = BRL1_VALID;    return 1;}/* * brl1_receive * * This function reads a Bedrock-L1 protocol packet into the l1sc_t * response buffer. * * The operation of this function can be expressed as a finite state * machine: *START STATE			INPUT		TRANSITION==========================================================BRL1_IDLE (reset or error)	flag		BRL1_FLAG				other		BRL1_IDLE@BRL1_FLAG (saw a flag (0x7e))	flag		BRL1_FLAG				escape		BRL1_IDLE@				header byte	BRL1_HDR				other		BRL1_IDLE@BRL1_HDR (saw a type/subch byte)(see below)	BRL1_BODY						BRL1_HDRBRL1_BODY (reading packet body)	flag		BRL1_FLAG				escape		BRL1_ESC				other		BRL1_BODYBRL1_ESC (saw an escape (0x7d))	flag		BRL1_FLAG@				escape		BRL1_IDLE@				other		BRL1_BODY=========================================================="@" denotes an error transition. * The BRL1_HDR state is a transient state which doesn't read input, * but just provides a way in to code which decides to whom an * incoming packet should be directed. * * brl1_receive can be used to poll for input from the L1, or as  * an interrupt service routine.  It reads as much data as is * ready from the junk bus UART and places into the appropriate * input queues according to subchannel.  The header byte is * stripped from console-type data, but is retained for message- * type data (L1 responses).  A length byte will also be * prepended to message-type packets. * * This routine is non-blocking; if the caller needs to block * for input, it must call brl1_receive in a loop. * * brl1_receive returns when there is no more input, the queue * for the current incoming message is full, or there is an * error (parity error, bad header, bad CRC, etc.). */#define STATE_SET(l,s)	((l)->brl1_state = (s))#define STATE_GET(l)	((l)->brl1_state)#define LAST_HDR_SET(l,h)	((l)->brl1_last_hdr = (h))#define LAST_HDR_GET(l)		((l)->brl1_last_hdr)#define SEQSTAMP_INCR(l)#define SEQSTAMP_GET(l)#define VALID_HDR(c)				\    ( SUBCH((c)) <= SC_CONS_SYSTEM		\	? PKT_TYPE((c)) == BRL1_REQUEST		\	: ( PKT_TYPE((c)) == BRL1_RESPONSE ||	\	    PKT_TYPE((c)) == BRL1_EVENT ) )#define IS_TTY_PKT(l) \         ( SUBCH(LAST_HDR_GET(l)) <= SC_CONS_SYSTEM ? 1 : 0 )intbrl1_receive( l1sc_t *sc ){    int result;		/* value to be returned by brl1_receive */    int c;		/* most-recently-read character	     	*/    int done;		/* set done to break out of recv loop	*/    sc_cq_t *q;		/* pointer to queue we're working with	*/    result = BRL1_NO_MESSAGE;#ifdef FORCE_CONSOLE_NASID    sc->nasid = 0;#endif    if ( sc->uart == BRL1_LOCALUART )	lock_console(sc->nasid);    done = 0;    while( !done )    {	switch( STATE_GET(sc) )	{	  case BRL1_IDLE:	    /* Initial or error state.  Waiting for a flag character             * to resynchronize with the L1.             */	    if( !read_uart( sc, &c, &result ) ) {		/* error reading uart */		done = 1;		continue;	    }	    	    if( c == BRL1_FLAG_CH ) {		/* saw a flag character */		STATE_SET( sc, BRL1_FLAG );		continue;	    }	    break;	    	  case BRL1_FLAG:	    /* One or more flag characters have been read; look for	     * the beginning of a packet (header byte).	     */	    	    if( !read_uart( sc, &c, &result ) ) {		/* error reading uart */		if( c != UART_NO_CHAR )		    STATE_SET( sc, BRL1_IDLE );		done = 1;		continue;	    }	    	    if( c == BRL1_FLAG_CH ) {		/* multiple flags are OK */		continue;	    }	    if( !VALID_HDR( c ) ) {		/* if c isn't a flag it should have been		 * a valid header, so we have an error		 */		result = BRL1_PROTOCOL;		STATE_SET( sc, BRL1_IDLE );		done = 1;		continue;	    }	    /* we have a valid header byte */	    LAST_HDR_SET( sc, c );	    STATE_SET( sc, BRL1_HDR );	    break; 	  case BRL1_HDR:	    /* A header byte has been read. Do some bookkeeping. */	    q = sc->subch[ SUBCH( LAST_HDR_GET(sc) ) ].iqp;	    ASSERT(q);	    	    if( !IS_TTY_PKT(sc) ) {		/* if this is an event or command response rather		 * than console I/O, we need to reserve a couple		 * of extra spaces in the queue for the header		 * byte and a length byte; if we can't, stay in		 * the BRL1_HDR state.		 */		if( cq_room( q ) < 2 ) {		    result = BRL1_FULL_Q;		    done = 1;		    continue;		}		cq_tent_add( q, 0 );			/* reserve length byte */		cq_tent_add( q, LAST_HDR_GET( sc ) );	/* record header byte  */	    }	    STATE_SET( sc, BRL1_BODY );	    break;	  case BRL1_BODY:	    /* A header byte has been read.  We are now attempting	     * to receive the packet body.	     */	    q = sc->subch[ SUBCH( LAST_HDR_GET(sc) ) ].iqp;	    ASSERT(q);	    /* if the queue we want to write into is full, don't read from	     * the uart (this provides backpressure to the L1 side)	     */	    if( cq_tent_full( q ) ) {		result = BRL1_FULL_Q;		done = 1;		continue;	    }	    	    if( !read_uart( sc, &c, &result ) ) {		/* error reading uart */		if( c != UART_NO_CHAR )		    STATE_SET( sc, BRL1_IDLE );		done = 1;		continue;	    }	    if( c == BRL1_ESC_CH ) {		/* prepare to unescape the next character */		STATE_SET( sc, BRL1_ESC );		continue;	    }	    	    if( c == BRL1_FLAG_CH ) {		/* flag signifies the end of a packet */		unsigned short crc;	/* holds the crc as we calculate it */		int i;			/* index variable */		brl1_sch_t *subch;      /* subchannel for received packet */		brl1_notif_t callup;	/* "data ready" callup */		/* whatever else may happen, we've seen a flag and we're		 * starting a new packet		 */		STATE_SET( sc, BRL1_FLAG );		SEQSTAMP_INCR(sc); /* bump the packet sequence counter */				/* if the packet body has less than 2 characters,		 * it can't be a well-formed packet.  Discard it.		 */		if( cq_tent_len( q ) < /* 2 + possible length byte */		    (2 + (IS_TTY_PKT(sc) ? 0 : 1)) )		{		    result = BRL1_PROTOCOL;		    cq_discard_tent( q );		    STATE_SET( sc, BRL1_FLAG );		    done = 1;		    continue;		}				/* check CRC */		/* accumulate CRC, starting with the header byte and		 * ending with the transmitted CRC.  This should		 * result in a known good value.		 */		crc = crc16_calc( INIT_CRC, LAST_HDR_GET(sc) );		for( i = (q->ipos + (IS_TTY_PKT(sc) ? 0 : 2)) % BRL1_QSIZE;		     i != q->tent_next;		     i = (i + 1) % BRL1_QSIZE )		{		    crc = crc16_calc( crc, q->buf[i] );		}		/* verify the caclulated crc against the "good" crc value;		 * if we fail, discard the bad packet and return an error.		 */		if( crc != (unsigned short)GOOD_CRC ) {		    result = BRL1_CRC;		    cq_discard_tent( q );		    STATE_SET( sc, BRL1_FLAG );		    done = 1;		    continue;		}				/* so the crc check was ok.  Now we discard the CRC		 * from the end of the received bytes.		 */		q->tent_next += (BRL1_QSIZE - 2);		q->tent_next %= BRL1_QSIZE;		/* get the subchannel and lock it */		subch = &(sc->subch[SUBCH( LAST_HDR_GET(sc) )]);		SUBCH_DATA_LOCK( subch );				/* if this isn't a console packet, we need to record		 * a length byte		 */		if( !IS_TTY_PKT(sc) ) {		    q->buf[q->ipos] = cq_tent_len( q ) - 1;		}				/* record packet for posterity */		cq_commit_tent( q );		result = BRL1_VALID;		/* notify subchannel owner that there's something		 * on the queue for them		 */		atomic_inc(&(subch->packet_arrived));		callup = subch->rx_notify;		SUBCH_DATA_UNLOCK( subch );		if( callup ) {		    if ( sc->uart == BRL1_LOCALUART )			unlock_console(sc->nasid);		    (*callup)( sc, SUBCH(LAST_HDR_GET(sc)) );		    if ( sc->uart == BRL1_LOCALUART )			lock_console(sc->nasid);		}		continue;	/* go back for more! */	    }	    	    /* none of the special cases applied; we've got a normal	     * body character	     */	    cq_tent_add( q, c );	    break;	  case BRL1_ESC:	    /* saw an escape character.  The next character will need	     * to be unescaped.	     */	    q = sc->subch[ SUBCH( LAST_HDR_GET(sc) ) ].iqp;	    ASSERT(q);	    /* if the queue we want to write into is full, don't read from	     * the uart (this provides backpressure to the L1 side)	     */	    if( cq_tent_full( q ) ) {		result = BRL1_FULL_Q;		done = 1;		continue;	    }	    	    if( !read_uart( sc, &c, &result ) ) {		/* error reading uart */		if( c != UART_NO_CHAR ) {		    cq_discard_tent( q );		    STATE_SET( sc, BRL1_IDLE );		}		done = 1;		continue;	    }	    	    if( c == BRL1_FLAG_CH ) {		/* flag after escape is an error */		STATE_SET( sc, BRL1_FLAG );		cq_discard_tent( q );		result = BRL1_PROTOCOL;		done = 1;		continue;	    }	    if( c == BRL1_ESC_CH ) {		/* two consecutive escapes is an error */		STATE_SET( sc, BRL1_IDLE );		cq_discard_tent( q );		result = BRL1_PROTOCOL;		done = 1;		continue;	    }	    	    /* otherwise, we've got a character that needs	     * to be unescaped	     */	    cq_tent_add( q, (c ^ BRL1_XOR_CH) );	    STATE_SET( sc, BRL1_BODY );	    break;	} /* end of switch( STATE_GET(sc) ) */    } /* end of while(!done) */        if ( sc->uart == BRL1_LOCALUART )	unlock_console(sc->nasid);    return result;}	    /* brl1_init initializes the Bedrock/L1 protocol layer.  This includes * zeroing out the send and receive state information. */voidbrl1_init( l1sc_t *sc, nasid_t nasid, net_vec_t uart ){    int i;    brl1_sch_t *subch;    bzero( sc, sizeof( *sc ) );#ifdef FORCE_CONSOLE_NASID    nasid = (nasid_t)0;#endif    sc->nasid = nasid;    sc->uart = uart;    sc->getc_f = (uart == BRL1_LOCALUART ? uart_getc : rtr_uart_getc);    sc->putc_f = (uart == BRL1_LOCALUART ? uart_putc : rtr_uart_putc);    sc->sol = 1;    subch = sc->subch;    /* initialize L1 subchannels     */    /* assign processor TTY channels */    for( i = 0; i < CPUS_PER_NODE; i++, subch++ ) {	subch->use = BRL1_SUBCH_RSVD;	subch->packet_arrived = ATOMIC_INIT(0);	spin_lock_init( &(subch->data_lock) );	sv_init( &(subch->arrive_sv), &(subch->data_lock), SV_MON_SPIN | SV_ORDER_FIFO /* | SV_INTS */ );	subch->tx_notify = NULL;	/* (for now, drop elscuart packets in the kernel) */	subch->rx_notify = brl1_discard_packet;	subch->iqp = &sc->garbage_q;    }    /* assign system TTY channel (first free subchannel after each     * processor's individual TTY channel has been assigned)     */    subch->use = BRL1_SUBCH_RSVD;    subch->packet_arrived = ATOMIC_INIT(0);    spin_lock_init( &(subch->data_lock) );    sv_init( &(subch->arrive_sv), &subch->data_lock, SV_MON_SPIN | SV_ORDER_FIFO /* | SV_INTS */ );    subch->tx_notify = NULL;    if( sc->uart == BRL1_LOCALUART ) {	subch->iqp = kmem_zalloc_node( sizeof(sc_cq_t), KM_NOSLEEP,				       NASID_TO_COMPACT_NODEID(nasid) );	ASSERT( subch->iqp );	cq_init( subch->iqp );	subch->rx_notify = NULL;    }    else {	/* we shouldn't be getting console input from remote UARTs */	subch->iqp = &sc->garbage_q;	subch->rx_notify = brl1_discard_packet;    }    subch++; i++;    /* "reserved" subchannels (0x05-0x0F); for now, throw away     * incoming packets     */    for( ; i < 0x10; i++, subch++ ) {	subch->use = BRL1_SUBCH_FREE;	subch->packet_arrived = ATOMIC_INIT(0);	subch->tx_notify = NULL;	subch->rx_notify = brl1_discard_packet;	subch->iqp = &sc->garbage_q;    }    /* remaining subchannels are free */    for( ; i < BRL1_NUM_SUBCHANS; i++, subch++ ) {	subch->use = BRL1_SUBCH_FREE;	subch->packet_arrived = ATOMIC_INIT(0);	subch->tx_notify = NULL;	subch->rx_notify = brl1_discard_packet;	subch->iqp = &sc->garbage_q;    }    /* initialize synchronization structures     */    spin_lock_init( &(sc->subch_lock) );    if( sc->uart == BRL1_LOCALUART ) {	uart_init( sc, UART_BAUD_RATE );    }    else {	rtr_uart_init( sc, UART_BAUD_RATE );    }    /* Set up remaining fields using L1 command functions-- elsc_module_get     * to read the module id, elsc_debug_get to see whether or not we're     * in verbose mode.     */    {	extern int elsc_module_get(l1sc_t *);	sc->modid = elsc_module_get( sc );	sc->modid = (sc->modid < 0 ? INVALID_MODULE : sc->modid);	sc->verbose = 1;    }}/* These are functions to use from serial_in/out when in protocol * mode to send and receive uart control regs. These are external * interfaces into the protocol driver. */voidl1_control_out(int offset, int value){	nasid_t nasid = 0; //(get_elsc())->nasid;	WRITE_L1_UART_REG(nasid, offset, value); 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91日韩在线专区| 色婷婷综合五月| 美女免费视频一区二区| 亚洲一区二区三区爽爽爽爽爽 | 国产欧美日韩在线看| 欧美成人aa大片| 欧美r级电影在线观看| 日韩精品综合一本久道在线视频| 9191国产精品| 欧美一区二区三区爱爱| 日韩精品一区二| 亚洲精品在线电影| 久久综合资源网| 久久精品亚洲乱码伦伦中文| 久久精品这里都是精品| 国产欧美日韩三区| 亚洲视频一区二区在线观看| 亚洲视频在线观看一区| 亚洲一区二区三区四区不卡| 午夜欧美电影在线观看| 日韩中文字幕亚洲一区二区va在线 | 国产成人精品一区二区三区四区| 亚洲人妖av一区二区| 91精品视频网| 成人性视频网站| 美女视频黄免费的久久 | 色综合一个色综合| 九一九一国产精品| 一本久久精品一区二区| 日韩国产精品久久| 玖玖九九国产精品| 国产一区999| 99re这里都是精品| 欧美日韩1234| 久久久亚洲综合| 国产综合久久久久影院| 国产精品性做久久久久久| 99综合电影在线视频| 欧美视频一区二区三区四区| 欧美mv日韩mv亚洲| 亚洲天堂网中文字| 日韩制服丝袜先锋影音| 成人综合日日夜夜| 欧美精品色一区二区三区| 久久精品网站免费观看| 亚洲激情综合网| 久久国产精品色| 99国产精品久| 日韩精品中文字幕一区二区三区| 中文字幕av在线一区二区三区| 亚洲小说欧美激情另类| 久久er精品视频| 一本大道综合伊人精品热热| 日韩一卡二卡三卡| 亚洲精品国产一区二区三区四区在线| 日韩高清一区在线| 成人国产精品免费观看视频| 制服丝袜成人动漫| 亚洲天堂精品在线观看| 免费人成网站在线观看欧美高清| 成人av小说网| 精品免费视频一区二区| 夜夜精品视频一区二区| 国产成人欧美日韩在线电影| 欧美日韩国产美女| 亚洲天堂成人网| 国产精品一区二区视频| 欧美精品v国产精品v日韩精品| 国产精品麻豆欧美日韩ww| 免费在线成人网| 欧美写真视频网站| 中文字幕精品一区二区三区精品| 日韩国产高清在线| 91黄色小视频| 国产精品久久久一本精品| 国内一区二区在线| 91精品国产综合久久精品图片| 136国产福利精品导航| 国产一区在线精品| 日韩免费性生活视频播放| 亚洲一二三区在线观看| 91啦中文在线观看| 精品国产麻豆免费人成网站| 亚洲国产精品久久久久婷婷884 | 国产91丝袜在线观看| 日韩视频永久免费| 亚洲第一搞黄网站| 欧美日韩中文另类| 亚洲综合色区另类av| 日本乱人伦aⅴ精品| 亚洲丝袜自拍清纯另类| 成+人+亚洲+综合天堂| 久久婷婷国产综合国色天香 | 欧美猛男gaygay网站| 一区二区三区中文字幕精品精品 | 日韩精品中文字幕在线一区| 午夜视黄欧洲亚洲| 国产无人区一区二区三区| 国内一区二区视频| 久久久电影一区二区三区| 久久99国产精品久久99| 日韩视频在线你懂得| 免费观看成人鲁鲁鲁鲁鲁视频| 555www色欧美视频| 麻豆成人久久精品二区三区红 | 亚洲女与黑人做爰| 国产丶欧美丶日本不卡视频| 欧美精品vⅰdeose4hd| 亚洲激情男女视频| www.成人在线| 国产精品美日韩| 国产99久久久国产精品免费看| 在线成人免费观看| 亚洲成人一区二区| 色八戒一区二区三区| 一区免费观看视频| 成人h精品动漫一区二区三区| 2020国产精品自拍| 国产一区二区主播在线| 欧美一级理论性理论a| 日韩高清不卡一区二区| 欧美美女一区二区三区| 亚洲视频你懂的| 成人18视频日本| 亚洲视频免费观看| 91国产丝袜在线播放| 国产精品夫妻自拍| 91色porny在线视频| 亚洲欧美一区二区久久| 欧美吻胸吃奶大尺度电影 | 成人av网站免费观看| 一区二区三区四区在线| 欧美精品久久99久久在免费线| 蜜桃精品视频在线| 国产精品美女久久久久aⅴ国产馆| 91视频国产观看| 免费久久99精品国产| 国产免费成人在线视频| 91在线免费看| 五月婷婷久久综合| 久久精品综合网| 在线观看国产精品网站| 日韩高清不卡一区二区| 欧美激情一区二区三区在线| 亚洲一区二区偷拍精品| 欧美精品三级日韩久久| 日韩黄色免费电影| 久久久久久久免费视频了| 91蜜桃在线免费视频| 美女视频黄免费的久久| 国产精品乱人伦中文| 欧美日韩国产在线观看| 国产高清无密码一区二区三区| 夜夜嗨av一区二区三区| 亚洲精品一线二线三线| 色欧美88888久久久久久影院| 男女性色大片免费观看一区二区| 国产精品美女一区二区在线观看| 欧美久久一二三四区| 成人永久看片免费视频天堂| 婷婷久久综合九色综合伊人色| 久久精品亚洲国产奇米99| 欧美精品日韩精品| 99精品国产一区二区三区不卡| 日本不卡1234视频| 亚洲精品高清在线| 国产日韩欧美a| 欧美精品丝袜中出| 日韩精品一区在线观看| 一本一道综合狠狠老| 国产真实乱偷精品视频免| 亚洲一区二区av在线| 国产精品伦理一区二区| 欧美精品一区在线观看| 欧美日韩高清影院| 91久久国产最好的精华液| 国产精品亚洲专一区二区三区 | 亚洲欧美中日韩| 亚洲五码中文字幕| 99在线视频精品| 国产一区二区不卡老阿姨| 国产日韩欧美高清在线| 日韩视频永久免费| 欧美日韩大陆在线| 在线观看亚洲专区| 成人a区在线观看| 国产一区二区在线电影| 青青草一区二区三区| 一区二区成人在线视频| 久久网站最新地址| 91麻豆精品国产91久久久资源速度| 国产激情一区二区三区四区| 久久色.com| 欧美日韩1234| 91色在线porny| 高清不卡在线观看| 免费观看91视频大全| 亚洲综合在线视频| 91.成人天堂一区| 久久99热99|