[RTEMS Project] #3875: Split up confdefs.h in component based header files

RTEMS trac trac at rtems.org
Fri Feb 14 13:13:44 UTC 2020


#3875: Split up confdefs.h in component based header files
------------------------------+-----------------------------
  Reporter:  Sebastian Huber  |      Owner:  Sebastian Huber
      Type:  task             |     Status:  assigned
  Priority:  normal           |  Milestone:  5.1
 Component:  config           |    Version:  5
  Severity:  normal           |   Keywords:
Blocked By:                   |   Blocking:
------------------------------+-----------------------------
 The confdefs.h header file is large, complex, and hard to review. Split it
 up into component header files to make it easier to maintain and review.

 The general approach is to place the default configuration of things in
 librtemscpu.a. The benefit is that the application configuration object
 file
 will only include data structures which have a user-defined value.

 The component based header files include their dependencies explicitly. It
 should be possible to include component based header files separately to
 ease
 testing. For example we could use this template:

 {{{
   #ifndef _RTEMS_CONFDEFS_FOOBAR_H
   #define _RTEMS_CONFDEFS_FOOBAR_H

   #ifndef __CONFIGURATION_TEMPLATE_h
   #error "Do not include this file directly, use <rtems/confdefs.h>
 instead"
   #endif

   #if defined(CONFIGURE_INIT) && \
     defined(CONFIGURE_FOOBAR_STUFF) && \
     defined(CONFIGURE_MORE_FOOBAR_STUFF)

   /* Foobar includes */

   #ifdef __cplusplus
   extern "C" {
   #endif /* __cplusplus */

   /* Configure foobar. */

   #ifdef __cplusplus
   }
   #endif /* __cplusplus */

   #endif /* CONFIGURE_INIT */

   #endif /* _RTEMS_CONFDEFS_FOOBAR_H */
 }}}

 In case CONFIGURE_INIT is not defined, then including <rtems/confdefs.h>
 should
 expose nothing to the C compiler.

 Here is a first proposal to group the configuration in components:

 {{{
 rtems/
   confdefs.h
     This file just includes the component based header files listed below.
   confdefs/
     bdbuf.h
     classicobj.h
       Classic API objects
     classictasksinit.h
       Classic initialization task
     driverclock.h
       Clock driver and related configuration, e.g.
 CONFIGURE_MICROSECONDS_PER_TICK
     driverconsolesimple.h
       Simple console driver configuration
     driverlegacy.h
       Legacy IO driver configuration table
     extensions.h
       User extensions, internal extensions
     filesystem.h
       Filesystem configuration
     general.h
       Basic stuff which is mandatory to configure, e.g. ISR stacks, per-
 CPU information
     libpci.h
       PCI library configuration
     malloc.h
       Malloc configuration
     mpci.h
       MPCI specific configuration options
     msgq.h
       General message queue configuration
     obsolete.h
       Warning about the use of obsolete configure options
     posixkeys.h
       POSIX keys
     posixobj.h
       POSIX objects
     posixthreadsinit.h
       POSIX initialization threads
     scheduler.h
       Scheduler configuration
     support.h
       Support macros for confdefs header files
     threads.h
       General thread configuration (e.g. thread control block)
     unlimited.h
       Unlimited objects configuration
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3875>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list