source: rtems/c/src/lib/libbsp/sparc/erc32/include/bsp.h @ 39aa75e7

4.115
Last change on this file since 39aa75e7 was 39aa75e7, checked in by Sebastian Huber <sebastian.huber@…>, on 11/23/12 at 21:40:09

bsps: Use RTEMS_BSP_CLEANUP_OPTIONS

  • 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/*
56 *  Information placed in the linkcmds file.
57 */
58
59extern int   RAM_START;
60extern int   RAM_END;
61extern int   RAM_SIZE;
62
63extern int   PROM_START;
64extern int   PROM_END;
65extern int   PROM_SIZE;
66
67extern int   CLOCK_SPEED;
68
69extern int   end;        /* last address in the program */
70
71/* functions */
72
73rtems_isr_entry set_vector(                     /* returns old vector */
74    rtems_isr_entry     handler,                /* isr routine        */
75    rtems_vector_number vector,                 /* vector number      */
76    int                 type                    /* RTEMS or RAW intr  */
77);
78
79void BSP_fatal_return( void );
80
81void bsp_spurious_initialize( void );
82
83/* Allocate 8-byte aligned non-freeable pre-malloc() memory. The function
84 * can be called at any time. The work-area will shrink when called before
85 * bsp_work_area_initialize(). malloc() is called to get memory when this function
86 * is called after bsp_work_area_initialize().
87 */
88void *bsp_early_malloc(int size);
89
90/* Interrupt Service Routine (ISR) pointer */
91typedef void (*bsp_shared_isr)(void *arg);
92
93/* Initializes the Shared System Interrupt service */
94extern void BSP_shared_interrupt_init(void);
95
96/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
97 * interrupt handlers may use the same IRQ number, all ISRs will be called
98 * when an interrupt on that line is fired.
99 *
100 * Arguments
101 *  irq       System IRQ number
102 *  info      Optional Name of IRQ source
103 *  isr       Function pointer to the ISR
104 *  arg       Second argument to function isr
105 */
106static __inline__ int BSP_shared_interrupt_register
107       (
108       int irq,
109       const char *info,
110       bsp_shared_isr isr,
111       void *arg
112       )
113{
114       return rtems_interrupt_handler_install(irq, info,
115                                       RTEMS_INTERRUPT_SHARED, isr, arg);
116}
117
118/* Unregister previously registered shared IRQ handler.
119 *
120 * Arguments
121 *  irq       System IRQ number
122 *  isr       Function pointer to the ISR
123 *  arg       Second argument to function isr
124 */
125static __inline__ int BSP_shared_interrupt_unregister
126       (
127       int irq,
128       bsp_shared_isr isr,
129       void *arg
130       )
131{
132       return rtems_interrupt_handler_remove(irq, isr, arg);
133}
134
135/* Clear interrupt pending on IRQ controller, this is typically done on a
136 * level triggered interrupt source such as PCI to avoid taking double IRQs.
137 * In such a case the interrupt source must be cleared first on LEON, before
138 * acknowledging the IRQ with this function.
139 *
140 * Arguments
141 *  irq       System IRQ number
142 */
143extern void BSP_shared_interrupt_clear(int irq);
144
145/* Enable Interrupt. This function will unmask the IRQ at the interrupt
146 * controller. This is normally done by _register(). Note that this will
147 * affect all ISRs on this IRQ.
148 *
149 * Arguments
150 *  irq       System IRQ number
151 */
152extern void BSP_shared_interrupt_unmask(int irq);
153
154/* Disable Interrupt. This function will mask one IRQ at the interrupt
155 * controller. This is normally done by _unregister().  Note that this will
156 * affect all ISRs on this IRQ.
157 *
158 * Arguments
159 *  irq         System IRQ number
160 */
161extern void BSP_shared_interrupt_mask(int irq);
162
163#ifdef __cplusplus
164}
165#endif
166
167#endif
Note: See TracBrowser for help on using the repository browser.