[lkml]   [2005]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 1/5] Convert resource to u64 from unsigned long
Dave <> wrote:
> ere's my first attempt of trying to convert the struct resource
> start/end to u64 per blessed by Linus =) This is to support >32bit
> physical address on 32bit archs such as some of the newer ARMv6 and
> XSC3 based platforms and perhaps IA32 PAE. I left the PCI stuff alone
> functionally. Supporting 64bit PCI BAR on 32bit archs is for another
> day. I fixed most of the core stuff I can think of, fixed ARM and i386
> hopefully and a few of the device drivers as examples. I have tested
> on an IQ31244 XScale IOP (ARM) platform and a dual-xeon platform for
> i386. Matt Porter has graciously sent me PPC fixes that he tested on.

OK, well Greg KH will be the main target of this work..

Can you do something a bit more friendly than application/octet-stream
encoding, btw?

+#if BITS_PER_LONG == 64
+#define U64FMT "016lx"
+#define U64FMT "016Lx"

We've avoided doing this. We prefer to do

printk("%llx", (unsigned long long)foo);

which is tidier, although a little more runtime-costly.

Your approach assumes that all 64-bit architectures implement u64 as
unsigned long (as opposed to unsigned long long, which I guess is legal?) I
don't know if that's a problem or not.

Also, the patches introduce tons of ifdefs such as:

+#if BITS_PER_LONG == 64
return (void __iomem *)pci_resource_start(pdev, PCI_ROM_RESOURCE);
+ return (void __iomem *)(u32)pci_resource_start(pdev, PCI_ROM_RESOURCE);

We really should find a way of avoiding this. Even if it is

#if BITS_PER_LONG == 64
#define resource_to_ptr(r) ((void *)(r))
#define resource_to_ptr(r) ((void *)((u32)r))

in a header file somewhere. Open-coding the decision all over the place is

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:09    [W:0.054 / U:8.488 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site