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

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

?? eurotechwdt.c

?? 底層驅(qū)動開發(fā)
?? 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 */static int nowayout = WATCHDOG_NOWAYOUT;module_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");	emergency_restart();#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一区二区三区免费野_久草精品视频
亚洲一区二区三区精品在线| 亚洲精品亚洲人成人网| 国产.欧美.日韩| 亚洲天天做日日做天天谢日日欢| 欧美视频在线一区二区三区| 美女脱光内衣内裤视频久久网站| 国产日产亚洲精品系列| 懂色中文一区二区在线播放| 亚洲精品一卡二卡| 欧美一区二区三区视频| 成人精品高清在线| 亚洲免费观看视频| 欧美色图天堂网| 粗大黑人巨茎大战欧美成人| 日精品一区二区| 国产精品日产欧美久久久久| 欧美一级艳片视频免费观看| 成人黄页在线观看| 久久精品国产999大香线蕉| 国产精品三级久久久久三级| 欧美一二三区精品| 91蜜桃婷婷狠狠久久综合9色| 视频一区二区中文字幕| 亚洲最大的成人av| 亚洲乱码国产乱码精品精可以看| 亚洲国产精品成人综合| 2023国产精品视频| 精品三级av在线| 制服丝袜亚洲网站| 欧美另类z0zxhd电影| 欧美性色欧美a在线播放| 色天天综合色天天久久| 99久久精品久久久久久清纯| 成人91在线观看| 成人美女在线观看| 成人精品一区二区三区四区| 成人午夜私人影院| a在线欧美一区| 色综合天天综合在线视频| 成人黄动漫网站免费app| 国产**成人网毛片九色 | 欧美日韩不卡一区| 色天天综合久久久久综合片| 色噜噜偷拍精品综合在线| 91丨九色丨国产丨porny| 91香蕉视频污在线| 91国偷自产一区二区使用方法| 色婷婷一区二区| 欧美日韩一级片在线观看| 欧美探花视频资源| 宅男噜噜噜66一区二区66| 日韩亚洲欧美在线| 久久久亚洲午夜电影| 久久久综合视频| 亚洲国产精品av| 一区二区三区精品| 日本少妇一区二区| 国产精品77777| 成人高清av在线| 91国内精品野花午夜精品| 欧美日韩一二三区| 精品区一区二区| 日本一区二区三区四区| 一区二区三区毛片| 青青草国产精品亚洲专区无| 国产精品一区三区| 一本一道久久a久久精品| 欧美精品一卡两卡| 精品久久一区二区| 亚洲色图在线看| 日韩国产欧美一区二区三区| 久久国产精品露脸对白| av成人老司机| 在线不卡中文字幕| 国产精品污污网站在线观看| 亚洲国产综合在线| 国产裸体歌舞团一区二区| 91日韩在线专区| 91精品国产入口在线| 中文字幕成人av| 亚洲成a人在线观看| 国产乱人伦偷精品视频不卡 | 国产盗摄一区二区| 在线观看区一区二| 久久九九影视网| 亚洲午夜免费视频| 国产精品中文字幕欧美| 欧美亚洲免费在线一区| www久久久久| 午夜精品福利一区二区三区蜜桃| 国产真实乱对白精彩久久| 色吊一区二区三区| 国产日韩欧美精品电影三级在线| 亚洲国产综合在线| 成人在线综合网| 在线成人小视频| 亚洲欧美一区二区三区极速播放 | 日本最新不卡在线| 91在线精品秘密一区二区| **欧美大码日韩| 久久国产精品99久久久久久老狼 | 精品久久久久久久久久久久包黑料| 国产精品福利av| 久久电影网站中文字幕 | 精品国产污污免费网站入口| 亚洲美女视频一区| 国产精品18久久久久久久久 | 26uuuu精品一区二区| 亚洲已满18点击进入久久| 粉嫩一区二区三区在线看| 日韩一区二区三| 亚洲午夜精品一区二区三区他趣| 成人免费不卡视频| 久久九九国产精品| 麻豆成人久久精品二区三区红 | 日韩精品一区二区三区蜜臀| 亚洲午夜久久久久久久久电影网 | 国产麻豆视频精品| 日韩一区二区三| 日韩精品免费视频人成| 国产精品久久久久7777按摩| 精品在线你懂的| 91精品国产综合久久久久久| 亚洲一区免费视频| 在线观看网站黄不卡| 伊人色综合久久天天| 91在线免费播放| 亚洲色欲色欲www| 99国产欧美另类久久久精品| 久久美女艺术照精彩视频福利播放 | 日韩欧美精品在线视频| 日韩国产精品久久久| 欧美日韩一级大片网址| 亚洲r级在线视频| 欧美日韩一区小说| 午夜精品一区二区三区电影天堂| 欧美日韩情趣电影| 首页国产丝袜综合| 日韩午夜三级在线| 久久电影网电视剧免费观看| 精品美女一区二区三区| 国产在线乱码一区二区三区| 久久网这里都是精品| 处破女av一区二区| 亚洲丝袜精品丝袜在线| 在线亚洲高清视频| 午夜精品成人在线| 日韩欧美123| 国产精品一区二区在线看| 国产精品视频一二三区| 色婷婷国产精品| 天天综合天天做天天综合| 欧美成人vps| 精品国产乱码久久| 粉嫩av一区二区三区在线播放| 国产目拍亚洲精品99久久精品| www.欧美日韩国产在线| 亚洲人成伊人成综合网小说| 欧美日韩精品一二三区| 免费的成人av| 亚洲国产成人自拍| 欧洲在线/亚洲| 蜜乳av一区二区| 国产欧美精品一区二区色综合| aa级大片欧美| 日韩电影在线一区二区| 精品国产伦一区二区三区观看体验| 国产69精品久久久久毛片 | 午夜国产精品一区| 精品不卡在线视频| 99久久久国产精品| 婷婷综合久久一区二区三区| 久久久久亚洲蜜桃| 在线精品视频免费播放| 另类小说一区二区三区| 亚洲欧洲精品天堂一级 | 亚洲人成亚洲人成在线观看图片| 欧美老女人第四色| 国产成人综合精品三级| 亚洲韩国精品一区| 久久精品人人做人人爽97| 欧美日韩综合在线| 国模大尺度一区二区三区| 亚洲精品自拍动漫在线| 精品国产免费久久 | 色婷婷综合久色| 国内外成人在线| 亚洲福利视频一区二区| 国产欧美一区二区精品忘忧草 | 欧美人妖巨大在线| 成人免费视频一区| 另类综合日韩欧美亚洲| 亚洲精品中文字幕乱码三区| 久久久久久久久蜜桃| 欧美精品三级在线观看| 97se亚洲国产综合自在线不卡| 国产又黄又大久久| 午夜精品久久久久久久99水蜜桃 | 成人午夜电影久久影院| 麻豆精品在线视频|