RTEMS  5.0.0
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
46 extern "C" {
47 #endif
48 
49 /*
50  * BSP provides its own Idle thread body
51  */
52 void *bsp_idle_thread( uintptr_t ignored );
53 #define BSP_IDLE_TASK_BODY bsp_idle_thread
54 
55 /*
56  * Network driver configuration
57  */
58 struct rtems_bsdnet_ifconfig;
59 extern 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 
71 extern int RAM_START;
72 extern int RAM_END;
73 extern int RAM_SIZE;
74 
75 extern int PROM_START;
76 extern int PROM_END;
77 extern int PROM_SIZE;
78 
79 extern int CLOCK_SPEED;
80 
81 extern int end; /* last address in the program */
82 
83 /* functions */
84 
85 rtems_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 
91 void BSP_fatal_exit(uint32_t error);
92 
93 void bsp_spurious_initialize( void );
94 
95 /* Interrupt Service Routine (ISR) pointer */
96 typedef void (*bsp_shared_isr)(void *arg);
97 
98 /* Initializes the Shared System Interrupt service */
99 extern void BSP_shared_interrupt_init(void);
100 
101 /* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
102 void 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  */
114 static __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  */
133 static __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  */
151 extern 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  */
160 extern 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  */
169 extern void BSP_shared_interrupt_mask(int irq);
170 
171 /*
172  * Delay for the specified number of microseconds.
173  */
174 void rtems_bsp_delay(int usecs);
175 
176 /*
177  * Prototypes for methods used across file boundaries
178  */
179 void console_outbyte_polled(int port, unsigned char ch);
180 int console_inbyte_nonblocking(int port);
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
188 #endif
Definition: deflate.c:115
rtems_isr_entry set_vector(rtems_isr_entry handler, rtems_vector_number vector, int type)
Install an interrupt handler.
Definition: setvec.c:28
#define RTEMS_INTERRUPT_SHARED
Allows that this interrupt handler may share a common interrupt vector with other handler...
Definition: irq-extension.h:56
Contains information pertaining to the ERC32.
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
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
DEFAULT_INITIAL_EXTENSION Support.
ISR_Vector_number rtems_vector_number
Control block type used to manage the vectors.
Definition: intr.h:47
int console_inbyte_nonblocking(int port)
Definition: console-io.c:46
Header file for the Interrupt Manager Extension.
void * bsp_idle_thread(uintptr_t ignored)
Optimized idle task.
Definition: bspidle.c:26