RE: 64bit driver driver with 32 bit long

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

 



Hi Jonathan

That is what I would have ended up with anyway. But I did not find gcc
option to force long to 32 bit. I got my answer, the best way is to use
"u32" datasize, which would work across 32/64 bit platform.

Prashant 


-----Original Message-----
From: fedora-list-bounces@xxxxxxxxxx
[mailto:fedora-list-bounces@xxxxxxxxxx] On Behalf Of Jonathan Berry
Sent: Monday, April 04, 2005 5:27 PM
To: For users of Fedora Core releases
Subject: Re: 64bit driver driver with 32 bit long

On Apr 4, 2005 1:04 PM, Tawade, Prashant <prashant.tawade@xxxxxxxxx>
wrote:
> 
> Hi 
> 
> Does anyone know how to build a 64 bit driver with "32 bit unsigned
long",
> as is in the case of windows 64 bit drivers ? 
> 
> Prashant 

Hi Prashant,
What exactly do you mean?  With a 64-bit compile, an unsigned long
variable is going to be 64-bits wide.  As far as I know, there is no
way to change that.  sizeof(long) == sizeof(void *) has to be true. 
To use a 32-bit wide (unsigned) variable, use the unsigned int type. 
For example:
typedef unsigned int u32type;
"u32type" can be whatever you want to call your unsigned 32-bit data
type.  If this code has to work for both 32- and 64-bit environments,
then you should use some #if statements to determine which typedef to
use.  Is this what you wanted to know, or are you asking something
different?

Jonathan

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux