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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? time.c

?? ARM 嵌入式 系統(tǒng) 設(shè)計(jì)與實(shí)例開發(fā) 實(shí)驗(yàn)教材 二源碼
?? C
字號:
/* * Copyright (C) 2001 MontaVista Software, ppopov@mvista.com * Copied and modified Carsten Langgaard's time.c * * Carsten Langgaard, carstenl@mips.com * Copyright (C) 1999,2000 MIPS Technologies, Inc.  All rights reserved. * * ######################################################################## * *  This program is free software; you can distribute it and/or modify it *  under the terms of the GNU General Public License (Version 2) as *  published by the Free Software Foundation. * *  This program is distributed in the hope it will be useful, but WITHOUT *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License *  for more details. * *  You should have received a copy of the GNU General Public License along *  with this program; if not, write to the Free Software Foundation, Inc., *  59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * ######################################################################## * * Setting up the clock on the MIPS boards. */#include <linux/config.h>#include <linux/init.h>#include <linux/kernel_stat.h>#include <linux/sched.h>#include <linux/spinlock.h>#include <asm/mipsregs.h>#include <asm/ptrace.h>#include <asm/div64.h>#include <asm/au1000.h>#include <linux/mc146818rtc.h>#include <linux/timex.h>extern volatile unsigned long wall_jiffies;unsigned long missed_heart_beats = 0;unsigned long uart_baud_base;static unsigned long r4k_offset; /* Amount to increment compare reg each time */static unsigned long r4k_cur;    /* What counter should be at next timer irq */extern rwlock_t xtime_lock;#define ALLINTS (IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5)static inline void ack_r4ktimer(unsigned long newval){	write_32bit_cp0_register(CP0_COMPARE, newval);}/* * There are a lot of conceptually broken versions of the MIPS timer interrupt * handler floating around.  This one is rather different, but the algorithm * is provably more robust. */unsigned long wtimer;void mips_timer_interrupt(struct pt_regs *regs){	int irq = 7;	if (r4k_offset == 0)		goto null;	do {		kstat.irqs[0][irq]++;		do_timer(regs);		r4k_cur += r4k_offset;		ack_r4ktimer(r4k_cur);	} while (((unsigned long)read_32bit_cp0_register(CP0_COUNT)	         - r4k_cur) < 0x7fffffff);	return;null:	ack_r4ktimer(0);}/*  * Figure out the r4k offset, the amount to increment the compare * register for each time tick.  * Use the Programmable Counter 1 to do this. */unsigned long cal_r4koff(void){	unsigned long count;	unsigned long cpu_pll;	unsigned long cpu_speed;	unsigned long start, end;	unsigned long counter;	int i;	int trim_divide = 16;	counter = inl(PC_COUNTER_CNTRL);	outl(counter | PC_CNTRL_EN1, PC_COUNTER_CNTRL);	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_T1S);	outl(trim_divide-1, PC1_TRIM);    /* RTC now ticks at 32.768/16 kHz */	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_T1S);	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_C1S);	outl (0, PC1_COUNTER_WRITE);	while (inl(PC_COUNTER_CNTRL) & PC_CNTRL_C1S);	start = inl(PC1_COUNTER_READ);	start += 2;	/* wait for the beginning of a new tick */	while (inl(PC1_COUNTER_READ) < start);	/* Start r4k counter. */	write_32bit_cp0_register(CP0_COUNT, 0);	end = start + (32768 / trim_divide)/2; /* wait 0.5 seconds */	while (end > inl(PC1_COUNTER_READ));	count = read_32bit_cp0_register(CP0_COUNT);	cpu_speed = count * 2;	uart_baud_base = (((cpu_speed) / 4) / 16);	return (cpu_speed / HZ);}static unsigned long __init get_mips_time(void){	return inl(PC0_COUNTER_READ);}void __init time_init(void){        unsigned int est_freq, flags;	printk("calculating r4koff... ");	r4k_offset = cal_r4koff();	printk("%08lx(%d)\n", r4k_offset, (int) r4k_offset);	//est_freq = 2*r4k_offset*HZ;		est_freq = r4k_offset*HZ;		est_freq += 5000;    /* round */	est_freq -= est_freq%10000;	printk("CPU frequency %d.%02d MHz\n", est_freq/1000000, 	       (est_freq%1000000)*100/1000000);	r4k_cur = (read_32bit_cp0_register(CP0_COUNT) + r4k_offset);	write_32bit_cp0_register(CP0_COMPARE, r4k_cur);	set_cp0_status(ALLINTS);	/* Read time from the RTC chipset. */	write_lock_irqsave (&xtime_lock, flags);	xtime.tv_sec = get_mips_time();	xtime.tv_usec = 0;	write_unlock_irqrestore(&xtime_lock, flags);}/* This is for machines which generate the exact clock. */#define USECS_PER_JIFFY (1000000/HZ)#define USECS_PER_JIFFY_FRAC ((1000000ULL << 32) / HZ & 0xffffffff)/* Cycle counter value at the previous timer interrupt.. */static unsigned int timerhi = 0, timerlo = 0;static unsigned longdiv64_32(unsigned long v1, unsigned long v2, unsigned long v3){	unsigned long r0;	do_div64_32(r0, v1, v2, v3);	return r0;}/* * FIXME: Does playing with the RP bit in c0_status interfere with this code? */static unsigned long do_fast_gettimeoffset(void){	u32 count;	unsigned long res, tmp;	unsigned long r0;	/* Last jiffy when do_fast_gettimeoffset() was called. */	static unsigned long last_jiffies=0;	unsigned long quotient;	/*	 * Cached "1/(clocks per usec)*2^32" value.	 * It has to be recalculated once each jiffy.	 */	static unsigned long cached_quotient=0;	tmp = jiffies;	quotient = cached_quotient;	if (tmp && last_jiffies != tmp) {		last_jiffies = tmp;		if (last_jiffies != 0) {			r0 = div64_32(timerhi, timerlo, tmp);			quotient = div64_32(USECS_PER_JIFFY, USECS_PER_JIFFY_FRAC, r0);			cached_quotient = quotient;		}	}	/* Get last timer tick in absolute kernel time */	count = read_32bit_cp0_register(CP0_COUNT);	/* .. relative to previous jiffy (32 bits is enough) */	count -= timerlo;	__asm__("multu\t%1,%2\n\t"		"mfhi\t%0"		:"=r" (res)		:"r" (count),		 "r" (quotient));	/* 	 * Due to possible jiffies inconsistencies, we need to check 	 * the result so that we'll get a timer that is monotonic.	 */	if (res >= USECS_PER_JIFFY)		res = USECS_PER_JIFFY-1;	return res;}void do_gettimeofday(struct timeval *tv){	unsigned int flags;	read_lock_irqsave (&xtime_lock, flags);	*tv = xtime;	tv->tv_usec += do_fast_gettimeoffset();	/*	 * xtime is atomically updated in timer_bh. jiffies - wall_jiffies	 * is nonzero if the timer bottom half hasnt executed yet.	 */	if (jiffies - wall_jiffies)		tv->tv_usec += USECS_PER_JIFFY;	read_unlock_irqrestore (&xtime_lock, flags);	if (tv->tv_usec >= 1000000) {		tv->tv_usec -= 1000000;		tv->tv_sec++;	}}void do_settimeofday(struct timeval *tv){	write_lock_irq (&xtime_lock);	/* This is revolting. We need to set the xtime.tv_usec correctly.	 * However, the value in this location is is value at the last tick.	 * Discover what correction gettimeofday would have done, and then	 * undo it!	 */	tv->tv_usec -= do_fast_gettimeoffset();	if (tv->tv_usec < 0) {		tv->tv_usec += 1000000;		tv->tv_sec--;	}	xtime = *tv;	time_adjust = 0;		/* stop active adjtime() */	time_status |= STA_UNSYNC;	time_maxerror = NTP_PHASE_LIMIT;	time_esterror = NTP_PHASE_LIMIT;	write_unlock_irq (&xtime_lock);}/* * The UART baud base is not known at compile time ... if * we want to be able to use the same code on different * speed CPUs. */unsigned long get_au1000_uart_baud(){	return uart_baud_base;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美影院精品一区| 成人白浆超碰人人人人| 在线播放欧美女士性生活| 亚洲国产wwwccc36天堂| 欧美色综合网站| 日韩激情在线观看| xfplay精品久久| 国产成都精品91一区二区三| 国产精品初高中害羞小美女文| 不卡的av电影| 亚洲午夜日本在线观看| 欧美一区二区免费观在线| 极品尤物av久久免费看| 国产精品午夜在线| 欧美日韩综合在线免费观看| 免费一级欧美片在线观看| 国产欧美一区二区精品性| 99国产精品国产精品毛片| 午夜精品久久久久久久99樱桃| 日韩视频免费观看高清完整版| 国产精品99久| 亚洲综合男人的天堂| 91精品国产品国语在线不卡| 国产在线视频一区二区三区| 亚洲精品视频免费观看| 91精品国产91热久久久做人人| 国产精品一区久久久久| 一区二区三区日韩欧美| 欧美不卡在线视频| 在线亚洲高清视频| 国模大尺度一区二区三区| 中文字幕五月欧美| 91精品国产日韩91久久久久久| 国产精品亚洲一区二区三区妖精| 怡红院av一区二区三区| 亚洲精品在线电影| 在线观看精品一区| 成人国产精品视频| 免费看欧美美女黄的网站| 国产精品欧美久久久久无广告 | av一区二区三区| 一区二区三区欧美在线观看| 欧美大白屁股肥臀xxxxxx| 一本色道久久加勒比精品| 狠狠色丁香婷婷综合| 亚洲成人中文在线| 1024国产精品| 2022国产精品视频| 欧美日韩精品电影| 99精品视频一区| 韩国成人在线视频| 日本中文字幕一区二区有限公司| 国产精品久久三| 精品福利一区二区三区免费视频| 欧美在线观看视频一区二区| 成人黄色小视频在线观看| 国产一区二区不卡| 麻豆精品新av中文字幕| 亚洲高清视频在线| 一区二区三区日本| 综合久久给合久久狠狠狠97色| 精品国产亚洲一区二区三区在线观看| 欧美撒尿777hd撒尿| 一本色道久久综合亚洲精品按摩| 大胆亚洲人体视频| 国产在线视频精品一区| 久久99精品网久久| 日本视频一区二区三区| 午夜电影一区二区| 天堂在线亚洲视频| 亚洲国产乱码最新视频| 亚洲福利视频导航| 午夜视频久久久久久| 亚洲va欧美va人人爽| 亚洲自拍另类综合| 夜夜嗨av一区二区三区| 亚洲欧美视频在线观看| 亚洲伦理在线免费看| 亚洲综合偷拍欧美一区色| 伊人夜夜躁av伊人久久| 亚洲永久免费av| 天堂一区二区在线| 美女在线一区二区| 国产一区二区三区免费在线观看| 久久av中文字幕片| 国产精品中文有码| 丁香激情综合五月| 99re这里只有精品视频首页| 色综合天天综合在线视频| 在线看不卡av| 欧美一区二区不卡视频| 久久夜色精品国产噜噜av | 国产欧美视频一区二区三区| 久久久久88色偷偷免费| 亚洲国产精品黑人久久久| 亚洲视频在线一区观看| 夜色激情一区二区| 美女视频一区二区三区| 国产乱子轮精品视频| 丁香啪啪综合成人亚洲小说| 色综合久久久久综合99| 欧美高清你懂得| 精品成人免费观看| 国产精品久久久久一区二区三区共| 亚洲欧洲av在线| 日日摸夜夜添夜夜添亚洲女人| 蜜桃视频在线一区| 国产成人免费视| 欧美综合久久久| 2023国产精华国产精品| 亚洲女与黑人做爰| 男女性色大片免费观看一区二区| 国产乱码精品1区2区3区| 91丝袜国产在线播放| 欧美一区二区视频网站| 欧美激情一二三区| 亚洲gay无套男同| 国产一区在线不卡| 欧美高清性hdvideosex| 一个色在线综合| 毛片av中文字幕一区二区| www.爱久久.com| 国产精品美女久久福利网站| 亚洲一区二区三区视频在线| 国产福利电影一区二区三区| 国产一区二区调教| 欧美电影免费观看高清完整版在| 欧美无砖砖区免费| 日韩精品一区二区在线| 国产一区二区在线视频| 国产精品女人毛片| 亚洲一区二区在线免费看| 国产一区二区在线看| 欧美综合一区二区| 国产精品美女久久久久久久久 | 26uuu精品一区二区| 亚洲一级二级在线| 成人h版在线观看| 日韩欧美在线网站| 亚洲综合在线视频| 成人97人人超碰人人99| 日韩精品一区二区三区视频播放| 亚洲免费观看高清| 国产成人精品www牛牛影视| 欧美一区二区在线播放| 亚洲综合激情另类小说区| kk眼镜猥琐国模调教系列一区二区 | 在线欧美日韩国产| 中文一区在线播放| 国产在线精品免费av| 91精品国产综合久久香蕉的特点 | 国产三级精品三级在线专区| 日韩精品视频网站| 色欧美日韩亚洲| 亚洲色图都市小说| 不卡的看片网站| 国产精品欧美一区二区三区| 国产91精品一区二区麻豆网站| 日韩欧美电影一区| 蜜臀久久99精品久久久画质超高清 | 热久久久久久久| 欧美乱熟臀69xxxxxx| 亚洲一二三级电影| 欧美亚男人的天堂| 亚洲午夜免费福利视频| 欧美三级电影一区| 肉丝袜脚交视频一区二区| 欧美午夜电影网| 中文字幕一区在线| 国产精品―色哟哟| 久久国产视频网| 欧美高清视频在线高清观看mv色露露十八| 亚洲特黄一级片| 99精品欧美一区二区三区小说| 久久久久99精品一区| 国产大陆亚洲精品国产| 久久夜色精品国产噜噜av| 国产精品99久久不卡二区| 国产拍揄自揄精品视频麻豆| 国产99久久久久| 亚洲色图欧美激情| 亚洲最新在线观看| 国产在线精品一区二区不卡了| 免费高清成人在线| 国产精品美日韩| 日韩视频一区二区三区| 欧美福利视频导航| 国产高清不卡二三区| 人人精品人人爱| 亚洲国产va精品久久久不卡综合| 2020日本不卡一区二区视频| 欧美亚洲愉拍一区二区| 99久免费精品视频在线观看| 免费成人av资源网| 亚洲午夜精品在线| 久久国产剧场电影| 欧美在线观看一二区| 午夜欧美大尺度福利影院在线看 | 成人妖精视频yjsp地址| 国产精品久久久久一区二区三区|