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

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

?? time.c

?? 優龍2410linux2.6.8內核源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: time.c,v 1.21 2004/04/21 00:09:15 lethal Exp $ * *  linux/arch/sh/kernel/time.c * *  Copyright (C) 1999  Tetsuya Okada & Niibe Yutaka *  Copyright (C) 2000  Philipp Rumpf <prumpf@tux.org> *  Copyright (C) 2002, 2003, 2004  Paul Mundt *  Copyright (C) 2002  M. R. Brown  <mrbrown@linux-sh.org> * *  Some code taken from i386 version. *    Copyright (C) 1991, 1992, 1995  Linus Torvalds */#include <linux/config.h>#include <linux/errno.h>#include <linux/module.h>#include <linux/sched.h>#include <linux/kernel.h>#include <linux/param.h>#include <linux/string.h>#include <linux/mm.h>#include <linux/interrupt.h>#include <linux/time.h>#include <linux/delay.h>#include <linux/init.h>#include <linux/smp.h>#include <asm/processor.h>#include <asm/uaccess.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/delay.h>#include <asm/machvec.h>#include <asm/rtc.h>#include <asm/freq.h>#ifdef CONFIG_SH_KGDB#include <asm/kgdb.h>#endif#include <linux/timex.h>#include <linux/irq.h>#define TMU_TOCR_INIT	0x00#define TMU0_TCR_INIT	0x0020#define TMU_TSTR_INIT	1#define TMU0_TCR_CALIB	0x0000#if defined(CONFIG_CPU_SH3)#if defined(CONFIG_CPU_SUBTYPE_SH7300)#define TMU_TSTR        0xA412FE92      /* Byte access */#define TMU0_TCOR       0xA412FE94      /* Long access */#define TMU0_TCNT       0xA412FE98      /* Long access */#define TMU0_TCR        0xA412FE9C      /* Word access */#define TMU1_TCOR	0xA412FEA0	/* Long access */#define TMU1_TCNT	0xA412FEA4	/* Long access */#define TMU1_TCR	0xA412FEA8	/* Word access */#define FRQCR           0xA415FF80#else#define TMU_TOCR	0xfffffe90	/* Byte access */#define TMU_TSTR	0xfffffe92	/* Byte access */#define TMU0_TCOR	0xfffffe94	/* Long access */#define TMU0_TCNT	0xfffffe98	/* Long access */#define TMU0_TCR	0xfffffe9c	/* Word access */#endif#elif defined(CONFIG_CPU_SH4)#define TMU_TOCR	0xffd80000	/* Byte access */#define TMU_TSTR	0xffd80004	/* Byte access */#define TMU0_TCOR	0xffd80008	/* Long access */#define TMU0_TCNT	0xffd8000c	/* Long access */#define TMU0_TCR	0xffd80010	/* Word access */#ifdef CONFIG_CPU_SUBTYPE_ST40STB1#define CLOCKGEN_MEMCLKCR 0xbb040038#define MEMCLKCR_RATIO_MASK 0x7#endif /* CONFIG_CPU_SUBTYPE_ST40STB1 */#endif /* CONFIG_CPU_SH3 or CONFIG_CPU_SH4 */extern unsigned long wall_jiffies;#define TICK_SIZE (tick_nsec / 1000)spinlock_t tmu0_lock = SPIN_LOCK_UNLOCKED;u64 jiffies_64 = INITIAL_JIFFIES;EXPORT_SYMBOL(jiffies_64);/* XXX: Can we initialize this in a routine somewhere?  Dreamcast doesn't want * these routines anywhere... */#ifdef CONFIG_SH_RTCvoid (*rtc_get_time)(struct timespec *) = sh_rtc_gettimeofday;int (*rtc_set_time)(const time_t) = sh_rtc_settimeofday;#elsevoid (*rtc_get_time)(struct timespec *) = 0;int (*rtc_set_time)(const time_t) = 0;#endif#if defined(CONFIG_CPU_SUBTYPE_SH7300)static int md_table[] = { 1, 2, 3, 4, 6, 8, 12 };#endif#if defined(CONFIG_CPU_SH3)static int stc_multipliers[] = { 1, 2, 3, 4, 6, 1, 1, 1 };static int stc_values[]      = { 0, 1, 4, 2, 5, 0, 0, 0 };#define bfc_divisors stc_multipliers#define bfc_values stc_valuesstatic int ifc_divisors[]    = { 1, 2, 3, 4, 1, 1, 1, 1 };static int ifc_values[]      = { 0, 1, 4, 2, 0, 0, 0, 0 };static int pfc_divisors[]    = { 1, 2, 3, 4, 6, 1, 1, 1 };static int pfc_values[]      = { 0, 1, 4, 2, 5, 0, 0, 0 };#elif defined(CONFIG_CPU_SH4)static int ifc_divisors[] = { 1, 2, 3, 4, 6, 8, 1, 1 };static int ifc_values[]   = { 0, 1, 2, 3, 0, 4, 0, 5 };#define bfc_divisors ifc_divisors	/* Same */#define bfc_values ifc_valuesstatic int pfc_divisors[] = { 2, 3, 4, 6, 8, 2, 2, 2 };static int pfc_values[]   = { 0, 0, 1, 2, 0, 3, 0, 4 };#else#error "Unknown ifc/bfc/pfc/stc values for this processor"#endif/* * Scheduler clock - returns current time in nanosec units. */unsigned long long sched_clock(void){	return (unsigned long long)jiffies * (1000000000 / HZ);}static unsigned long do_gettimeoffset(void){	int count;	unsigned long flags;	static int count_p = 0x7fffffff;    /* for the first call after boot */	static unsigned long jiffies_p = 0;	/*	 * cache volatile jiffies temporarily; we have IRQs turned off. 	 */	unsigned long jiffies_t;	spin_lock_irqsave(&tmu0_lock, flags);	/* timer count may underflow right here */	count = ctrl_inl(TMU0_TCNT);	/* read the latched count */ 	jiffies_t = jiffies;	/*	 * avoiding timer inconsistencies (they are rare, but they happen)...	 * there is one kind of problem that must be avoided here:	 *  1. the timer counter underflows	 */	if( jiffies_t == jiffies_p ) {		if( count > count_p ) {			/* the nutcase */			if(ctrl_inw(TMU0_TCR) & 0x100) { /* Check UNF bit */				/*				 * We cannot detect lost timer interrupts ... 				 * well, that's why we call them lost, don't we? :)				 * [hmm, on the Pentium and Alpha we can ... sort of]				 */				count -= LATCH;			} else {				printk("do_slow_gettimeoffset(): hardware timer problem?\n");			}		}	} else		jiffies_p = jiffies_t;	count_p = count;	spin_unlock_irqrestore(&tmu0_lock, flags);	count = ((LATCH-1) - count) * TICK_SIZE;	count = (count + LATCH/2) / LATCH;	return count;}void do_gettimeofday(struct timeval *tv){	unsigned long seq;	unsigned long usec, sec;	unsigned long lost;	do {		seq = read_seqbegin(&xtime_lock);		usec = do_gettimeoffset();				lost = jiffies - wall_jiffies;		if (lost)			usec += lost * (1000000 / HZ);		sec = xtime.tv_sec;		usec += xtime.tv_nsec / 1000;	} while (read_seqretry(&xtime_lock, seq));	while (usec >= 1000000) {		usec -= 1000000;		sec++;	}	tv->tv_sec = sec;	tv->tv_usec = usec;}EXPORT_SYMBOL(do_gettimeofday);int do_settimeofday(struct timespec *tv){	time_t wtm_sec, sec = tv->tv_sec;	long wtm_nsec, nsec = tv->tv_nsec;	if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)		return -EINVAL;	write_seqlock_irq(&xtime_lock);	/*	 * This is revolting. We need to set "xtime" correctly. However, the	 * value in this location is the value at the most recent update of	 * wall time.  Discover what correction gettimeofday() would have	 * made, and then undo it!	 */	nsec -= 1000 * (do_gettimeoffset() +				(jiffies - wall_jiffies) * (1000000 / HZ));	wtm_sec  = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);	wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);	set_normalized_timespec(&xtime, sec, nsec);	set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);	time_adjust = 0;		/* stop active adjtime() */	time_status |= STA_UNSYNC;	time_maxerror = NTP_PHASE_LIMIT;	time_esterror = NTP_PHASE_LIMIT;	write_sequnlock_irq(&xtime_lock);	clock_was_set();	return 0;}EXPORT_SYMBOL(do_settimeofday);/* last time the RTC clock got updated */static long last_rtc_update;/* Profiling definitions */extern unsigned long prof_cpu_mask;extern unsigned int * prof_buffer;extern unsigned long prof_len;extern unsigned long prof_shift;extern char _stext;static inline void sh_do_profile(unsigned long pc){	/* Don't profile cpu_idle.. */	if (!prof_buffer || !current->pid)		return;	if (pc >= 0xa0000000UL && pc < 0xc0000000UL)		pc -= 0x20000000;	pc -= (unsigned long)&_stext;	pc >>= prof_shift;	/*	 * Don't ignore out-of-bounds PC values silently,	 * put them into the last histogram slot, so if	 * present, they will show up as a sharp peak.	 */	if (pc > prof_len - 1)		pc = prof_len - 1;	atomic_inc((atomic_t *)&prof_buffer[pc]);}/* * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs){	do_timer(regs);	if (!user_mode(regs))		sh_do_profile(regs->pc);#ifdef CONFIG_HEARTBEAT	if (sh_mv.mv_heartbeat != NULL) 		sh_mv.mv_heartbeat();#endif	/*	 * If we have an externally synchronized Linux clock, then update	 * RTC clock accordingly every ~11 minutes. Set_rtc_mmss() has to be	 * called as close as possible to 500 ms before the new second starts.	 */	if ((time_status & STA_UNSYNC) == 0 &&	    xtime.tv_sec > last_rtc_update + 660 &&	    (xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&	    (xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {		if (rtc_set_time(xtime.tv_sec) == 0)			last_rtc_update = xtime.tv_sec;		else			last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */	}}/* * This is the same as the above, except we _also_ save the current * Time Stamp Counter value at the time of the timer interrupt, so that * we later on can estimate the time of day more exactly. */static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs){	unsigned long timer_status;	/* Clear UNF bit */	timer_status = ctrl_inw(TMU0_TCR);	timer_status &= ~0x100;	ctrl_outw(timer_status, TMU0_TCR);	/*	 * Here we are in the timer irq handler. We just have irqs locally	 * disabled but we don't know if the timer_bh is running on the other	 * CPU. We need to avoid to SMP race with it. NOTE: we don' t need	 * the irq version of write_lock because as just said we have irq	 * locally disabled. -arca	 */	write_seqlock(&xtime_lock);	do_timer_interrupt(irq, NULL, regs);	write_sequnlock(&xtime_lock);	return IRQ_HANDLED;}/* * Hah!  We'll see if this works (switching from usecs to nsecs). */static unsigned int __init get_timer_frequency(void){	u32 freq;	struct timespec ts1, ts2;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产一区二| 国产拍欧美日韩视频二区| 欧美午夜精品久久久久久超碰 | 69久久夜色精品国产69蝌蚪网| 欧美日韩精品系列| 欧美sm极限捆绑bd| 亚洲精品视频一区二区| 日本不卡免费在线视频| 成人综合婷婷国产精品久久免费| 在线亚洲精品福利网址导航| 日韩视频免费观看高清完整版 | 色妞www精品视频| 欧美性大战久久久久久久| 欧美国产日韩a欧美在线观看| 天天色 色综合| 色88888久久久久久影院野外| 欧美国产成人在线| 久久电影网站中文字幕| 欧美日韩亚洲综合在线| 一区二区三区日韩精品视频| 成人av网站免费| 国产欧美一区二区精品婷婷| 国产一区二区三区日韩| 日韩写真欧美这视频| 香蕉乱码成人久久天堂爱免费| 99精品欧美一区二区三区综合在线| 久久亚洲综合色一区二区三区| 婷婷久久综合九色综合伊人色| 欧美视频中文一区二区三区在线观看| 亚洲欧美日韩在线播放| 95精品视频在线| 亚洲精品国产a久久久久久| 99精品视频在线播放观看| 国产精品久久午夜| av电影天堂一区二区在线观看| 国产精品三级久久久久三级| 成人在线一区二区三区| 国产精品久久久久婷婷二区次| 成人免费看的视频| 亚洲欧美综合网| 欧美在线综合视频| 午夜精品福利视频网站| 欧美一区二区三区人| 精品午夜久久福利影院| 久久精品一区二区三区不卡牛牛| 国产91精品一区二区麻豆亚洲| 亚洲国产精品成人综合色在线婷婷| 国产成人精品亚洲777人妖 | 中文字幕第一页久久| 成人福利视频在线看| 自拍偷拍国产精品| 欧美日韩在线三级| 久久国产免费看| 中文字幕 久热精品 视频在线| av网站一区二区三区| 亚洲一二三四久久| 欧美xxxxx牲另类人与| 成人精品小蝌蚪| 一区二区成人在线| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 91精品国产欧美一区二区18| 国产精品自产自拍| 亚洲精品视频免费看| 欧美成人a在线| 99久久国产综合精品色伊| 日本免费新一区视频| 国产精品视频免费看| 日韩一区二区在线观看视频 | 午夜视频在线观看一区二区| 精品免费视频.| 色综合天天做天天爱| 日本免费新一区视频| 国产精品久久久久影院亚瑟| 欧美日韩精品一区二区三区四区| 国产一区视频在线看| 一区二区在线观看不卡| 久久久久久97三级| 欧美男男青年gay1069videost | 久久精品国产久精国产爱| 欧美国产丝袜视频| 欧美一区二区三区视频免费播放| 成人精品免费看| 日韩**一区毛片| 中文字幕视频一区二区三区久| 欧美日韩综合在线免费观看| 国产成人免费视频| 亚洲高清免费视频| 国产嫩草影院久久久久| 日韩一区二区在线观看视频播放| 91在线观看一区二区| 国产精品一区二区在线观看网站 | 在线播放欧美女士性生活| 风间由美中文字幕在线看视频国产欧美 | 精品国产91久久久久久久妲己 | 午夜视频一区在线观看| 亚洲精品成人精品456| 国产欧美日韩在线观看| 精品福利av导航| 337p亚洲精品色噜噜| 色中色一区二区| 成人激情黄色小说| 国产精品一卡二卡| 精品一二三四区| 久久国产精品一区二区| 日韩电影免费在线看| 午夜成人免费视频| 亚洲成av人在线观看| 亚洲综合免费观看高清完整版在线 | 99国产精品久久| 91一区在线观看| 国产精品亚洲午夜一区二区三区| 看片网站欧美日韩| 蜜臀av在线播放一区二区三区| 亚洲不卡一区二区三区| 欧美高清www午色夜在线视频| 国产亚洲婷婷免费| 欧美不卡一区二区| 精品日韩在线观看| xfplay精品久久| 日韩精品一区二区三区在线| 91精品午夜视频| 91精品在线免费观看| 欧美一级一区二区| 欧美tickling网站挠脚心| 欧美电影免费观看高清完整版在线 | 亚洲黄色av一区| 亚洲专区一二三| 亚洲国产日韩一级| 奇米亚洲午夜久久精品| 首页综合国产亚洲丝袜| 国产日产欧美一区二区三区| 久久久亚洲高清| 成人免费一区二区三区在线观看| 欧美精品一区二区久久婷婷| 精品久久人人做人人爰| 日本一区二区免费在线观看视频 | 精品一区二区三区视频在线观看| 免费欧美日韩国产三级电影| 国产呦精品一区二区三区网站| 成人午夜视频免费看| 91麻豆国产在线观看| 欧美日韩国产免费| 久久一二三国产| 亚洲精品免费在线观看| 日韩精品一级中文字幕精品视频免费观看 | 欧美亚洲综合在线| 91精品国产高清一区二区三区蜜臀| 精品国产sm最大网站免费看| 国产精品福利一区| 日本va欧美va瓶| 99精品视频在线观看| 欧美激情一区二区三区四区| 亚洲天堂a在线| 久久国产精品72免费观看| 99九九99九九九视频精品| 91精品国产免费| 亚洲色欲色欲www在线观看| 美腿丝袜亚洲一区| www.欧美.com| 日韩欧美在线网站| 亚洲女厕所小便bbb| 久久99国产精品麻豆| 91小视频在线免费看| 精品国产不卡一区二区三区| 亚洲自拍偷拍欧美| www.视频一区| 精品国产乱码久久久久久蜜臀| 亚洲精品视频一区二区| 国产在线视频不卡二| 欧美日韩一区二区电影| 国产精品久久久久久久久动漫| 日韩高清不卡在线| 91久久精品国产91性色tv| 久久免费的精品国产v∧| 亚洲成人一区在线| 色先锋资源久久综合| 国产婷婷色一区二区三区在线| 日日噜噜夜夜狠狠视频欧美人| av一区二区三区在线| 久久亚洲二区三区| 精品在线视频一区| 欧美巨大另类极品videosbest | 欧美日韩精品福利| 亚洲色欲色欲www在线观看| 国产成人精品免费一区二区| 日韩久久久精品| 日本伊人精品一区二区三区观看方式| www.激情成人| 国产精品人人做人人爽人人添| 久久精品国产99国产| 欧美一二三区在线观看| 午夜久久电影网| 欧美日韩中文另类| 亚洲最大的成人av| 91免费看片在线观看| 亚洲欧美激情一区二区| 91欧美一区二区| 亚洲一区在线看| 欧美日韩在线三区| 日本欧美肥老太交大片|