source: rtems/bsps/sparc/leon2/include/bsp.h @ 4cf93658

5
Last change on this file since 4cf93658 was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 5.5 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup sparc_leon2
5 *
6 * @brief Global BSP Definitions.
7 */
8
9/*  bsp.h
10 *
11 *  This include file contains all SPARC simulator definitions.
12 *
13 *  COPYRIGHT (c) 1989-1998.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.org/license/LICENSE.
19 *
20 *  Ported to ERC32 implementation of the SPARC by On-Line Applications
21 *  Research Corporation (OAR) under contract to the European Space
22 *  Agency (ESA).
23 *
24 *  ERC32 modifications of respective RTEMS file: COPYRIGHT (c) 1995.
25 *  European Space Agency.
26 */
27
28#ifndef LIBBSP_SPARC_LEON2_BSP_H
29#define LIBBSP_SPARC_LEON2_BSP_H
30
31#include <bspopts.h>
32#include <bsp/default-initial-extension.h>
33
34#include <rtems.h>
35#include <leon.h>
36#include <rtems/irq-extension.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/**
43 *  @defgroup sparc_leon2 LEON2 Support
44 *
45 *  @ingroup bsp_sparc
46 *
47 *  @brief LEON2 Support Package
48 *
49 */
50
51/* SPARC CPU variant: LEON2 */
52#define LEON2 1
53
54/*
55 *  BSP provides its own Idle thread body
56 */
57void *bsp_idle_thread( uintptr_t ignored );
58#define BSP_IDLE_TASK_BODY bsp_idle_thread
59
60/*
61 * Network driver configuration
62 */
63struct rtems_bsdnet_ifconfig;
64extern int rtems_leon_open_eth_driver_attach(
65  struct rtems_bsdnet_ifconfig *config
66);
67extern int rtems_smc91111_driver_attach_leon2(
68  struct rtems_bsdnet_ifconfig *config
69);
70#define RTEMS_BSP_NETWORK_DRIVER_NAME "open_eth1"
71#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_OPENETH \
72          rtems_leon_open_eth_driver_attach
73#define RTEMS_BSP_NETWORK_DRIVER_ATTACH_SMC91111 \
74          rtems_smc91111_driver_attach_leon2
75
76#define HAS_SMC91111
77
78/* Configure GRETH driver */
79#define GRETH_SUPPORTED
80#define GRETH_MEM_LOAD(addr) leon_r32_no_cache((uintptr_t) addr)
81
82/*
83 *  The synchronous trap is an arbitrarily chosen software trap.
84 */
85
86extern int   CPU_SPARC_HAS_SNOOPING;
87
88/* Constants */
89
90/*
91 *  Information placed in the linkcmds file.
92 */
93
94extern int   RAM_START;
95extern int   RAM_END;
96extern int   RAM_SIZE;
97
98extern int   PROM_START;
99extern int   PROM_END;
100extern int   PROM_SIZE;
101
102extern int   CLOCK_SPEED;
103
104extern int   end;        /* last address in the program */
105
106/* miscellaneous stuff assumed to exist */
107
108rtems_isr_entry set_vector(                     /* returns old vector */
109    rtems_isr_entry     handler,                /* isr routine        */
110    rtems_vector_number vector,                 /* vector number      */
111    int                 type                    /* RTEMS or RAW intr  */
112);
113
114void BSP_fatal_exit(uint32_t error);
115
116void bsp_spurious_initialize( void );
117
118/* Interrupt Service Routine (ISR) pointer */
119typedef void (*bsp_shared_isr)(void *arg);
120
121/* Initializes the Shared System Interrupt service */
122extern void BSP_shared_interrupt_init(void);
123
124/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
125void bsp_isr_handler(rtems_vector_number vector);
126
127/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
128 * interrupt handlers may use the same IRQ number, all ISRs will be called
129 * when an interrupt on that line is fired.
130 *
131 * Arguments
132 *  irq       System IRQ number
133 *  info      Optional Name of IRQ source
134 *  isr       Function pointer to the ISR
135 *  arg       Second argument to function isr
136 */
137static __inline__ int BSP_shared_interrupt_register
138       (
139       int irq,
140       const char *info,
141       bsp_shared_isr isr,
142       void *arg
143       )
144{
145       return rtems_interrupt_handler_install(irq, info,
146                                       RTEMS_INTERRUPT_SHARED, isr, arg);
147}
148
149/* Unregister previously registered shared IRQ handler.
150 *
151 * Arguments
152 *  irq       System IRQ number
153 *  isr       Function pointer to the ISR
154 *  arg       Second argument to function isr
155 */
156static __inline__ int BSP_shared_interrupt_unregister
157       (
158       int irq,
159       bsp_shared_isr isr,
160       void *arg
161       )
162{
163       return rtems_interrupt_handler_remove(irq, isr, arg);
164}
165
166/* Clear interrupt pending on IRQ controller, this is typically done on a
167 * level triggered interrupt source such as PCI to avoid taking double IRQs.
168 * In such a case the interrupt source must be cleared first on LEON, before
169 * acknowledging the IRQ with this function.
170 *
171 * Arguments
172 *  irq       System IRQ number
173 */
174extern void BSP_shared_interrupt_clear(int irq);
175
176/* Enable Interrupt. This function will unmask the IRQ at the interrupt
177 * controller. This is normally done by _register(). Note that this will
178 * affect all ISRs on this IRQ.
179 *
180 * Arguments
181 *  irq       System IRQ number
182 */
183extern void BSP_shared_interrupt_unmask(int irq);
184
185/* Disable Interrupt. This function will mask one IRQ at the interrupt
186 * controller. This is normally done by _unregister().  Note that this will
187 * affect all ISRs on this IRQ.
188 *
189 * Arguments
190 *  irq         System IRQ number
191 */
192extern void BSP_shared_interrupt_mask(int irq);
193
194/*
195 * Delay method
196 */
197void rtems_bsp_delay(int usecs);
198
199/*
200 * Prototypes for BSP methods that are used across file boundaries
201 */
202int cchip1_register(void);
203
204/* AT697 has PCI defined as big endian */
205#define BSP_PCI_BIG_ENDIAN
206
207/* Common driver build-time configurations. On small systems undefine
208 * [DRIVER]_INFO_AVAIL to avoid info routines get dragged in. It is good
209 * for debugging and printing information about the system, but makes the
210 * image bigger.
211 */
212#define AMBAPPBUS_INFO_AVAIL          /* AMBAPP Bus driver */
213#define GPTIMER_INFO_AVAIL            /* GPTIMER Timer driver */
214#define GRETH_INFO_AVAIL              /* GRETH Ethernet driver */
215
216#ifdef __cplusplus
217}
218#endif
219
220#endif
Note: See TracBrowser for help on using the repository browser.