WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] 32/64-bit hypercall interface


On 30 Sep 2005, at 17:44, David wrote:

I think the Linux kernel folks learned the "unsigned long" lesson too late, and now there is quite a lot of fixup code to convert 32-bit userspace structs to 64-bit kernel structs (have a look at linux/fs/compat_ioctl.c and compat.c). It seems a shame to repeat the same mistakes in Xen...

Quick question.... What is this "'unsigned long' lesson" you are refering to?

As a rule, longs are 4 bytes on 32-bit architectures and 8 bytes on 64-bit architectures. If you want to support 32-bit apps on your shiny new 64-bit OS, it is nice if your interface doesn't contain too many structures with different layouts between 32-bit and 64-bit. If you have pointers and longs, the structures have differenrt layouts and you need a shim layer at the top of the OS to convert 32-bit format into the 64-bit format that the OS uses internally. Which is a pain.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel