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

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

?? zs.c

?? linux和2410結合開發 用他可以生成2410所需的zImage文件
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* $Id: zs.c,v 1.68.2.2 2002/01/12 07:04:33 davem Exp $ * zs.c: Zilog serial port driver for the Sparc. * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1996 Eddie C. Dost   (ecd@skynet.be) * Fixes by Pete A. Zaitcev <zaitcev@yahoo.com>. * * Fixed to use tty_get_baud_rate(). *   Theodore Ts'o <tytso@mit.edu>, 2001-Oct-12 * * /proc/tty/driver/serial now exists and is readable. *   Alex Buell <alex.buell@tahallah.demon.co.uk>, 2001-12-23 * */#include <linux/errno.h>#include <linux/signal.h>#include <linux/sched.h>#include <linux/timer.h>#include <linux/interrupt.h>#include <linux/tty.h>#include <linux/tty_flip.h>#include <linux/config.h>#include <linux/major.h>#include <linux/string.h>#include <linux/fcntl.h>#include <linux/mm.h>#include <linux/kernel.h>#include <linux/keyboard.h>#include <linux/console.h>#include <linux/delay.h>#include <linux/init.h>#include <linux/bootmem.h>#include <linux/sysrq.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/oplib.h>#include <asm/system.h>#include <asm/uaccess.h>#include <asm/bitops.h>#include <asm/kdebug.h>#include <asm/page.h>#include <asm/pgtable.h>#include <asm/sbus.h>#ifdef __sparc_v9__#include <asm/fhc.h>#endif#ifdef CONFIG_PCI#include <linux/pci.h>#endif#include "sunserial.h"#include "zs.h"#include "sunkbd.h"#include "sunmouse.h"static int num_serial = 2; /* sun4/sun4c/sun4m - Two chips on board. */#define NUM_SERIAL num_serial#define NUM_CHANNELS (NUM_SERIAL * 2)#define KEYBOARD_LINE 0x2#define MOUSE_LINE    0x3/* On 32-bit sparcs we need to delay after register accesses * to accomodate sun4 systems, but we do not need to flush writes. * On 64-bit sparc we only need to flush single writes to ensure * completion. */#ifndef __sparc_v9__#define ZSDELAY()		udelay(5)#define ZSDELAY_LONG()		udelay(20)#define ZS_WSYNC(channel)	do { } while(0)#else#define ZSDELAY()#define ZSDELAY_LONG()#define ZS_WSYNC(__channel) \	sbus_readb(&((__channel)->control))#endifstruct sun_zslayout **zs_chips;struct sun_zschannel **zs_channels;struct sun_zschannel *zs_mousechan;struct sun_zschannel *zs_kbdchan;struct sun_zschannel *zs_kgdbchan;int *zs_nodes;struct sun_serial *zs_soft;struct sun_serial *zs_chain;  /* IRQ servicing chain */int zilog_irq;struct tty_struct *zs_ttys;/* Console hooks... */#ifdef CONFIG_SERIAL_CONSOLEstatic struct console zs_console;static int zs_console_init(void);/* * Define this to get the zs_fair_output() functionality. */#undef SERIAL_CONSOLE_FAIR_OUTPUT#endif /* CONFIG_SERIAL_CONSOLE */static unsigned char kgdb_regs[16] = {	0, 0, 0,                     /* write 0, 1, 2 */	(Rx8 | RxENAB),              /* write 3 */	(X16CLK | SB1 | PAR_EVEN),   /* write 4 */	(DTR | Tx8 | TxENAB),        /* write 5 */	0, 0, 0,                     /* write 6, 7, 8 */	(NV),                        /* write 9 */	(NRZ),                       /* write 10 */	(TCBR | RCBR),               /* write 11 */	0, 0,                        /* BRG time constant, write 12 + 13 */	(BRSRC | BRENAB),            /* write 14 */	(DCDIE)                      /* write 15 */};static unsigned char zscons_regs[16] = {	0,                           /* write 0 */	(EXT_INT_ENAB | INT_ALL_Rx), /* write 1 */	0,                           /* write 2 */	(Rx8 | RxENAB),              /* write 3 */	(X16CLK),                    /* write 4 */	(DTR | Tx8 | TxENAB),        /* write 5 */	0, 0, 0,                     /* write 6, 7, 8 */	(NV | MIE),                  /* write 9 */	(NRZ),                       /* write 10 */	(TCBR | RCBR),               /* write 11 */	0, 0,                        /* BRG time constant, write 12 + 13 */	(BRSRC | BRENAB),            /* write 14 */	(DCDIE | CTSIE | TxUIE | BRKIE) /* write 15 */};#define ZS_CLOCK         4915200   /* Zilog input clock rate */DECLARE_TASK_QUEUE(tq_serial);static struct tty_driver serial_driver, callout_driver;static int serial_refcount;/* serial subtype definitions */#define SERIAL_TYPE_NORMAL	1#define SERIAL_TYPE_CALLOUT	2  /* number of characters left in xmit buffer before we ask for more */#define WAKEUP_CHARS 256#define SERIAL_DO_RESTART/* Debugging... DEBUG_INTR is bad to use when one of the zs * lines is your console ;( */#undef SERIAL_DEBUG_INTR#undef SERIAL_DEBUG_OPEN#undef SERIAL_DEBUG_FLOW#define RS_STROBE_TIME 10#define RS_ISR_PASS_LIMIT 256#define _INLINE_ inlineint zs_init(void);static void zs_kgdb_hook(int);static void change_speed(struct sun_serial *info);static struct tty_struct **serial_table;static struct termios **serial_termios;static struct termios **serial_termios_locked;#ifndef MIN#define MIN(a,b)	((a) < (b) ? (a) : (b))#endif#undef ZS_LOG#ifdef ZS_LOGstruct zs_logent {	u8 reg, val;	u8 write, __pad;#define REGIRQ	0xff#define REGDATA	0xfe#define REGCTRL	0xfd};struct zs_logent zslog[32];int zs_curlog;#define ZSLOG(__reg, __val, __write) \do{	int index = zs_curlog; \	zslog[index].reg = (__reg); \	zslog[index].val = (__val); \	zslog[index].write = (__write); \	zs_curlog = (index + 1) & (32 - 1); \}while(0)int zs_dumplog(char *buffer){	int len = 0;	int i;	for (i = 0; i < 32; i++) {		u8 reg, val, write;		reg = zslog[i].reg;		val = zslog[i].val;		write = zslog[i].write;		len += sprintf(buffer + len,			       "ZSLOG[%2d]: reg %2x val %2x %s\n",			       i, reg, val, write ? "write" : "read");	}	len += sprintf(buffer + len, "ZS current log index %d\n",		       zs_curlog);	return len;}#else#define ZSLOG(x,y,z)	do { } while (0)#endif/* * tmp_buf is used as a temporary buffer by serial_write.  We need to * lock it in case the memcpy_fromfs 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 = 0;static DECLARE_MUTEX(tmp_buf_sem);static inline int serial_paranoia_check(struct sun_serial *info,					dev_t device, const char *routine){#ifdef SERIAL_PARANOIA_CHECK	static const char *badmagic =		"Warning: bad magic number for serial struct (%d, %d) in %s\n";	static const char *badinfo =		"Warning: null sun_serial for (%d, %d) in %s\n";	if (!info) {		printk(badinfo, MAJOR(device), MINOR(device), routine);		return 1;	}	if (info->magic != SERIAL_MAGIC) {		printk(badmagic, MAJOR(device), MINOR(device), routine);		return 1;	}#endif	return 0;}/* Reading and writing Zilog8530 registers.  The delays are to make this * driver work on the Sun4 which needs a settling delay after each chip * register access, other machines handle this in hardware via auxiliary * flip-flops which implement the settle time we do in software. */static unsigned char read_zsreg(struct sun_zschannel *channel,				unsigned char reg){	unsigned char retval;	sbus_writeb(reg, &channel->control);	ZSDELAY();	retval = sbus_readb(&channel->control);	ZSDELAY();	ZSLOG(reg, retval, 0);	return retval;}static void write_zsreg(struct sun_zschannel *channel,			unsigned char reg, unsigned char value){	ZSLOG(reg, value, 1);	sbus_writeb(reg, &channel->control);	ZSDELAY();	sbus_writeb(value, &channel->control);	ZSDELAY();}static void load_zsregs(struct sun_serial *info, unsigned char *regs){	struct sun_zschannel *channel = info->zs_channel;	unsigned long flags;	unsigned char stat;	int i;	for (i = 0; i < 1000; i++) {		stat = read_zsreg(channel, R1);		if (stat & ALL_SNT)			break;		udelay(100);	}	write_zsreg(channel, R3, 0);	ZS_CLEARSTAT(channel);	ZS_CLEARERR(channel);	ZS_CLEARFIFO(channel);	/* Load 'em up */	save_flags(flags); cli();	if (info->channelA)		write_zsreg(channel, R9, CHRA);	else		write_zsreg(channel, R9, CHRB);	ZSDELAY_LONG();	write_zsreg(channel, R4, regs[R4]);	write_zsreg(channel, R3, regs[R3] & ~RxENAB);	write_zsreg(channel, R5, regs[R5] & ~TxENAB);	write_zsreg(channel, R9, regs[R9] & ~MIE);	write_zsreg(channel, R10, regs[R10]);	write_zsreg(channel, R11, regs[R11]);	write_zsreg(channel, R12, regs[R12]);	write_zsreg(channel, R13, regs[R13]);	write_zsreg(channel, R14, regs[R14] & ~BRENAB);	write_zsreg(channel, R14, regs[R14]);	write_zsreg(channel, R14, (regs[R14] & ~SNRZI) | BRENAB);	write_zsreg(channel, R3, regs[R3]);	write_zsreg(channel, R5, regs[R5]);	write_zsreg(channel, R15, regs[R15]);	write_zsreg(channel, R0, RES_EXT_INT);	write_zsreg(channel, R0, ERR_RES);	write_zsreg(channel, R1, regs[R1]);	write_zsreg(channel, R9, regs[R9]);	restore_flags(flags);}#define ZS_PUT_CHAR_MAX_DELAY	2000	/* 10 ms */static void zs_put_char(struct sun_zschannel *channel, char ch){	int loops = ZS_PUT_CHAR_MAX_DELAY;	/* Do not change this to use ZSDELAY as this is	 * a timed polling loop and on sparc64 ZSDELAY	 * is a nop.  -DaveM	 */	do {		u8 val = sbus_readb(&channel->control);		ZSLOG(REGCTRL, val, 0);		if (val & Tx_BUF_EMP)			break;		udelay(5);	} while (--loops);	sbus_writeb(ch, &channel->data);	ZSDELAY();	ZS_WSYNC(channel);	ZSLOG(REGDATA, ch, 1);}/* Sets or clears DTR/RTS on the requested line */static void zs_rtsdtr(struct sun_serial *ss, int set){	unsigned long flags;	save_flags(flags); cli();	if(set) {		ss->curregs[5] |= (RTS | DTR);		write_zsreg(ss->zs_channel, 5, ss->curregs[5]);	} else {		ss->curregs[5] &= ~(RTS | DTR);		write_zsreg(ss->zs_channel, 5, ss->curregs[5]);	}	restore_flags(flags);	return;}static void kgdb_chaninit(struct sun_serial *ss, int intson, int bps){	int brg;	if(intson) {		kgdb_regs[R1] = INT_ALL_Rx;		kgdb_regs[R9] |= MIE;	} else {		kgdb_regs[R1] = 0;		kgdb_regs[R9] &= ~MIE;	}	brg = BPS_TO_BRG(bps, ZS_CLOCK/16);	kgdb_regs[R12] = (brg & 255);	kgdb_regs[R13] = ((brg >> 8) & 255);	load_zsregs(ss, kgdb_regs);}/* * ------------------------------------------------------------ * zs_stop() and zs_start() * * This routines are called before setting or resetting tty->stopped. * They enable or disable transmitter interrupts, as necessary. * ------------------------------------------------------------ */static void zs_stop(struct tty_struct *tty){	struct sun_serial *info = (struct sun_serial *) tty->driver_data;	unsigned long flags;	if (serial_paranoia_check(info, tty->device, "zs_stop"))		return;		save_flags(flags); cli();	if (info->curregs[5] & TxENAB) {		info->curregs[5] &= ~TxENAB;		write_zsreg(info->zs_channel, 5, info->curregs[5]);	}	restore_flags(flags);}static void zs_start(struct tty_struct *tty){	struct sun_serial *info = (struct sun_serial *) tty->driver_data;	unsigned long flags;		if (serial_paranoia_check(info, tty->device, "zs_start"))		return;		save_flags(flags); cli();	if (info->xmit_cnt && info->xmit_buf && !(info->curregs[5] & TxENAB)) {		info->curregs[5] |= TxENAB;		write_zsreg(info->zs_channel, 5, info->curregs[5]);	}	restore_flags(flags);}/* Drop into either the boot monitor or kadb upon receiving a break * from keyboard/console input. */void batten_down_hatches(void){	if (!stop_a_enabled)		return;	/* If we are doing kadb, we call the debugger	 * else we just drop into the boot monitor.	 * Note that we must flush the user windows	 * first before giving up control.	 */	printk("\n");	flush_user_windows();#ifndef __sparc_v9__	if((((unsigned long)linux_dbvec)>=DEBUG_FIRSTVADDR) &&	   (((unsigned long)linux_dbvec)<=DEBUG_LASTVADDR))		sp_enter_debugger();	else#endif		prom_cmdline();	/* XXX We want to notify the keyboard driver that all	 * XXX keys are in the up state or else weird things	 * XXX happen...	 */	return;}/* * ---------------------------------------------------------------------- * * Here starts the interrupt handling routines.  All of the following * subroutines are declared as inline and are folded into * zs_interrupt().  They were separated out for readability's sake. * * Note: zs_interrupt() is a "fast" interrupt, which means that it * runs with interrupts turned off.  People who may want to modify * zs_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 void zs_sched_event(struct sun_serial *info, int event){	info->event |= 1 << event;	queue_task(&info->tqueue, &tq_serial);	mark_bh(SERIAL_BH);}#ifndef __sparc_v9__extern void breakpoint(void);  /* For the KGDB frame character */#endifstatic void receive_chars(struct sun_serial *info, struct pt_regs *regs){	struct tty_struct *tty = info->tty;	int do_queue_task = 0;	while (1) {		unsigned char ch, r1;		r1 = read_zsreg(info->zs_channel, R1);		if (r1 & (PAR_ERR | Rx_OVR | CRC_ERR)) {			sbus_writeb(ERR_RES, &info->zs_channel->control);			ZSDELAY();			ZS_WSYNC(info->zs_channel);			ZSLOG(REGCTRL, ERR_RES, 1);		}		ch = sbus_readb(&info->zs_channel->data);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲美女偷拍久久| 韩国av一区二区三区四区| 日韩精品1区2区3区| 国产麻豆午夜三级精品| 欧美日韩情趣电影| 亚洲欧美偷拍三级| 国产伦精品一区二区三区视频青涩 | 中文字幕免费不卡| 七七婷婷婷婷精品国产| 91在线国内视频| 久久精品一区二区三区不卡| 日韩成人一区二区| 色偷偷88欧美精品久久久| 久久视频一区二区| 麻豆国产精品官网| 欧美挠脚心视频网站| 亚洲综合一区二区三区| 99在线精品视频| 欧美经典一区二区| 国产成人精品亚洲午夜麻豆| 日韩免费观看2025年上映的电影| 亚洲黄色性网站| 91在线观看地址| 国产精品久久久久久久久久久免费看| 久久电影网站中文字幕| 7777精品伊人久久久大香线蕉 | 亚洲美腿欧美偷拍| 97精品国产97久久久久久久久久久久 | 在线观看亚洲精品| 亚洲另类在线视频| 一本一道久久a久久精品| 国产精品成人免费精品自在线观看| 国产另类ts人妖一区二区| 日韩精品一区二区三区中文精品| 全国精品久久少妇| 日韩欧美国产午夜精品| 经典三级在线一区| 欧美成人a视频| 国产精华液一区二区三区| 久久久99久久精品欧美| 国产精品亚洲午夜一区二区三区 | 欧美伊人精品成人久久综合97 | 中文字幕不卡三区| 成人国产精品免费观看动漫| 国产精品免费观看视频| 欧美日本在线观看| 日韩电影在线免费看| 欧美日韩国产电影| 久久福利资源站| 国产亚洲欧美中文| 99热99精品| 一区二区三区不卡在线观看 | 香蕉久久夜色精品国产使用方法 | 91麻豆swag| 亚洲午夜久久久| 日韩一二在线观看| 国产成人一区在线| 亚洲精品欧美在线| 日韩一区二区三区观看| 国产美女精品人人做人人爽 | 亚洲一区二区三区在线播放| 91麻豆精品国产自产在线观看一区| 久久精品国产精品亚洲红杏| 国产精品色婷婷久久58| 欧美午夜在线一二页| 久久国产综合精品| 亚洲美女免费视频| 欧美精品一区二区高清在线观看 | 韩国在线一区二区| 亚洲欧美日本在线| 欧美岛国在线观看| 99精品视频中文字幕| 日韩福利视频导航| 国产精品美女久久久久久久久久久 | 婷婷开心激情综合| 欧美激情一区在线| 欧美日韩国产另类一区| 国产一区999| 午夜伦理一区二区| 中文字幕一区二区日韩精品绯色| 欧美日韩大陆一区二区| www.日本不卡| 国产在线麻豆精品观看| 亚洲一区视频在线观看视频| 国产日韩欧美不卡| 欧美一级欧美三级| 欧美在线观看一二区| 丁香五精品蜜臀久久久久99网站| 日韩二区三区四区| 亚洲一区在线电影| 中文字幕一区二区三区四区不卡 | 激情综合色播五月| 亚洲成人动漫一区| 亚洲天堂成人在线观看| 精品久久国产老人久久综合| 欧美三级视频在线| 99国产精品久| 国产suv精品一区二区6| 精品伊人久久久久7777人| 午夜电影一区二区三区| 亚洲欧美日本在线| 国产精品沙发午睡系列990531| 日韩欧美在线网站| 91精品国产色综合久久| 欧美三级中文字幕在线观看| 一本色道久久综合精品竹菊| 成人av网站免费| 成人精品免费看| 成人视屏免费看| 国产.精品.日韩.另类.中文.在线.播放| 秋霞av亚洲一区二区三| 午夜影视日本亚洲欧洲精品| 黄色小说综合网站| 另类小说视频一区二区| 日韩成人免费看| 热久久免费视频| 另类小说视频一区二区| 久久成人综合网| 国产综合成人久久大片91| 狠狠色丁香婷婷综合| 久久国产视频网| 国产在线精品不卡| 懂色av中文一区二区三区| 成人自拍视频在线| 91美女视频网站| 欧美性一二三区| 欧美日韩不卡一区| 日韩欧美一区二区三区在线| 欧美大片顶级少妇| 国产亚洲一区字幕| 综合色中文字幕| 亚洲高清免费一级二级三级| 亚洲成人动漫av| 久久精品国产999大香线蕉| 国产一区二区在线电影| 成人av影院在线| 欧美伊人精品成人久久综合97 | 91免费视频观看| 精品视频资源站| 精品国产自在久精品国产| 国产欧美一区二区三区网站| 一区在线观看免费| 视频在线观看国产精品| 久久精品国产精品亚洲综合| 成人av动漫网站| 欧美日韩中文字幕一区| 精品欧美久久久| 亚洲免费观看高清完整版在线观看 | 制服丝袜亚洲精品中文字幕| 精品福利二区三区| 亚洲欧美日韩精品久久久久| 免费成人在线影院| av综合在线播放| 日韩丝袜美女视频| 一区在线观看视频| 裸体健美xxxx欧美裸体表演| 波多野结衣精品在线| 欧美一级二级三级蜜桃| 国产精品网曝门| 美女视频黄 久久| 色综合网色综合| 久久久精品蜜桃| 一区二区三区精品视频在线| 久久99久久久欧美国产| 99久久国产综合精品色伊| 欧美一级欧美一级在线播放| 日韩一区中文字幕| 国产一区二区看久久| 欧美日韩免费在线视频| 日韩一区日韩二区| 国产原创一区二区三区| 欧美人伦禁忌dvd放荡欲情| 国产精品每日更新| 经典三级在线一区| 欧美一区二区视频观看视频 | 色妹子一区二区| 亚洲国产精华液网站w| 免费成人美女在线观看| 欧美无人高清视频在线观看| 亚洲国产成人在线| 国产一区二区日韩精品| 91精品国产综合久久福利| 夜夜嗨av一区二区三区网页| 不卡影院免费观看| 国产人久久人人人人爽| 国内精品久久久久影院薰衣草| 制服丝袜av成人在线看| 成人国产在线观看| www久久精品| 久久se精品一区二区| 91麻豆精品国产自产在线| 亚洲无人区一区| 在线观看欧美黄色| 亚洲综合在线电影| 日本高清成人免费播放| 亚洲美女屁股眼交3| 在线观看精品一区| 亚洲成人动漫在线观看| 欧美区在线观看| 青青草成人在线观看|