Re: fuword(), suword(), etc.

From: Terry Lambert <tlambert2_at_mindspring.com>
Date: Thu, 24 Jul 2003 01:35:43 -0700
Julian Elischer wrote:
> I'd like to have a "suptr and fuptr" to be able to save and read
> user pointers in a "machine independent" manner..
> at the moment ia need to know the size of a pointer and select the
> appropriate 32 or 64 version.. It would jus tbe another ENTRY files in
> support.[sS] alongside teh appropriate sized entry
> for each architecture so it wouldn't 'cost' anything..
> 
> for i386 it would be an alternate name for fuword32() and suword32()
> I'm not sure what it would be on other architectures....
> 
> comments?

You cannot be certain that specific user space pointers are 64
bits on a 32 bit kernel or 32 bits on on a 64 bit kernel, etc..

The reason for this is that you may wish to operate in a hybrid
or backward compatability mode, or you may wish to operate the
kernel in a smaller virtual address space than user space, or
vice versa, as a developement decision.

For example the PPC 970 ("G5") processor has specific support for
backward binary compatability, as does the AMD "Hammer", the Intel
"Opteron" (IA64), and the SPARC64.

Probably it will be a long time before many commercial 32 bit
applications are ported to 64 bit kernels, and you're going to
want to be able to run the 32 bit applications.

The point is that you will probably end up needing at least 4
macros each, if you have sized types on both ends, and two each,
if you assume that the kernel pointer size is fixed on every
architecture.

Personally, I would call this a "kernel is aware of the ABI for
each of the applications it is currently running", and make it a
flag in the system call table, if you insist on using a single
name for the thing.

-- Terry
Received on Wed Jul 23 2003 - 23:37:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:16 UTC