]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: remove IO_DEBUG
authorAndrew Morton <akpm@osdl.org>
Thu, 18 Mar 2004 22:58:33 +0000 (14:58 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 18 Mar 2004 22:58:33 +0000 (14:58 -0800)
From: Anton Blanchard <anton@samba.org>

Remove the old __IO_DEBUG stuff and add some nice comments courtesy of x86.

include/asm-ppc64/io.h

index 15e6a01927058e2a067cedf53ddd21624d90ab63..ac409a04aa11f7c8a69b367b29a3ffe3984ff128 100644 (file)
@@ -27,8 +27,6 @@
 #define SIO_CONFIG_RD  0x399
 
 #define SLOW_DOWN_IO
-/* Define this if you want to see virt_to_* messages */
-#undef __IO_DEBUG
 
 extern unsigned long isa_io_base;
 extern unsigned long pci_io_base;
@@ -149,40 +147,61 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl);
 
 
 #ifdef __KERNEL__
-/*
- * Map in an area of physical address space, for accessing
- * I/O devices etc.
- */
 extern int __ioremap_explicit(unsigned long p_addr, unsigned long v_addr,
                              unsigned long size, unsigned long flags);
 extern void *__ioremap(unsigned long address, unsigned long size,
                       unsigned long flags);
+
+/**
+ * ioremap     -   map bus memory into CPU space
+ * @address:   bus address of the memory
+ * @size:      size of the resource to map
+ *
+ * ioremap performs a platform specific sequence of operations to
+ * make bus memory CPU accessible via the readb/readw/readl/writeb/
+ * writew/writel functions and the other mmio helpers. The returned
+ * address is not guaranteed to be usable directly as a virtual
+ * address.
+ */
 extern void *ioremap(unsigned long address, unsigned long size);
+
 #define ioremap_nocache(addr, size)    ioremap((addr), (size))
 extern int iounmap_explicit(void *addr, unsigned long size);
 extern void iounmap(void *addr);
 extern void * reserve_phb_iospace(unsigned long size);
 
-/*
- * Change virtual addresses to physical addresses and vv, for
- * addresses in the area where the kernel has the RAM mapped.
+/**
+ *     virt_to_phys    -       map virtual addresses to physical
+ *     @address: address to remap
+ *
+ *     The returned physical address is the physical (CPU) mapping for
+ *     the memory address given. It is only valid to use this function on
+ *     addresses directly mapped or allocated via kmalloc.
+ *
+ *     This function does not give bus mappings for DMA transfers. In
+ *     almost all conceivable cases a device driver should not be using
+ *     this function
  */
 static inline unsigned long virt_to_phys(volatile void * address)
 {
-#ifdef __IO_DEBUG
-       printk("virt_to_phys: 0x%08lx -> 0x%08lx\n", 
-                       (unsigned long) address,
-                       __pa((unsigned long)address));
-#endif
        return __pa((unsigned long)address);
 }
 
+/**
+ *     phys_to_virt    -       map physical address to virtual
+ *     @address: address to remap
+ *
+ *     The returned virtual address is a current CPU mapping for
+ *     the memory address given. It is only valid to use this function on
+ *     addresses that have a kernel mapping
+ *
+ *     This function does not handle bus mappings for DMA transfers. In
+ *     almost all conceivable cases a device driver should not be using
+ *     this function
+ */
 static inline void * phys_to_virt(unsigned long address)
 {
-#ifdef __IO_DEBUG
-       printk("phys_to_virt: 0x%08lx -> 0x%08lx\n", address, __va(address));
-#endif
-       return (void *) __va(address);
+       return (void *)__va(address);
 }
 
 /*
@@ -344,6 +363,17 @@ static inline void out_be64(volatile unsigned long *addr, int val)
 #endif
 
 #ifdef __KERNEL__
+
+/**
+ *     check_signature         -       find BIOS signatures
+ *     @io_addr: mmio address to check
+ *     @signature:  signature block
+ *     @length: length of signature
+ *
+ *     Perform a signature comparison with the mmio address io_addr. This
+ *     address should have been obtained by ioremap.
+ *     Returns 1 on a match.
+ */
 static inline int check_signature(unsigned long io_addr,
        const unsigned char *signature, int length)
 {