source: rtems/c/src/lib/libbsp/sparc/erc32/include/bsp.h @ 9d10cf90

4.115
Last change on this file since 9d10cf90 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: 4.4 KB
Line 
1/*  bsp.h
2 *
3 *  This include file contains all SPARC simulator definitions.
4 *
5 *  COPYRIGHT (c) 1989-2007.
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 *  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
20#ifndef _BSP_H
21#define _BSP_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#include <bspopts.h>
28#include <bsp/default-initial-extension.h>
29
30#include <rtems.h>
31#include <rtems/iosupp.h>
32#include <erc32.h>
33#include <rtems/clockdrv.h>
34#include <rtems/console.h>
35#include <rtems/irq-extension.h>
36
37/*
38 *  BSP provides its own Idle thread body
39 */
40void *bsp_idle_thread( uintptr_t ignored );
41#define BSP_IDLE_TASK_BODY bsp_idle_thread
42
43/*
44 * Network driver configuration
45 */
46struct rtems_bsdnet_ifconfig;
47extern int rtems_erc32_sonic_driver_attach(
48  struct rtems_bsdnet_ifconfig *config
49);
50#define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
51#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_erc32_sonic_driver_attach
52
53/* Constants */
54
55#define BSP_RESET_BOARD_AT_EXIT 1
56
57/*
58 *  Information placed in the linkcmds file.
59 */
60
61extern int   RAM_START;
62extern int   RAM_END;
63extern int   RAM_SIZE;
64
65extern int   PROM_START;
66extern int   PROM_END;
67extern int   PROM_SIZE;
68
69extern int   CLOCK_SPEED;
70
71extern int   end;        /* last address in the program */
72
73/* functions */
74
75rtems_isr_entry set_vector(                     /* returns old vector */
76    rtems_isr_entry     handler,                /* isr routine        */
77    rtems_vector_number vector,                 /* vector number      */
78    int                 type                    /* RTEMS or RAW intr  */
79);
80
81void BSP_fatal_return( void );
82
83void bsp_spurious_initialize( void );
84
85/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function
86 * can be called at any time. The work-area will shrink when called before
87 * bsp_work_area_initialize(). malloc() is called to get memory when this function
88 * is called after bsp_work_area_initialize().
89 */
90void *bsp_early_malloc(int size);
91
92/* Interrupt Service Routine (ISR) pointer */
93typedef void (*bsp_shared_isr)(void *arg);
94
95/* Initializes the Shared System Interrupt service */
96extern int BSP_shared_interrupt_init(void);
97
98/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
99 * interrupt handlers may use the same IRQ number, all ISRs will be called
100 * when an interrupt on that line is fired.
101 *
102 * Arguments
103 *  irq       System IRQ number
104 *  info      Optional Name of IRQ source
105 *  isr       Function pointer to the ISR
106 *  arg       Second argument to function isr
107 */
108static __inline__ int BSP_shared_interrupt_register
109       (
110       int irq,
111       const char *info,
112       bsp_shared_isr isr,
113       void *arg
114       )
115{
116       return rtems_interrupt_handler_install(irq, info,
117                                       RTEMS_INTERRUPT_SHARED, isr, arg);
118}
119
120/* Unregister previously registered shared IRQ handler.
121 *
122 * Arguments
123 *  irq       System IRQ number
124 *  isr       Function pointer to the ISR
125 *  arg       Second argument to function isr
126 */
127static __inline__ int BSP_shared_interrupt_unregister
128       (
129       int irq,
130       bsp_shared_isr isr,
131       void *arg
132       )
133{
134       return rtems_interrupt_handler_remove(irq, isr, arg);
135}
136
137/* Clear interrupt pending on IRQ controller, this is typically done on a
138 * level triggered interrupt source such as PCI to avoid taking double IRQs.
139 * In such a case the interrupt source must be cleared first on LEON, before
140 * acknowledging the IRQ with this function.
141 *
142 * Arguments
143 *  irq       System IRQ number
144 */
145extern void BSP_shared_interrupt_clear(int irq);
146
147/* Enable Interrupt. This function will unmask the IRQ at the interrupt
148 * controller. This is normally done by _register(). Note that this will
149 * affect all ISRs on this IRQ.
150 *
151 * Arguments
152 *  irq       System IRQ number
153 */
154extern void BSP_shared_interrupt_unmask(int irq);
155
156/* Disable Interrupt. This function will mask one IRQ at the interrupt
157 * controller. This is normally done by _unregister().  Note that this will
158 * affect all ISRs on this IRQ.
159 *
160 * Arguments
161 *  irq         System IRQ number
162 */
163extern void BSP_shared_interrupt_mask(int irq);
164
165#ifdef __cplusplus
166}
167#endif
168
169#endif
Note: See TracBrowser for help on using the repository browser.