Re: What size is "unsigned long" on an x86-64 kernel?

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

 



On Thu, Jun 24, 2004 at 23:28:30 +0200, Jan Hudec wrote:
> On Thu, Jun 24, 2004 at 15:15:12 -0500, Timur Tabi wrote:
> > If I compile my driver for the x86-64 platform, is "unsigned long" a 
> > 32-bit or 64-bit quantity?
> 
> You don't want to know that ;-). And since drivers in Linux are supposed
> to compile on all platforms (well, not all drivers, but most should),
> you shouldn't rely on sizes on particular platforms.
> 
> On all platforms an unsigned long will hold a void *. For most other
> purposes, there are speicalized types, like off_t, size_t, ssize_t etc.
> There are also the s32/u32/s64/u64 types, that have those sizes on all
> platforms.
> 
> That being said, looking at include/asm-x86_64/types.h shows, that you
> need long long to define s64, so long is likely to be 32 bits wide.

OOPS, sorry. Overlooked something:

There is a BITS_PER_LONG define in include/asm/types.h. It says 64 on
x86-64

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux