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