RTEMS 7.0-rc1
Loading...
Searching...
No Matches
bsp.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+-with-RTEMS-exception */
2
11/*
12 * COPYRIGHT (c) 1989-2007.
13 * On-Line Applications Research Corporation (OAR).
14 *
15 * The license and distribution terms for this file may be
16 * found in the file LICENSE in this distribution or at
17 * http://www.rtems.org/license/LICENSE.
18 *
19 * Ported to ERC32 implementation of the SPARC by On-Line Applications
20 * Research Corporation (OAR) under contract to the European Space
21 * Agency (ESA).
22 *
23 * ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
24 * European Space Agency.
25 */
26
27#ifndef LIBBSP_SPARC_ERC32_BSP_H
28#define LIBBSP_SPARC_ERC32_BSP_H
29
40#include <bspopts.h>
42
43#include <rtems.h>
44#include <erc32.h>
45#include <rtems/irq-extension.h>
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51#define BSP_FEATURE_IRQ_EXTENSION
52
53/*
54 * BSP provides its own Idle thread body
55 */
56void *bsp_idle_thread( uintptr_t ignored );
57#define BSP_IDLE_TASK_BODY bsp_idle_thread
58
59/*
60 * Network driver configuration
61 */
62struct rtems_bsdnet_ifconfig;
63extern int rtems_erc32_sonic_driver_attach(
64 struct rtems_bsdnet_ifconfig *config
65);
66#define RTEMS_BSP_NETWORK_DRIVER_NAME "sonic1"
67#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_erc32_sonic_driver_attach
68
69/* Constants */
70
71/*
72 * Information placed in the linkcmds file.
73 */
74
75extern int RAM_START;
76extern int RAM_END;
77extern int RAM_SIZE;
78
79extern int PROM_START;
80extern int PROM_END;
81extern int PROM_SIZE;
82
83extern int CLOCK_SPEED;
84
85extern int end; /* last address in the program */
86
87/* functions */
88
89void SPARC_Clear_and_unmask_interrupt(rtems_vector_number vector);
90
91void BSP_fatal_exit(uint32_t error);
92
93/* Interrupt Service Routine (ISR) pointer */
94typedef void (*bsp_shared_isr)(void *arg);
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 */
106RTEMS_DEPRECATED static 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 */
125RTEMS_DEPRECATED static 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 */
143RTEMS_DEPRECATED static inline void BSP_shared_interrupt_clear( int irq )
144{
146}
147
148/* Enable Interrupt. This function will unmask the IRQ at the interrupt
149 * controller. This is normally done by _register(). Note that this will
150 * affect all ISRs on this IRQ.
151 *
152 * Arguments
153 * irq System IRQ number
154 */
155RTEMS_DEPRECATED static inline void BSP_shared_interrupt_unmask( int irq )
156{
158}
159
160/* Disable Interrupt. This function will mask one IRQ at the interrupt
161 * controller. This is normally done by _unregister(). Note that this will
162 * affect all ISRs on this IRQ.
163 *
164 * Arguments
165 * irq System IRQ number
166 */
167RTEMS_DEPRECATED static inline void BSP_shared_interrupt_mask( int irq )
168{
170}
171
172/*
173 * Delay for the specified number of microseconds.
174 */
175void rtems_bsp_delay(int usecs);
176
177/*
178 * Prototypes for methods used across file boundaries
179 */
180void console_outbyte_polled(int port, unsigned char ch);
181int console_inbyte_nonblocking(int port);
182
183#ifdef __cplusplus
184}
185#endif
186
189#endif
void console_outbyte_polled(int port, char ch)
Definition: console-io.c:57
This header file provides the default definition of BSP_INITIAL_EXTENSION.
Contains information pertaining to the ERC32.
#define RTEMS_DEPRECATED
Instructs the compiler in a declaration to issue a warning whenever a variable, function,...
Definition: basedefs.h:334
rtems_status_code rtems_interrupt_vector_disable(rtems_vector_number vector)
Disables the interrupt vector.
Definition: irq-enable-disable.c:94
rtems_status_code rtems_interrupt_handler_install(rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler routine, void *arg)
Installs the interrupt handler routine and argument at the interrupt vector.
Definition: irq-handler-install.c:85
ISR_Vector_number rtems_vector_number
This integer type represents interrupt vector numbers.
Definition: intr.h:102
#define RTEMS_INTERRUPT_SHARED
This interrupt handler install option allows that the interrupt handler may share the interrupt vecto...
Definition: intr.h:960
rtems_status_code rtems_interrupt_handler_remove(rtems_vector_number vector, rtems_interrupt_handler routine, void *arg)
Removes the interrupt handler routine and argument from the interrupt vector.
Definition: irq-handler-remove.c:62
rtems_status_code rtems_interrupt_vector_enable(rtems_vector_number vector)
Enables the interrupt vector.
Definition: irq-enable-disable.c:85
rtems_status_code rtems_interrupt_clear(rtems_vector_number vector)
Clears the interrupt vector.
Definition: irq-raise-clear.c:92
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:39
int console_inbyte_nonblocking(int port)
Definition: console-io.c:78
This header file is provided for backward compatiblility.
This header file defines the RTEMS Classic API.