source: rtems/c/src/lib/libbsp/m68k/mrm332/include/bsp.h @ a052181

4.115
Last change on this file since a052181 was a052181, checked in by Sebastian Huber <sebastian.huber@…>, on 11/14/12 at 08:59:10

score: Add RTEMS_FATAL_SOURCE_EXIT

Include <bsp/default-initial-extension.h> in all BSPs. Call
rtems_fatal() with RTEMS_FATAL_SOURCE_EXIT as source and the exit()
status code as fatal code in every bsp_cleanup(). Move previous
bsp_cleanup() code into bsp_fatal_extension().

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all mrm board IO definitions.
4 *
5 *  COPYRIGHT (c) 1989-2009.
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.rtems.com/license/LICENSE.
11 */
12
13#ifndef _BSP_H
14#define _BSP_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#include <bspopts.h>
21#include <bsp/default-initial-extension.h>
22
23#include <rtems.h>
24#include <rtems/bspIo.h>
25#include <rtems/clockdrv.h>
26#include <rtems/console.h>
27#include <rtems/iosupp.h>
28#include <mrm332.h>
29#include <rtems/m68k/sim.h>
30#include <rtems/m68k/qsm.h>
31
32#define BSP_SMALL_MEMORY 1
33
34#define CONSOLE_SCI
35
36/*
37 *  Simple spin delay in microsecond units for device drivers.
38 *  This is very dependent on the clock speed of the target.
39 */
40
41#define rtems_bsp_delay( microseconds ) \
42  { register uint32_t         _delay=(microseconds); \
43    register uint32_t         _tmp=123; \
44    __asm__ volatile( "0: \
45                     nbcd      %0 ; \
46                     nbcd      %0 ; \
47                     dbf       %1,0b" \
48                  : "=d" (_tmp), "=d" (_delay) \
49                  : "0"  (_tmp), "1"  (_delay) ); \
50  }
51
52/* externals */
53
54extern char _etext[];
55extern char _copy_start[];
56extern char _edata[];
57extern char _clear_start[];
58extern char end[];
59extern char _copy_data_from_rom[];
60
61/* constants */
62
63#ifdef __START_C__
64#define STACK_SIZE "#0x800"
65#else
66#define STACK_SIZE 0x800
67#endif
68
69/* macros */
70
71#define RAW_PUTS(str) \
72  { register char *ptr = str; \
73    while (*ptr) SCI_output_char(*ptr++); \
74  }
75
76#define RAW_PUTI(n) { \
77    register int i, j; \
78    \
79    RAW_PUTS("0x"); \
80    for (i=28;i>=0;i -= 4) { \
81      j = (n>>i) & 0xf; \
82      SCI_output_char( (j>9 ? j-10+'a' : j+'0') ); \
83    } \
84  }
85
86/* miscellaneous stuff assumed to exist */
87
88extern rtems_isr_entry M68Kvec[];   /* vector table address */
89
90extern int stack_size;
91extern int stack_start;
92
93/* functions */
94
95rtems_isr_entry set_vector(
96  rtems_isr_entry     handler,
97  rtems_vector_number vector,
98  int                 type
99);
100
101void Spurious_Initialize(void);
102
103void _UART_flush(void);
104
105void outbyte(char);
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif
Note: See TracBrowser for help on using the repository browser.