lkml.org 
[lkml]   [2006]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectwriting portable code based on BITS_PER_LONG?
Hi,
I am trying to port a driver written for IA32. This is a pci driver
and has a chipset doing PCI <-> local bus data transfer, where local
bus is 16 bit. So a number of values are converted by right/left
shifting by 16 bits.

Now that I am doing porting, I would like to make it fully portable
across AMD64 and IA32. What is the best method for this? Should I do
something like,

#if BITS_PER_LONG = 64
shiftwidth = 48
#else if BITS_PER_LONG = 32
shiftwidth = 16
#endif

I don't like this. I would not do it if there is some elegant way.

Is there any other way?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-06 08:19    [W:0.055 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site