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

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

?? tty_io.c

?? linux0.11內(nèi)核源代碼,學(xué)習(xí)內(nèi)核入門必看
?? C
字號(hào):
/* *  linux/kernel/tty_io.c * *  (C) 1991  Linus Torvalds *//* * 'tty_io.c' gives an orthogonal feeling to tty's, be they consoles * or rs-channels. It also implements echoing, cooked mode etc. * * Kill-line thanks to John T Kohl. */#include <ctype.h>#include <errno.h>#include <signal.h>#define ALRMMASK (1<<(SIGALRM-1))#define KILLMASK (1<<(SIGKILL-1))#define INTMASK (1<<(SIGINT-1))#define QUITMASK (1<<(SIGQUIT-1))#define TSTPMASK (1<<(SIGTSTP-1))#include <linux/sched.h>#include <linux/tty.h>#include <asm/segment.h>#include <asm/system.h>#define _L_FLAG(tty,f)	((tty)->termios.c_lflag & f)#define _I_FLAG(tty,f)	((tty)->termios.c_iflag & f)#define _O_FLAG(tty,f)	((tty)->termios.c_oflag & f)#define L_CANON(tty)	_L_FLAG((tty),ICANON)#define L_ISIG(tty)	_L_FLAG((tty),ISIG)#define L_ECHO(tty)	_L_FLAG((tty),ECHO)#define L_ECHOE(tty)	_L_FLAG((tty),ECHOE)#define L_ECHOK(tty)	_L_FLAG((tty),ECHOK)#define L_ECHOCTL(tty)	_L_FLAG((tty),ECHOCTL)#define L_ECHOKE(tty)	_L_FLAG((tty),ECHOKE)#define I_UCLC(tty)	_I_FLAG((tty),IUCLC)#define I_NLCR(tty)	_I_FLAG((tty),INLCR)#define I_CRNL(tty)	_I_FLAG((tty),ICRNL)#define I_NOCR(tty)	_I_FLAG((tty),IGNCR)#define O_POST(tty)	_O_FLAG((tty),OPOST)#define O_NLCR(tty)	_O_FLAG((tty),ONLCR)#define O_CRNL(tty)	_O_FLAG((tty),OCRNL)#define O_NLRET(tty)	_O_FLAG((tty),ONLRET)#define O_LCUC(tty)	_O_FLAG((tty),OLCUC)struct tty_struct tty_table[] = {	{		{ICRNL,		/* change incoming CR to NL */		OPOST|ONLCR,	/* change outgoing NL to CRNL */		0,		ISIG | ICANON | ECHO | ECHOCTL | ECHOKE,		0,		/* console termio */		INIT_C_CC},		0,			/* initial pgrp */		0,			/* initial stopped */		con_write,		{0,0,0,0,""},		/* console read-queue */		{0,0,0,0,""},		/* console write-queue */		{0,0,0,0,""}		/* console secondary queue */	},{		{0, /* no translation */		0,  /* no translation */		B2400 | CS8,		0,		0,		INIT_C_CC},		0,		0,		rs_write,		{0x3f8,0,0,0,""},		/* rs 1 */		{0x3f8,0,0,0,""},		{0,0,0,0,""}	},{		{0, /* no translation */		0,  /* no translation */		B2400 | CS8,		0,		0,		INIT_C_CC},		0,		0,		rs_write,		{0x2f8,0,0,0,""},		/* rs 2 */		{0x2f8,0,0,0,""},		{0,0,0,0,""}	}};/* * these are the tables used by the machine code handlers. * you can implement pseudo-tty's or something by changing * them. Currently not done. */struct tty_queue * table_list[]={	&tty_table[0].read_q, &tty_table[0].write_q,	&tty_table[1].read_q, &tty_table[1].write_q,	&tty_table[2].read_q, &tty_table[2].write_q	};void tty_init(void){	rs_init();	con_init();}void tty_intr(struct tty_struct * tty, int mask){	int i;	if (tty->pgrp <= 0)		return;	for (i=0;i<NR_TASKS;i++)		if (task[i] && task[i]->pgrp==tty->pgrp)			task[i]->signal |= mask;}static void sleep_if_empty(struct tty_queue * queue){	cli();	while (!current->signal && EMPTY(*queue))		interruptible_sleep_on(&queue->proc_list);	sti();}static void sleep_if_full(struct tty_queue * queue){	if (!FULL(*queue))		return;	cli();	while (!current->signal && LEFT(*queue)<128)		interruptible_sleep_on(&queue->proc_list);	sti();}void wait_for_keypress(void){	sleep_if_empty(&tty_table[0].secondary);}void copy_to_cooked(struct tty_struct * tty){	signed char c;	while (!EMPTY(tty->read_q) && !FULL(tty->secondary)) {		GETCH(tty->read_q,c);		if (c==13)			if (I_CRNL(tty))				c=10;			else if (I_NOCR(tty))				continue;			else ;		else if (c==10 && I_NLCR(tty))			c=13;		if (I_UCLC(tty))			c=tolower(c);		if (L_CANON(tty)) {			if (c==KILL_CHAR(tty)) {				/* deal with killing the input line */				while(!(EMPTY(tty->secondary) ||				        (c=LAST(tty->secondary))==10 ||				        c==EOF_CHAR(tty))) {					if (L_ECHO(tty)) {						if (c<32)							PUTCH(127,tty->write_q);						PUTCH(127,tty->write_q);						tty->write(tty);					}					DEC(tty->secondary.head);				}				continue;			}			if (c==ERASE_CHAR(tty)) {				if (EMPTY(tty->secondary) ||				   (c=LAST(tty->secondary))==10 ||				   c==EOF_CHAR(tty))					continue;				if (L_ECHO(tty)) {					if (c<32)						PUTCH(127,tty->write_q);					PUTCH(127,tty->write_q);					tty->write(tty);				}				DEC(tty->secondary.head);				continue;			}			if (c==STOP_CHAR(tty)) {				tty->stopped=1;				continue;			}			if (c==START_CHAR(tty)) {				tty->stopped=0;				continue;			}		}		if (L_ISIG(tty)) {			if (c==INTR_CHAR(tty)) {				tty_intr(tty,INTMASK);				continue;			}			if (c==QUIT_CHAR(tty)) {				tty_intr(tty,QUITMASK);				continue;			}		}		if (c==10 || c==EOF_CHAR(tty))			tty->secondary.data++;		if (L_ECHO(tty)) {			if (c==10) {				PUTCH(10,tty->write_q);				PUTCH(13,tty->write_q);			} else if (c<32) {				if (L_ECHOCTL(tty)) {					PUTCH('^',tty->write_q);					PUTCH(c+64,tty->write_q);				}			} else				PUTCH(c,tty->write_q);			tty->write(tty);		}		PUTCH(c,tty->secondary);	}	wake_up(&tty->secondary.proc_list);}int tty_read(unsigned channel, char * buf, int nr){	struct tty_struct * tty;	char c, * b=buf;	int minimum,time,flag=0;	long oldalarm;	if (channel>2 || nr<0) return -1;	tty = &tty_table[channel];	oldalarm = current->alarm;	time = 10L*tty->termios.c_cc[VTIME];	minimum = tty->termios.c_cc[VMIN];	if (time && !minimum) {		minimum=1;		if (flag=(!oldalarm || time+jiffies<oldalarm))			current->alarm = time+jiffies;	}	if (minimum>nr)		minimum=nr;	while (nr>0) {		if (flag && (current->signal & ALRMMASK)) {			current->signal &= ~ALRMMASK;			break;		}		if (current->signal)			break;		if (EMPTY(tty->secondary) || (L_CANON(tty) &&		!tty->secondary.data && LEFT(tty->secondary)>20)) {			sleep_if_empty(&tty->secondary);			continue;		}		do {			GETCH(tty->secondary,c);			if (c==EOF_CHAR(tty) || c==10)				tty->secondary.data--;			if (c==EOF_CHAR(tty) && L_CANON(tty))				return (b-buf);			else {				put_fs_byte(c,b++);				if (!--nr)					break;			}		} while (nr>0 && !EMPTY(tty->secondary));		if (time && !L_CANON(tty))			if (flag=(!oldalarm || time+jiffies<oldalarm))				current->alarm = time+jiffies;			else				current->alarm = oldalarm;		if (L_CANON(tty)) {			if (b-buf)				break;		} else if (b-buf >= minimum)			break;	}	current->alarm = oldalarm;	if (current->signal && !(b-buf))		return -EINTR;	return (b-buf);}int tty_write(unsigned channel, char * buf, int nr){	static cr_flag=0;	struct tty_struct * tty;	char c, *b=buf;	if (channel>2 || nr<0) return -1;	tty = channel + tty_table;	while (nr>0) {		sleep_if_full(&tty->write_q);		if (current->signal)			break;		while (nr>0 && !FULL(tty->write_q)) {			c=get_fs_byte(b);			if (O_POST(tty)) {				if (c=='\r' && O_CRNL(tty))					c='\n';				else if (c=='\n' && O_NLRET(tty))					c='\r';				if (c=='\n' && !cr_flag && O_NLCR(tty)) {					cr_flag = 1;					PUTCH(13,tty->write_q);					continue;				}				if (O_LCUC(tty))					c=toupper(c);			}			b++; nr--;			cr_flag = 0;			PUTCH(c,tty->write_q);		}		tty->write(tty);		if (nr>0)			schedule();	}	return (b-buf);}/* * Jeh, sometimes I really like the 386. * This routine is called from an interrupt, * and there should be absolutely no problem * with sleeping even in an interrupt (I hope). * Of course, if somebody proves me wrong, I'll * hate intel for all time :-). We'll have to * be careful and see to reinstating the interrupt * chips before calling this, though. * * I don't think we sleep here under normal circumstances * anyway, which is good, as the task sleeping might be * totally innocent. */void do_tty_interrupt(int tty){	copy_to_cooked(tty_table+tty);}void chr_dev_init(void){}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩黄色影视| 欧美日韩一级黄| 欧美一区二区三区四区五区| 亚洲视频一区在线观看| 国产在线精品一区二区夜色 | 强制捆绑调教一区二区| 在线免费观看日韩欧美| 亚洲精品v日韩精品| 91美女视频网站| 亚洲激情在线激情| 国产婷婷色一区二区三区 | 久久精品久久久精品美女| 日韩一区二区三区观看| 美女一区二区久久| 国产欧美一区二区三区在线看蜜臀| 国模一区二区三区白浆| 午夜精品久久久久久久久久| 欧美日韩在线播| 99国产精品久久| 亚洲va欧美va人人爽| 91精品国产日韩91久久久久久| 91色在线porny| 成人综合激情网| 亚洲精品成人精品456| 国产欧美精品一区二区色综合| 精品久久久久av影院| 国产麻豆精品在线| 看片网站欧美日韩| 久久av老司机精品网站导航| 午夜激情综合网| 午夜激情综合网| 午夜精品久久久久影视| 日韩成人免费电影| 日本一区二区三区在线不卡| ww久久中文字幕| 日本道免费精品一区二区三区| 日一区二区三区| 欧美国产成人精品| 欧美日本精品一区二区三区| 欧美综合亚洲图片综合区| 在线免费观看视频一区| 91福利精品视频| 91美女视频网站| 在线观看亚洲专区| 欧美在线看片a免费观看| 欧美日韩国产在线播放网站| 欧美日韩国产综合视频在线观看| 欧美日韩免费观看一区二区三区| 欧美日韩一区二区在线视频| 欧美日韩国产综合一区二区三区| 在线电影国产精品| 色综合久久久久综合99| 久久成人久久鬼色| 国产精品亚洲人在线观看| 亚洲国产精品影院| 国产女同性恋一区二区| 国产精品美女久久福利网站| 日韩欧美高清dvd碟片| 色婷婷av一区二区三区软件| 日本二三区不卡| 日韩亚洲欧美高清| 亚洲国产精品精华液ab| 综合中文字幕亚洲| 亚洲成人一区二区在线观看| 久久精品噜噜噜成人88aⅴ| 国产成人免费网站| 蜜桃传媒麻豆第一区在线观看| 久久99精品久久久久婷婷| 日本不卡高清视频| 国产一区二区在线影院| 99re视频这里只有精品| 欧美精品第一页| 久久精品亚洲精品国产欧美kt∨| 国产精品高清亚洲| 国产精品毛片无遮挡高清| 一区二区三区加勒比av| 亚洲精品精品亚洲| 蜜桃精品视频在线| 成人国产精品视频| 波多野结衣中文字幕一区 | 亚洲欧美偷拍卡通变态| 中文字幕一区二区三区不卡| 国产喂奶挤奶一区二区三区| 亚洲精品国产视频| 精品一区精品二区高清| 91色porny在线视频| 欧美不卡一区二区三区四区| 自拍偷拍亚洲欧美日韩| 久久精品国产在热久久| 91豆麻精品91久久久久久| 精品国产精品网麻豆系列 | 国产午夜精品久久久久久免费视| 亚洲一区二区影院| 三级久久三级久久久| 成人视屏免费看| 日韩三级免费观看| 亚洲精品精品亚洲| 国产成a人亚洲精品| 菠萝蜜视频在线观看一区| 日韩一区二区免费视频| 一区二区三区日韩精品视频| 国产精品白丝jk黑袜喷水| 欧美久久一二区| 亚洲欧洲日韩av| 国产米奇在线777精品观看| 欧美肥胖老妇做爰| 亚洲精品v日韩精品| 成人91在线观看| 国产亚洲欧美一级| 免费在线视频一区| 欧美日韩国产另类不卡| 亚洲欧美激情插 | 国产主播一区二区三区| 欧美日韩不卡一区二区| 亚洲毛片av在线| www.亚洲在线| 在线观看一区二区视频| 国产精品久久久久久久久快鸭 | 久久久久久久精| 国产精品对白交换视频 | 成人综合在线视频| 久久综合九色欧美综合狠狠| 青青草国产成人av片免费| 欧美日韩久久一区二区| 亚洲综合免费观看高清完整版 | 亚洲国产成人tv| 色先锋aa成人| 一区二区三区在线看| 91一区二区在线| 日韩毛片一二三区| 99精品视频在线免费观看| |精品福利一区二区三区| 96av麻豆蜜桃一区二区| 综合久久久久久| 91视频在线观看免费| 亚洲精品国产成人久久av盗摄| 色综合欧美在线| 亚洲成人在线网站| 91精品国产免费久久综合| 日本午夜精品一区二区三区电影| 欧美欧美欧美欧美首页| 秋霞午夜av一区二区三区 | 亚洲一二三四区| 欧美色综合天天久久综合精品| 久久一区二区视频| 国产在线一区观看| 国产欧美综合在线| 99久久精品免费看国产免费软件| 中文字幕在线不卡| 91高清视频在线| 天天综合色天天综合| 日韩限制级电影在线观看| 久久国产精品99久久人人澡| 国产日韩视频一区二区三区| 不卡视频一二三| 亚洲一区二区三区视频在线| 欧美日韩大陆在线| 久久激情综合网| 国产蜜臀av在线一区二区三区| av不卡一区二区三区| 亚洲综合另类小说| 精品久久一区二区三区| 国产91丝袜在线18| 亚洲一区视频在线| 日韩精品中午字幕| 成人黄色a**站在线观看| 亚洲电影视频在线| 久久久久免费观看| 一本一道综合狠狠老| 日本成人中文字幕| 中文字幕亚洲不卡| 在线成人高清不卡| 国产91综合一区在线观看| 亚洲国产精品欧美一二99| 精品久久国产老人久久综合| 成人av在线资源网站| 日韩精品成人一区二区三区| 久久精品免费在线观看| 欧美在线|欧美| 国产精品自产自拍| 亚洲欧洲制服丝袜| 精品理论电影在线观看| 在线亚洲一区观看| 国产精品资源在线看| 亚洲一区二区三区四区五区黄| 久久久久久影视| 9191久久久久久久久久久| 亚洲chinese男男1069| 久久精品欧美一区二区三区麻豆| 欧美视频一区二区三区四区| 国产成人免费视频一区| 人禽交欧美网站| 亚洲精品一二三四区| 久久久精品影视| 7777精品久久久大香线蕉| 99久久久国产精品免费蜜臀| 国模一区二区三区白浆| 日本中文在线一区| 亚洲精品国产成人久久av盗摄| 日本一区二区久久|