我是靠谱客的博主 鳗鱼鼠标,这篇文章主要介绍arch_sys_timer --- Linux kernel 实现欣赏,现在分享给大家,希望可以做个参考。

 一个时钟硬件设备,可被编程.

struct clock_event_device {
    void            (*event_handler)(struct clock_event_device *);
    int            (*set_next_event)(unsigned long evt, struct clock_event_device *);
    int            (*set_next_ktime)(ktime_t expires, struct clock_event_device *);
    ktime_t            next_event;
    u64            max_delta_ns;
    u64            min_delta_ns;
    u32            mult;
    u32            shift;
    enum clock_event_state    state_use_accessors;
    unsigned int        features;
    unsigned long        retries;

    int            (*set_state_periodic)(struct clock_event_device *);
    int            (*set_state_oneshot)(struct clock_event_device *);
    int            (*set_state_oneshot_stopped)(struct clock_event_device *);
    int            (*set_state_shutdown)(struct clock_event_device *);
    int            (*tick_resume)(struct clock_event_device *);

    void            (*broadcast)(const struct cpumask *mask);
    void            (*suspend)(struct clock_event_device *);
    void            (*resume)(struct clock_event_device *);
    unsigned long        min_delta_ticks;
    unsigned long        max_delta_ticks;

    const char        *name;
    int            rating;
    int            irq;
    int            bound_on;
    const struct cpumask    *cpumask;
    struct list_head    list;
    struct module        *owner;
} ____cacheline_aligned;

在smp系统中,每个cpu都有本地的 lock_event_device.

遍历全局 clockevent_devices 链表 ,取出每个entry,然后输出该entry的名字, 看下面的输出信息.

 

最后

以上就是鳗鱼鼠标最近收集整理的关于arch_sys_timer --- Linux kernel 实现欣赏的全部内容,更多相关arch_sys_timer内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(118)

评论列表共有 0 条评论

立即
投稿
返回
顶部