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

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

?? uart00.c

?? IXP425 平臺下嵌入式LINUX的串口的驅動程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* *  linux/drivers/char/serial_uart00.c * *  Driver for UART00 serial ports * *  Based on drivers/char/serial_amba.c, by ARM Limited &  *                                          Deep Blue Solutions Ltd. *  Copyright 2001 Altera Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * *  $Id: uart00.c,v 1.3.2.5 2002/10/24 09:53:26 rmk Exp $ * */#include <linux/config.h>#include <linux/module.h>#include <linux/errno.h>#include <linux/signal.h>#include <linux/sched.h>#include <linux/interrupt.h>#include <linux/tty.h>#include <linux/tty_flip.h>#include <linux/major.h>#include <linux/string.h>#include <linux/fcntl.h>#include <linux/ptrace.h>#include <linux/ioport.h>#include <linux/mm.h>#include <linux/slab.h>#include <linux/init.h>#include <linux/circ_buf.h>#include <linux/serial.h>#include <linux/console.h>#include <linux/sysrq.h>#include <asm/system.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/uaccess.h>#include <asm/bitops.h>#include <asm/sizes.h>#if defined(CONFIG_SERIAL_UART00_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)#define SUPPORT_SYSRQ#endif#include <linux/serial_core.h>#include <asm/arch/excalibur.h>#define UART00_TYPE (volatile unsigned int*)#include <asm/arch/uart00.h>#include <asm/arch/int_ctrl00.h>#undef DEBUG#define UART_NR		2#define SERIAL_UART00_NAME	"ttyUA"#define SERIAL_UART00_MAJOR	204#define SERIAL_UART00_MINOR	16      /* Temporary - will change in future */#define SERIAL_UART00_NR	UART_NR#define UART_PORT_SIZE 0x50#define CALLOUT_UART00_NAME	"cuaua"#define CALLOUT_UART00_MAJOR	205#define CALLOUT_UART00_MINOR	16      /* Temporary - will change in future */#define CALLOUT_UART00_NR	UART_NRstatic struct tty_driver normal, callout;static struct tty_struct *uart00_table[UART_NR];static struct termios *uart00_termios[UART_NR], *uart00_termios_locked[UART_NR];//static struct uart_state uart00_state[UART_NR];static struct console uart00_console;#define UART00_ISR_PASS_LIMIT	256/* * Access macros for the UART00 UARTs */#define UART_GET_INT_STATUS(p)	inl(UART_ISR((p)->membase))#define UART_PUT_IES(p, c)      outl(c,UART_IES((p)->membase))#define UART_GET_IES(p)         inl(UART_IES((p)->membase))#define UART_PUT_IEC(p, c)      outl(c,UART_IEC((p)->membase))#define UART_GET_IEC(p)         inl(UART_IEC((p)->membase))#define UART_PUT_CHAR(p, c)     outl(c,UART_TD((p)->membase))#define UART_GET_CHAR(p)        inl(UART_RD((p)->membase))#define UART_GET_RSR(p)         inl(UART_RSR((p)->membase))#define UART_GET_RDS(p)         inl(UART_RDS((p)->membase))#define UART_GET_MSR(p)         inl(UART_MSR((p)->membase))#define UART_GET_MCR(p)         inl(UART_MCR((p)->membase))#define UART_PUT_MCR(p, c)      outl(c,UART_MCR((p)->membase))#define UART_GET_MC(p)          inl(UART_MC((p)->membase))#define UART_PUT_MC(p, c)       outl(c,UART_MC((p)->membase))#define UART_GET_TSR(p)         inl(UART_TSR((p)->membase))#define UART_GET_DIV_HI(p)	inl(UART_DIV_HI((p)->membase))#define UART_PUT_DIV_HI(p,c)	outl(c,UART_DIV_HI((p)->membase))#define UART_GET_DIV_LO(p)	inl(UART_DIV_LO((p)->membase))#define UART_PUT_DIV_LO(p,c)	outl(c,UART_DIV_LO((p)->membase))#define UART_RX_DATA(s)		((s) & UART_RSR_RX_LEVEL_MSK)#define UART_TX_READY(s)	(((s) & UART_TSR_TX_LEVEL_MSK) < 15)//#define UART_TX_EMPTY(p)	((UART_GET_FR(p) & UART00_UARTFR_TMSK) == 0)static void uart00_stop_tx(struct uart_port *port, u_int from_tty){	UART_PUT_IEC(port, UART_IEC_TIE_MSK);}static void uart00_stop_rx(struct uart_port *port){	UART_PUT_IEC(port, UART_IEC_RE_MSK);}static void uart00_enable_ms(struct uart_port *port){	UART_PUT_IES(port, UART_IES_ME_MSK);}static voiduart00_rx_chars(struct uart_info *info, struct pt_regs *regs){	struct tty_struct *tty = info->tty;	unsigned int status, ch, rds, flg, ignored = 0;	struct uart_port *port = info->port;		status = UART_GET_RSR(port);	while (UART_RX_DATA(status)) {		/* 		 * We need to read rds before reading the 		 * character from the fifo		 */		rds = UART_GET_RDS(port);		ch = UART_GET_CHAR(port);		port->icount.rx++;		if (tty->flip.count >= TTY_FLIPBUF_SIZE)			goto ignore_char;		flg = TTY_NORMAL;		/*		 * Note that the error handling code is		 * out of the main execution path		 */		if (rds & (UART_RDS_BI_MSK |UART_RDS_FE_MSK|			   UART_RDS_PE_MSK |UART_RDS_PE_MSK))			goto handle_error;		if (uart_handle_sysrq_char(info, ch, regs))			goto ignore_char;	error_return:		*tty->flip.flag_buf_ptr++ = flg;		*tty->flip.char_buf_ptr++ = ch;		tty->flip.count++;	ignore_char:		status = UART_GET_RSR(port);	}out:	tty_flip_buffer_push(tty);	return;handle_error:	if (rds & UART_RDS_BI_MSK) {		status &= ~(UART_RDS_FE_MSK | UART_RDS_PE_MSK);		port->icount.brk++;#ifdef SUPPORT_SYSRQ		if (uart_handle_break(info, &uart00_console))			goto ignore_char;#endif	} else if (rds & UART_RDS_PE_MSK)		port->icount.parity++;	else if (rds & UART_RDS_PE_MSK)		port->icount.frame++;	if (rds & UART_RDS_OE_MSK)		port->icount.overrun++;	if (rds & port->ignore_status_mask) {		if (++ignored > 100)			goto out;		goto ignore_char;	}	rds &= port->read_status_mask;	if (rds & UART_RDS_BI_MSK)		flg = TTY_BREAK;	else if (rds & UART_RDS_PE_MSK)		flg = TTY_PARITY;	else if (rds & UART_RDS_FE_MSK)		flg = TTY_FRAME;	if (status & UART_RDS_OE_MSK) {		/*		 * CHECK: does overrun affect the current character?		 * ASSUMPTION: it does not.		 */		*tty->flip.flag_buf_ptr++ = flg;		*tty->flip.char_buf_ptr++ = ch;		tty->flip.count++;		if (tty->flip.count >= TTY_FLIPBUF_SIZE)			goto ignore_char;		ch = 0;		flg = TTY_OVERRUN;	}#ifdef SUPPORT_SYSRQ	info->sysrq = 0;#endif	goto error_return;}static void uart00_tx_chars(struct uart_info *info){	int count;	struct uart_port *port=info->port;	if (port->x_char) {		while((UART_GET_TSR(port)& UART_TSR_TX_LEVEL_MSK)==15);		UART_PUT_CHAR(port, port->x_char);		port->icount.tx++;		port->x_char = 0;				return;	}	if (info->xmit.head == info->xmit.tail	    || info->tty->stopped	    || info->tty->hw_stopped) {		uart00_stop_tx(info->port, 0);		return;	}	count = port->fifosize >> 1;	do {		while((UART_GET_TSR(port)& UART_TSR_TX_LEVEL_MSK)==15);		UART_PUT_CHAR(port, info->xmit.buf[info->xmit.tail]);		info->xmit.tail = (info->xmit.tail + 1) & (UART_XMIT_SIZE - 1);		port->icount.tx++;		if (info->xmit.head == info->xmit.tail)			break;	} while (--count > 0);	if (CIRC_CNT(info->xmit.head,		     info->xmit.tail,		     UART_XMIT_SIZE) < WAKEUP_CHARS)		uart_event(info, EVT_WRITE_WAKEUP);	if (info->xmit.head == info->xmit.tail)		uart00_stop_tx(info->port, 0);}static void uart00_start_tx(struct uart_port *port, u_int nonempty, u_int from_tty){	struct uart_info *info=(struct uart_info*)(port->iobase);	UART_PUT_IES(port,UART_IES_TIE_MSK );			uart00_tx_chars(info);}static void uart00_modem_status(struct uart_info *info){	unsigned int status;	struct uart_icount *icount = &info->port->icount;	status = UART_GET_MSR(info->port);	if (!status & (UART_MSR_DCTS_MSK | UART_MSR_DDSR_MSK | 		       UART_MSR_TERI_MSK | UART_MSR_DDCD_MSK))		return;	if (status & UART_MSR_DDCD_MSK) {		icount->dcd++;#ifdef CONFIG_HARD_PPS		if ((info->flags & ASYNC_HARDPPS_CD) &&		    (status & UART_MSR_DCD_MSK))			hardpps();#endif		if (info->flags & ASYNC_CHECK_CD) {			if (status & UART_MSR_DCD_MSK)				wake_up_interruptible(&info->open_wait);			else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&				   (info->flags & ASYNC_CALLOUT_NOHUP))) {				if (info->tty)					tty_hangup(info->tty);			}		}	}	if (status & UART_MSR_DDSR_MSK)		icount->dsr++;	if (status & UART_MSR_DCTS_MSK) {		icount->cts++;		if (info->flags & ASYNC_CTS_FLOW) {			status &= UART_MSR_CTS_MSK;			if (info->tty->hw_stopped) {				if (status) {					info->tty->hw_stopped = 0;					info->ops->start_tx(info->port, 1, 0);					uart_event(info, EVT_WRITE_WAKEUP);				}			} else {				if (!status) {					info->tty->hw_stopped = 1;					info->ops->stop_tx(info->port, 0);				}			}		}	}	wake_up_interruptible(&info->delta_msr_wait);}static void uart00_int(int irq, void *dev_id, struct pt_regs *regs){	struct uart_info *info = dev_id;	unsigned int status, pass_counter = 0;	status = UART_GET_INT_STATUS(info->port);	do {		if (status & UART_ISR_RI_MSK)			uart00_rx_chars(info, regs);		if (status & (UART_ISR_TI_MSK | UART_ISR_TII_MSK))			uart00_tx_chars(info);		if (status & UART_ISR_MI_MSK)			uart00_modem_status(info);		if (pass_counter++ > UART00_ISR_PASS_LIMIT)			break;		status = UART_GET_INT_STATUS(info->port);	} while (status);}static u_int uart00_tx_empty(struct uart_port *port){	return UART_GET_TSR(port) & UART_TSR_TX_LEVEL_MSK? 0 : TIOCSER_TEMT;}static u_int uart00_get_mctrl(struct uart_port *port){	unsigned int result = 0;	unsigned int status;	status = UART_GET_MSR(port);	if (status & UART_MSR_DCD_MSK)		result |= TIOCM_CAR;	if (status & UART_MSR_DSR_MSK)		result |= TIOCM_DSR;	if (status & UART_MSR_CTS_MSK)		result |= TIOCM_CTS;	if (status & UART_MSR_RI_MSK)		result |= TIOCM_RI;	return result;}static void uart00_set_mctrl_null(struct uart_port *port, u_int mctrl){}static void uart00_break_ctl(struct uart_port *port, int break_state){	unsigned int mcr;	mcr = UART_GET_MCR(port);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久成人麻豆午夜电影| 久久综合色8888| 国产精品每日更新| 国内国产精品久久| 日本一区二区成人在线| 国产福利91精品| 国产精品高清亚洲| 在线免费观看一区| 日精品一区二区| 精品国内二区三区| 99在线视频精品| 一区二区三区中文字幕在线观看| 欧美在线视频你懂得| 日韩成人精品在线| 欧美tk丨vk视频| 成人丝袜18视频在线观看| 亚洲免费视频中文字幕| 7777精品伊人久久久大香线蕉经典版下载 | 91一区一区三区| 夜夜亚洲天天久久| 精品国产电影一区二区| 成人av在线网| 日韩高清电影一区| 欧美激情综合五月色丁香| 日本韩国一区二区三区| 蜜臀av性久久久久蜜臀aⅴ四虎 | 在线观看亚洲一区| 一区二区三区免费网站| 日韩女优av电影在线观看| 成人免费视频视频| 亚洲6080在线| 国产欧美一区二区精品忘忧草| 91蜜桃传媒精品久久久一区二区| 蜜桃一区二区三区在线观看| 国产精品国产三级国产普通话三级 | 日韩有码一区二区三区| 久久久99精品久久| 欧美日韩一区精品| 国产美女一区二区| 亚洲国产乱码最新视频| 国产亚洲人成网站| 欧美精品久久99久久在免费线 | 亚洲 欧美综合在线网络| 国产日韩影视精品| 欧美男女性生活在线直播观看| 国产激情视频一区二区三区欧美 | 97精品国产露脸对白| 久久99日本精品| 亚洲图片欧美一区| 最新国产精品久久精品| 日韩精品专区在线影院观看| 一本一道久久a久久精品| 精品一区二区三区影院在线午夜| 亚洲欧美日本韩国| 国产精品婷婷午夜在线观看| 日韩精品一区二区三区中文不卡 | 午夜视频一区二区| 亚洲欧美一区二区三区极速播放| 久久嫩草精品久久久久| 日韩视频一区二区三区在线播放 | av在线不卡电影| 国产一区二区福利视频| 蜜桃91丨九色丨蝌蚪91桃色| 亚洲午夜久久久久| 亚洲丝袜自拍清纯另类| 欧美激情一区二区三区蜜桃视频| 精品日韩欧美一区二区| 制服丝袜中文字幕一区| 欧美午夜影院一区| 色婷婷综合久久久| 99在线精品观看| 成人激情免费视频| 成人丝袜18视频在线观看| 国产精品18久久久久久久久久久久 | 欧美日韩精品一区二区天天拍小说| 成人免费视频免费观看| 国产成人免费在线观看不卡| 国内外成人在线| 国产一区二区三区日韩| 极品少妇xxxx精品少妇偷拍| 美脚の诱脚舐め脚责91| 久久国产精品无码网站| 麻豆精品精品国产自在97香蕉| 日本中文字幕一区二区视频| 丝袜美腿成人在线| 免费观看30秒视频久久| 蜜臀av性久久久久蜜臀aⅴ | 精品系列免费在线观看| 韩日欧美一区二区三区| 色综合天天狠狠| 成人性生交大片免费看中文网站| 成人一区在线看| 91网址在线看| 欧美日韩三级一区二区| 91麻豆精品国产无毒不卡在线观看| 在线不卡免费av| 欧美mv日韩mv亚洲| 日本一区二区视频在线| 亚洲品质自拍视频网站| 一个色综合av| 日本欧美一区二区在线观看| 国产最新精品精品你懂的| 成人三级伦理片| 色综合久久久久网| 91精品国产综合久久婷婷香蕉 | 亚洲精品一区二区三区在线观看| 久久综合中文字幕| 亚洲日本在线a| 日韩精品五月天| 国产精品影视天天线| 色94色欧美sute亚洲线路二| 91麻豆精品国产91| 国产女人aaa级久久久级| 亚洲精品免费一二三区| 久久精品国产亚洲aⅴ| 国产成人av影院| 欧美色精品在线视频| 精品va天堂亚洲国产| 亚洲老司机在线| 麻豆精品视频在线| 91亚洲国产成人精品一区二三| 91精品国产91久久久久久一区二区| 久久亚洲精精品中文字幕早川悠里 | 麻豆成人久久精品二区三区红 | 日韩欧美在线网站| 国产精品美女一区二区| 青青草国产精品97视觉盛宴| 福利电影一区二区三区| 5月丁香婷婷综合| 亚洲国产精品激情在线观看 | 久久99热狠狠色一区二区| 成人av在线网| 欧美不卡视频一区| 亚洲自拍欧美精品| 成人福利在线看| 日韩小视频在线观看专区| 亚洲欧美一区二区三区极速播放 | 蜜乳av一区二区三区| 99精品国产视频| 久久久久久久免费视频了| 丝袜a∨在线一区二区三区不卡| 成人a区在线观看| 久久一区二区三区国产精品| 偷拍一区二区三区| 91麻豆免费看片| 久久蜜桃一区二区| 日本不卡在线视频| 欧美亚洲禁片免费| 国产精品第五页| 国产高清亚洲一区| 精品免费视频一区二区| 丝袜亚洲另类丝袜在线| 欧美中文字幕一区二区三区亚洲| 中国av一区二区三区| 国产精品一区二区三区99| 欧美一区二区三区四区在线观看| 亚洲国产日韩精品| 色综合一区二区| 亚洲欧美偷拍卡通变态| 99精品在线观看视频| 日本一区二区电影| 国产成人综合亚洲91猫咪| 久久综合网色—综合色88| 久久疯狂做爰流白浆xx| 91精品国产综合久久精品图片| 日韩av中文在线观看| 在线91免费看| 视频一区中文字幕国产| 91精品久久久久久久99蜜桃| 爽好多水快深点欧美视频| 欧美日韩国产一二三| 午夜精品久久久久久久久| 欧美日韩久久不卡| 亚瑟在线精品视频| 91精品国产黑色紧身裤美女| 日本不卡免费在线视频| 日韩午夜激情电影| 久久99精品一区二区三区| 精品国产不卡一区二区三区| 激情丁香综合五月| 国产女同性恋一区二区| av不卡免费在线观看| 亚洲精品美腿丝袜| 欧美精品aⅴ在线视频| 秋霞电影网一区二区| 久久综合久久综合久久综合| 国产盗摄一区二区| 亚洲人吸女人奶水| 91成人看片片| 男男gaygay亚洲| 国产亚洲成av人在线观看导航| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 蜜臀久久久99精品久久久久久| 精品国产免费人成电影在线观看四季| 国产一区视频在线看| 中文字幕精品在线不卡| 欧洲生活片亚洲生活在线观看| 日韩国产精品久久久| 久久久99精品久久| 欧美在线|欧美|