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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? serial.c

?? <Linux1.0核心游記>電子書(shū)+書(shū)后源碼+Linux1.0源碼
?? C
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
	}	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE|			 ASYNC_CLOSING);	wake_up_interruptible(&info->close_wait);}/* * rs_hangup() --- called by tty_hangup() when a hangup is signaled. */void rs_hangup(struct tty_struct *tty){	struct async_struct * info;	int line;	line = DEV_TO_SL(tty->line);	if ((line < 0) || (line >= NR_PORTS))		return;	info = rs_table + line;		shutdown(info, 1);	clear_bit(line, rs_event);	info->event = 0;	info->count = 0;	info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);	info->tty = 0;	wake_up_interruptible(&info->open_wait);}/* * ------------------------------------------------------------ * rs_open() and friends * ------------------------------------------------------------ */static int block_til_ready(struct tty_struct *tty, struct file * filp,			   struct async_struct *info){	struct wait_queue wait = { current, NULL };	int		retval;	int		do_clocal = C_CLOCAL(tty);	/*	 * If the device is in the middle of being closed, then block	 * until it's done, and then try again.	 */	if (info->flags & ASYNC_CLOSING) {		interruptible_sleep_on(&info->close_wait);#ifdef SERIAL_DO_RESTART		if (info->flags & ASYNC_HUP_NOTIFY)			return -EAGAIN;		else			return -ERESTARTSYS;#else		return -EAGAIN;#endif	}	/*	 * If this is a callout device, then just make sure the normal	 * device isn't being used.	 */	if (MAJOR(filp->f_rdev) == TTYAUX_MAJOR) {		if (info->flags & ASYNC_NORMAL_ACTIVE)			return -EBUSY;		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&		    (info->flags & ASYNC_SESSION_LOCKOUT) &&		    (info->session != current->session))		    return -EBUSY;		if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&		    (info->flags & ASYNC_PGRP_LOCKOUT) &&		    (info->pgrp != current->pgrp))		    return -EBUSY;		info->flags |= ASYNC_CALLOUT_ACTIVE;		return 0;	}		/*	 * If non-blocking mode is set, then make the check up front	 * and then exit.	 */	if (filp->f_flags & O_NONBLOCK) {		if (info->flags & ASYNC_CALLOUT_ACTIVE)			return -EBUSY;		info->flags |= ASYNC_NORMAL_ACTIVE;		return 0;	}	/*	 * Block waiting for the carrier detect and the line to become	 * free (i.e., not in use by the callout).  While we are in	 * this loop, info->count is dropped by one, so that	 * rs_close() knows when to free things.  We restore it upon	 * exit, either normal or abnormal.	 */	retval = 0;	add_wait_queue(&info->open_wait, &wait);#ifdef SERIAL_DEBUG_OPEN	printk("block_til_ready before block: ttys%d, count = %d\n",	       info->line, info->count);#endif	info->count--;	info->blocked_open++;	while (1) {		cli();		if (!(info->flags & ASYNC_CALLOUT_ACTIVE))			serial_out(info, UART_MCR,				   serial_inp(info, UART_MCR) |				   (UART_MCR_DTR | UART_MCR_RTS));		sti();		current->state = TASK_INTERRUPTIBLE;		if (tty_hung_up_p(filp) ||		    !(info->flags & ASYNC_INITIALIZED)) {#ifdef SERIAL_DO_RESTART			if (info->flags & ASYNC_HUP_NOTIFY)				retval = -EAGAIN;			else				retval = -ERESTARTSYS;#else			retval = -EAGAIN;#endif			break;		}		if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&		    !(info->flags & ASYNC_CLOSING) &&		    (do_clocal || (serial_in(info, UART_MSR) &				   UART_MSR_DCD)))			break;		if (current->signal & ~current->blocked) {			retval = -ERESTARTSYS;			break;		}#ifdef SERIAL_DEBUG_OPEN		printk("block_til_ready blocking: ttys%d, count = %d\n",		       info->line, info->count);#endif		schedule();	}	current->state = TASK_RUNNING;	remove_wait_queue(&info->open_wait, &wait);	if (!tty_hung_up_p(filp))		info->count++;	info->blocked_open--;#ifdef SERIAL_DEBUG_OPEN	printk("block_til_ready after blocking: ttys%d, count = %d\n",	       info->line, info->count);#endif	if (retval)		return retval;	info->flags |= ASYNC_NORMAL_ACTIVE;	return 0;}	/* * This routine is called whenever a serial port is opened.  It * enables interrupts for a serial port, linking in its async structure into * the IRQ chain.   It also performs the serial-speicific * initalization for the tty structure. */int rs_open(struct tty_struct *tty, struct file * filp){	struct async_struct	*info;	int 			retval, line;	line = DEV_TO_SL(tty->line);	if ((line < 0) || (line >= NR_PORTS))		return -ENODEV;	info = rs_table + line;#ifdef SERIAL_DEBUG_OPEN	printk("rs_open ttys%d, count = %d\n", info->line, info->count);#endif	info->count++;	info->tty = tty;		tty->write = rs_write;	tty->close = rs_close;	tty->ioctl = rs_ioctl;	tty->throttle = rs_throttle;	tty->set_termios = rs_set_termios;	tty->stop = rs_stop;	tty->start = rs_start;	tty->hangup = rs_hangup;	if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {		if (MAJOR(filp->f_rdev) == TTY_MAJOR)			*tty->termios = info->normal_termios;		else 			*tty->termios = info->callout_termios;	}	/*	 * Start up serial port	 */	retval = startup(info, 1);	if (retval)		return retval;	retval = block_til_ready(tty, filp, info);	if (retval) {#ifdef SERIAL_DEBUG_OPEN		printk("rs_open returning after block_til_ready with %d\n",		       retval);#endif		return retval;	}	info->session = current->session;	info->pgrp = current->pgrp;#ifdef SERIAL_DEBUG_OPEN	printk("rs_open ttys%d successful...", info->line);#endif	return 0;}/* * --------------------------------------------------------------------- * rs_init() and friends * * rs_init() is called at boot-time to initialize the serial driver. * --------------------------------------------------------------------- *//* * This routine prints out the appropriate serial driver version * number, and identifies which options were configured into this * driver. */static void show_serial_version(void){	printk("Serial driver version 3.99a with");#ifdef CONFIG_AST_FOURPORT	printk(" AST_FOURPORT");#define SERIAL_OPT#endif#ifdef CONFIG_ACCENT_ASYNC	printk(" ACCENT_ASYNC");#define SERIAL_OPT#endif#ifdef CONFIG_HUB6	printk(" HUB-6");#define SERIAL_OPT#endif#ifdef CONFIG_AUTO_IRQ	printk (" AUTO_IRQ");#define SERIAL_OPT#endif#ifdef SERIAL_OPT	printk(" enabled\n");#else	printk(" no serial options enabled\n");#endif#undef SERIAL_OPT}/* * This routine is called by do_auto_irq(); it attempts to determine * which interrupt a serial port is configured to use.  It is not * fool-proof, but it works a large part of the time. */static int get_auto_irq(struct async_struct *info){	unsigned char save_MCR, save_IER, save_ICP=0;	unsigned short ICP=0, port = info->port;	unsigned long timeout;		/*	 * Enable interrupts and see who answers	 */	rs_irq_triggered = 0;	cli();	save_IER = serial_inp(info, UART_IER);	save_MCR = serial_inp(info, UART_MCR);	if (info->flags & ASYNC_FOURPORT)  {		serial_outp(info, UART_MCR, UART_MCR_DTR | UART_MCR_RTS);		serial_outp(info, UART_IER, 0x0f);	/* enable all intrs */		ICP = (port & 0xFE0) | 0x01F;		save_ICP = inb_p(ICP);		outb_p(0x80, ICP);		(void) inb_p(ICP);	} else {		serial_outp(info, UART_MCR,			    UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2);		serial_outp(info, UART_IER, 0x0f);	/* enable all intrs */	}	sti();	/*	 * Next, clear the interrupt registers.	 */	(void)serial_inp(info, UART_LSR);	(void)serial_inp(info, UART_RX);	(void)serial_inp(info, UART_IIR);	(void)serial_inp(info, UART_MSR);		timeout = jiffies+2;	while (timeout >= jiffies) {		if (rs_irq_triggered)			break;	}	/*	 * Now check to see if we got any business, and clean up.	 */	cli();	serial_outp(info, UART_IER, save_IER);	serial_outp(info, UART_MCR, save_MCR);	if (info->flags & ASYNC_FOURPORT)		outb_p(save_ICP, ICP);	sti();	return(rs_irq_triggered);}/* * Calls get_auto_irq() multiple times, to make sure we don't get * faked out by random interrupts */static int do_auto_irq(struct async_struct * info){	unsigned 		port = info->port;	int 			irq_lines = 0;	int			irq_try_1 = 0, irq_try_2 = 0;	int			retries;	unsigned long flags;	if (!port)		return 0;	/* Turn on interrupts (they may be off) */	save_flags(flags); sti();	irq_lines = grab_all_interrupts(rs_wild_int_mask);		for (retries = 0; retries < 5; retries++) {		if (!irq_try_1)			irq_try_1 = get_auto_irq(info);		if (!irq_try_2)			irq_try_2 = get_auto_irq(info);		if (irq_try_1 && irq_try_2) {			if (irq_try_1 == irq_try_2)				break;			irq_try_1 = irq_try_2 = 0;		}	}	restore_flags(flags);	free_all_interrupts(irq_lines);	return (irq_try_1 == irq_try_2) ? irq_try_1 : 0;}/* * This routine is called by rs_init() to initialize a specific serial * port.  It determines what type of UART ship this serial port is * using: 8250, 16450, 16550, 16550A.  The important question is * whether or not this UART is a 16550A or not, since this will * determine whether or not we can use its FIFO features or not. */static void autoconfig(struct async_struct * info){	unsigned char status1, status2, scratch, scratch2;	unsigned port = info->port;	unsigned long flags;	info->type = PORT_UNKNOWN;		if (!port)		return;	save_flags(flags); cli();		/*	 * Do a simple existence test first; if we fail this, there's	 * no point trying anything else.	 */	scratch = serial_inp(info, UART_IER);	serial_outp(info, UART_IER, 0);	scratch2 = serial_inp(info, UART_IER);	serial_outp(info, UART_IER, scratch);	if (scratch2) {		restore_flags(flags);		return;		/* We failed; there's nothing here */	}	/* 	 * Check to see if a UART is really there.  Certain broken	 * internal modems based on the Rockwell chipset fail this	 * test, because they apparently don't implement the loopback	 * test mode.  So this test is skipped on the COM 1 through	 * COM 4 ports.  This *should* be safe, since no board	 * manufactucturer would be stupid enough to design a board	 * that conflicts with COM 1-4 --- we hope!	 */	if (!(info->flags & ASYNC_SKIP_TEST)) {		scratch = serial_inp(info, UART_MCR);		serial_outp(info, UART_MCR, UART_MCR_LOOP | scratch);		scratch2 = serial_inp(info, UART_MSR);		serial_outp(info, UART_MCR, UART_MCR_LOOP | 0x0A);		status1 = serial_inp(info, UART_MSR) & 0xF0;		serial_outp(info, UART_MCR, scratch);		serial_outp(info, UART_MSR, scratch2);		if (status1 != 0x90) {			restore_flags(flags);			return;		}	} 		/*	 * If the AUTO_IRQ flag is set, try to do the automatic IRQ	 * detection.	 */	if (info->flags & ASYNC_AUTO_IRQ)		info->irq = do_auto_irq(info);			serial_outp(info, UART_FCR, UART_FCR_ENABLE_FIFO);	scratch = serial_in(info, UART_IIR) >> 6;	info->xmit_fifo_size = 1;	switch (scratch) {		case 0:			info->type = PORT_16450;			break;		case 1:			info->type = PORT_UNKNOWN;			break;		case 2:			info->type = PORT_16550;			break;		case 3:			info->type = PORT_16550A;			info->xmit_fifo_size = 16;			break;	}	if (info->type == PORT_16450) {		scratch = serial_in(info, UART_SCR);		serial_outp(info, UART_SCR, 0xa5);		status1 = serial_in(info, UART_SCR);		serial_outp(info, UART_SCR, 0x5a);		status2 = serial_in(info, UART_SCR);		serial_outp(info, UART_SCR, scratch);		if ((status1 != 0xa5) || (status2 != 0x5a))			info->type = PORT_8250;	}	/*	 * Reset the UART.	 */	serial_outp(info, UART_MCR, 0x00);	serial_outp(info, UART_FCR, (UART_FCR_CLEAR_RCVR |				     UART_FCR_CLEAR_XMIT));	(void)serial_in(info, UART_RX);		restore_flags(flags);}/* * The serial driver boot-time initialization code! */long rs_init(long kmem_start){	int i;	struct async_struct * info;		memset(&rs_event, 0, sizeof(rs_event));	bh_base[SERIAL_BH].routine = do_softint;	timer_table[RS_TIMER].fn = rs_timer;	timer_table[RS_TIMER].expires = 0;	IRQ_active = 0;#ifdef CONFIG_AUTO_IRQ	rs_wild_int_mask = check_wild_interrupts(1);#endif	for (i = 0; i < 16; i++) {		IRQ_ports[i] = 0;		IRQ_timeout[i] = 0;	}		show_serial_version();	for (i = 0, info = rs_table; i < NR_PORTS; i++,info++) {		info->line = i;		info->tty = 0;		info->type = PORT_UNKNOWN;		info->custom_divisor = 0;		info->close_delay = 50;		info->x_char = 0;		info->event = 0;		info->count = 0;		info->blocked_open = 0;		memset(&info->callout_termios, 0, sizeof(struct termios));		memset(&info->normal_termios, 0, sizeof(struct termios));		info->open_wait = 0;		info->xmit_wait = 0;		info->close_wait = 0;		info->next_port = 0;		info->prev_port = 0;		if (info->irq == 2)			info->irq = 9;		if (!(info->flags & ASYNC_BOOT_AUTOCONF))			continue;		autoconfig(info);		if (info->type == PORT_UNKNOWN)			continue;		printk("tty%02d%s at 0x%04x (irq = %d)", info->line, 		       (info->flags & ASYNC_FOURPORT) ? " FourPort" : "",		       info->port, info->irq);		switch (info->type) {			case PORT_8250:				printk(" is a 8250\n");				break;			case PORT_16450:				printk(" is a 16450\n");				break;			case PORT_16550:				printk(" is a 16550\n");				break;			case PORT_16550A:				printk(" is a 16550A\n");				break;			default:				printk("\n");				break;		}	}	return kmem_start;}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产大陆亚洲精品国产| 欧美精品一区二区三区在线播放| 成人精品一区二区三区中文字幕| 国产一本一道久久香蕉| 国产在线观看一区二区| 久久99国产乱子伦精品免费| 蜜臀av性久久久久蜜臀aⅴ流畅 | 国产精品久久久久久久岛一牛影视 | 精品国产一区二区三区四区四 | 专区另类欧美日韩| 亚洲三级小视频| 亚洲精品国产高清久久伦理二区| 中文字幕一区二区三区四区 | 麻豆国产欧美日韩综合精品二区| 日本欧美久久久久免费播放网| 日本美女一区二区三区| 乱一区二区av| 国产精品乡下勾搭老头1| 国产成人av电影在线播放| 成人在线视频一区| 色一情一伦一子一伦一区| 欧美午夜精品一区二区蜜桃 | 亚洲欧洲日韩在线| 亚洲自拍偷拍图区| 视频一区视频二区在线观看| 青青草伊人久久| 国产美女精品人人做人人爽| 不卡一区中文字幕| 欧美丝袜丝nylons| 日韩三级精品电影久久久| 久久精品一区四区| 一区二区三区在线看| 日本免费新一区视频| 国产福利精品导航| 欧美在线视频不卡| 久久综合九色欧美综合狠狠| 中文字幕欧美一| 午夜久久久久久久久久一区二区| 精品制服美女丁香| 懂色av中文一区二区三区| 欧美色综合网站| 精品国产sm最大网站| 中文字幕在线不卡| 日韩成人精品在线观看| 成人av资源下载| 欧美三级日韩三级| 欧美国产一区二区在线观看| 夜夜嗨av一区二区三区中文字幕| 美女精品一区二区| 91网页版在线| 日韩精品一区二区三区在线播放 | 亚洲欧洲成人av每日更新| 日韩国产精品久久| 不卡大黄网站免费看| 91精品免费观看| 中文字幕一区二区三区视频 | 精品国产在天天线2019| 亚洲精品日韩综合观看成人91| 久久成人久久鬼色| 日本电影欧美片| 国产午夜精品久久久久久久 | 波多野结衣一区二区三区| 91精品国产综合久久香蕉的特点| 国产精品白丝在线| 国产在线国偷精品免费看| 欧美另类久久久品| 亚洲欧美另类图片小说| 国产乱码字幕精品高清av| 欧美精品一二三四| 亚洲精选视频在线| 丁香另类激情小说| 26uuu欧美| 日韩电影在线观看网站| 91成人看片片| 最新欧美精品一区二区三区| 国产乱子轮精品视频| 日韩欧美一二三区| 亚洲成人精品一区| 91视频一区二区三区| 中文字幕乱码亚洲精品一区| 麻豆91在线播放免费| 欧美日韩不卡视频| 夜夜嗨av一区二区三区网页 | 中文字幕精品综合| 国产乱码一区二区三区| 日韩午夜激情免费电影| 亚洲成人资源在线| 欧美日韩三级在线| 一区二区三区精品久久久| av一区二区三区黑人| 国产欧美精品一区aⅴ影院| 久久爱www久久做| 日韩一区二区三区电影在线观看| 亚洲大片在线观看| 欧美视频一区二区在线观看| 亚洲人吸女人奶水| 色综合久久久久综合99| 国产精品久久久久aaaa樱花| 国产一区二区三区久久悠悠色av| 91精品国产综合久久精品| 亚洲午夜免费视频| 欧美午夜寂寞影院| 亚洲高清不卡在线观看| 欧美自拍丝袜亚洲| 亚洲成av人在线观看| 欧美日韩国产精品自在自线| 亚洲国产综合在线| 欧美美女bb生活片| 天堂影院一区二区| 日韩一区二区三| 欧美96一区二区免费视频| 欧美成人精品二区三区99精品| 蜜桃视频在线观看一区| 欧美xfplay| 国产成人欧美日韩在线电影| 国产精品美女一区二区在线观看| 成人a免费在线看| 一区二区久久久久| 91精品欧美久久久久久动漫 | 欧美欧美午夜aⅴ在线观看| 日韩国产欧美视频| 亚洲精品一区二区三区精华液| 国产美女主播视频一区| 国产精品久久久久久久久免费樱桃 | 国产美女在线精品| 国产精品乱人伦一区二区| 91麻豆精东视频| 午夜精品久久一牛影视| 欧美videossexotv100| 国产精品一区久久久久| 最新久久zyz资源站| 欧美在线综合视频| 久久66热re国产| 中文av一区二区| 欧美性大战xxxxx久久久| 理论电影国产精品| 欧美激情一区不卡| 欧美日韩亚洲另类| 国产乱淫av一区二区三区| 亚洲另类一区二区| 日韩午夜av一区| 国产成人精品亚洲午夜麻豆| 亚洲视频免费看| 欧美一区二区三区视频免费| 国产成人鲁色资源国产91色综| 一区二区在线免费观看| 欧美成人激情免费网| www.日韩av| 日本vs亚洲vs韩国一区三区 | 黑人巨大精品欧美一区| 亚洲女性喷水在线观看一区| 日韩欧美你懂的| 99精品国产视频| 精品一区二区国语对白| 亚洲色图在线视频| 欧美成人性战久久| 日本韩国一区二区三区视频| 国产自产高清不卡| 亚洲国产毛片aaaaa无费看| 国产亚洲一二三区| 欧美日韩激情一区二区三区| 成人av电影免费观看| 久久精品99国产国产精| 一区二区三区 在线观看视频| 亚洲精品一区二区三区影院 | 亚洲欧洲另类国产综合| 日韩精品一区在线| 欧美色图12p| 成人综合婷婷国产精品久久蜜臀 | 欧美亚洲精品一区| 国产成人丝袜美腿| 麻豆国产欧美一区二区三区| 亚洲午夜日本在线观看| 国产精品久久三| 久久久噜噜噜久噜久久综合| 精品视频在线免费看| 99免费精品在线观看| 黑人巨大精品欧美一区| 日韩在线一二三区| 一区二区三区四区不卡在线 | 日本sm残虐另类| 亚洲一级在线观看| 亚洲青青青在线视频| 国产婷婷色一区二区三区在线| 日韩精品专区在线| 欧美精品少妇一区二区三区| 日本久久一区二区| 91麻豆免费看| 99视频精品在线| 成人动漫av在线| 国产一区二区三区四| 蜜桃视频一区二区三区| 男男gaygay亚洲| 视频一区二区中文字幕| 一区二区三区日韩欧美精品| 国产精品久久免费看| 国产欧美日韩在线观看| 国产视频一区二区在线| 久久午夜免费电影| 精品va天堂亚洲国产|