-static void *hpet_start(struct seq_file *s, loff_t * pos)
-{
- struct hpets *hpetp;
- loff_t n;
-
- for (n = *pos, hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
- if (!n--)
- return hpetp;
-
- return 0;
-}
-
-static void *hpet_next(struct seq_file *s, void *v, loff_t * pos)
-{
- struct hpets *hpetp;
-
- hpetp = v;
- ++*pos;
- return hpetp->hp_next;
-}
-
-static void hpet_stop(struct seq_file *s, void *v)
-{
- return;
-}
-
-static int hpet_show(struct seq_file *s, void *v)
-{
- struct hpets *hpetp;
- struct hpet *hpet;
- u64 cap, vendor, period;
-
- hpetp = v;
- hpet = hpetp->hp_hpet;
-
- cap = readq(&hpet->hpet_cap);
- period = (cap & HPET_COUNTER_CLK_PERIOD_MASK) >>
- HPET_COUNTER_CLK_PERIOD_SHIFT;
- vendor = (cap & HPET_VENDOR_ID_MASK) >> HPET_VENDOR_ID_SHIFT;
-
- seq_printf(s,
- "HPET%d period = %d 10**-15 vendor = 0x%x number timer = %d\n",
- hpetp->hp_which, (u32) period, (u32) vendor,
- hpetp->hp_ntimer);
-
- return 0;
-}
-
-static struct seq_operations hpet_seq_ops = {
- .start = hpet_start,
- .next = hpet_next,
- .stop = hpet_stop,
- .show = hpet_show
-};
-
-static int hpet_proc_open(struct inode *inode, struct file *file)
-{
- return seq_open(file, &hpet_seq_ops);
-}
-
-static struct file_operations hpet_proc_fops = {
- .open = hpet_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release
-};
-