* [PATCH] HPET: Supporting info for hpet_example
@ 2010-09-04 8:46 Jaswinder Singh Rajput
2010-09-06 8:55 ` Clemens Ladisch
0 siblings, 1 reply; 2+ messages in thread
From: Jaswinder Singh Rajput @ 2010-09-04 8:46 UTC (permalink / raw)
To: Clemens Ladisch, Venkatesh Pallipadi (Venki),
the arch/x86 maintainers, Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
Hello,
I am attaching the patch and also uploaded on :
http://userweb.kernel.org/~jaswinder/patches/0001-HPET-Supporting-info-for-hpet_example.patch
Thanks,
--
Jaswinder Singh.
[-- Attachment #2: 0001-HPET-Supporting-info-for-hpet_example.patch --]
[-- Type: application/octet-stream, Size: 1540 bytes --]
From 92f4d790f0d1c1382c374719e992a689bc06d8fc Mon Sep 17 00:00:00 2001
From: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Date: Sat, 4 Sep 2010 13:59:57 +0530
Subject: [PATCH] HPET: 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>
---
Documentation/timers/hpet_example.c | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c
index 4bfafb7..9a3e701 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)
void
hpet_info(int argc, const char **argv)
{
+ struct hpet_info info;
+ int fd;
+
+ if (argc != 1) {
+ fprintf(stderr, "hpet_info: device-name\n");
+ return;
+ }
+
+ fd = open(argv[0], O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "hpet_info: open of %s failed\n", argv[0]);
+ return;
+ }
+
+ if (ioctl(fd, HPET_INFO, &info) < 0) {
+ fprintf(stderr, "hpet_info: failed to get info\n");
+ goto out;
+ }
+
+ fprintf(stderr, "hpet_info: hi_irqfreq 0x%lx hi_flags 0x%lx ",
+ info.hi_ireqfreq, info.hi_flags);
+ fprintf(stderr, "hi_hpet %d hi_timer %d\n",
+ info.hi_hpet, info.hi_timer);
+
+out:
+ close(fd);
+ return;
}
void
--
1.7.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HPET: Supporting info for hpet_example
2010-09-04 8:46 [PATCH] HPET: Supporting info for hpet_example Jaswinder Singh Rajput
@ 2010-09-06 8:55 ` Clemens Ladisch
0 siblings, 0 replies; 2+ messages in thread
From: Clemens Ladisch @ 2010-09-06 8:55 UTC (permalink / raw)
To: Jaswinder Singh Rajput
Cc: Venkatesh Pallipadi (Venki),
the arch/x86 maintainers, Linux Kernel Mailing List
Jaswinder Singh Rajput wrote:
> $./hpet_example info /dev/hpet
> -hpet: executing info
> hpet_info: hi_irqfreq 0x0 hi_flags 0x0 hi_hpet 0 hi_timer 2
The interrupt frequency is always zero before the application has set
it, so it doesn't make much sense to show it in this function.
Regards,
Clemens
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-06 8:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-04 8:46 [PATCH] HPET: Supporting info for hpet_example Jaswinder Singh Rajput
2010-09-06 8:55 ` Clemens Ladisch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.