Skip to Content
Linux Device Drivers Development
book

Linux Device Drivers Development

by John Madieu
October 2017
Intermediate to advanced
586 pages
14h 8m
English
Packt Publishing
Content preview from Linux Device Drivers Development

HRT setup initialization

The HRT setup initialization is done as follows:

  1. Initializing the hrtimer: Before hrtimer initialization, you need to set up a ktime, which represents time duration. We will see how to achieve that in the following example:
 void hrtimer_init( struct hrtimer *time, clockid_t which_clock, 
                    enum hrtimer_mode mode); 
  1. Starting hrtimer: hrtimer can be started as shown in the following example:
int hrtimer_start( struct hrtimer *timer, ktime_t time, 
                    const enum hrtimer_mode mode); 

mode represents the expiry mode. It should be HRTIMER_MODE_ABS for an absolute time value, or HRTIMER_MODE_REL for a time value relative to now.

  1. hrtimer cancellation: You can either cancel the timer or see whether it is possible to cancel ...
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 Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini
Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 9781785280009Supplemental Content