/* 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. 112 Path Sum 路径总和

    给定一棵二叉树和一个总和,确定该树中是否存在根到叶的路径,这条路径的所有值相加等于给定的总和.例如:给定下面的二叉树和 总和 = 22,              5             / \  ...

  2. odoo8 报表页面修改和字体设置

    版本8.0, 想要发票修改报表页眉的内容,去公司设置下修改,返现无论如何也不生效. 放狗后得知: You probably already know that you can customise th ...

  3. corn表达式 经典

    https://www.cnblogs.com/GarfieldTom/p/3746290.html

  4. Kettle Rest大文件上传(RestUploadFile.ktr) Rest文件下载(FileDownload.ktr)

    1. Rest大文件上传(RestUploadFile.ktr) 需求描述 上传文件大于10M小于500M 上传文件进行分片(5M一片要比1M分片整体时间快) 先使用java类进行功能模拟在迁移Ktr ...

  5. STL使用迭代器逆向删除

    网上有很多这种例子: void erase(vector<int> &v) { for(vector<int>::reverse_iterator ri=v.rbegi ...

  6. P1791 线段覆盖

    题目描述 已知数轴上0<N<10000条线段.每条线段按照端点Ai和Bi(Ai<>Bi,i=1..N)定义.端点坐标在(-999,999)内,坐标为整数.有些线段可能相交.编程 ...

  7. 学习php中的mysql()函数

    1.mysql_connect(1,2,3):连接数据库服务器语句,一般常用这三个参数(1)数据库服务器地址,(2)用户名,(3)密码:常与die()(或者exit())函数结合使用:die()函数用 ...

  8. Android笔记--Bitmap

    Android | Bitmap解析 Android中Bitmap是对图像的一种抽象.通过他可以对相应的图像进行剪裁,旋转,压缩,缩放等操作.这里循序渐进的一步步了解Bitmap的相关内容. 先了解B ...

  9. Oracle种常用性能监控SQL语句

    --Oracle常用性能监控SQL语句 --1 SELECT * FROM SYS.V_$SQLAREA WHERE DISK_READS > 100; --2 监控事例的等待 SELECT E ...

  10. 反射机制与IOC容器

    原文地址:http://blog.csdn.net/u010926964/article/details/47262771