source: rtems/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h @ dc104a4

4.104.114.84.95
Last change on this file since dc104a4 was dc104a4, checked in by Joel Sherrill <joel.sherrill@…>, on 05/30/98 at 11:46:21

Updated to current source and removed warnings.

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all DY-4 DMV170 board IO definitions.
4 *
5 *  COPYRIGHT (c) 1989-1997.
6 *  On-Line Applications Research Corporation (OAR).
7 *  All rights assigned to U.S. Government, 1994.
8 *
9 *  This material may be reproduced by or for the U.S. Government pursuant
10 *  to the copyright license under the clause at DFARS 252.227-7013.  This
11 *  notice must appear in all copies of this file and its derivatives.
12 *
13 *  $Id$
14 */
15
16#ifndef __DMV170_BSP_h
17#define __DMV170_BSP_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#ifdef ASM
24/* Definition of where to store registers in alignment handler */
25#define ALIGN_REGS 0x0140
26
27#else
28#include <rtems.h>
29#include <console.h>
30#include <clockdrv.h>
31#include <console.h>
32#include <iosupp.h>
33
34#include <dmv170.h>
35
36#define Enable_Debug() \
37  DMV170_WRITE( 0xffffbd0c, 0 )
38
39#define Debug_Entry( num ) \
40  DMV170_WRITE( 0xffffbd06, num )
41
42/*
43 * The following macro calculates the Baud constant. For the Z8530 chip.
44 */
45#define Z8530_Baud( _frequency, _clock_by, _baud_rate  )   \
46  ( (_frequency /( _clock_by * 2 * _baud_rate))  - 2)
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       300 /* 5 minutes = 300 seconds */
58#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
59
60
61/*
62 *  Stuff for Time Test 27
63 */
64
65#define MUST_WAIT_FOR_INTERRUPT 1
66
67#define Install_tm27_vector( _handler ) \
68  set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
69
70#define Cause_tm27_intr()  \
71  do { \
72    unsigned32 _clicks = 1; \
73    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
74  } while (0)
75
76#define Clear_tm27_intr() \
77  do { \
78    unsigned32 _clicks = 0xffffffff; \
79    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
80  } while (0)
81
82#define Lower_tm27_intr() \
83  do { \
84    unsigned32 _msr = 0; \
85    _ISR_Set_level( 0 ); \
86    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
87    _msr |=  0x8002; \
88    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
89  } while (0)
90
91/* Constants */
92
93/*
94 *  Device Driver Table Entries
95 */
96 
97/*
98 * NOTE: Use the standard Console driver entry
99 */
100 
101/*
102 * NOTE: Use the standard Clock driver entry
103 */
104 
105
106/*
107 *  Information placed in the linkcmds file.
108 */
109
110extern int   RAM_START;
111extern int   RAM_END;
112extern int   RAM_SIZE;
113
114extern int   PROM_START;
115extern int   PROM_END;
116extern int   PROM_SIZE;
117
118extern int   CLOCK_SPEED;
119
120extern int   end;        /* last address in the program */
121
122/*
123 * How many libio files we want
124 */
125 
126#define BSP_LIBIO_MAX_FDS       20
127
128/* functions */
129
130/*
131 * genvec.c
132 */
133rtems_isr_entry  set_EE_vector(
134  rtems_isr_entry     handler,                  /* isr routine        */
135  rtems_vector_number vector                    /* vector number      */
136);
137void initialize_external_exception_vector ();
138
139/*
140 * console.c
141 */
142void DEBUG_puts( char *string );
143
144void BSP_fatal_return( void );
145
146
147
148void bsp_start( void );
149
150void bsp_cleanup( void );
151
152rtems_isr_entry set_vector(                    /* returns old vector */
153  rtems_isr_entry     handler,                  /* isr routine        */
154  rtems_vector_number vector,                   /* vector number      */
155  int                 type                      /* RTEMS or RAW intr  */
156);
157
158void BSP_fatal_return( void );
159
160void bsp_spurious_initialize( void );
161
162extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
163
164extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
165
166extern rtems_unsigned32          bsp_isr_level;
167
168extern int   CPU_PPC_CLICKS_PER_MS;
169
170#endif /* ASM */
171
172#ifdef __cplusplus
173}
174#endif
175
176#endif
177/* end of include file */
Note: See TracBrowser for help on using the repository browser.