source: rtems/bsps/powerpc/include/bsp/irq_supp.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: 3.0 KB
Line 
1/*
2 *  The license and distribution terms for this file may be
3 *  found in the file LICENSE in this distribution or at
4 *  http://www.rtems.org/license/LICENSE.
5 */
6
7#ifndef IRQ_SHARED_IRQ_C_GLUE_H
8#define IRQ_SHARED_IRQ_C_GLUE_H
9/*
10 *  This header describes the routines that are needed by the shared
11 *  version of 'irq.c' (implementing the RTEMS irq API). They
12 *  must be provided by the BSP.
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 *
18 */
19
20#ifndef BSP_SHARED_HANDLER_SUPPORT
21#define BSP_SHARED_HANDLER_SUPPORT      1
22#endif
23
24#include <rtems.h>
25#include <rtems/irq.h>
26
27#include <bsp/vectors.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/*
34 * PIC-independent functions to enable/disable interrupt lines at
35 * the pic.
36 *
37 * NOTE: the routines must ignore requests for enabling/disabling
38 *       interrupts that are outside of the range handled by the
39 *       PIC(s).
40 */
41extern void BSP_enable_irq_at_pic(const rtems_irq_number irqLine);
42/*
43 * RETURNS: nonzero (> 0 ) if irq was enabled originally, zero if irq
44 *          was off and negative value if there was an error.
45 */
46extern int  BSP_disable_irq_at_pic(const rtems_irq_number irqLine);
47
48/*
49 * Initialize the PIC.
50 */
51extern int  BSP_setup_the_pic(rtems_irq_global_settings* config);
52
53/* IRQ dispatcher to be defined by the PIC driver; note that it MUST
54 * implement shared interrupts.
55 * Note also that the exception frame passed to this handler is not very
56 * meaningful. Only the volatile registers and vector info are stored.
57 *
58 *******************************************************************
59 * The routine must return zero if the interrupt was handled. If a
60 * nonzero value is returned the dispatcher may panic and flag an
61 * uncaught exception.
62 *******************************************************************
63 */
64int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned int excNum);
65
66/*
67 * Snippet to be used by PIC drivers and by bsp_irq_dispatch_list
68 * traverses list of shared handlers for a given interrupt
69 *
70 */
71
72static inline void
73bsp_irq_dispatch_list_base(
74  rtems_irq_connect_data *tbl,
75  unsigned irq,
76  rtems_irq_hdl sentinel
77)
78{
79        rtems_irq_connect_data* vchain;
80        for( vchain = &tbl[irq];
81                        ((intptr_t)vchain != -1 && vchain->hdl != sentinel);
82                        vchain = (rtems_irq_connect_data*)vchain->next_handler )
83        {
84          vchain->hdl(vchain->handle);
85        }
86}
87
88
89/*
90 * Snippet to be used by PIC drivers;
91 * enables interrupts, traverses list of
92 * shared handlers for a given interrupt
93 * and restores original irq level
94 *
95 * Note that _ISR_Get_level() & friends are preferable to
96 * manipulating MSR directly.
97 */
98
99static inline void
100bsp_irq_dispatch_list(
101  rtems_irq_connect_data *tbl,
102  unsigned irq,
103  rtems_irq_hdl sentinel
104)
105{
106        register uint32_t l_orig;
107
108        l_orig = _ISR_Get_level();
109
110        /* Enable all interrupts */
111        _ISR_Set_level(0);
112
113
114        bsp_irq_dispatch_list_base( tbl, irq, sentinel );
115
116        /* Restore original level */
117        _ISR_Set_level(l_orig);
118}
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif
Note: See TracBrowser for help on using the repository browser.