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

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

?? tty_io.c

?? 這是一個linux011版本的源碼
?? C
字號:
/* *  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 int 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){}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产精品乱码不99| 成人精品鲁一区一区二区| 一本大道综合伊人精品热热| 国产精品久久久爽爽爽麻豆色哟哟| 国产剧情一区二区三区| 中文字幕av在线一区二区三区| 99在线热播精品免费| 亚洲韩国精品一区| 欧美一区二区精美| 国产精品综合一区二区| 国产欧美一区二区精品婷婷| 91在线免费看| 首页国产丝袜综合| 国产欧美一区二区精品久导航| 色婷婷久久99综合精品jk白丝| 天天色天天爱天天射综合| 日韩欧美资源站| 国产一区二区伦理| 一区二区三区在线观看欧美| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲精品综合在线| 91麻豆精品国产91久久久使用方法 | 一二三区精品视频| 日韩欧美国产麻豆| 99国产精品久久久久| 五月天激情小说综合| 国产精品美女视频| 欧美另类变人与禽xxxxx| 国产91露脸合集magnet| 亚洲第一搞黄网站| 国产欧美一区二区在线观看| 欧美精品自拍偷拍| 色婷婷亚洲精品| 粉嫩蜜臀av国产精品网站| 丝袜国产日韩另类美女| 日韩毛片视频在线看| 精品国产不卡一区二区三区| 在线精品观看国产| youjizz久久| 国产不卡免费视频| 久久成人麻豆午夜电影| 亚洲午夜一区二区| 亚洲精品成人少妇| 国产欧美日韩三级| 2023国产精华国产精品| 欧美日韩国产另类不卡| 波多野结衣在线aⅴ中文字幕不卡| 日韩av一区二区在线影视| 一区二区三区日韩精品| 国产精品美女久久久久久久久久久 | 午夜精品影院在线观看| 中文字幕一区二区三区视频| 久久综合色播五月| 日韩一区二区三区免费看 | 亚洲国产精品一区二区www| 国产日韩一级二级三级| 精品少妇一区二区三区日产乱码| 欧美色综合久久| 欧美视频完全免费看| 日本黄色一区二区| 欧洲精品一区二区| 欧美性猛交xxxx乱大交退制版 | 午夜国产不卡在线观看视频| 亚洲码国产岛国毛片在线| 亚洲欧美综合色| 亚洲日本护士毛茸茸| 亚洲天堂精品视频| 亚洲欧美日韩在线| 亚洲国产精品一区二区尤物区| 亚洲大片免费看| 全部av―极品视觉盛宴亚洲| 久久成人久久鬼色| 高清不卡在线观看| 色哟哟一区二区三区| 欧美综合在线视频| 日韩区在线观看| 欧美极品aⅴ影院| 亚洲女厕所小便bbb| 亚洲chinese男男1069| 日韩av中文字幕一区二区| 久久不见久久见免费视频7| 国产精品中文字幕日韩精品| av综合在线播放| 欧美午夜电影网| 精品久久久影院| 亚洲国产精品激情在线观看| 亚洲人成小说网站色在线 | 国产精品青草久久| 亚洲综合小说图片| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产精一品亚洲二区在线视频| 国产高清在线观看免费不卡| 91麻豆国产香蕉久久精品| 6080yy午夜一二三区久久| 国产亚洲婷婷免费| 午夜精品福利一区二区三区av | 大桥未久av一区二区三区中文| 91香蕉国产在线观看软件| 日韩亚洲欧美综合| 亚洲欧洲av一区二区三区久久| 日本成人在线一区| av在线这里只有精品| 91精品在线麻豆| 国产精品狼人久久影院观看方式| 亚洲午夜一区二区| 成+人+亚洲+综合天堂| 麻豆精品久久久| 中文字幕av免费专区久久| 亚洲一二三专区| 国产乱子轮精品视频| 欧美色图第一页| 国产精品美女www爽爽爽| 麻豆一区二区三区| 欧美日韩aaaaaa| 亚洲视频在线一区| 国产福利电影一区二区三区| 欧美老人xxxx18| 亚洲精品国产精品乱码不99| 国产精品白丝av| 日韩午夜激情视频| 天天影视色香欲综合网老头| 在线观看欧美精品| 亚洲欧美偷拍三级| 9久草视频在线视频精品| 日本一区二区电影| 国产伦精品一区二区三区免费| 欧美一区二区三区思思人| 亚洲高清三级视频| 91精品91久久久中77777| 国产精品萝li| 成人免费视频视频在线观看免费 | 国产精品久久久久久一区二区三区| 日本网站在线观看一区二区三区 | 久久久精品免费免费| 精品一区二区久久| 精品国产亚洲一区二区三区在线观看| 香蕉久久夜色精品国产使用方法 | 日韩欧美一级二级三级久久久| 日韩专区中文字幕一区二区| 欧美日韩在线免费视频| 亚洲成av人片在线| 欧美精品乱码久久久久久按摩| 日日摸夜夜添夜夜添精品视频| 日本久久一区二区| 午夜精品aaa| 日韩精品一区二区在线| 久久97超碰国产精品超碰| 精品国产伦一区二区三区观看体验| 久久精品久久99精品久久| 精品国产免费人成电影在线观看四季 | 亚洲一区二区美女| 欧美婷婷六月丁香综合色| 日韩黄色在线观看| 精品国产区一区| 国产v综合v亚洲欧| 国产精品久久久久影院老司| 99国产精品国产精品久久| 亚洲一区二区在线播放相泽| 欧美精品在线观看播放| 九一久久久久久| 国产精品久久久久精k8| 日本乱人伦一区| 麻豆精品精品国产自在97香蕉| 国产欧美精品一区二区色综合| 91蝌蚪porny| 久久精品99国产精品| 中文字幕在线不卡国产视频| 在线观看欧美黄色| 国产一区二区三区久久悠悠色av| 国产精品沙发午睡系列990531| 91免费精品国自产拍在线不卡| 日本午夜精品视频在线观看| 国产欧美日韩中文久久| 欧美人与禽zozo性伦| 国产aⅴ精品一区二区三区色成熟| 国产精品视频第一区| 9191久久久久久久久久久| 成人永久看片免费视频天堂| 亚洲精品ww久久久久久p站| 精品国产成人系列| 欧美日韩在线综合| 成人妖精视频yjsp地址| 日本不卡一二三| 国产精品久久久久影视| 日韩三级视频在线观看| 在线免费观看视频一区| 国产精品 日产精品 欧美精品| 亚洲电影在线播放| 中文字幕不卡在线播放| 日韩午夜中文字幕| 欧美午夜视频网站| 成人国产精品免费观看| 久久国产尿小便嘘嘘尿| 亚洲成av人片观看| 一区二区三区日韩欧美精品| 国产精品天天看| 国产亚洲综合av| 国产日韩欧美激情| 国产视频一区不卡| 亚洲精品一区二区三区香蕉|