source: rtems/c/src/lib/libbsp/sparc/leon3/include/bsp.h @ 038e2f4a

4.115
Last change on this file since 038e2f4a was 7121cac0, checked in by Sebastian Huber <sebastian.huber@…>, on 11/07/12 at 13:59:20

bsps/sparc: Add BSP_INITIAL_EXTENSION to <bsp.h>

The bsp_fatal_extension() will call BSP_fatal_return().

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