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

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

?? su.c

?? 廣州斯道2410普及版II的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* $Id: su.c,v 1.54 2001/11/07 14:52:30 davem Exp $ * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI * * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be) * Copyright (C) 1998-1999  Pete Zaitcev   (zaitcev@yahoo.com) * * This is mainly a variation of drivers/char/serial.c, * credits go to authors mentioned therein. * * Fixed to use tty_get_baud_rate(). *   Theodore Ts'o <tytso@mit.edu>, 2001-Oct-12 *//* * Configuration section. */#undef SERIAL_PARANOIA_CHECK#define CONFIG_SERIAL_NOPAUSE_IO	/* Unused on sparc */#define SERIAL_DO_RESTART/* Set of debugging defines */#undef SERIAL_DEBUG_INTR#undef SERIAL_DEBUG_OPEN#undef SERIAL_DEBUG_FLOW#undef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT#undef SERIAL_DEBUG_THROTTLE#define RS_ISR_PASS_LIMIT 256/* * 0x20 is sun4m thing, Dave Redman heritage. * See arch/sparc/kernel/irq.c. */#define IRQ_4M(n)	((n)|0x20)#if defined(MODULE) && defined(SERIAL_DEBUG_MCOUNT)#define DBG_CNT(s)							\do {									\	printk("(%s): [%x] refc=%d, serc=%d, ttyc=%d -> %s\n",		\	       kdevname(tty->device), (info->flags), serial_refcount,	\	       info->count,tty->count,s);				\} while (0)#else#define DBG_CNT(s)#endif/* * End of serial driver configuration section. */#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/serial.h>#include <linux/serialP.h>#include <linux/serial_reg.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/bootmem.h>#include <linux/delay.h>#ifdef CONFIG_SERIAL_CONSOLE#include <linux/console.h>#include <linux/major.h>#endif#include <linux/sysrq.h>#include <asm/system.h>#include <asm/oplib.h>#include <asm/io.h>#include <asm/ebus.h>#ifdef CONFIG_SPARC64#include <asm/isa.h>#endif#include <asm/irq.h>#include <asm/uaccess.h>#include <asm/bitops.h>#include "sunserial.h"#include "sunkbd.h"#include "sunmouse.h"/* We are on a NS PC87303 clocked with 24.0 MHz, which results * in a UART clock of 1.8462 MHz. */#define BAUD_BASE	(1846200 / 16)#ifdef CONFIG_SERIAL_CONSOLEextern int serial_console;static struct console sercons;int su_serial_console_init(void);#endifenum su_type { SU_PORT_NONE, SU_PORT_MS, SU_PORT_KBD, SU_PORT_PORT };static char *su_typev[] = { "???", "mouse", "kbd", "serial" };#define SU_PROPSIZE	128/* * serial.c saves memory when it allocates async_info upon first open. * We have parts of state structure together because we do call startup * for keyboard and mouse. */struct su_struct {	int		 magic;	unsigned long	 port;	int		 baud_base;	int		 type;		/* Hardware type: e.g. 16550 */	int		 irq;	int		 flags;	int		 line;	int		 cflag;	enum su_type	 port_type;	/* Hookup type: e.g. mouse */	int		 is_console;	int		 port_node;	char		 name[16];	int		 xmit_fifo_size;	int		 custom_divisor;	unsigned short	 close_delay;	unsigned short	 closing_wait;	/* time to wait before closing */	struct tty_struct 	*tty;	int			read_status_mask;	int			ignore_status_mask;	int			timeout;	int			quot;	int			x_char;	/* xon/xoff character */	int			IER; 	/* Interrupt Enable Register */	int			MCR; 	/* Modem control register */	unsigned long		event;	int			blocked_open; /* # of blocked opens */	long			session; /* Session of opening process */	long			pgrp; /* pgrp of opening process */	unsigned char 		*xmit_buf;	int			xmit_head;	int			xmit_tail;	int			xmit_cnt;	struct tq_struct	tqueue;	wait_queue_head_t	open_wait;	wait_queue_head_t	close_wait;	wait_queue_head_t	delta_msr_wait;	int			count;	struct async_icount	icount;	struct termios		normal_termios, callout_termios;	unsigned long		last_active;	/* For async_struct, to be */};/* * Scan status structure. * "prop" is a local variable but it eats stack to keep it in each * stack frame of a recursive procedure. */struct su_probe_scan {	int msnode, kbnode;	/* PROM nodes for mouse and keyboard */	int msx, kbx;		/* minors for mouse and keyboard */	int devices;		/* scan index */	char prop[SU_PROPSIZE];};static char *serial_name = "PCIO serial driver";static char serial_version[16];static DECLARE_TASK_QUEUE(tq_serial);static struct tty_driver serial_driver, callout_driver;static int serial_refcount;/* number of characters left in xmit buffer before we ask for more */#define WAKEUP_CHARS 256static void autoconfig(struct su_struct *info);static void change_speed(struct su_struct *info, struct termios *old);static void su_wait_until_sent(struct tty_struct *tty, int timeout);/* * Here we define the default xmit fifo size used for each type of * UART */static struct serial_uart_config uart_config[] = {	{ "unknown", 1, 0 }, 	{ "8250", 1, 0 }, 	{ "16450", 1, 0 }, 	{ "16550", 1, 0 }, 	{ "16550A", 16, UART_CLEAR_FIFO | UART_USE_FIFO }, 	{ "cirrus", 1, 0 }, 	{ "ST16650", 1, UART_CLEAR_FIFO |UART_STARTECH }, 	{ "ST16650V2", 32, UART_CLEAR_FIFO | UART_USE_FIFO |		  UART_STARTECH }, 	{ "TI16750", 64, UART_CLEAR_FIFO | UART_USE_FIFO},	{ 0, 0}};#define NR_PORTS	4static struct su_struct su_table[NR_PORTS];static struct tty_struct *serial_table[NR_PORTS];static struct termios *serial_termios[NR_PORTS];static struct termios *serial_termios_locked[NR_PORTS];#ifndef MIN#define MIN(a,b)	((a) < (b) ? (a) : (b))#endif/* * tmp_buf is used as a temporary buffer by serial_write.  We need to * lock it in case the copy_from_user blocks while swapping in a page, * and some other program tries to do a serial write at the same time. * Since the lock will only come under contention when the system is * swapping and available memory is low, it makes sense to share one * buffer across all the serial ports, since it significantly saves * memory if large numbers of serial ports are open. */static unsigned char *tmp_buf;static DECLARE_MUTEX(tmp_buf_sem);static inline int serial_paranoia_check(struct su_struct *info,					kdev_t device, const char *routine){#ifdef SERIAL_PARANOIA_CHECK	static const char *badmagic = KERN_WARNING		"Warning: bad magic number for serial struct (%s) in %s\n";	static const char *badinfo = KERN_WARNING		"Warning: null su_struct for (%s) in %s\n";	if (!info) {		printk(badinfo, kdevname(device), routine);		return 1;	}	if (info->magic != SERIAL_MAGIC) {		printk(badmagic, kdevname(device), routine);		return 1;	}#endif	return 0;}static inlineunsigned int su_inb(struct su_struct *info, unsigned long offset){	return inb(info->port + offset);}static inline voidsu_outb(struct su_struct *info, unsigned long offset, int value){#ifndef __sparc_v9__	/*	 * MrCoffee has weird schematics: IRQ4 & P10(?) pins of SuperIO are	 * connected with a gate then go to SlavIO. When IRQ4 goes tristated	 * gate outputs a logical one. Since we use level triggered interrupts	 * we have lockup and watchdog reset. We cannot mask IRQ because	 * keyboard shares IRQ with us (Word has it as Bob Smelik's design).	 * This problem is similar to what Alpha people suffer, see serial.c.	 */	if (offset == UART_MCR) value |= UART_MCR_OUT2;#endif	outb(value, info->port + offset);}#define serial_in(info, off)		su_inb(info, off)#define serial_inp(info, off)		su_inb(info, off)#define serial_out(info, off, val)	su_outb(info, off, val)#define serial_outp(info, off, val)	su_outb(info, off, val)/* * ------------------------------------------------------------ * su_stop() and su_start() * * This routines are called before setting or resetting tty->stopped. * They enable or disable transmitter interrupts, as necessary. * ------------------------------------------------------------ */static void su_stop(struct tty_struct *tty){	struct su_struct *info = (struct su_struct *)tty->driver_data;	unsigned long flags;	if (serial_paranoia_check(info, tty->device, "su_stop"))		return;	save_flags(flags); cli();	if (info->IER & UART_IER_THRI) {		info->IER &= ~UART_IER_THRI;		serial_out(info, UART_IER, info->IER);	}	restore_flags(flags);}static void su_start(struct tty_struct *tty){	struct su_struct *info = (struct su_struct *)tty->driver_data;	unsigned long flags;		if (serial_paranoia_check(info, tty->device, "su_start"))		return;	save_flags(flags); cli();	if (info->xmit_cnt && info->xmit_buf && !(info->IER & UART_IER_THRI)) {		info->IER |= UART_IER_THRI;		serial_out(info, UART_IER, info->IER);	}	restore_flags(flags);}/* * ---------------------------------------------------------------------- * * Here starts the interrupt handling routines.  All of the following * subroutines are declared as inline and are folded into * su_interrupt().  They were separated out for readability's sake. * * Note: rs_interrupt() is a "fast" interrupt, which means that it * runs with interrupts turned off.  People who may want to modify * rs_interrupt() should try to keep the interrupt handler as fast as * possible.  After you are done making modifications, it is not a bad * idea to do: *  * gcc -S -DKERNEL -Wall -Wstrict-prototypes -O6 -fomit-frame-pointer serial.c * * and look at the resulting assemble code in serial.s. * * 				- Ted Ts'o (tytso@mit.edu), 7-Mar-93 * ----------------------------------------------------------------------- *//* * This routine is used by the interrupt handler to schedule * processing in the software interrupt portion of the driver. */static voidsu_sched_event(struct su_struct *info, int event){	info->event |= 1 << event;	queue_task(&info->tqueue, &tq_serial);	mark_bh(SERIAL_BH);}static voidreceive_kbd_ms_chars(struct su_struct *info, struct pt_regs *regs, int is_brk){	unsigned char status = 0;	unsigned char ch;	do {		ch = serial_inp(info, UART_RX);		if (info->port_type == SU_PORT_KBD) {			if (ch == SUNKBD_RESET) {                        	l1a_state.kbd_id = 1;                        	l1a_state.l1_down = 0;                	} else if (l1a_state.kbd_id) {                        	l1a_state.kbd_id = 0;                	} else if (ch == SUNKBD_L1) {                        	l1a_state.l1_down = 1;                	} else if (ch == (SUNKBD_L1|SUNKBD_UP)) {                        	l1a_state.l1_down = 0;                	} else if (ch == SUNKBD_A && l1a_state.l1_down) {                        	/* whee... */                        	batten_down_hatches();                        	/* Continue execution... */                        	l1a_state.l1_down = 0;                        	l1a_state.kbd_id = 0;                        	return;                	}                	sunkbd_inchar(ch, regs);		} else {			sun_mouse_inbyte(ch, is_brk);		}		status = su_inb(info, UART_LSR);	} while (status & UART_LSR_DR);}static voidreceive_serial_chars(struct su_struct *info, int *status, struct pt_regs *regs){	struct tty_struct *tty = info->tty;	unsigned char ch;	int ignored = 0, saw_console_brk = 0;	struct	async_icount *icount;	icount = &info->icount;	do {		ch = serial_inp(info, UART_RX);		if (info->is_console &&		    (ch == 0 || (*status &UART_LSR_BI)))			saw_console_brk = 1;		if (tty->flip.count >= TTY_FLIPBUF_SIZE)			break;		*tty->flip.char_buf_ptr = ch;		icount->rx++;#ifdef SERIAL_DEBUG_INTR		printk("D%02x:%02x.", ch, *status);#endif		*tty->flip.flag_buf_ptr = 0;		if (*status & (UART_LSR_BI | UART_LSR_PE |			       UART_LSR_FE | UART_LSR_OE)) {			/*			 * For statistics only			 */			if (*status & UART_LSR_BI) {				*status &= ~(UART_LSR_FE | UART_LSR_PE);				icount->brk++;			} else if (*status & UART_LSR_PE)				icount->parity++;			else if (*status & UART_LSR_FE)				icount->frame++;			if (*status & UART_LSR_OE)				icount->overrun++;			/*			 * Now check to see if character should be			 * ignored, and mask off conditions which			 * should be ignored.			 */			if (*status & info->ignore_status_mask) {				if (++ignored > 100) {#ifdef SERIAL_DEBUG_INTR					printk("ign100..");#endif					break;				}				goto ignore_char;			}			*status &= info->read_status_mask;			if (*status & (UART_LSR_BI)) {#ifdef SERIAL_DEBUG_INTR				printk("handling break....");#endif				*tty->flip.flag_buf_ptr = TTY_BREAK;				if (info->flags & ASYNC_SAK)					do_SAK(tty);			} else if (*status & UART_LSR_PE)				*tty->flip.flag_buf_ptr = TTY_PARITY;			else if (*status & UART_LSR_FE)				*tty->flip.flag_buf_ptr = TTY_FRAME;			if (*status & UART_LSR_OE) {				/*				 * Overrun is special, since it's				 * reported immediately, and doesn't				 * affect the current character				 */				if (tty->flip.count < TTY_FLIPBUF_SIZE) {					tty->flip.count++;					tty->flip.flag_buf_ptr++;					tty->flip.char_buf_ptr++;					*tty->flip.flag_buf_ptr = TTY_OVERRUN;				}			}		}		tty->flip.flag_buf_ptr++;		tty->flip.char_buf_ptr++;		tty->flip.count++;	ignore_char:		*status = serial_inp(info, UART_LSR);	} while (*status & UART_LSR_DR);#ifdef SERIAL_DEBUG_INTR	printk("E%02x.R%d", *status, tty->flip.count);#endif	tty_flip_buffer_push(tty);	if (saw_console_brk != 0)		batten_down_hatches();}static voidtransmit_chars(struct su_struct *info, int *intr_done){	int count;	if (info->x_char) {		serial_outp(info, UART_TX, info->x_char);		info->icount.tx++;		info->x_char = 0;		if (intr_done)			*intr_done = 0;		return;	}	if ((info->xmit_cnt <= 0) || info->tty->stopped ||	    info->tty->hw_stopped) {		info->IER &= ~UART_IER_THRI;		serial_out(info, UART_IER, info->IER);		return;	}	count = info->xmit_fifo_size;	do {		serial_out(info, UART_TX, info->xmit_buf[info->xmit_tail++]);		info->xmit_tail = info->xmit_tail & (SERIAL_XMIT_SIZE-1);		info->icount.tx++;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区免费看 | 欧美一区二区三级| 国内不卡的二区三区中文字幕| 一区二区在线免费观看| 国产三级精品三级| 日韩欧美在线综合网| 欧美日韩免费观看一区三区| 一本一本大道香蕉久在线精品 | 粉嫩一区二区三区性色av| 蜜臀av国产精品久久久久| 亚洲成人tv网| 亚洲午夜免费福利视频| 午夜电影网一区| 欧美aaaaaa午夜精品| 久久精品久久精品| 国产精品一区免费在线观看| 国产91丝袜在线18| 日韩无一区二区| 亚洲成人动漫在线免费观看| 色狠狠一区二区三区香蕉| 欧美伊人久久久久久午夜久久久久| 欧美日韩一本到| 亚洲乱码日产精品bd| 成人av影视在线观看| 在线国产亚洲欧美| 欧美一级一区二区| 亚洲高清在线精品| 欧美在线观看视频一区二区 | 亚洲综合色网站| 日韩综合在线视频| 国产在线一区二区综合免费视频| 欧美日韩精品一区视频| 日韩一卡二卡三卡四卡| 日韩av一区二区在线影视| 国产福利一区二区三区视频在线 | 中文一区一区三区高中清不卡| 亚洲色图19p| 亚洲五码中文字幕| 在线观看一区日韩| 性久久久久久久久久久久| 欧美性猛交xxxx黑人交| 亚洲香肠在线观看| 欧美丰满一区二区免费视频| 久久久精品综合| 中文字幕一区二区三区在线播放 | 国产亚洲一区字幕| 亚洲国产美女搞黄色| 欧美性色综合网| 亚洲成av人综合在线观看| 欧美丰满少妇xxxbbb| 久久狠狠亚洲综合| 久久婷婷国产综合精品青草| 亚洲午夜在线观看视频在线| 欧美精选一区二区| 美国三级日本三级久久99| 久久综合狠狠综合久久综合88| 国产不卡在线视频| 亚洲精品成人悠悠色影视| 欧美三级日韩三级| 蜜桃91丨九色丨蝌蚪91桃色| 国产视频一区二区在线观看| 91污在线观看| 国产亚洲女人久久久久毛片| 成人激情开心网| 一区二区三区色| 99精品视频一区| 国产午夜亚洲精品理论片色戒| 97精品电影院| 日韩电影在线免费看| 欧美韩国一区二区| 欧美精品粉嫩高潮一区二区| 东方aⅴ免费观看久久av| 国产福利一区在线| 亚洲精品精品亚洲| 欧美日韩免费观看一区二区三区 | 久久成人免费日本黄色| 久久美女艺术照精彩视频福利播放| 国产99精品视频| 亚洲6080在线| 国产清纯白嫩初高生在线观看91| 色婷婷精品久久二区二区蜜臂av| 蜜臀国产一区二区三区在线播放 | 在线综合视频播放| 国产精品成人免费| 国产成人啪免费观看软件 | 午夜精品久久久久久久蜜桃app| 精品国产成人系列| 精品一区二区三区不卡| 日韩精品一区国产麻豆| 免费精品视频在线| 亚洲欧美日韩久久精品| 91久久久免费一区二区| 久久国产精品无码网站| 亚洲成av人片观看| 中文字幕一区二区三区四区不卡 | 日韩国产精品久久久| 中文字幕制服丝袜成人av | 免费久久精品视频| 亚洲国产精品久久一线不卡| 国产精品不卡在线| 久久久www成人免费无遮挡大片| 在线综合亚洲欧美在线视频| 欧美在线观看一二区| 99国产精品国产精品久久| 国产精品自在欧美一区| 久久成人免费网站| 久久不见久久见免费视频1| 亚洲va欧美va天堂v国产综合| 亚洲人成网站色在线观看 | 26uuu久久综合| 91精品国产乱| 欧美日韩国产色站一区二区三区| 99精品视频中文字幕| 91在线精品一区二区| 成人avav影音| 成人黄色软件下载| 成人午夜短视频| 婷婷国产v国产偷v亚洲高清| 亚洲一区二区欧美日韩| 亚洲一区免费在线观看| 亚洲精品国产一区二区三区四区在线 | 亚洲午夜激情av| 亚洲一卡二卡三卡四卡无卡久久| 亚洲男人的天堂av| 亚洲精品欧美在线| 亚洲一区二区在线播放相泽| 亚洲成人激情综合网| 日本aⅴ精品一区二区三区| 免费精品视频最新在线| 久久不见久久见免费视频7| 国产麻豆欧美日韩一区| 国产91精品精华液一区二区三区 | 欧美一区二区精品| 久久综合给合久久狠狠狠97色69| 国产偷国产偷亚洲高清人白洁| 欧美国产日韩在线观看| 亚洲三级视频在线观看| 亚洲成年人影院| 美女视频黄a大片欧美| 国产激情视频一区二区三区欧美| 粗大黑人巨茎大战欧美成人| 色哟哟国产精品免费观看| 日韩精品一区二区三区在线观看| 精品久久久久久久久久久久久久久久久 | 成人av资源站| 欧美三级电影一区| 精品日韩成人av| 日韩毛片精品高清免费| 午夜精品久久一牛影视| 国产成人免费视频一区| 欧美在线免费观看亚洲| 精品国产一区二区三区不卡| 中文字幕一区二区三| 五月天婷婷综合| 国产福利不卡视频| 欧美性色黄大片| 久久精品一区八戒影视| 亚洲综合精品久久| 极品少妇xxxx精品少妇| 色婷婷综合久久| 精品国产3级a| 亚洲一区在线观看免费 | 国产精品一区二区男女羞羞无遮挡| jlzzjlzz欧美大全| 丁香另类激情小说| 欧美精品久久一区二区三区| 亚洲国产精品成人久久综合一区| 日日夜夜免费精品| jizz一区二区| 久久久久高清精品| 免费在线观看日韩欧美| 色综合欧美在线视频区| 国产亚洲一区二区三区在线观看| 亚洲午夜视频在线| 99久久国产免费看| 国产亚洲制服色| 捆绑调教美女网站视频一区| 欧美四级电影在线观看| 国产精品福利一区| 国产另类ts人妖一区二区| 欧美一区二区三区性视频| 亚洲精品免费在线播放| 成人h精品动漫一区二区三区| 欧美大片顶级少妇| 日韩国产高清在线| 欧美唯美清纯偷拍| 亚洲精品ww久久久久久p站| 成人免费黄色大片| 久久综合国产精品| 激情欧美一区二区| 国产欧美日韩三区| 精品在线播放免费| 日韩久久久精品| 奇米影视在线99精品| 欧美乱妇15p| 亚洲国产日韩a在线播放性色| 91一区二区在线| 亚洲人成电影网站色mp4| 成人精品小蝌蚪| 国产精品高潮呻吟|