Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217501
b: refs/heads/master
c: aaaddfe
h: refs/heads/master
i:
  217499: a8a6b0b
v: v3
  • Loading branch information
Jaswinder Singh Rajput authored and Linus Torvalds committed Oct 26, 2010
1 parent 070d06f commit b3f57df
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ca01763a028d0034042a9397534bc1f27848652
refs/heads/master: aaaddfe0b3bb449b8734bf29bbd36141076e5277
27 changes: 27 additions & 0 deletions trunk/Documentation/timers/hpet_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3f57df

Please sign in to comment.