aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/timers
diff options
context:
space:
mode:
authorJaswinder Singh Rajput <jaswinderlinux@gmail.com>2010-10-26 17:22:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 19:52:11 -0400
commitaaaddfe0b3bb449b8734bf29bbd36141076e5277 (patch)
tree40bb4f75fa62ffb483e1b60a6f70dca9c6abb12a /Documentation/timers
parent0ca01763a028d0034042a9397534bc1f27848652 (diff)
Documentation/timers/hpet_example.c: add supporting info for hpet_example
$./hpet_example info /dev/hpet -hpet: executing info hpet_info: hi_irqfreq 0x0 hi_flags 0x0 hi_hpet 0 hi_timer 2 Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: "Venkatesh Pallipadi (Venki)" <venki@google.com> Cc: john stultz <johnstul@us.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/timers')
-rw-r--r--Documentation/timers/hpet_example.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c
index 4bfafb7bc4c5..9a3e7012c190 100644
--- a/Documentation/timers/hpet_example.c
+++ b/Documentation/timers/hpet_example.c
@@ -97,6 +97,33 @@ hpet_open_close(int argc, const char **argv)
97void 97void
98hpet_info(int argc, const char **argv) 98hpet_info(int argc, const char **argv)
99{ 99{
100 struct hpet_info info;
101 int fd;
102
103 if (argc != 1) {
104 fprintf(stderr, "hpet_info: device-name\n");
105 return;
106 }
107
108 fd = open(argv[0], O_RDONLY);
109 if (fd < 0) {
110 fprintf(stderr, "hpet_info: open of %s failed\n", argv[0]);
111 return;
112 }
113
114 if (ioctl(fd, HPET_INFO, &info) < 0) {
115 fprintf(stderr, "hpet_info: failed to get info\n");
116 goto out;
117 }
118
119 fprintf(stderr, "hpet_info: hi_irqfreq 0x%lx hi_flags 0x%lx ",
120 info.hi_ireqfreq, info.hi_flags);
121 fprintf(stderr, "hi_hpet %d hi_timer %d\n",
122 info.hi_hpet, info.hi_timer);
123
124out:
125 close(fd);
126 return;
100} 127}
101 128
102void 129void