source: rtems/c/src/lib/libbsp/powerpc/psim/include/bsp.h @ df49c60

4.104.114.84.95
Last change on this file since df49c60 was df49c60, checked in by Joel Sherrill <joel.sherrill@…>, on 06/12/00 at 15:00:15

Merged from 4.5.0-beta3a

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all Papyrus board IO definitions.
4 *
5 *  Author:     Andrew Bray <andy@i-cubed.co.uk>
6 *
7 *  COPYRIGHT (c) 1995 by i-cubed ltd.
8 *
9 *  To anyone who acknowledges that this file is provided "AS IS"
10 *  without any express or implied warranty:
11 *      permission to use, copy, modify, and distribute this file
12 *      for any purpose is hereby granted without fee, provided that
13 *      the above copyright notice and this notice appears in all
14 *      copies, and that the name of i-cubed limited not be used in
15 *      advertising or publicity pertaining to distribution of the
16 *      software without specific, written prior permission.
17 *      i-cubed limited makes no representations about the suitability
18 *      of this software for any purpose.
19 *
20 *  Derived from c/src/lib/libbsp/no_cpu/no_bsp/include/bsp.h
21 *
22 *  COPYRIGHT (c) 1989-1999.
23 *  On-Line Applications Research Corporation (OAR).
24 *
25 *  The license and distribution terms for this file may be
26 *  found in found in the file LICENSE in this distribution or at
27 *  http://www.OARcorp.com/rtems/license.html.
28 *
29 *  $Id$
30 */
31
32#ifndef __PAPYRUS_h
33#define __PAPYRUS_h
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/*
40 *  confdefs.h overrides for this BSP:
41 *   - termios serial ports (defaults to 1)
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  (12 * 1024)
47 
48#ifdef ASM
49/* Definition of where to store registers in alignment handler */
50#define ALIGN_REGS 0x0140
51
52#else
53#include <rtems.h>
54#include <console.h>
55#include <clockdrv.h>
56#include <console.h>
57#include <iosupp.h>
58
59/*
60 *  Define the time limits for RTEMS Test Suite test durations.
61 *  Long test and short test duration limits are provided.  These
62 *  values are in seconds and need to be converted to ticks for the
63 *  application.
64 *
65 */
66
67#define MAX_LONG_TEST_DURATION       300 /* 5 minutes = 300 seconds */
68#define MAX_SHORT_TEST_DURATION      3   /* 3 seconds */
69
70
71/*
72 *  Stuff for Time Test 27
73 */
74
75#define MUST_WAIT_FOR_INTERRUPT 1
76
77#define Install_tm27_vector( _handler ) \
78  set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 )
79
80#define Cause_tm27_intr()  \
81  do { \
82    unsigned32 _clicks = 1; \
83    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
84  } while (0)
85
86
87#define Clear_tm27_intr() \
88  do { \
89    unsigned32 _clicks = 0xffffffff; \
90    asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
91  } while (0)
92
93#define Lower_tm27_intr() \
94  do { \
95    unsigned32 _msr = 0; \
96    _ISR_Set_level( 0 ); \
97    asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
98    _msr |=  0x8002; \
99    asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
100  } while (0)
101
102/* Constants */
103
104/*
105 *  Device Driver Table Entries
106 */
107 
108/*
109 * NOTE: Use the standard Console driver entry
110 */
111 
112/*
113 * NOTE: Use the standard Clock driver entry
114 */
115 
116
117/*
118 *  Information placed in the linkcmds file.
119 */
120
121extern int   RAM_START;
122extern int   RAM_END;
123extern int   RAM_SIZE;
124
125extern int   PROM_START;
126extern int   PROM_END;
127extern int   PROM_SIZE;
128
129extern int   CLOCK_SPEED;
130
131extern int   end;        /* last address in the program */
132
133/* functions */
134
135void bsp_start( void );
136
137void bsp_cleanup( void );
138
139rtems_isr_entry set_vector(                    /* returns old vector */
140  rtems_isr_entry     handler,                  /* isr routine        */
141  rtems_vector_number vector,                   /* vector number      */
142  int                 type                      /* RTEMS or RAW intr  */
143);
144
145void DEBUG_puts( char *string );
146
147void BSP_fatal_return( void );
148
149void bsp_spurious_initialize( void );
150
151extern rtems_configuration_table BSP_Configuration;     /* owned by BSP */
152
153extern rtems_cpu_table           Cpu_table;             /* owned by BSP */
154
155extern rtems_unsigned32          bsp_isr_level;
156
157#endif /* ASM */
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif
164/* end of include file */
Note: See TracBrowser for help on using the repository browser.