Skip to Content
Mastering Linux Kernel Development
book

Mastering Linux Kernel Development

by CH Raghav Maruthi
October 2017
Intermediate to advanced
354 pages
9h 28m
English
Packt Publishing
Content preview from Mastering Linux Kernel Development

Hardware abstraction

Every system has at least one clock counter. As with any hardware device in a machine, this counter too is represented and managed by a structure. Hardware abstraction is provided by struct clocksource, defined in the include/linux/clocksource.h header file. This structure provides callbacks to access and handle power management on the counter through the read, enable, disable, suspend, and resume routines:

struct clocksource {
        u64 (*read)(struct clocksource *cs);
        u64 mask;
        u32 mult;
        u32 shift;
        u64 max_idle_ns;
        u32 maxadj;
#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
        struct arch_clocksource_data archdata;
#endif
        u64 max_cycles;
        const char *name;
        struct list_head list;
        int rating;
        int (*enable)(struct clocksource *cs);
        void (
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Kernel Development, Third Edition

Linux Kernel Development, Third Edition

Robert Love
Understanding the Linux Kernel

Understanding the Linux Kernel

Daniel P. Bovet, Marco Cesati
Linux Kernel Debugging

Linux Kernel Debugging

Kaiwan N. Billimoria

Publisher Resources

ISBN: 9781785883057Other