source: rtems/bsps/powerpc/beatnik/include/bsp/bsp_bsdnet_attach.h @ 2afb22b

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

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

Update #3254.

  • Property mode set to 100644
File size: 2.6 KB
4/* Author: Till Straumann, 2005; see ../../LICENSE */
6/* Rationale: traditionally, BSPs only supported a single networking interface
7 *            the BSP defined RTEMS_NETWORK_DRIVER_NAME & friends macros
8 *            for applications to use.
9 *            If more than one interface is present, this simple approach is
10 *            not enough.
11 *            Hence, this BSP exports a routine declaring all available interfaces
12 *            so the application can make a choice.
13 */
15#ifdef __cplusplus
16  extern "C" {
19/* Fwd. decl just in case */
20struct rtems_bsdnet_ifconfig;
22typedef struct {
23                                                        /* name of the interface */
24                const char *name;               
25                                                        /* optional description (to be used by chooser 'help' function etc.) */
26                const char *description;
27                                                        /* driver 'attach' function */
28                int                     (*attach_fn)(struct rtems_bsdnet_ifconfig*, int);
29} BSP_NetIFDescRec, *BSP_NetIFDesc;
31/* Return a pointer to the (static) list of network interface descriptions
32 * of this board.
33 *
34 * NOTES: A NULL value is returned if e.g., the board type cannot be determined
35 *        or for other reasons.
36 *        The 'description' field is optional, i.e., may be NULL.
37 *        The list is terminated by an element with a NULL name field.
38 *        The interfaces are listed in the order they are labelled.
39 */
44/* Define this macro so applications can conditionally compile this API */
45#define BSP_HAS_MULTIPLE_NETIFS(x)      BSP_availableNetIFs()   
47/* Legacy macro; applications should use BSP_Available_NetIfs() to choose
48 * an interface and attach function.
49 */
50extern char BSP_auto_network_driver_name[20];
51#define RTEMS_BSP_NETWORK_DRIVER_NAME   BSP_auto_network_driver_name
53#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_auto_enet_attach
55/* This routine checks the name field passed in the 'ifconfig'.
56 * If the name is NULL or points to the BSP_auto_network_driver_name
57 * array, the routine checks all interfaces for an active link and
58 * attaches the first alive one.
59 * It also updates 'ifconfig' to reflect the chosen interface's name
60 * and attach function.
61 *
62 * If another name is passed in, the routine scans
63 * the available interfaces for that name and uses it, if found.
64 * Eventually, a default interface is chosen (provided that
65 * the board type is successfully detected).
66 *
67 * Note that only ONE interface chained into rtems_bsdnet_config
68 * may use the "auto" name.
69 *
70 */
73BSP_auto_enet_attach(struct rtems_bsdnet_ifconfig *ifconfig, int attaching);
75#ifdef __cplusplus
76  }
Note: See TracBrowser for help on using the repository browser.