linux/arch/arm/mach-ebsa110/include/mach/io.h
<<
>>
Prefs
   1/*
   2 *  arch/arm/mach-ebsa110/include/mach/io.h
   3 *
   4 *  Copyright (C) 1997,1998 Russell King
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License version 2 as
   8 * published by the Free Software Foundation.
   9 *
  10 * Modifications:
  11 *  06-Dec-1997 RMK     Created.
  12 */
  13#ifndef __ASM_ARM_ARCH_IO_H
  14#define __ASM_ARM_ARCH_IO_H
  15
  16u8 __inb8(unsigned int port);
  17void __outb8(u8  val, unsigned int port);
  18
  19u8 __inb16(unsigned int port);
  20void __outb16(u8  val, unsigned int port);
  21
  22u16 __inw(unsigned int port);
  23void __outw(u16 val, unsigned int port);
  24
  25u32 __inl(unsigned int port);
  26void __outl(u32 val, unsigned int port);
  27
  28u8  __readb(const volatile void __iomem *addr);
  29u16 __readw(const volatile void __iomem *addr);
  30u32 __readl(const volatile void __iomem *addr);
  31
  32void __writeb(u8  val, void __iomem *addr);
  33void __writew(u16 val, void __iomem *addr);
  34void __writel(u32 val, void __iomem *addr);
  35
  36/*
  37 * Argh, someone forgot the IOCS16 line.  We therefore have to handle
  38 * the byte stearing by selecting the correct byte IO functions here.
  39 */
  40#ifdef ISA_SIXTEEN_BIT_PERIPHERAL
  41#define inb(p)                  __inb16(p)
  42#define outb(v,p)               __outb16(v,p)
  43#else
  44#define inb(p)                  __inb8(p)
  45#define outb(v,p)               __outb8(v,p)
  46#endif
  47
  48#define inw(p)                  __inw(p)
  49#define outw(v,p)               __outw(v,p)
  50
  51#define inl(p)                  __inl(p)
  52#define outl(v,p)               __outl(v,p)
  53
  54#define readb(b)                __readb(b)
  55#define readw(b)                __readw(b)
  56#define readl(b)                __readl(b)
  57#define readb_relaxed(addr)     readb(addr)
  58#define readw_relaxed(addr)     readw(addr)
  59#define readl_relaxed(addr)     readl(addr)
  60
  61#define writeb(v,b)             __writeb(v,b)
  62#define writew(v,b)             __writew(v,b)
  63#define writel(v,b)             __writel(v,b)
  64
  65extern void insb(unsigned int port, void *buf, int sz);
  66extern void insw(unsigned int port, void *buf, int sz);
  67extern void insl(unsigned int port, void *buf, int sz);
  68
  69extern void outsb(unsigned int port, const void *buf, int sz);
  70extern void outsw(unsigned int port, const void *buf, int sz);
  71extern void outsl(unsigned int port, const void *buf, int sz);
  72
  73/* can't support writesb atm */
  74extern void writesw(void __iomem *addr, const void *data, int wordlen);
  75extern void writesl(void __iomem *addr, const void *data, int longlen);
  76
  77/* can't support readsb atm */
  78extern void readsw(const void __iomem *addr, void *data, int wordlen);
  79extern void readsl(const void __iomem *addr, void *data, int longlen);
  80
  81#endif
  82