source: rtems/bsps/sparc/erc32/include/bsp.h @ 2afb22b

5
Last change on this file since 2afb22b 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: 4.5 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup sparc_erc32
5 *
6 * @brief Global BSP Definitions.
7 */
8
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
28#include <bspopts.h>
29#include <bsp/default-initial-extension.h>
30
31#include <rtems.h>
32#include <erc32.h>
33#include <rtems/irq-extension.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
39/**
40 * @defgroup sparc_erc32 ERC32 Support
41 *
42 * @ingroup bsp_sparc
43 *
44 * @brief ERC32 Support Package
45 */
46
47/*
48 *  BSP provides its own Idle thread body
49 */
50void *bsp_idle_thread( uintptr_t ignored );
51#define BSP_IDLE_TASK_BODY bsp_idle_thread
52
53/*
54 * Network driver configuration
55 */
56struct rtems_bsdnet_ifconfig;
57extern int rtems_erc32_sonic_driver_attach(
58  struct rtems_bsdnet_ifconfig *config
59);
60#define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
61#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_erc32_sonic_driver_attach
62
63/* Constants */
64
65/*
66 *  Information placed in the linkcmds file.
67 */
68
69extern int   RAM_START;
70extern int   RAM_END;
71extern int   RAM_SIZE;
72
73extern int   PROM_START;
74extern int   PROM_END;
75extern int   PROM_SIZE;
76
77extern int   CLOCK_SPEED;
78
79extern int   end;        /* last address in the program */
80
81/* functions */
82
83rtems_isr_entry set_vector(                     /* returns old vector */
84    rtems_isr_entry     handler,                /* isr routine        */
85    rtems_vector_number vector,                 /* vector number      */
86    int                 type                    /* RTEMS or RAW intr  */
87);
88
89void BSP_fatal_exit(uint32_t error);
90
91void bsp_spurious_initialize( void );
92
93/* Interrupt Service Routine (ISR) pointer */
94typedef void (*bsp_shared_isr)(void *arg);
95
96/* Initializes the Shared System Interrupt service */
97extern void BSP_shared_interrupt_init(void);
98
99/* Called directly from IRQ trap handler TRAP[0x10..0x1F] = IRQ[0..15] */
100void bsp_isr_handler(rtems_vector_number vector);
101
102/* Registers a shared IRQ handler, and enable it at IRQ controller. Multiple
103 * interrupt handlers may use the same IRQ number, all ISRs will be called
104 * when an interrupt on that line is fired.
105 *
106 * Arguments
107 *  irq       System IRQ number
108 *  info      Optional Name of IRQ source
109 *  isr       Function pointer to the ISR
110 *  arg       Second argument to function isr
111 */
112static __inline__ int BSP_shared_interrupt_register
113       (
114       int irq,
115       const char *info,
116       bsp_shared_isr isr,
117       void *arg
118       )
119{
120       return rtems_interrupt_handler_install(irq, info,
121                                       RTEMS_INTERRUPT_SHARED, isr, arg);
122}
123
124/* Unregister previously registered shared IRQ handler.
125 *
126 * Arguments
127 *  irq       System IRQ number
128 *  isr       Function pointer to the ISR
129 *  arg       Second argument to function isr
130 */
131static __inline__ int BSP_shared_interrupt_unregister
132       (
133       int irq,
134       bsp_shared_isr isr,
135       void *arg
136       )
137{
138       return rtems_interrupt_handler_remove(irq, isr, arg);
139}
140
141/* Clear interrupt pending on IRQ controller, this is typically done on a
142 * level triggered interrupt source such as PCI to avoid taking double IRQs.
143 * In such a case the interrupt source must be cleared first on LEON, before
144 * acknowledging the IRQ with this function.
145 *
146 * Arguments
147 *  irq       System IRQ number
148 */
149extern void BSP_shared_interrupt_clear(int irq);
150
151/* Enable Interrupt. This function will unmask the IRQ at the interrupt
152 * controller. This is normally done by _register(). Note that this will
153 * affect all ISRs on this IRQ.
154 *
155 * Arguments
156 *  irq       System IRQ number
157 */
158extern void BSP_shared_interrupt_unmask(int irq);
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 */
167extern void BSP_shared_interrupt_mask(int irq);
168
169/*
170 *  Delay for the specified number of microseconds.
171 */
172void rtems_bsp_delay(int usecs);
173
174/*
175 * Prototypes for methods used across file boundaries
176 */
177void console_outbyte_polled(int  port, unsigned char ch);
178int console_inbyte_nonblocking(int port);
179
180#ifdef __cplusplus
181}
182#endif
183
184#endif
Note: See TracBrowser for help on using the repository browser.