Files
rtems/cpukit/sapi/include/rtems
Chris Johns 2afb22b7e1 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.
2018-01-25 08:45:26 +01:00
..

Configuring a System Using the Template in confdefs.h
=====================================================

The file confdefs.h is a Configuration Template file which can be
used to greatly simplify the creation and maintenance of RTEMS
Configuration Tables.  The basic concepts are:

   + confdefs.h provides defaults for all configuration parameters

   + applications specify only those values they wish to override

   + confdefs.h can be the only file which knows the precise layout
     of the RTEMS Configuration Tables.

The Configuration Template setup is used by all RTEMS tests to
simplify the maintenance of the tests.

Here is the section from the system.h file from test tm21 from 
the Timing Test Suite:

   /* configuration information */
 
   #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
   #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
 
   #define CONFIGURE_MAXIMUM_TASKS              102
   #define CONFIGURE_MAXIMUM_TIMERS             100
   #define CONFIGURE_MAXIMUM_SEMAPHORES         100
   #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES     100
   #define CONFIGURE_MAXIMUM_PARTITIONS         100
   #define CONFIGURE_MAXIMUM_REGIONS            100
   #define CONFIGURE_MAXIMUM_PORTS              100
   #define CONFIGURE_MAXIMUM_PERIODS            100
 
   #define CONFIGURE_TICKS_PER_TIMESLICE        0
 
   #include <confdefs.h>
 

The above example overrides a number of the configuration parameters.
It informs the template that it is a member of the Timing Suite, 
requires a console and timer driver, and that it needs 102 tasks,
100 timers, 100 semaphores, 100 message queues, 100 partitions, 
100 regions, 100 ports, and 100 periods.   By default, the test
would have gotten no drivers, 10 tasks, and no other RTEMS objects.

The following shows the configuration tables generated by the 
template by default.


#include <bsp.h>

#define NULL_DRIVER_TABLE_ENTRY \
 { NULL, NULL, NULL, NULL, NULL, NULL }
 
rtems_driver_address_table Device_drivers[] = {
#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
  CONSOLE_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
  CLOCK_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
  STUB_DRIVER_TABLE_ENTRY,
#endif
  NULL_DRIVER_TABLE_ENTRY,
};

rtems_initialization_tasks_table Initialization_tasks[] = {
  { rtems_build_name( 'U', 'I', '1', ' ' ), /* init task name */
    RTEMS_MINIMUM_STACK_SIZE,               /* init task stack size */
    1,                                      /* init task priority */
    RTEMS_DEFAULT_ATTRIBUTES,               /* init task attributes */
    Init,                                   /* init task entry point */
    RTEMS_NO_PREEMPT,                       /* init task initial mode */
    0                                       /* init task argument list */
  }
};

#ifdef CONFIGURE_MP_APPLICATION
/*
 *  NODE_NUMBER is assumed to be set on the compile line.
 */

rtems_multiprocessing_table Multiprocessing_configuration = {
  NODE_NUMBER,                           /* local node number */
  2,                                     /* maximum # nodes in system */
  32,                                    /* maximum # global objects */
  32,                                    /* maximum # proxies */
  &MPCI_table                            /* pointer to MPCI config table */
};
#endif

/*
 *  CONFIGURE_EXECUTIVE_RAM_SIZE is a rough guess based on the number of
 *  tasks in the system plus enough extra to get a whole 64K extra.
 *
 *  The NULL address for the workspace area is assumed to be assigned
 *  at startup time by the BSP.
 */
   
rtems_configuration_table Configuration = {
  NULL,                      /* executive RAM work area */
  CONFIGURE_EXECUTIVE_RAM_SIZE, /* executive RAM size */
  10,                        /* maximum # tasks */
  0,                         /* maximum # timers */
  0,                         /* maximum # semaphores */
  0,                         /* maximum # message queues */
  0,                         /* maximum # messages */
  0,                         /* maximum # partitions */
  0,                         /* maximum # regions */
  0,                         /* maximum # dp memory areas */
  0,                         /* maximum # periods */
  0,                         /* maximum # user extensions */
  RTEMS_MILLISECONDS_TO_MICROSECONDS(10), /* # us in a tick */
  50,                        /* # ticks in a timeslice */
  sizeof (Initialization_tasks) / sizeof(rtems_initialization_tasks_table),
                             /* number of init tasks */
  Initialization_tasks,      /* init task(s) table */
  sizeof (Device_drivers) / sizeof(rtems_driver_address_table),
                             /* number of device drivers */
  Device_drivers,            /* pointer to driver address table */
  NULL,                      /* pointer to initial extensions */
#ifdef CONFIGURE_MP_APPLICATION
  &Multiprocessing_configuration
#else
  NULL                       /* ptr to MP config table */
#endif
};