Messages in this thread | | | Date | Wed, 8 Dec 1999 12:24:40 -0700 | From | Richard Gooch <> | Subject | Re: What I suspect |
| |
Linus Torvalds writes: > On Wed, 8 Dec 1999, Rogier Wolff wrote: > > Wouldn't you specify > > > > struct fast_time { > > volatile int jiffies; > > volatile int CPUspeed; > > volatile int time_base; > > }; > > > > such that the kernel can adjust these values whenever the "resume" > > event comes in? > > But where would the kernel adjust them? > > This is truly _trivial_ to do when we have a fixed mapping: we not > only have the code (that the kernel controls and can change > depending on features like a broken TSC or newfangled TSC's like the > Coppermine one that changes frequency), but we'd also have the above > kind of embedded structure that is NOT exported to user space > explicitly. > > It's impossible to do sanely if we have a generic notion of > MAP_INHERIT which can be used by user space in an uncontrolled > manner. And that's the problem.
Maybe I'm missing something, but it seems to me you're still mixing the two problems together.
1a) the kernel exports a global page which has kernel data, such as the current time. Since the kernel exports it, it knows where it is
1b) user-space can look for the known page and read values from it, if it wants
2) MAP_INHERIT can be used by user-space to implement machine-specific code.
Linus, another reason why I prefer MAP_INHERIT for code, is that it is more expandable than having the kernel export a few "important" pieces of code. It would allow dozens of liboptimise.so to come with a distribution, and be mapped once (or a small number of times). It then means it's easy to add new functions to this library. We'd start out with the syscall interface, but then we'd have memset, memcpy, strcpy, strncpy and so on.
Kernel exports data. User-space exports/shares/inherits code. Two problems, two simple solutions. Why won't this work?
Regards,
Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |