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

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

?? eurotechwdt.c

?? Linux Kernel 2.6.9 for OMAP1710
?? C
字號:
/* *	Eurotech CPU-1220/1410 on board WDT driver * *	(c) Copyright 2001 Ascensit <support@ascensit.com> *	(c) Copyright 2001 Rodolfo Giometti <giometti@ascensit.com> *	(c) Copyright 2002 Rob Radez <rob@osinvestor.com> * *	Based on wdt.c. *	Original copyright messages: * *      (c) Copyright 1996-1997 Alan Cox <alan@redhat.com>, All Rights Reserved. *                              http://www.redhat.com * *      This program is free software; you can redistribute it and/or *      modify it under the terms of the GNU General Public License *      as published by the Free Software Foundation; either version *      2 of the License, or (at your option) any later version. * *      Neither Alan Cox nor CymruNet Ltd. admit liability nor provide *      warranty for any of this software. This material is provided *      "AS-IS" and at no charge. * *      (c) Copyright 1995    Alan Cox <alan@lxorguk.ukuu.org.uk>* *//* Changelog: * * 2002/04/25 - Rob Radez *	clean up #includes *	clean up locking *	make __setup param unique *	proper options in watchdog_info *	add WDIOC_GETSTATUS and WDIOC_SETOPTIONS ioctls *	add expect_close support * * 2001 - Rodolfo Giometti *	Initial release * * 2002.05.30 - Joel Becker <joel.becker@oracle.com> * 	Added Matt Domsch's nowayout module option. */#include <linux/config.h>#include <linux/interrupt.h>#include <linux/module.h>#include <linux/moduleparam.h>#include <linux/types.h>#include <linux/miscdevice.h>#include <linux/watchdog.h>#include <linux/fs.h>#include <linux/ioport.h>#include <linux/notifier.h>#include <linux/reboot.h>#include <linux/init.h>#include <asm/io.h>#include <asm/uaccess.h>#include <asm/system.h>static unsigned long eurwdt_is_open;static int eurwdt_timeout;static char eur_expect_close;/* * You must set these - there is no sane way to probe for this board. * You can use eurwdt=x,y to set these now. */static int io = 0x3f0;static int irq = 10;static char *ev = "int";#define WDT_TIMEOUT		60                /* 1 minute */#ifdef CONFIG_WATCHDOG_NOWAYOUTstatic int nowayout = 1;#elsestatic int nowayout = 0;#endifmodule_param(nowayout, int, 0);MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");/* * Some symbolic names */#define WDT_CTRL_REG		0x30#define WDT_OUTPIN_CFG		0xe2#define WDT_EVENT_INT		0x00#define WDT_EVENT_REBOOT	0x08#define WDT_UNIT_SEL		0xf1#define WDT_UNIT_SECS		0x80#define WDT_TIMEOUT_VAL		0xf2#define WDT_TIMER_CFG		0xf3module_param(io, int, 0);MODULE_PARM_DESC(io, "Eurotech WDT io port (default=0x3f0)");module_param(irq, int, 0);MODULE_PARM_DESC(irq, "Eurotech WDT irq (default=10)");module_param(ev, charp, 0);MODULE_PARM_DESC(ev, "Eurotech WDT event type (default is `int')");/* * Programming support */static inline void eurwdt_write_reg(u8 index, u8 data){	outb(index, io);	outb(data, io+1);}static inline void eurwdt_lock_chip(void){	outb(0xaa, io);}static inline void eurwdt_unlock_chip(void){	outb(0x55, io);	eurwdt_write_reg(0x07, 0x08);	/* set the logical device */}static inline void eurwdt_set_timeout(int timeout){	eurwdt_write_reg(WDT_TIMEOUT_VAL, (u8) timeout);}static inline void eurwdt_disable_timer(void){	eurwdt_set_timeout(0);}static void eurwdt_activate_timer(void){	eurwdt_disable_timer();	eurwdt_write_reg(WDT_CTRL_REG, 0x01);	/* activate the WDT */	eurwdt_write_reg(WDT_OUTPIN_CFG, !strcmp("int", ev) ? WDT_EVENT_INT : WDT_EVENT_REBOOT);	/* Setting interrupt line */	if (irq == 2 || irq > 15 || irq < 0) {		printk(KERN_ERR ": invalid irq number\n");		irq = 0;	/* if invalid we disable interrupt */	}	if (irq == 0)		printk(KERN_INFO ": interrupt disabled\n");	eurwdt_write_reg(WDT_TIMER_CFG, irq<<4);	eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS);	/* we use seconds */	eurwdt_set_timeout(0);	/* the default timeout */}/* * Kernel methods. */static irqreturn_t eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs){	printk(KERN_CRIT "timeout WDT timeout\n");#ifdef ONLY_TESTING	printk(KERN_CRIT "Would Reboot.\n");#else	printk(KERN_CRIT "Initiating system reboot.\n");	machine_restart(NULL);#endif	return IRQ_HANDLED;}/** * eurwdt_ping: * * Reload counter one with the watchdog timeout. */static void eurwdt_ping(void){	/* Write the watchdog default value */	eurwdt_set_timeout(eurwdt_timeout);}/** * eurwdt_write: * @file: file handle to the watchdog * @buf: buffer to write (unused as data does not matter here * @count: count of bytes * @ppos: pointer to the position to write. No seeks allowed * * A write to a watchdog device is defined as a keepalive signal. Any * write of data will do, as we we don't define content meaning. */static ssize_t eurwdt_write(struct file *file, const char __user *buf,size_t count, loff_t *ppos){	if (count) 	{		if (!nowayout) {			size_t i;			eur_expect_close = 0;			for (i = 0; i != count; i++) {				char c;				if(get_user(c, buf+i))					return -EFAULT;				if (c == 'V')					eur_expect_close = 42;			}		}		eurwdt_ping();	/* the default timeout */	}	return count;}/** * eurwdt_ioctl: * @inode: inode of the device * @file: file handle to the device * @cmd: watchdog command * @arg: argument pointer * * The watchdog API defines a common set of functions for all watchdogs * according to their available features. */static int eurwdt_ioctl(struct inode *inode, struct file *file,	unsigned int cmd, unsigned long arg){	void __user *argp = (void __user *)arg;	int __user *p = argp;	static struct watchdog_info ident = {		.options	  = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE,		.firmware_version = 1,		.identity	  = "WDT Eurotech CPU-1220/1410",	};	int time;	int options, retval = -EINVAL;	switch(cmd) {	default:		return -ENOIOCTLCMD;	case WDIOC_GETSUPPORT:		return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;	case WDIOC_GETSTATUS:	case WDIOC_GETBOOTSTATUS:		return put_user(0, p);	case WDIOC_KEEPALIVE:		eurwdt_ping();		return 0;	case WDIOC_SETTIMEOUT:		if (copy_from_user(&time, p, sizeof(int)))			return -EFAULT;		/* Sanity check */		if (time < 0 || time > 255)			return -EINVAL;		eurwdt_timeout = time;		eurwdt_set_timeout(time);		/* Fall */	case WDIOC_GETTIMEOUT:		return put_user(eurwdt_timeout, p);	case WDIOC_SETOPTIONS:		if (get_user(options, p))			return -EFAULT;		if (options & WDIOS_DISABLECARD) {			eurwdt_disable_timer();			retval = 0;		}		if (options & WDIOS_ENABLECARD) {			eurwdt_activate_timer();			eurwdt_ping();			retval = 0;		}		return retval;	}}/** * eurwdt_open: * @inode: inode of device * @file: file handle to device * * The misc device has been opened. The watchdog device is single * open and on opening we load the counter. */static int eurwdt_open(struct inode *inode, struct file *file){	if (test_and_set_bit(0, &eurwdt_is_open))		return -EBUSY;	eurwdt_timeout = WDT_TIMEOUT;	/* initial timeout */	/* Activate the WDT */	eurwdt_activate_timer();	return nonseekable_open(inode, file);}/** * eurwdt_release: * @inode: inode to board * @file: file handle to board * * The watchdog has a configurable API. There is a religious dispute * between people who want their watchdog to be able to shut down and * those who want to be sure if the watchdog manager dies the machine * reboots. In the former case we disable the counters, in the latter * case you have to open it again very soon. */static int eurwdt_release(struct inode *inode, struct file *file){	if (eur_expect_close == 42) {		eurwdt_disable_timer();	} else {		printk(KERN_CRIT "eurwdt: Unexpected close, not stopping watchdog!\n");		eurwdt_ping();	}	clear_bit(0, &eurwdt_is_open);	eur_expect_close = 0;	return 0;}/** * eurwdt_notify_sys: * @this: our notifier block * @code: the event being reported * @unused: unused * * Our notifier is called on system shutdowns. We want to turn the card * off at reboot otherwise the machine will reboot again during memory * test or worse yet during the following fsck. This would suck, in fact * trust me - if it happens it does suck. */static int eurwdt_notify_sys(struct notifier_block *this, unsigned long code,	void *unused){	if (code == SYS_DOWN || code == SYS_HALT) {		/* Turn the card off */		eurwdt_disable_timer();	}	return NOTIFY_DONE;}/* * Kernel Interfaces */static struct file_operations eurwdt_fops = {	.owner	= THIS_MODULE,	.llseek	= no_llseek,	.write	= eurwdt_write,	.ioctl	= eurwdt_ioctl,	.open	= eurwdt_open,	.release	= eurwdt_release,};static struct miscdevice eurwdt_miscdev = {	.minor	= WATCHDOG_MINOR,	.name	= "watchdog",	.fops	= &eurwdt_fops,};/* * The WDT card needs to learn about soft shutdowns in order to * turn the timebomb registers off. */static struct notifier_block eurwdt_notifier = {	.notifier_call = eurwdt_notify_sys,};/** * cleanup_module: * * Unload the watchdog. You cannot do this with any file handles open. * If your watchdog is set to continue ticking on close and you unload * it, well it keeps ticking. We won't get the interrupt but the board * will not touch PC memory so all is fine. You just have to load a new * module in 60 seconds or reboot. */static void __exit eurwdt_exit(void){	eurwdt_lock_chip();	misc_deregister(&eurwdt_miscdev);	unregister_reboot_notifier(&eurwdt_notifier);	release_region(io, 2);	free_irq(irq, NULL);}/** * eurwdt_init: * * Set up the WDT watchdog board. After grabbing the resources * we require we need also to unlock the device. * The open() function will actually kick the board off. */static int __init eurwdt_init(void){	int ret;	ret = misc_register(&eurwdt_miscdev);	if (ret) {		printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n",		WATCHDOG_MINOR);		goto out;	}	ret = request_irq(irq, eurwdt_interrupt, SA_INTERRUPT, "eurwdt", NULL);	if(ret) {		printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq);		goto outmisc;	}	if (!request_region(io, 2, "eurwdt")) {		printk(KERN_ERR "eurwdt: IO %X is not free.\n", io);		ret = -EBUSY;		goto outirq;	}	ret = register_reboot_notifier(&eurwdt_notifier);	if (ret) {		printk(KERN_ERR "eurwdt: can't register reboot notifier (err=%d)\n", ret);		goto outreg;	}	eurwdt_unlock_chip();	ret = 0;	printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)"		" - timeout event: %s\n",		io, irq, (!strcmp("int", ev) ? "int" : "reboot"));out:	return ret;outreg:	release_region(io, 2);outirq:	free_irq(irq, NULL);outmisc:	misc_deregister(&eurwdt_miscdev);	goto out;}module_init(eurwdt_init);module_exit(eurwdt_exit);MODULE_AUTHOR("Rodolfo Giometti");MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog");MODULE_LICENSE("GPL");MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成a人片亚洲日本久久| 日韩精品高清不卡| 欧美在线播放高清精品| 蜜臀av性久久久久av蜜臀妖精 | 国产精品久久久久aaaa樱花| 在线观看一区二区精品视频| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美日韩精品免费| 成人午夜免费视频| 麻豆精品在线视频| 香港成人在线视频| 亚洲一区二区三区精品在线| 久久精品免费在线观看| 日韩一区二区三区视频| 3atv在线一区二区三区| 欧美日韩国产天堂| 91蝌蚪porny成人天涯| 国产成a人无v码亚洲福利| 美脚の诱脚舐め脚责91| 蜜桃视频在线观看一区| 日本人妖一区二区| 亚洲成人免费视| 亚洲一区自拍偷拍| 亚洲国产日产av| 亚洲成人自拍偷拍| 天天做天天摸天天爽国产一区| 亚洲老司机在线| 亚洲综合av网| 日本大胆欧美人术艺术动态| 奇米四色…亚洲| 国内精品在线播放| 成人av一区二区三区| 成人福利视频在线看| 色国产精品一区在线观看| 91久久精品网| 日韩欧美亚洲国产另类| 久久精品视频一区| 亚洲美女少妇撒尿| 日本不卡视频在线观看| 国产精品久久久久久久久果冻传媒| 制服丝袜一区二区三区| 久久视频一区二区| 国产精品白丝在线| 天堂蜜桃91精品| 国产一区二区在线免费观看| av在线播放不卡| 欧美一区二区三区四区视频| 久久蜜桃av一区精品变态类天堂 | www激情久久| 亚洲人123区| 麻豆一区二区三区| 91久久线看在观草草青青| 精品久久久网站| 亚洲国产另类精品专区| 色av成人天堂桃色av| 日韩精品一区二区三区中文不卡| 亚洲嫩草精品久久| 国产91丝袜在线18| 欧美成人精品1314www| 亚洲图片自拍偷拍| 91老司机福利 在线| 欧美高清一级片在线观看| 国产真实乱对白精彩久久| 精品欧美乱码久久久久久| 一区在线播放视频| 国产一区二区三区国产| 日韩视频123| 日韩vs国产vs欧美| 欧美另类videos死尸| 亚洲精品中文在线观看| 91蜜桃在线免费视频| 亚洲国产精品黑人久久久| 国产精品18久久久久久久网站| 日韩欧美一区中文| 美女在线视频一区| 精品国产乱码久久久久久浪潮| 久久99精品久久久久婷婷| 一本到高清视频免费精品| 精品国产1区二区| 国产一区激情在线| 久久久久久久久久久久久夜| 国产一区二三区好的| 亚洲国产经典视频| 91美女片黄在线观看| 一区二区三区电影在线播| 精品视频在线视频| 日本伊人色综合网| 国产亚洲一二三区| 色婷婷激情综合| 五月开心婷婷久久| 久久久久97国产精华液好用吗| 99国产精品久久久久| 亚洲免费观看视频| 日韩片之四级片| 99国产精品视频免费观看| 天天爽夜夜爽夜夜爽精品视频 | 欧美视频在线一区二区三区| 日韩精品电影在线| 中文字幕免费在线观看视频一区| 色婷婷久久一区二区三区麻豆| 秋霞影院一区二区| 国产精品国产三级国产| 欧美一级日韩免费不卡| a美女胸又www黄视频久久| 天堂午夜影视日韩欧美一区二区| 中文字幕免费观看一区| 7777精品伊人久久久大香线蕉| 成人性生交大片| 另类小说色综合网站| 亚洲欧美日韩国产综合在线| 精品福利一二区| 欧美三区在线观看| 色成人在线视频| 99视频国产精品| 丁香亚洲综合激情啪啪综合| 国产精品一品二品| 久久激情五月激情| 天堂在线亚洲视频| 一区二区高清在线| 日韩高清欧美激情| 中文字幕第一区第二区| 欧美日韩午夜影院| 欧美少妇xxx| 欧美无乱码久久久免费午夜一区| 成人精品视频一区二区三区尤物| 国产主播一区二区| 国产一区二区视频在线| 麻豆91精品视频| 极品少妇一区二区三区精品视频| 男女视频一区二区| 黑人精品欧美一区二区蜜桃| 精品一区二区免费在线观看| 免费看日韩a级影片| 麻豆精品在线播放| 国产成人8x视频一区二区| 成人的网站免费观看| 91蜜桃免费观看视频| 欧美性xxxxx极品少妇| 在线电影国产精品| 久久久久久久国产精品影院| 国产欧美1区2区3区| 夜夜嗨av一区二区三区四季av| 亚洲成人免费视频| 国产另类ts人妖一区二区| www.欧美.com| 欧美一区午夜视频在线观看 | 亚洲欧洲成人av每日更新| 亚洲自拍偷拍av| 久久66热偷产精品| 色婷婷精品久久二区二区蜜臀av | 久久久99免费| 亚洲与欧洲av电影| 国产成人在线影院| 欧美中文字幕一二三区视频| 久久久久久久久久久久久久久99 | 亚洲伦理在线精品| 久久国产免费看| 色吊一区二区三区| 精品国产免费人成电影在线观看四季| 国产精品网曝门| 午夜激情一区二区| 免费xxxx性欧美18vr| 91在线云播放| 久久久精品一品道一区| 亚洲国产成人tv| 国产电影一区二区三区| 欧美一区国产二区| 五月激情六月综合| 在线亚洲免费视频| 久久尤物电影视频在线观看| 天堂蜜桃一区二区三区| 欧美日韩中字一区| 国产精品成人在线观看| 国产福利一区二区三区在线视频| 欧美一区二区三区在线观看| 一区二区三区在线免费播放| 国产风韵犹存在线视精品| 久久一二三国产| 精东粉嫩av免费一区二区三区| 56国语精品自产拍在线观看| 视频一区二区不卡| 欧美一区二区视频免费观看| 日本不卡一区二区三区高清视频| 欧美日韩国产经典色站一区二区三区 | 国产一区二区三区久久久| 精品国产免费人成在线观看| 国产在线不卡一卡二卡三卡四卡| 精品国产网站在线观看| 久久成人免费电影| 日本一区二区三区在线不卡| 99精品欧美一区二区三区小说| 中文字幕综合网| 欧美精品丝袜中出| 九九九精品视频| 亚洲女同一区二区| 欧美丰满嫩嫩电影| 国产一区二区美女诱惑| 亚洲美女一区二区三区| 日韩欧美一卡二卡| 成人影视亚洲图片在线|