source: rtems/cpukit/score/cpu/sh/rtems/score/sh_io.h @ 7f70d1b7

4.104.114.84.95
Last change on this file since 7f70d1b7 was 7f70d1b7, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/28/05 at 15:56:09

New header guard.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/**
2 * @file rtems/score/sh_io.h
3 */
4
5/*
6 * These are some macros to access memory mapped devices
7 * on the SH7000-architecture.
8 *
9 * Inspired from the linux kernel's include/asm/io.h
10 *
11 *  Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and
12 *           Bernd Becker (becker@faw.uni-ulm.de)
13 *
14 *  COPYRIGHT (c) 1996-1998, FAW Ulm, Germany
15 *
16 *  This program is distributed in the hope that it will be useful,
17 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 *
21 *  COPYRIGHT (c) 1998-2001.
22 *  On-Line Applications Research Corporation (OAR).
23 *
24 *  The license and distribution terms for this file may be
25 *  found in the file LICENSE in this distribution or at
26 *  http://www.rtems.com/license/LICENSE.
27 *
28 *  $Id$
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
Note: See TracBrowser for help on using the repository browser.