Fixed some of the drivers as example just to get working on i386.
Signed-off-by: Dave Jiang ([email protected])
--
-= Dave =-
Software Engineer - Advanced Development Engineering Team
Storage Component Division - Intel Corp.
mailto://dave.jiang @ intel
http://sourceforge.net/projects/xscaleiop/
----
The views expressed in this email are
mine alone and do not necessarily
reflect the views of my employer
(Intel Corp.).
On Jan 13, 2005 16:28 -0700, Dave wrote:
> Fixed some of the drivers as example just to get working on i386.
> + /*
> + * FIXME: apparently ia32 does not have u64 divide implementation
> + * we cast the pci_resource_len to u32 for the time being
> + * this probably should be fixed to support u64 for ia32
> + * and other archs that do not have u64 divide
> + */
> +#if BIS_PER_LONG == 64
> maxnr = (pci_resource_len(dev, bar) - board->first_offset) /
> (8 << board->reg_shift);
> +#else
> + maxnr = ((u32)pci_resource_len(dev, bar) - board->first_offset) /
> + (8 << board->reg_shift);
> +#endif
One of the reasons that ia32 doesn't support 64-bit divide directly is
because it is a big red flag that you are probably doing something wrong.
This is a prime example - why do a divide when you could do a shift:
maxnr = (pci_resource_len(dev, bar) - board->first_offset) >>
(board->reg_shift + 3);
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://members.shaw.ca/adilger/ http://members.shaw.ca/golinux/