lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 30 Jul 2006 01:18:15 +0200
From:	Edgar Toernig <froese@....de>
To:	Keith Packard <keithp@...thp.com>
Cc:	Neil Horman <nhorman@...driver.com>, keithp@...thp.com,
	Bill Huey <billh@...ppy.monkey.org>,
	Jim Gettys <jg@...top.org>, "H. Peter Anvin" <hpa@...or.com>,
	Dave Airlie <airlied@...il.com>,
	Segher Boessenkool <segher@...nel.crashing.org>,
	linux-kernel@...r.kernel.org, a.zummo@...ertech.it,
	jg@...edesktop.org
Subject: Re: [PATCH] RTC: Add mmap method to rtc character driver

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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ