/* linux/kernel/time/jiffies.c*/
static cycle_t jiffies_read(struct clocksource *cs)
{
return (cycle_t) jiffies;
} struct clocksource clocksource_jiffies = {
.name = "jiffies",
.rating = , /* lowest valid rating*/
.read = jiffies_read,
.mask = 0xffffffff, /*32bits*/
.mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */
.mult_orig = NSEC_PER_JIFFY << JIFFIES_SHIFT,
.shift = JIFFIES_SHIFT,
}; static int __init init_jiffies_clocksource(void)
{
return clocksource_register(&clocksource_jiffies);
} core_initcall(init_jiffies_clocksource); int clocksource_register(struct clocksource *c)
-->ret = clocksource_enqueue(c);
/*静态全局变量存储下一个精度最高的时钟源
static struct clocksource *next_clocksource;*/
-->next_clocksource = select_clocksource(); struct clocksource *clocksource_get_next(void)
/*静态全局变量存储当前使用的时钟源
static struct clocksource *curr_clocksource = &clocksource_jiffies;*/
-->curr_clocksource = next_clocksource; /*什么时间更换时钟源,以下两种方法选择其一*/
/*1.jiffies时间中断处理函数*/
static irqreturn_t s3c2410_timer_interrupt(int irq, void *dev_id)
-->void timer_tick(void)
-->void do_timer(unsigned long ticks)
-->jiffies_64 += ticks;
-->update_times(ticks);
-->void update_wall_time(void)
/* check to see if there is a new clocksource to use */
-->change_clocksource();
/*2.jiffies时间中断处理函数*/
void clockevents_register_device(struct clock_event_device *dev)
/*内核通知链触发*/
-->clockevents_do_notify(CLOCK_EVT_NOTIFY_ADD, dev); /*通知链注册*/
void __init tick_init(void)
/*static struct notifier_block tick_notifier = {
.notifier_call = tick_notify,
};*/
-->clockevents_register_notifier(&tick_notifier);
/*通知链回调*/
static int tick_notify(struct notifier_block *nb, unsigned long reason,void *dev)
-->static int tick_check_new_device(struct clock_event_device *newdev)
-->static void tick_setup_device(struct tick_device *td,struct clock_event_device *newdev, int cpu,const struct cpumask *cpumask)
-->void tick_setup_periodic(struct clock_event_device *dev, int broadcast)
-->void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast)
-->dev->event_handler = tick_handle_periodic;
/*event时间处理函数调用*/
void tick_handle_periodic(struct clock_event_device *dev)
-->static void tick_periodic(int cpu)
-->void do_timer(unsigned long ticks)
-->jiffies_64 += ticks;
-->update_times(ticks);
-->void update_wall_time(void)
/* check to see if there is a new clocksource to use */
-->change_clocksource();

/* linux/kernel/time/jiffies.c*/static cycle_t jiffies_read(struct clocksource *cs){return (cycle_t) jiffies;}
struct clocksource clocksource_jiffies = {.name= "jiffies",.rating= 1, /* lowest valid rating*/.read= jiffies_read,.mask= 0xffffffff, /*32bits*/.mult= NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */.mult_orig= NSEC_PER_JIFFY << JIFFIES_SHIFT,.shift= JIFFIES_SHIFT,};
static int __init init_jiffies_clocksource(void){return clocksource_register(&clocksource_jiffies);}
core_initcall(init_jiffies_clocksource);

int clocksource_register(struct clocksource *c)-->ret = clocksource_enqueue(c);/*静态全局变量存储下一个精度最高的时钟源static struct clocksource *next_clocksource;*/-->next_clocksource = select_clocksource();
struct clocksource *clocksource_get_next(void)/*静态全局变量存储当前使用的时钟源static struct clocksource *curr_clocksource = &clocksource_jiffies;*/-->curr_clocksource = next_clocksource;
/*什么时间更换时钟源,以下两种方法选择其一*//*1.jiffies时间中断处理函数*/static irqreturn_t s3c2410_timer_interrupt(int irq, void *dev_id)-->void timer_tick(void)-->void do_timer(unsigned long ticks)-->jiffies_64 += ticks;-->update_times(ticks);-->void update_wall_time(void)/* check to see if there is a new clocksource to use */-->change_clocksource();/*2.jiffies时间中断处理函数*/void clockevents_register_device(struct clock_event_device *dev)/*内核通知链触发*/-->clockevents_do_notify(CLOCK_EVT_NOTIFY_ADD, dev);
/*通知链注册*/void __init tick_init(void)/*static struct notifier_block tick_notifier = {.notifier_call = tick_notify,};*/-->clockevents_register_notifier(&tick_notifier);/*通知链回调*/static int tick_notify(struct notifier_block *nb, unsigned long reason,void *dev)-->static int tick_check_new_device(struct clock_event_device *newdev)-->static void tick_setup_device(struct tick_device *td,struct clock_event_device *newdev, int cpu,const struct cpumask *cpumask)-->void tick_setup_periodic(struct clock_event_device *dev, int broadcast)-->void tick_set_periodic_handler(struct clock_event_device *dev, int broadcast)-->dev->event_handler = tick_handle_periodic;/*event时间处理函数调用*/void tick_handle_periodic(struct clock_event_device *dev)-->static void tick_periodic(int cpu)-->void do_timer(unsigned long ticks)-->jiffies_64 += ticks;-->update_times(ticks);-->void update_wall_time(void)/* check to see if there is a new clocksource to use */-->change_clocksource();

timer event的更多相关文章

  1. Microsecond and Millisecond C# Timer[转]

    文章转至:http://www.codeproject.com/Articles/98346/Microsecond-and-Millisecond-NET-Timer IntroductionAny ...

  2. Python 3.X 实现定时器 Timer,制作抽象的Timer定时器基类

    Python 在不依赖第三方库的前提下,对于定时器的实现并不是很完美,但是这不意味着我们无法实现. 阅读了网上的一些资料,得出一些结论,顺手写了一个基类的定时器(Python3) BaseTimer: ...

  3. C#中5中timer的比较

    C#中有5个timer,它们的主要区别如下: System.Threading.Timer  在线程池启动一个后台任务.我前段时间写过一个关于timer的垃圾回收的需要注意一下,参见谁动了我的time ...

  4. Swoole源代码学习记录(十五)——Timer模块分析

    swoole版本号:1.7.7-stable Github地址:点此查看 1.Timer 1.1.swTimer_interval_node 声明: // swoole.h 1045-1050h ty ...

  5. Linux时间子系统之(十七):ARM generic timer驱动代码分析

    专题文档汇总目录 Notes:ARM平台Clock/Timer架构:System counter.Timer以及两者之间关系:Per cpu timer通过CP15访问,System counter通 ...

  6. UEFI EVENT 全解

    Event和Timer在UEFI当中是怎么实现的以及原理,我们先从Timer开始,然后细细的拨开隐藏在底层的实现. 先说Timer,那什么是Timer呢?其实在中文里面我们把它叫做定时/计数器,但是我 ...

  7. Linux时间子系统(十七) ARM generic timer驱动代码分析

    一.前言 关注ARM平台上timer driver(clocksource chip driver和clockevent chip driver)的驱动工程师应该会注意到timer硬件的演化过程.在单 ...

  8. System and method for controlling switching between VMM and VM using enabling value of VMM timer indicator and VMM timer value having a specified time

    In one embodiment, a method includes transitioning control to a virtual machine (VM) from a virtual ...

  9. .net几种timer区别

    概述:.net框架不同名称控件都包含了各种timer,但每个timer有什么具体区别呢? 一.System.Threading private static void ThreadingTimer() ...

随机推荐

  1. Tinghua Data Mining 2

    数据预处理 https://www.bilibili.com/video/av23933161/?p=11 http://www.xuetangx.com/courses/course-v1:Tsin ...

  2. Connected Components? Codeforces - 920E || 洛谷 P3452 &&bzoj1098 [POI2007]BIU-Offices

    https://codeforces.com/contest/920/problem/E https://www.luogu.org/problemnew/show/P3452 https://www ...

  3. JAVA常用知识总结(十四)——Servlet

    Servlet属于线程安全的吗? Servlet不是线程安全的! 谈谈转发和重定向的区别 请求转发: request.getRequestDispatcher("/king_l2lu.jsp ...

  4. Nginx 配置https 开启ssl 同时支持http

    server { listen ; listen 443 ssl; server_name default; index index.html index.php; root /www/html; a ...

  5. webApi Authentication failed because the remote party has closed the transport stream\身份验证失败了,因为远程方关闭了传输流。

    public class CertificateTrust { public static void SetCertificatePolicy() { //当在浏览器中可以正常访问,而code中出现错 ...

  6. 学习笔记——Paint 1(MaskFilter)

    对于Paint没有很好的深入的学习过,在工作之余再巩固巩固. 1.Paint的BlurMaskFilter(模糊效果) 自定义一个View继承View 重写里面的onDraw方法.这里直接上代码了: ...

  7. 最新深度ghost win7系统下载

    深度技术ghost win7系统 64位快速安装版 V2016年2月,深度技术ghost win7 64位快速安装版在不影响大多数软件和硬件运行的前提下,已经尽可能关闭非必要服务,自动安装AMD/In ...

  8. 洛谷 P1181 数列分段Section I(水题日常)

    题目描述 对于给定的一个长度为N的正整数数列A[i],现要将其分成连续的若干段,并且每段和不超过M(可以等于M),问最少能将其分成多少段使得满足要求. 输入输出格式 输入格式: 输入文件divide_ ...

  9. 验证 .NET 4.6 的 SIMD 硬件加速支持的重要性

    SIMD 的意思是 Single Instruction Multiple Data.顾名思义,一个指令可以处理多个数据. .NET Framework 4.6 推出的 Nuget 程序包 Syste ...

  10. python一周速成学习笔记

    目录 一:语法元素 1.注释,变量,空格的使用 2.输入函数,输出函数 3.分支语句,循环语句 4.保留字in,同步赋值 5.import与def以及turtle库 6.eval函数与repr函数 二 ...