[50cf94da] | 1 | /* |
---|
| 2 | * These are some macros to access memory mapped devices |
---|
| 3 | * on the SH7000-architecture. |
---|
| 4 | * |
---|
| 5 | * Inspired from the linux kernel's include/asm/io.h |
---|
| 6 | * |
---|
| 7 | * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and |
---|
| 8 | * Bernd Becker (becker@faw.uni-ulm.de) |
---|
| 9 | * |
---|
| 10 | * COPYRIGHT (c) 1996-1998, FAW Ulm, Germany |
---|
| 11 | * |
---|
| 12 | * This program is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
| 15 | * |
---|
| 16 | * |
---|
| 17 | * COPYRIGHT (c) 1998. |
---|
| 18 | * On-Line Applications Research Corporation (OAR). |
---|
| 19 | * Copyright assigned to U.S. Government, 1994. |
---|
| 20 | * |
---|
| 21 | * The license and distribution terms for this file may be |
---|
| 22 | * found in the file LICENSE in this distribution or at |
---|
| 23 | * http://www.OARcorp.com/rtems/license.html. |
---|
| 24 | * |
---|
| 25 | * $Id$ |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | #ifndef _asm_io_h |
---|
| 29 | #define _asm_io_h |
---|
| 30 | |
---|
| 31 | #define readb(addr) (*(volatile unsigned char *) (addr)) |
---|
| 32 | #define readw(addr) (*(volatile unsigned short *) (addr)) |
---|
| 33 | #define readl(addr) (*(volatile unsigned int *) (addr)) |
---|
| 34 | #define read8(addr) (*(volatile unsigned8 *) (addr)) |
---|
| 35 | #define read16(addr) (*(volatile unsigned16 *) (addr)) |
---|
| 36 | #define read32(addr) (*(volatile unsigned32 *) (addr)) |
---|
| 37 | |
---|
| 38 | #define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b)) |
---|
| 39 | #define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b)) |
---|
| 40 | #define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b)) |
---|
| 41 | #define write8(b,addr) ((*(volatile unsigned8 *) (addr)) = (b)) |
---|
| 42 | #define write16(b,addr) ((*(volatile unsigned16 *) (addr)) = (b)) |
---|
| 43 | #define write32(b,addr) ((*(volatile unsigned32 *) (addr)) = (b)) |
---|
| 44 | |
---|
| 45 | #define inb(addr) readb(addr) |
---|
| 46 | #define outb(b,addr) writeb(b,addr) |
---|
| 47 | |
---|
| 48 | #endif |
---|