Skip to contentSkip to conversation

x86: fix "__udivdi3" [drivers/scsi/aha1542.ko] undefined

tip:x86/headers H. Peter Anvin 3 participants 4 messages Feb 13, 2009 – Feb 14, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 8 lines · James Bottomley
 arch/x86/include/asm/io.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/include/asm/io.h +0 -0
index e5a2ab4..4f8e820 100644

arch/x86/include/asm/io.h static inline void *phys_to_virt(phys_addr_t address) · line 131

Quoted 8 lines
arch/x86/include/asm/io.h +1 -1
@@ -125,7 +125,7 @@ static inline void *phys_to_virt(phys_addr_t address)
 /*
  * ISA I/O bus memory addresses are 1:1 with the physical address.
  */
-#define isa_virt_to_bus virt_to_phys
+#define isa_virt_to_bus (unsigned long)virt_to_phys
 #define isa_page_to_bus page_to_phys
 #define isa_bus_to_virt phys_to_virt
 

This changes one token to multiple, and not even with the highest precedence.

It needs to be something like:

#define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))

... if we're going to do that.

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#2 lore raw
Quoted 4 lines · H. Peter Anvin
Quoted 3 lines · James Bottomley
 arch/x86/include/asm/io.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines

arch/x86/include/asm/io.h static inline void *phys_to_virt(phys_addr_t address) · line 131

Quoted 13 lines
arch/x86/include/asm/io.h +1 -1
index e5a2ab4..4f8e820 100644
@@ -125,7 +125,7 @@ static inline void *phys_to_virt(phys_addr_t address)
 /*
  * ISA I/O bus memory addresses are 1:1 with the physical address.
  */
-#define isa_virt_to_bus virt_to_phys
+#define isa_virt_to_bus (unsigned long)virt_to_phys
 #define isa_page_to_bus page_to_phys
 #define isa_bus_to_virt phys_to_virt
 

This changes one token to multiple, and not even with the highest precedence.

Yes, well, it was just a verifying patch, really.

Quoted 5 lines

It needs to be something like:

#define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))

... if we're going to do that.

Actually, it probably wants to become a static inline ... that way the compiler can always verify the promotion and truncation is legal regardless of whether an actual user is compiled or not.

James

#3 lore raw
Quoted 11 lines · James Bottomley
Quoted 5 lines · H. Peter Anvin

James Bottomley wrote:

#define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))

... if we're going to do that.

Actually, it probably wants to become a static inline ... that way the compiler can always verify the promotion and truncation is legal regardless of whether an actual user is compiled or not.

Yes, that's the right thing to do. I'll fix it up and commit a patch.

-hpa

#4 lore raw
Quoted 6 lines · H. Peter Anvin
Quoted 5 lines · James Bottomley
Quoted 4 lines · H. Peter Anvin

James Bottomley wrote:

#define isa_virt_to_bus(x) ((unsigned int)virt_to_phys(x))

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

... if we're going to do that.

Actually, it probably wants to become a static inline ... that way the compiler can always verify the promotion and truncation is legal regardless of whether an actual user is compiled or not.

Yes, that's the right thing to do. I'll fix it up and commit a patch.

Yeah, sure - nevertheless i committed the obvious build fix first.

And as i said, the whole pointer magic construct in aha1542 is a borderline bug, and if anything like that pops up in non-utter-legacy code it should be cleaned up anyway.

Ingo