source: rtems/c/src/lib/libbsp/sh/gensh1/include/bsp.h @ 0a3946f

4.104.114.84.95
Last change on this file since 0a3946f was d76608e0, checked in by Joel Sherrill <joel.sherrill@…>, on 11/03/99 at 12:46:29

Typo fixed by Ralf Corsepius <corsepiu@…>.

  • Property mode set to 100644
File size: 3.6 KB
Line 
1/*
2 *  This include file contains all board IO definitions.
3 *
4 *  generic sh1
5 *
6 *  Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
7 *
8 *  COPYRIGHT (c) 1997-1998, FAW Ulm, Germany
9 *
10 *  This program is distributed in the hope that it will be useful,
11 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 *
15 *  COPYRIGHT (c) 1998.
16 *  On-Line Applications Research Corporation (OAR).
17 *  Copyright assigned to U.S. Government, 1994.
18 *
19 *  The license and distribution terms for this file may be
20 *  found in the file LICENSE in this distribution or at
21 *  http://www.OARcorp.com/rtems/license.html.
22 *
23 *  $Id$
24 */
25
26#ifndef __gensh1_h
27#define __gensh1_h
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#define CPU_CONSOLE_DEVNAME "/dev/null"
34
35
36#include <rtems.h>
37#include <clockdrv.h>
38#include <sh/null.h>
39#include <console.h>
40
41/*
42 *  Define the time limits for RTEMS Test Suite test durations.
43 *  Long test and short test duration limits are provided.  These
44 *  values are in seconds and need to be converted to ticks for the
45 *  application.
46 *
47 */
48
49#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
50#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
51
52/*
53 *  Stuff for Time Test 27
54 */
55
56#define MUST_WAIT_FOR_INTERRUPT 0
57
58#define Install_tm27_vector( handler ) \
59{ \
60  rtems_isr_entry ignored ; \
61  rtems_interrupt_catch( (handler), 0, &ignored ) ; \
62}
63
64#define Cause_tm27_intr()
65
66#define Clear_tm27_intr()
67
68#define Lower_tm27_intr()
69
70/* Constants */
71#ifndef MHZ
72#error Missing MHZ
73#endif
74
75/*
76 *  Simple spin delay in microsecond units for device drivers.
77 *  This is very dependent on the clock speed of the target.
78 *
79 *  Since we don't have a real time clock, this is a very rough
80 *  approximation, assuming that each cycle of the delay loop takes
81 *  approx. 4 machine cycles.
82 *
83 *  e.g.: MHZ = 20 =>     5e-8 secs per instruction
84 *                 => 4 * 5e-8 secs per delay loop
85 */
86
87#define delay( microseconds ) \
88{ register unsigned int _delay = (microseconds) * (MHZ / 4 ); \
89  asm volatile ( \
90"0:     add  #-1,%0\n \
91        nop\n \
92        cmp/pl %0\n \
93        bt 0b\
94        nop" \
95    :: "r" (_delay) );  \
96}
97
98/*
99 * For backward compatibility only.
100 * Do not rely on them being present in future
101 */
102#define CPU_delay( microseconds ) delay( microseconds )
103#define sh_delay( microseconds ) delay( microseconds )
104
105/*
106 * Defined in the linker script 'linkcmds'
107 */
108
109extern unsigned32       HeapStart ;
110extern unsigned32       HeapEnd ;
111extern unsigned32       WorkSpaceStart ;
112extern unsigned32       WorkSpaceEnd ;
113
114extern void *CPU_Interrupt_stack_low ;
115extern void *CPU_Interrupt_stack_high ;
116
117 
118/* miscellaneous stuff assumed to exist */
119
120extern rtems_configuration_table BSP_Configuration;
121
122extern void bsp_cleanup( void );
123
124/*
125 *  Device Driver Table Entries
126 */
127
128/*
129 * We redefine CONSOLE_DRIVER_TABLE_ENTRY to redirect /dev/console
130 */
131#if defined(CONSOLE_DRIVER_TABLE_ENTRY)
132#warning Overwriting CONSOLE_DRIVER_TABLE_ENTRY
133#undef CONSOLE_DRIVER_TABLE_ENTRY
134#endif
135
136#define CONSOLE_DRIVER_TABLE_ENTRY \
137  DEVNULL_DRIVER_TABLE_ENTRY, \
138  { console_initialize, console_open, console_close, \
139      console_read, console_write, console_control }
140 
141/*
142 * NOTE: Use the standard Clock driver entry
143 */
144
145/*
146 * FIXME: Should this go to libcpu/sh/sh7032 ?
147 */
148#if 0
149/* functions */
150sh_isr_entry set_vector(                    /* returns old vector */
151  rtems_isr_entry     handler,                  /* isr routine        */
152  rtems_vector_number vector,                   /* vector number      */
153  int                 type                      /* RTEMS or RAW intr  */
154);
155#endif
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif
162/* end of include file */
Note: See TracBrowser for help on using the repository browser.