time.c

来自「microwindows移植到S3C44B0的源码」· C语言 代码 · 共 26 行

C
26
字号
/* * time.c  Timer functions for Atmel AT91 */#include <linux/time.h>#include <linux/timex.h>#include <linux/types.h>#include <linux/sched.h>#include <asm/io.h>#include <asm/arch/hardware.h>unsigned long atmel_gettimeoffset (void){	struct at91_timers* tt = (struct trio_timers*) (AT91_TC_BASE);	struct at91_timer_channel* tc = &tt->chans[KERNEL_TIMER].ch;	return tc->cv * (1000*1000)/(ARM_CLK/128);}void atmel_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs){	struct at91_timers* tt = (struct trio_timers*) (AT91_TC_BASE);	volatile struct  at91_timer_channel* tc = &tt->chans[KERNEL_TIMER].ch;	unsigned long v = tc->sr;        do_timer(regs);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?