source: rtems/c/src/lib/libbsp/sparc/leon2/include/bsp.h @ dd8df59

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

bsps: Interrupt initialization error is fatal

  • Property mode set to 100644
File size: 4.9 KB
Line 
1/*  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 *
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 <leon.h>
32#include <rtems/clockdrv.h>
33#include <rtems/console.h>
34#include <rtems/irq-extension.h>
35
36/* SPARC CPU variant: LEON2 */
37#define LEON2 1
38
39/*
40 *  BSP provides its own Idle thread body
41 */
42void *bsp_idle_thread( uintptr_t ignored );
43#define BSP_IDLE_TASK_BODY bsp_idle_thread
44
45/*
46 * Network driver configuration
47 */
48struct rtems_bsdnet_ifconfig;
49extern int rtems_leon_open_eth_driver_attach(
50  struct rtems_bsdnet_ifconfig *config
51);
52extern int rtems_smc91111_driver_attach_leon2(
53  struct rtems_bsdnet_ifconfig *config
54);
55#define RTEMS_BSP_NETWORK_DRIVER_NAME   "open_eth1"
56#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
57          rtems_leon_open_eth_driver_attach
58#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
59          rtems_smc91111_driver_attach_leon2
60
61#define HAS_SMC91111
62
63/* Configure GRETH driver */
64#define GRETH_SUPPORTED
65#define GRETH_MEM_LOAD(addr) leon_r32_no_cache(addr)
66
67/*
68 *  The synchronous trap is an arbitrarily chosen software trap.
69 */
70
71extern int   CPU_SPARC_HAS_SNOOPING;
72
73/* Constants */
74
75#define BSP_RESET_BOARD_AT_EXIT 1
76
77/*
78 *  Information placed in the linkcmds file.
79 */
80
81extern int   RAM_START;
82extern int   RAM_END;
83extern int   RAM_SIZE;
84
85extern int   PROM_START;
86extern int   PROM_END;
87extern int   PROM_SIZE;
88
89extern int   CLOCK_SPEED;
90
91extern int   end;        /* last address in the program */
92
93/* miscellaneous stuff assumed to exist */
94
95rtems_isr_entry set_vector(                     /* returns old vector */
96    rtems_isr_entry     handler,                /* isr routine        */
97    rtems_vector_number vector,                 /* vector number      */
98    int                 type                    /* RTEMS or RAW intr  */
99);
100
101void BSP_fatal_return( void );
102
103void bsp_spurious_initialize( void );
104
105/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function
106 * can be called at any time. The work-area will shrink when called before
107 * bsp_work_area_initialize(). malloc() is called to get memory when this function
108 * is called after bsp_work_area_initialize().
109 */
110void *bsp_early_malloc(int size);
111
112/* Interrupt Service Routine (ISR) pointer */
113typedef void (*bsp_shared_isr)(void *arg);
114
115/* Initializes the Shared System Interrupt service */
116extern void BSP_shared_interrupt_init(void);
117
118/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
119 * interrupt handlers may use the same IRQ number, all ISRs will be called
120 * when an interrupt on that line is fired.
121 *
122 * Arguments
123 *  irq       System IRQ number
124 *  info      Optional Name of IRQ source
125 *  isr       Function pointer to the ISR
126 *  arg       Second argument to function isr
127 */
128static __inline__ int BSP_shared_interrupt_register
129       (
130       int irq,
131       const char *info,
132       bsp_shared_isr isr,
133       void *arg
134       )
135{
136       return rtems_interrupt_handler_install(irq, info,
137                                       RTEMS_INTERRUPT_SHARED, isr, arg);
138}
139
140/* Unregister previously registered shared IRQ handler.
141 *
142 * Arguments
143 *  irq       System IRQ number
144 *  isr       Function pointer to the ISR
145 *  arg       Second argument to function isr
146 */
147static __inline__ int BSP_shared_interrupt_unregister
148       (
149       int irq,
150       bsp_shared_isr isr,
151       void *arg
152       )
153{
154       return rtems_interrupt_handler_remove(irq, isr, arg);
155}
156
157/* Clear interrupt pending on IRQ controller, this is typically done on a
158 * level triggered interrupt source such as PCI to avoid taking double IRQs.
159 * In such a case the interrupt source must be cleared first on LEON, before
160 * acknowledging the IRQ with this function.
161 *
162 * Arguments
163 *  irq       System IRQ number
164 */
165extern void BSP_shared_interrupt_clear(int irq);
166
167/* Enable Interrupt. This function will unmask the IRQ at the interrupt
168 * controller. This is normally done by _register(). Note that this will
169 * affect all ISRs on this IRQ.
170 *
171 * Arguments
172 *  irq       System IRQ number
173 */
174extern void BSP_shared_interrupt_unmask(int irq);
175
176/* Disable Interrupt. This function will mask one IRQ at the interrupt
177 * controller. This is normally done by _unregister().  Note that this will
178 * affect all ISRs on this IRQ.
179 *
180 * Arguments
181 *  irq         System IRQ number
182 */
183extern void BSP_shared_interrupt_mask(int irq);
184
185#ifdef __cplusplus
186}
187#endif
188
189#endif
Note: See TracBrowser for help on using the repository browser.