12 #include <linux/types.h>
13 #include <linux/kernel.h>
15 #include <linux/module.h>
17 #include <linux/errno.h>
24 #include <linux/time.h>
28 #include <asm/uv/uv_hub.h>
30 #include <asm/uv/uv.h>
37 #define UV_MMTIMER_NAME "mmtimer"
38 #define UV_MMTIMER_DESC "SGI UV Memory Mapped RTC Timer"
39 #define UV_MMTIMER_VERSION "1.0"
41 static long uv_mmtimer_ioctl(
struct file *
file,
unsigned int cmd,
48 static unsigned long uv_mmtimer_femtoperiod;
52 .mmap = uv_mmtimer_mmap,
53 .unlocked_ioctl = uv_mmtimer_ioctl,
84 static long uv_mmtimer_ioctl(
struct file *
file,
unsigned int cmd,
98 if (uv_get_min_hub_revision_id() == 1)
107 &uv_mmtimer_femtoperiod,
sizeof(
unsigned long)))
114 sizeof(
unsigned long)))
128 (
unsigned long *)uv_local_mmr_address(
UVH_RTC),
129 sizeof(
unsigned long)))
147 static int uv_mmtimer_mmap(
struct file *file,
struct vm_area_struct *vma)
149 unsigned long uv_mmtimer_addr;
164 uv_mmtimer_addr &= 0xfffffffffffffff
UL;
175 static struct miscdevice uv_mmtimer_miscdev = {
187 static int __init uv_mmtimer_init(
void)
197 if (sn_rtc_cycles_per_second < 100000) {
203 uv_mmtimer_femtoperiod = ((
unsigned long)1E15 +
204 sn_rtc_cycles_per_second / 2) /
215 sn_rtc_cycles_per_second/(
unsigned long)1E6);