Files
rtems/cpukit/sapi/include/rtems
Joel Sherrill f4a8ee1c55 Unlimited objects patch from Chris Johns <ccj@acm.org>. Email follows:
First, the unlimited patch. I have compiled the unlmited patch for the
    Linux posix BSP only and it seems to work cleanly. I would like a really
    major application run on this change before commiting as the changes are
    very core and significant. I am currently building all the tests to run.

    I have no targets suitable to test on at the moment.

    I have tested the patch for inline functions and macros.

    Turning macros on has found some core bugs. I have fixed these but have
    not run all the tests. Please review the patch for these changes. They
    are:

    1) The conditional compilation for MP support broke the core messages
    code. You cannot embed a conditional macro in another macro. The Send
    and Urgent Send calls are macros.

    2) User extensions handler initialisation now has two parameters. I have
    updated the macros to support the extra parameter.

    The patch also contains the gcc-target-default.cfg fix required to build
    the kernel. More of a by product than a fix for you.
1999-03-17 16:01:03 +00:00
..
1998-02-17 23:46:28 +00:00
1998-02-17 23:46:28 +00:00
1998-02-17 23:46:28 +00:00
1998-02-17 23:46:28 +00:00
1998-02-17 23:46:28 +00:00

#
#  $Id$
#

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_TMTEST
 
   #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
   #define CONFIGURE_TEST_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_TEST_NEEDS_CONSOLE_DRIVER
  CONSOLE_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
  CLOCK_DRIVER_TABLE_ENTRY,
#endif
#ifdef CONFIGURE_TEST_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_MPTEST
/*
 *  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_MPTEST
  &Multiprocessing_configuration
#else
  NULL                       /* ptr to MP config table */
#endif
};