Skip to contentSkip to conversation

fusion problems on 64bit hosts

DISCUSSION Christoph Hellwig 1 participant 1 message Sep 25, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

compiling fusion on ppc64 gives:

drivers/message/fusion/mptbase.c: In function `mpt_interrupt':
drivers/message/fusion/mptbase.c:360: warning: cast to pointer from integer of different size drivers/message/fusion/mptbase.c:384: warning: cast to pointer from integer of different size drivers/message/fusion/mptlan.c: In function `lan_reply':
drivers/message/fusion/mptlan.c:214: warning: cast from pointer to integer of different size

This is because of:

#if defined(__alpha__) || defined(__sparc_v9__) || defined(__ia64__) || defined(__x86_64__)
#define CAST_U32_TO_PTR(x) ((void *)(u64)x)
#define CAST_PTR_TO_U32(x) ((u32)(u64)x)
#else
#define CAST_U32_TO_PTR(x) ((void *)x)
#define CAST_PTR_TO_U32(x) ((u32)x)
#endif

which shuts the warning up on some 64bit architectures but doesn't solve the problem. You're trying to keep a 64bit pointer in a 32bit hardware register which can't work on 64bit architectures (the code if for the networking and target modules that few people use)

The right fix is to only store a 32bit lookup key for some datastructure in the register and use it as lookup key in the intr handler.