* [PATCH 6/7] remove apus special case in address conversion
@ 2004-05-25 0:29 Roman Zippel
0 siblings, 0 replies; only message in thread
From: Roman Zippel @ 2004-05-25 0:29 UTC (permalink / raw)
To: linuxppc-dev
Use __pa()/__va() instead of direct calculation.
Index: 2.6/include/asm-ppc/io.h
diff -u 2.6/include/asm-ppc/io.h:1.1.1.3 2.6/include/asm-ppc/io.h:1.5
--- 2.6/include/asm-ppc/io.h:1.1.1.3 Sun May 23 15:31:13 2004
+++ 2.6/include/asm-ppc/io.h Mon May 24 13:32:36 2004
@@ -213,24 +220,16 @@ extern void io_block_mapping(unsigned lo
*/
extern inline unsigned long virt_to_bus(volatile void * address)
{
-#ifndef CONFIG_APUS
if (address == (void *)0)
return 0;
- return (unsigned long)address - KERNELBASE + PCI_DRAM_OFFSET;
-#else
- return iopa ((unsigned long) address);
-#endif
+ return __pa(address) + PCI_DRAM_OFFSET;
}
extern inline void * bus_to_virt(unsigned long address)
{
-#ifndef CONFIG_APUS
if (address == 0)
return 0;
- return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
-#else
- return (void*) mm_ptov (address);
-#endif
+ return __va(address) - PCI_DRAM_OFFSET;
}
/*
@@ -239,20 +238,12 @@ extern inline void * bus_to_virt(unsigne
*/
extern inline unsigned long virt_to_phys(volatile void * address)
{
-#ifndef CONFIG_APUS
- return (unsigned long) address - KERNELBASE;
-#else
- return iopa ((unsigned long) address);
-#endif
+ return __pa(address);
}
extern inline void * phys_to_virt(unsigned long address)
{
-#ifndef CONFIG_APUS
- return (void *) (address + KERNELBASE);
-#else
- return (void*) mm_ptov (address);
-#endif
+ return __va(address);
}
/*
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-05-25 0:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-25 0:29 [PATCH 6/7] remove apus special case in address conversion Roman Zippel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox