Keith Packard wrote: > > A jiffy counter is sufficient for the X server; all I need is some > indication that time has passed with a resolution of 10 to 20 ms. I > check this after each X request is processed as that is the scheduling > granularity. An X request can range in time from .1us to 100 seconds, so > I really want to just check after each request rather than attempt some > heuristic. That's exactly what the mmap interface of /dev/itimer does. See: http://marc.theaimsgroup.com/?m=115412412427996 Example code: volatile unsigned long *counter; ... fd=open("/dev/itimer", O_RDWR); write(fd, "20/1000\n", 8); counter = mmap(0, sizeof(*counter), PROT_READ, MAP_PRIVATE, fd, 0); close(fd); Now, "*counter" is incremented every 20 ms by the kernel. Ciao, ET. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: "H. Peter Anvin" <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Neil Horman <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Jim Gettys <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: "H. Peter Anvin" <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Jim Gettys <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: "H. Peter Anvin" <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Jim Gettys <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Bill Huey (hui) <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Neil Horman <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Bill Huey (hui) <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Neil Horman <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- From: Keith Packard <[email protected]>
- Re: [PATCH] RTC: Add mmap method to rtc character driver
- Prev by Date: [PATCH] 9p: fix fid behavior on failed remove
- Next by Date: Re: swsusp regression (s2dsk) [Was: 2.6.18-rc2-mm1]
- Previous by thread: Re: [PATCH] RTC: Add mmap method to rtc character driver
- Next by thread: Re: [PATCH] RTC: Add mmap method to rtc character driver
- Index(es):