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

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

?? rtc.c

?? powerpc內核mpc8241linux系統下char驅動程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
		CMOS_WRITE(val, RTC_FREQ_SELECT);		restore_flags(flags);		return 0;	}#ifdef __alpha__	case RTC_EPOCH_READ:	/* Read the epoch.	*/	{		return put_user (epoch, (unsigned long *)arg);	}	case RTC_EPOCH_SET:	/* Set the epoch.	*/	{		/* 		 * There were no RTC clocks before 1900.		 */		if (arg < 1900)			return -EINVAL;		if (!capable(CAP_SYS_TIME))			return -EACCES;		epoch = arg;		return 0;	}#endif	default:		return -EINVAL;	}	return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;}/* *	We enforce only one user at a time here with the open/close. *	Also clear the previous interrupt data on an open, and clean *	up things on a close. */static int rtc_open(struct inode *inode, struct file *file){	if(rtc_status & RTC_IS_OPEN)		return -EBUSY;	rtc_status |= RTC_IS_OPEN;	rtc_irq_data = 0;	return 0;}static int rtc_release(struct inode *inode, struct file *file){	/*	 * Turn off all interrupts once the device is no longer	 * in use, and clear the data.	 */	unsigned char tmp;	unsigned long flags;	save_flags(flags);	cli();	tmp = CMOS_READ(RTC_CONTROL);	tmp &=  ~RTC_PIE;	tmp &=  ~RTC_AIE;	tmp &=  ~RTC_UIE;	CMOS_WRITE(tmp, RTC_CONTROL);	CMOS_READ(RTC_INTR_FLAGS);	restore_flags(flags);	if (rtc_status & RTC_TIMER_ON) {		rtc_status &= ~RTC_TIMER_ON;		del_timer(&rtc_irq_timer);	}	rtc_irq_data = 0;	rtc_status &= ~RTC_IS_OPEN;	return 0;}static unsigned int rtc_poll(struct file *file, poll_table *wait){	poll_wait(file, &rtc_wait, wait);	if (rtc_irq_data != 0)		return POLLIN | POLLRDNORM;	return 0;}/* *	The various file operations we support. */static struct file_operations rtc_fops = {	rtc_llseek,	rtc_read,	NULL,		/* No write */	NULL,		/* No readdir */	rtc_poll,	rtc_ioctl,	NULL,		/* No mmap */	rtc_open,	NULL,		/* flush */	rtc_release};static struct miscdevice rtc_dev={	RTC_MINOR,	"rtc",	&rtc_fops};__initfunc(int rtc_init(void)){	unsigned long flags;#ifdef __alpha__	unsigned int year, ctrl;	unsigned long uip_watchdog;	char *guess = NULL;#endif	printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);	if(request_irq(RTC_IRQ, rtc_interrupt, SA_INTERRUPT, "rtc", NULL))	{		/* Yeah right, seeing as irq 8 doesn't even hit the bus. */		printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);		return -EIO;	}	misc_register(&rtc_dev);	/* Check region? Naaah! Just snarf it up. */	request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");#ifdef __alpha__	rtc_freq = HZ;		/* Each operating system on an Alpha uses its own epoch.	   Let's try to guess which one we are using now. */		uip_watchdog = jiffies;	if (rtc_is_updating() != 0)		while (jiffies - uip_watchdog < 2*HZ/100)			barrier();		save_flags(flags);	cli();	year = CMOS_READ(RTC_YEAR);	ctrl = CMOS_READ(RTC_CONTROL);	restore_flags(flags);		if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)		BCD_TO_BIN(year);       /* This should never happen... */		if (year > 10 && year < 44) {		epoch = 1980;		guess = "ARC console";	} else if (year < 96) {		epoch = 1952;		guess = "Digital UNIX";	}	if (guess)		printk("rtc: %s epoch (%lu) detected\n", guess, epoch);#endif	init_timer(&rtc_irq_timer);	rtc_irq_timer.function = rtc_dropped_irq;	rtc_wait = NULL;	save_flags(flags);	cli();	/* Initialize periodic freq. to CMOS reset default, which is 1024Hz */	CMOS_WRITE(((CMOS_READ(RTC_FREQ_SELECT) & 0xF0) | 0x06), RTC_FREQ_SELECT);	restore_flags(flags);	rtc_freq = 1024;	return 0;}/* * 	At IRQ rates >= 4096Hz, an interrupt may get lost altogether. *	(usually during an IDE disk interrupt, with IRQ unmasking off) *	Since the interrupt handler doesn't get called, the IRQ status *	byte doesn't get read, and the RTC stops generating interrupts. *	A timer is set, and will call this function if/when that happens. *	To get it out of this stalled state, we just read the status. *	At least a jiffy of interrupts (rtc_freq/HZ) will have been lost. *	(You *really* shouldn't be trying to use a non-realtime system  *	for something that requires a steady > 1KHz signal anyways.) */void rtc_dropped_irq(unsigned long data){	unsigned long flags;	printk(KERN_INFO "rtc: lost some interrupts at %ldHz.\n", rtc_freq);	mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + 2*HZ/100);	save_flags(flags);	cli();	rtc_irq_data += ((rtc_freq/HZ)<<8);	rtc_irq_data &= ~0xff;	rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0);	/* restart */	restore_flags(flags);}/* *	Info exported via "/proc/rtc". */int get_rtc_status(char *buf){	char *p;	struct rtc_time tm;	unsigned char batt, ctrl;	unsigned long flags;	save_flags(flags);	cli();	batt = CMOS_READ(RTC_VALID) & RTC_VRT;	ctrl = CMOS_READ(RTC_CONTROL);	restore_flags(flags);	p = buf;	get_rtc_time(&tm);	/*	 * There is no way to tell if the luser has the RTC set for local	 * time or for Universal Standard Time (GMT). Probably local though.	 */	p += sprintf(p,		     "rtc_time\t: %02d:%02d:%02d\n"		     "rtc_date\t: %04d-%02d-%02d\n"	 	     "rtc_epoch\t: %04lu\n",		     tm.tm_hour, tm.tm_min, tm.tm_sec,		     tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch);	get_rtc_alm_time(&tm);	/*	 * We implicitly assume 24hr mode here. Alarm values >= 0xc0 will	 * match any value for that particular field. Values that are	 * greater than a valid time, but less than 0xc0 shouldn't appear.	 */	p += sprintf(p, "alarm\t\t: ");	if (tm.tm_hour <= 24)		p += sprintf(p, "%02d:", tm.tm_hour);	else		p += sprintf(p, "**:");	if (tm.tm_min <= 59)		p += sprintf(p, "%02d:", tm.tm_min);	else		p += sprintf(p, "**:");	if (tm.tm_sec <= 59)		p += sprintf(p, "%02d\n", tm.tm_sec);	else		p += sprintf(p, "**\n");	p += sprintf(p,		     "DST_enable\t: %s\n"		     "BCD\t\t: %s\n"		     "24hr\t\t: %s\n"		     "square_wave\t: %s\n"		     "alarm_IRQ\t: %s\n"		     "update_IRQ\t: %s\n"		     "periodic_IRQ\t: %s\n"		     "periodic_freq\t: %ld\n"		     "batt_status\t: %s\n",		     (ctrl & RTC_DST_EN) ? "yes" : "no",		     (ctrl & RTC_DM_BINARY) ? "no" : "yes",		     (ctrl & RTC_24H) ? "yes" : "no",		     (ctrl & RTC_SQWE) ? "yes" : "no",		     (ctrl & RTC_AIE) ? "yes" : "no",		     (ctrl & RTC_UIE) ? "yes" : "no",		     (ctrl & RTC_PIE) ? "yes" : "no",		     rtc_freq,		     batt ? "okay" : "dead");	return  p - buf;}/* * Returns true if a clock update is in progress */static inline unsigned char rtc_is_updating(void){	unsigned long flags;	unsigned char uip;	save_flags(flags);	cli();	uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);	restore_flags(flags);	return uip;}void get_rtc_time(struct rtc_time *rtc_tm){	unsigned long flags, uip_watchdog = jiffies;	unsigned char ctrl;	/*	 * read RTC once any update in progress is done. The update	 * can take just over 2ms. We wait 10 to 20ms. There is no need to	 * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP.	 * If you need to know *exactly* when a second has started, enable	 * periodic update complete interrupts, (via ioctl) and then 	 * immediately read /dev/rtc which will block until you get the IRQ.	 * Once the read clears, read the RTC time (again via ioctl). Easy.	 */	if (rtc_is_updating() != 0)		while (jiffies - uip_watchdog < 2*HZ/100)			barrier();	/*	 * Only the values that we read from the RTC are set. We leave	 * tm_wday, tm_yday and tm_isdst untouched. Even though the	 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated	 * by the RTC when initially set to a non-zero value.	 */	save_flags(flags);	cli();	rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS);	rtc_tm->tm_min = CMOS_READ(RTC_MINUTES);	rtc_tm->tm_hour = CMOS_READ(RTC_HOURS);	rtc_tm->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH);	rtc_tm->tm_mon = CMOS_READ(RTC_MONTH);	rtc_tm->tm_year = CMOS_READ(RTC_YEAR);	ctrl = CMOS_READ(RTC_CONTROL);	restore_flags(flags);	if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)	{		BCD_TO_BIN(rtc_tm->tm_sec);		BCD_TO_BIN(rtc_tm->tm_min);		BCD_TO_BIN(rtc_tm->tm_hour);		BCD_TO_BIN(rtc_tm->tm_mday);		BCD_TO_BIN(rtc_tm->tm_mon);		BCD_TO_BIN(rtc_tm->tm_year);	}	/*	 * Account for differences between how the RTC uses the values	 * and how they are defined in a struct rtc_time;	 */	if ((rtc_tm->tm_year += (epoch - 1900)) <= 69)		rtc_tm->tm_year += 100;	rtc_tm->tm_mon--;}void get_rtc_alm_time(struct rtc_time *alm_tm){	unsigned long flags;	unsigned char ctrl;	/*	 * Only the values that we read from the RTC are set. That	 * means only tm_hour, tm_min, and tm_sec.	 */	save_flags(flags);	cli();	alm_tm->tm_sec = CMOS_READ(RTC_SECONDS_ALARM);	alm_tm->tm_min = CMOS_READ(RTC_MINUTES_ALARM);	alm_tm->tm_hour = CMOS_READ(RTC_HOURS_ALARM);	ctrl = CMOS_READ(RTC_CONTROL);	restore_flags(flags);	if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)	{		BCD_TO_BIN(alm_tm->tm_sec);		BCD_TO_BIN(alm_tm->tm_min);		BCD_TO_BIN(alm_tm->tm_hour);	}}/* * Used to disable/enable interrupts for any one of UIE, AIE, PIE. * Rumour has it that if you frob the interrupt enable/disable * bits in RTC_CONTROL, you should read RTC_INTR_FLAGS, to * ensure you actually start getting interrupts. Probably for * compatibility with older/broken chipset RTC implementations. * We also clear out any old irq data after an ioctl() that * meddles with the interrupt enable/disable bits. */void mask_rtc_irq_bit(unsigned char bit){	unsigned char val;	unsigned long flags;	save_flags(flags);	cli();	val = CMOS_READ(RTC_CONTROL);	val &=  ~bit;	CMOS_WRITE(val, RTC_CONTROL);	CMOS_READ(RTC_INTR_FLAGS);	restore_flags(flags);	rtc_irq_data = 0;}void set_rtc_irq_bit(unsigned char bit){	unsigned char val;	unsigned long flags;	save_flags(flags);	cli();	val = CMOS_READ(RTC_CONTROL);	val |= bit;	CMOS_WRITE(val, RTC_CONTROL);	CMOS_READ(RTC_INTR_FLAGS);	rtc_irq_data = 0;	restore_flags(flags);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品另类一区| 麻豆精品国产91久久久久久| 亚洲国产精品自拍| 懂色av中文一区二区三区| 欧美日韩一级视频| 国产精品初高中害羞小美女文| 久久99在线观看| 色婷婷国产精品| 国产欧美日韩综合| 精品综合免费视频观看| youjizz久久| www精品美女久久久tv| 亚洲一区二区视频| 99re成人在线| 国产欧美在线观看一区| 精品一区二区三区在线观看| 在线精品视频小说1| 一区在线观看免费| 国产69精品一区二区亚洲孕妇| 国内成人免费视频| 欧美一区日本一区韩国一区| 亚洲视频图片小说| 成人激情黄色小说| 国产天堂亚洲国产碰碰| 狠狠v欧美v日韩v亚洲ⅴ| 欧美放荡的少妇| 天使萌一区二区三区免费观看| 天天色综合成人网| 欧美年轻男男videosbes| 一二三区精品视频| 成人av第一页| 亚洲欧美一区二区三区孕妇| 成人动漫在线一区| 欧美激情一区二区三区全黄| 国产成都精品91一区二区三| 国产视频一区二区三区在线观看 | 国产精品资源在线| 日韩亚洲欧美一区二区三区| 亚洲成人激情社区| 欧美二区三区91| 麻豆精品视频在线观看免费| 日韩欧美的一区二区| 免费美女久久99| 久久先锋影音av| 成人免费看黄yyy456| 一区二区三区在线免费观看| 91片在线免费观看| 夜夜揉揉日日人人青青一国产精品| 日韩电影在线看| 精品久久国产97色综合| 国产精品一区免费在线观看| 国产欧美日韩中文久久| 91网站黄www| 亚洲电影激情视频网站| 精品欧美乱码久久久久久1区2区| 亚洲欧洲国产日韩| 在线精品视频一区二区三四| 天堂久久一区二区三区| 日韩免费看的电影| 国产99久久久国产精品潘金| 亚洲欧美日韩人成在线播放| 欧美日本视频在线| 国产成人在线观看免费网站| 亚洲自拍偷拍九九九| 91精品国产色综合久久ai换脸| 亚洲六月丁香色婷婷综合久久| 精品无码三级在线观看视频| 国产欧美一区二区在线观看| 在线亚洲精品福利网址导航| 视频一区二区三区中文字幕| 国产夜色精品一区二区av| 在线日韩国产精品| 国产乱码精品一区二区三区忘忧草 | 久久天天做天天爱综合色| 不卡电影一区二区三区| 蜜臀av性久久久久av蜜臀妖精| 欧美午夜电影网| 国产一区视频网站| 一区二区三区毛片| 久久精品人人做人人综合| 欧美日韩精品一区二区三区蜜桃| 亚洲激情图片qvod| 久久精品日产第一区二区三区高清版 | 麻豆精品一二三| 亚洲人成亚洲人成在线观看图片 | 免费在线观看不卡| 亚洲欧美日韩综合aⅴ视频| 日韩精品资源二区在线| 丁香天五香天堂综合| 日韩精品五月天| 亚洲欧美偷拍三级| 国产亚洲欧美日韩在线一区| 欧美综合亚洲图片综合区| 国产suv一区二区三区88区| 看电影不卡的网站| 视频一区中文字幕| 一区二区三区蜜桃网| 国产精品国产三级国产普通话蜜臀 | 天天综合网 天天综合色| 国产亚洲成aⅴ人片在线观看| 顶级嫩模精品视频在线看| 另类调教123区 | 久久国产精品色| 亚洲成人先锋电影| 一区二区三区鲁丝不卡| ...xxx性欧美| 国产精品三级av在线播放| 久久精品网站免费观看| 欧美videos中文字幕| 日韩女优毛片在线| 日韩午夜激情视频| 欧美一区二区日韩一区二区| 91精品国产入口在线| 91麻豆精品国产| 欧美一区二区视频在线观看2020| 麻豆国产欧美日韩综合精品二区 | 欧美丝袜丝交足nylons图片| 色婷婷综合久久久| 一本色道久久综合亚洲91 | 美女免费视频一区二区| 首页国产丝袜综合| 欧美96一区二区免费视频| 三级精品在线观看| 日本在线观看不卡视频| 另类综合日韩欧美亚洲| 美女久久久精品| 国产精品99久久不卡二区| 成人福利电影精品一区二区在线观看| 亚洲精品乱码久久久久久| 亚洲免费视频中文字幕| 亚洲人成伊人成综合网小说| 亚洲与欧洲av电影| 日日摸夜夜添夜夜添亚洲女人| 一区视频在线播放| 亚洲国产精品久久久男人的天堂| 欧美成人一级视频| 26uuu精品一区二区在线观看| 一本大道av一区二区在线播放| 蜜臀久久久99精品久久久久久| 国产精品久久久久久户外露出| 欧美日韩成人综合天天影院 | 精品理论电影在线| 久久综合久久综合九色| 亚洲视频中文字幕| 一区二区三区四区在线| 免费看欧美女人艹b| 成人av在线播放网站| 欧美亚洲国产一区二区三区va| 成人午夜电影网站| 91精品91久久久中77777| 88在线观看91蜜桃国自产| 国产人久久人人人人爽| 亚洲综合图片区| 国产精品一级二级三级| 91国内精品野花午夜精品| 日韩精品一区二区三区三区免费| 欧美人狂配大交3d怪物一区| 精品国产区一区| 亚洲一二三四在线观看| 国产在线国偷精品免费看| 欧美专区在线观看一区| 久久精子c满五个校花| 亚洲一区二区欧美激情| 国产a视频精品免费观看| 在线播放欧美女士性生活| 国产精品久久久久久久岛一牛影视 | 一区视频在线播放| 老汉av免费一区二区三区 | 91精品中文字幕一区二区三区| 在线日韩av片| 亚洲国产精品成人综合| 免费成人av资源网| 色av综合在线| 天天综合网天天综合色| 99免费精品视频| 2021国产精品久久精品| 石原莉奈在线亚洲三区| 91在线视频播放地址| 中文字幕精品综合| 国产一区二三区好的| 制服丝袜激情欧洲亚洲| 亚洲永久免费视频| 99国产一区二区三精品乱码| 国产亚洲1区2区3区| 天堂av在线一区| 欧亚一区二区三区| 一区二区三区小说| 91影视在线播放| 国产精品久久免费看| 国产精品18久久久久久久久| 日韩欧美国产1| 欧美aaa在线| 日韩精品一区二区三区四区 | 欧美美女网站色| 亚洲另类春色校园小说| 成人午夜电影小说| 国产精品视频麻豆| 成人网在线播放| 中文字幕一区二区三区在线播放| 亚洲成人午夜影院|