Path: blob/master/arch/arm/mach-ebsa110/include/mach/io.h
10820 views
/*1* arch/arm/mach-ebsa110/include/mach/io.h2*3* Copyright (C) 1997,1998 Russell King4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 2 as7* published by the Free Software Foundation.8*9* Modifications:10* 06-Dec-1997 RMK Created.11*/12#ifndef __ASM_ARM_ARCH_IO_H13#define __ASM_ARM_ARCH_IO_H1415#define IO_SPACE_LIMIT 0xffff1617u8 __inb8(unsigned int port);18void __outb8(u8 val, unsigned int port);1920u8 __inb16(unsigned int port);21void __outb16(u8 val, unsigned int port);2223u16 __inw(unsigned int port);24void __outw(u16 val, unsigned int port);2526u32 __inl(unsigned int port);27void __outl(u32 val, unsigned int port);2829u8 __readb(const volatile void __iomem *addr);30u16 __readw(const volatile void __iomem *addr);31u32 __readl(const volatile void __iomem *addr);3233void __writeb(u8 val, void __iomem *addr);34void __writew(u16 val, void __iomem *addr);35void __writel(u32 val, void __iomem *addr);3637/*38* Argh, someone forgot the IOCS16 line. We therefore have to handle39* the byte stearing by selecting the correct byte IO functions here.40*/41#ifdef ISA_SIXTEEN_BIT_PERIPHERAL42#define inb(p) __inb16(p)43#define outb(v,p) __outb16(v,p)44#else45#define inb(p) __inb8(p)46#define outb(v,p) __outb8(v,p)47#endif4849#define inw(p) __inw(p)50#define outw(v,p) __outw(v,p)5152#define inl(p) __inl(p)53#define outl(v,p) __outl(v,p)5455#define readb(b) __readb(b)56#define readw(b) __readw(b)57#define readl(b) __readl(b)58#define readb_relaxed(addr) readb(addr)59#define readw_relaxed(addr) readw(addr)60#define readl_relaxed(addr) readl(addr)6162#define writeb(v,b) __writeb(v,b)63#define writew(v,b) __writew(v,b)64#define writel(v,b) __writel(v,b)6566static inline void __iomem *__arch_ioremap(unsigned long cookie, size_t size,67unsigned int flags)68{69return (void __iomem *)cookie;70}7172#define __arch_ioremap __arch_ioremap73#define __arch_iounmap(cookie) do { } while (0)7475extern void insb(unsigned int port, void *buf, int sz);76extern void insw(unsigned int port, void *buf, int sz);77extern void insl(unsigned int port, void *buf, int sz);7879extern void outsb(unsigned int port, const void *buf, int sz);80extern void outsw(unsigned int port, const void *buf, int sz);81extern void outsl(unsigned int port, const void *buf, int sz);8283/* can't support writesb atm */84extern void writesw(void __iomem *addr, const void *data, int wordlen);85extern void writesl(void __iomem *addr, const void *data, int longlen);8687/* can't support readsb atm */88extern void readsw(const void __iomem *addr, void *data, int wordlen);89extern void readsl(const void __iomem *addr, void *data, int longlen);9091#endif929394