source: rtems/cpukit/score/cpu/riscv/include/rtems/asm.h @ 2afb22b

5
Last change on this file since 2afb22b was 2afb22b, checked in by Chris Johns <chrisj@…>, on Dec 23, 2017 at 7:18:56 AM

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.6 KB
Line 
1/**
2 * @file rtems/asm.h
3 *
4 *  This include file attempts to address the problems
5 *  caused by incompatible flavors of assemblers and
6 *  toolsets.  It primarily addresses variations in the
7 *  use of leading underscores on symbols and the requirement
8 *  that register names be preceded by a %.
9 */
10
11/*
12 *  NOTE: The spacing in the use of these macros
13 *        is critical to them working as advertised.
14 *
15 *  This file is based on similar code found in newlib available
16 *  from ftp.cygnus.com.  The file which was used had no copyright
17 *  notice.  This file is freely distributable as long as the source
18 *  of the file is noted.  This file is:
19 *
20 * Copyright (c) 2015 University of York.
21 * Hesham Almatary <hesham@alumni.york.ac.uk>
22 *
23 *
24 * COPYRIGHT (c) 1994-1997.
25 * On-Line Applications Research Corporation (OAR).
26 *
27 * Redistribution and use in source and binary forms, with or without
28 * modification, are permitted provided that the following conditions
29 * are met:
30 * 1. Redistributions of source code must retain the above copyright
31 *    notice, this list of conditions and the following disclaimer.
32 * 2. Redistributions in binary form must reproduce the above copyright
33 *    notice, this list of conditions and the following disclaimer in the
34 *    documentation and/or other materials provided with the distribution.
35 *
36 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
37 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
39 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
40 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
41 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
42 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
43 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
44 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 */
48
49#ifndef __RISCV_ASM_H
50#define __RISCV_ASM_H
51
52/*
53 *  Indicate we are in an assembly file and get the basic CPU definitions.
54 */
55
56#ifndef ASM
57#define ASM
58#endif
59#include <rtems/score/cpuopts.h>
60#include <rtems/score/riscv.h>
61
62/*
63 *  Recent versions of GNU cpp define variables which indicate the
64 *  need for underscores and percents.  If not using GNU cpp or
65 *  the version does not support this, then you will obviously
66 *  have to define these as appropriate.
67 */
68
69#ifndef __USER_LABEL_PREFIX__
70#define __USER_LABEL_PREFIX__ _
71#endif
72
73#ifndef __REGISTER_PREFIX__
74#define __REGISTER_PREFIX__
75#endif
76
77/* ANSI concatenation macros.  */
78
79#define CONCAT1(a, b) CONCAT2(a, b)
80#define CONCAT2(a, b) a ## b
81
82/* Use the right prefix for global labels.  */
83
84#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
85
86/* Use the right prefix for registers.  */
87
88#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x)
89
90/*
91 *  define macros for all of the registers on this CPU
92 *
93 *  EXAMPLE:     #define d0 REG (d0)
94 */
95
96/*
97 *  Define macros to handle section beginning and ends.
98 */
99#define BEGIN_CODE_DCL .text
100#define END_CODE_DCL
101#define BEGIN_DATA_DCL .data
102#define END_DATA_DCL
103#define BEGIN_CODE .text
104#define END_CODE
105#define BEGIN_DATA
106#define END_DATA
107#define BEGIN_BSS
108#define END_BSS
109#define END
110
111/*
112 *  Following must be tailor for a particular flavor of the C compiler.
113 *  They may need to put underscores in front of the symbols.
114 */
115
116#define PUBLIC(sym)    .global SYM (sym)
117#define EXTERN(sym)    .extern SYM (sym)
118#define TYPE_FUNC(sym) .type SYM (sym), %function
119
120#endif
Note: See TracBrowser for help on using the repository browser.