RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
bsp.h
Go to the documentation of this file.
1
9/*
10 * COPYRIGHT (c) 1989-2007.
11 * On-Line Applications Research Corporation (OAR).
12 *
13 * The license and distribution terms for this file may be
14 * found in the file LICENSE in this distribution or at
15 * http://www.rtems.org/license/LICENSE.
16 *
17 * Ported to ERC32 implementation of the SPARC by On-Line Applications
18 * Research Corporation (OAR) under contract to the European Space
19 * Agency (ESA).
20 *
21 * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
22 * European Space Agency.
23 */
24
25#ifndef LIBBSP_SPARC_ERC32_BSP_H
26#define LIBBSP_SPARC_ERC32_BSP_H
27
38#include <bspopts.h>
40
41#include <rtems.h>
42#include <erc32.h>
43#include <rtems/irq-extension.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49/*
50 * BSP provides its own Idle thread body
51 */
52void *bsp_idle_thread( uintptr_t ignored );
53#define BSP_IDLE_TASK_BODY bsp_idle_thread
54
55/*
56 * Network driver configuration
57 */
58struct rtems_bsdnet_ifconfig;
59extern int rtems_erc32_sonic_driver_attach(
60 struct rtems_bsdnet_ifconfig *config
61);
62#define RTEMS_BSP_NETWORK_DRIVER_NAME "sonic1"
63#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_erc32_sonic_driver_attach
64
65/* Constants */
66
67/*
68 * Information placed in the linkcmds file.
69 */
70
71extern int RAM_START;
72extern int RAM_END;
73extern int RAM_SIZE;
74
75extern int PROM_START;
76extern int PROM_END;
77extern int PROM_SIZE;
78
79extern int CLOCK_SPEED;
80
81extern int end; /* last address in the program */
82
83/* functions */
84
85rtems_isr_entry set_vector( /* returns old vector */
86 rtems_isr_entry handler, /* isr routine */
87 rtems_vector_number vector, /* vector number */
88 int type /* RTEMS or RAW intr */
89);
90
91void BSP_fatal_exit(uint32_t error);
92
93void bsp_spurious_initialize( void );
94
95/* Interrupt Service Routine (ISR) pointer */
96typedef void (*bsp_shared_isr)(void *arg);
97
98/* Initializes the Shared System Interrupt service */
99extern void BSP_shared_interrupt_init(void);
100
101/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
102void bsp_isr_handler(rtems_vector_number vector);
103
104/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
105 * interrupt handlers may use the same IRQ number, all ISRs will be called
106 * when an interrupt on that line is fired.
107 *
108 * Arguments
109 * irq System IRQ number
110 * info Optional Name of IRQ source
111 * isr Function pointer to the ISR
112 * arg Second argument to function isr
113 */
114static __inline__ int BSP_shared_interrupt_register
115 (
116 int irq,
117 const char *info,
118 bsp_shared_isr isr,
119 void *arg
120 )
121{
122 return rtems_interrupt_handler_install(irq, info,
123 RTEMS_INTERRUPT_SHARED, isr, arg);
124}
125
126/* Unregister previously registered shared IRQ handler.
127 *
128 * Arguments
129 * irq System IRQ number
130 * isr Function pointer to the ISR
131 * arg Second argument to function isr
132 */
133static __inline__ int BSP_shared_interrupt_unregister
134 (
135 int irq,
136 bsp_shared_isr isr,
137 void *arg
138 )
139{
140 return rtems_interrupt_handler_remove(irq, isr, arg);
141}
142
143/* Clear interrupt pending on IRQ controller, this is typically done on a
144 * level triggered interrupt source such as PCI to avoid taking double IRQs.
145 * In such a case the interrupt source must be cleared first on LEON, before
146 * acknowledging the IRQ with this function.
147 *
148 * Arguments
149 * irq System IRQ number
150 */
151extern void BSP_shared_interrupt_clear(int irq);
152
153/* Enable Interrupt. This function will unmask the IRQ at the interrupt
154 * controller. This is normally done by _register(). Note that this will
155 * affect all ISRs on this IRQ.
156 *
157 * Arguments
158 * irq System IRQ number
159 */
160extern void BSP_shared_interrupt_unmask(int irq);
161
162/* Disable Interrupt. This function will mask one IRQ at the interrupt
163 * controller. This is normally done by _unregister(). Note that this will
164 * affect all ISRs on this IRQ.
165 *
166 * Arguments
167 * irq System IRQ number
168 */
169extern void BSP_shared_interrupt_mask(int irq);
170
171/*
172 * Delay for the specified number of microseconds.
173 */
174void rtems_bsp_delay(int usecs);
175
176/*
177 * Prototypes for methods used across file boundaries
178 */
179void console_outbyte_polled(int port, unsigned char ch);
180int console_inbyte_nonblocking(int port);
181
182#ifdef __cplusplus
183}
184#endif
185
188#endif
DEFAULT_INITIAL_EXTENSION Support.
Contains information pertaining to the ERC32.
ISR_Vector_number rtems_vector_number
Control block type used to manage the vectors.
Definition: intr.h:47
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:26
rtems_isr_entry set_vector(rtems_isr_entry handler, rtems_vector_number vector, int type)
Install an interrupt handler.
Definition: setvec.c:28
int console_inbyte_nonblocking(int port)
Definition: console-io.c:84
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler handler, void *arg)
Installs the interrupt handler routine handler for the interrupt vector with number vector.
Definition: irq.c:127
#define RTEMS_INTERRUPT_SHARED
Allows that this interrupt handler may share a common interrupt vector with other handler.
Definition: irq-extension.h:50
rtems_status_code rtems_interrupt_handler_remove(rtems_vector_number vector, rtems_interrupt_handler handler, void *arg)
Removes the interrupt handler routine handler with argument arg for the interrupt vector with number ...
Definition: irq.c:175
Header file for the Interrupt Manager Extension.
Definition: deflate.c:115