OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [sparc/] [leon/] [include/] [bsp.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.