[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] sizeof(long) different under windows x64 and linuxx64


  • To: "Daniel Stodden" <dns@xxxxxxxxxxxx>
  • From: "James Harper" <james.harper@xxxxxxxxxxxxxxxx>
  • Date: Wed, 23 Jan 2008 10:34:39 +1100
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 22 Jan 2008 15:35:05 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AchdTkSdZFxCaPfQT2u0zk0o5MjKxQAAB6xg
  • Thread-topic: [Xen-devel] sizeof(long) different under windows x64 and linuxx64

> On Wed, 2008-01-23 at 10:01 +1100, James Harper wrote:
> > Under gcc on an x64 system, sizeof(long) = 8
> > Under windows ddk on an x64 system, sizeof(long) = 4
> 
> true for windows c compilers, independent of the ddk.

Yes. sizeof(long) = 4 always under windows x32 and x64.

> > If so, this would explain why i'm getting EINVAL from the hypervisor
> > under windows x64...
> 
> indeed. it's still about the add_to_physmap issue you described?
> will need a fix then to adjust the xen_ulong_t typedef accordingly on
> x86_64.
> 
> correlated question from my side: what is xen_ulong_t good for?
> shouldn't the public headers use either stdint or a more descriptive
> typedef? ulong_t sounds pretty redundant to me, especially when
> typedef'd to an 'unsigned long'.

The enormity of this problem is just sinking in... Xen makes use of a
type (long) that it assumes is 32 bits under a 32 bit arch, and 64 bits
under a 64 bit arch. Windows has no such native type (except for
pointer), but that can be solved via some #if statements.

'long' and 'unsigned long' is used all over the place inside
xen/include/public. I would need to create this new type, and replace
all occurrences of 'long' with it in the 8750-ish lines of .h files.

Any suggestions as to what the type should be called? Maybe a bit of
typedef'ing around xen_ulong_t and xen_long_t would work?

Thanks

James

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.