Subject: Re: COMPAT_LINUX vsyscall
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@tac.gw.com>
List: tech-kern
Date: 05/01/2005 20:48:09
In article <20050501221625.GQ5984@snowdrop.l8s.co.uk>,
David Laight  <david@l8s.co.uk> wrote:
>On Sun, May 01, 2005 at 02:50:06PM -0700, Jonathan Stone wrote:
>> >
>> >Why would you want to map a page of code into userspace?
>> 
>> So the kernel has somewhere safe to put useful kernel-maintained
>> information into the page, where userspace (libc) code can access that
>> information, without paying the cost of crossing protection domains
>> (syscall overhead or other means to trap into the kernel).
>> 
>> For gettimeofday(), put base time-of-day, cycle-count, and a
>> context-switch counter in the page, and you can compute gettimeofday()
>> in userspace.  (use the csw counter to restart if a context-switch
>> happens in the userspace code; c.f. LBL (Van Jacobsen? Craig Leres?)
>> gettimeofday() for sun4c. Add frills as necessary for SMP).
>
>That is mapping data, not code.....

The kernel can map optimized versions of mem*() and str*() that depend
on the processor.

christos