source: rtems/c/src/lib/libbsp/sparc/erc32/include/bsp.h @ 21766bd6

Last change on this file since 21766bd6 was 21766bd6, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 8, 2001 at 2:15:47 PM

2001-11-08 Jiri Gaisler <jiri@…>

This fix is in response to test results reported by Jerry Needell
<jerry.needell@…> for the SPARC/ERC32 and tracked as PR80.

  • erc32/include/bsp.h: TM27 was not running properly because the ERC32 and LEON cannot nest interrupts at the same level. The BSP test support had to be modified to support using two different interrupt sources.
  • tm27/task1.c: Account for overhead in starting and stopping the timer.
  • Property mode set to 100644
File size: 4.2 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all SPARC simulator definitions.
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
13 *  Research Corporation (OAR) under contract to the European Space
14 *  Agency (ESA).
15 *
16 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
17 *  European Space Agency.
18 *
19 *  $Id$
20 */
21
22#ifndef __ERC32_BSP_h
23#define __ERC32_BSP_h
24 
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#include <rtems.h>
31#include <iosupp.h>
32#include <erc32.h>
33#include <clockdrv.h>
34
35#include <console.h>
36
37/*
38 *  confdefs.h overrides for this BSP:
39 *   - two termios serial ports
40 *   - Interrupt stack space is not minimum if defined.
41 */
42
43#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
44#define CONFIGURE_INTERRUPT_STACK_MEMORY  (16 * 1024)
45
46/*
47 *  Define the time limits for RTEMS Test Suite test durations.
48 *  Long test and short test duration limits are provided.  These
49 *  values are in seconds and need to be converted to ticks for the
50 *  application.
51 *
52 */
53
54#define MAX_LONG_TEST_DURATION       3   /* 3 seconds */
55#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
56
57/*
58 *  Define the interrupt mechanism for Time Test 27
59 *
60 *  NOTE: Since the interrupt code for the SPARC supports both synchronous
61 *        and asynchronous trap handlers, support for testing with both
62 *        is included.
63 */
64
65#define SIS_USE_SYNCHRONOUS_TRAP  0
66
67/*
68 *  The synchronous trap is an arbitrarily chosen software trap.
69 */
70
71#if (SIS_USE_SYNCHRONOUS_TRAP == 1)
72
73#define TEST_VECTOR SPARC_SYNCHRONOUS_TRAP( 0x90 )
74
75#define MUST_WAIT_FOR_INTERRUPT 1
76
77#define Install_tm27_vector( handler ) \
78  set_vector( (handler), TEST_VECTOR, 1 );
79
80#define Cause_tm27_intr() \
81  asm volatile( "ta 0x10; nop " );
82
83#define Clear_tm27_intr() 
84
85#define Lower_tm27_intr()
86
87/*
88 *  The asynchronous trap is an arbitrarily chosen ERC32 interrupt source.
89 */
90
91#else   /* use a regular asynchronous trap */
92
93#define TEST_INTERRUPT_SOURCE ERC32_INTERRUPT_EXTERNAL_1
94#define TEST_INTERRUPT_SOURCE2 (ERC32_INTERRUPT_EXTERNAL_1+1)
95#define TEST_VECTOR ERC32_TRAP_TYPE( TEST_INTERRUPT_SOURCE )
96#define TEST_VECTOR2 ERC32_TRAP_TYPE( TEST_INTERRUPT_SOURCE2 )
97 
98#define MUST_WAIT_FOR_INTERRUPT 1
99 
100#define Install_tm27_vector( handler ) \
101  set_vector( (handler), TEST_VECTOR, 1 ); \
102  set_vector( (handler), TEST_VECTOR2, 1 );
103 
104#define Cause_tm27_intr() \
105  do { \
106    ERC32_Force_interrupt( TEST_INTERRUPT_SOURCE+(Interrupt_nest>>1) ); \
107    nop(); \
108    nop(); \
109    nop(); \
110  } while (0)
111 
112#define Clear_tm27_intr() \
113  ERC32_Clear_interrupt( TEST_INTERRUPT_SOURCE )
114 
115#define Lower_tm27_intr()
116
117#endif
118
119/*
120 *  Simple spin delay in microsecond units for device drivers.
121 *  This is very dependent on the clock speed of the target.
122 */
123
124extern void Clock_delay(rtems_unsigned32 microseconds);
125
126#define delay( microseconds ) Clock_delay(microseconds)
127
128/* Constants */
129
130/*
131 *  Information placed in the linkcmds file.
132 */
133
134extern int   RAM_START;
135extern int   RAM_END;
136extern int   RAM_SIZE;
137 
138extern int   PROM_START;
139extern int   PROM_END;
140extern int   PROM_SIZE;
141
142extern int   CLOCK_SPEED;
143 
144extern int   end;        /* last address in the program */
145
146/*
147 *  Device Driver Table Entries
148 */
149 
150/*
151 * NOTE: Use the standard Console driver entry
152 */
153 
154/*
155 * NOTE: Use the standard Clock driver entry
156 */
157 
158 
159/* miscellaneous stuff assumed to exist */
160
161void bsp_cleanup( void );
162
163void bsp_start( void );
164
165rtems_isr_entry set_vector(                     /* returns old vector */
166    rtems_isr_entry     handler,                /* isr routine        */
167    rtems_vector_number vector,                 /* vector number      */
168    int                 type                    /* RTEMS or RAW intr  */
169);
170
171void DEBUG_puts( char *string );
172
173void BSP_fatal_return( void );
174
175void bsp_spurious_initialize( void );
176
177extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
178
179extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
180
181#ifdef __cplusplus
182}
183#endif
184
185#endif
186/* end of include file */
Note: See TracBrowser for help on using the repository browser.