aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/io.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2009-02-17 13:01:51 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2009-02-17 13:01:51 -0800
commita7eb518998529c08cc53fef17756d9fe433b0c23 (patch)
tree68efbd1592f2df847ffe5877c2a11c25d414b842 /arch/x86/include/asm/io.h
parentee8b53c1cfe33aecf0c77c0aa3ce437f0d84d831 (diff)
x86: truncate ISA addresses to unsigned int
Impact: Cleanup; fix inappropriate macro use ISA addresses on x86 are mapped 1:1 with the physical address space. Since the ISA address space is only 24 bits (32 for VLB or LPC) it will always fit in an unsigned int, and at least in the aha1542 driver using a wider type would cause an undesirable promotion. Hence explicitly cast the ISA bus addresses to unsigned int. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Diffstat (limited to 'arch/x86/include/asm/io.h')
-rw-r--r--arch/x86/include/asm/io.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 4f8e820cf38..683d0b4c00f 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -124,10 +124,15 @@ static inline void *phys_to_virt(phys_addr_t address)
/*
* ISA I/O bus memory addresses are 1:1 with the physical address.
+ * However, we truncate the address to unsigned int to avoid undesirable
+ * promitions in legacy drivers.
*/
-#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
+static inline unsigned int isa_virt_to_bus(volatile void *address)
+{
+ return (unsigned int)virt_to_phys(address);
+}
+#define isa_page_to_bus(page) ((unsigned int)page_to_phys(page))
+#define isa_bus_to_virt phys_to_virt
/*
* However PCI ones are not necessarily 1:1 and therefore these interfaces