Changeset 4cb19041 in rtems


Ignore:
Timestamp:
Jun 16, 2008, 3:54:21 PM (14 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
d695dfc
Parents:
f02ada81
Message:

2008-06-16 Joel Sherrill <joel.sherrill@…>

  • rtems/include/rtems/rtems/config.h, rtems/include/rtems/rtems/tasks.h, rtems/src/taskgetnote.c, rtems/src/tasks.c, rtems/src/tasksetnote.c, sapi/include/confdefs.h: Add CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS.
Location:
cpukit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rf02ada81 r4cb19041  
     12008-06-16      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * rtems/include/rtems/rtems/config.h,
     4        rtems/include/rtems/rtems/tasks.h, rtems/src/taskgetnote.c,
     5        rtems/src/tasks.c, rtems/src/tasksetnote.c, sapi/include/confdefs.h:
     6        Add CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS.
     7
    182008-06-13      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • cpukit/rtems/include/rtems/rtems/config.h

    rf02ada81 r4cb19041  
    4747   */
    4848  uint32_t                    maximum_tasks;
     49
     50  /**
     51   * This field indicates whether Classic API notepads are
     52   * enabled or disabled.
     53   */
     54  boolean                     notepads_enabled;
    4955
    5056  /**
     
    111117} rtems_api_configuration_table;
    112118
     119/**
     120 *  This macro returns the value of the notepads enabled field
     121 *  in the Classic API configuration table.
     122 */
     123#define rtems_configuration_get_notepads_enabled() \
     124        rtems_configuration_get_rtems_api_configuration()->notepads_enabled
     125
    113126#ifdef __cplusplus
    114127}
  • cpukit/rtems/include/rtems/rtems/tasks.h

    rf02ada81 r4cb19041  
    202202 *  This is the API specific information required by each thread for
    203203 *  the RTEMS API to function correctly.
     204 *
     205 *  @note Notepads must be the last entry in the structure and memory
     206 *        will be taken away from this structure when allocated if
     207 *        notespads are disabled by the application configuration.
    204208 */
    205209typedef struct {
    206   /** This field contains the notepads for this task. */
    207   uint32_t                 Notepads[ RTEMS_NUMBER_NOTEPADS ];
    208210  /** This field contains the pending events for this task. */
    209211  rtems_event_set          pending_events;
     
    212214  /** This field contains the Classic API Signal information for this task. */
    213215  ASR_Information          Signal;
     216  /**
     217   *  This field contains the notepads for this task.
     218   *
     219   *  @note MUST BE LAST ENTRY.
     220   */
     221  uint32_t                 Notepads[ RTEMS_NUMBER_NOTEPADS ];
    214222}  RTEMS_API_Control;
    215223
  • cpukit/rtems/src/taskgetnote.c

    rf02ada81 r4cb19041  
    1818
    1919#include <rtems/system.h>
     20#include <rtems/config.h>
    2021#include <rtems/rtems/status.h>
    2122#include <rtems/rtems/support.h>
     
    6162  RTEMS_API_Control       *api;
    6263
     64  if ( !rtems_configuration_get_notepads_enabled() )
     65    return RTEMS_NOT_CONFIGURED;
     66   
    6367  if ( !note )
    6468    return RTEMS_INVALID_ADDRESS;
  • cpukit/rtems/src/tasks.c

    rf02ada81 r4cb19041  
    1717
    1818#include <rtems/system.h>
     19#include <rtems/config.h>
    1920#include <rtems/rtems/status.h>
    2021#include <rtems/rtems/support.h>
     
    5051  RTEMS_API_Control *api;
    5152  int                i;
    52 
    53   api = _Workspace_Allocate( sizeof( RTEMS_API_Control ) );
     53  size_t             to_allocate;
     54
     55  /*
     56   *  Notepads must be the last entry in the structure and they
     57   *  can be left off if disabled in the configuration.
     58   */
     59  to_allocate = sizeof( RTEMS_API_Control );
     60  if ( !rtems_configuration_get_notepads_enabled() )
     61    to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t));
     62
     63  api = _Workspace_Allocate( to_allocate );
    5464
    5565  if ( !api )
     
    6272  created->task_variables = NULL;
    6373
    64   for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
    65     api->Notepads[i] = 0;
     74  if ( rtems_configuration_get_notepads_enabled() ) {
     75    for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++)
     76      api->Notepads[i] = 0;
     77  }
    6678
    6779  return TRUE;
  • cpukit/rtems/src/tasksetnote.c

    rf02ada81 r4cb19041  
    1818
    1919#include <rtems/system.h>
     20#include <rtems/config.h>
    2021#include <rtems/rtems/status.h>
    2122#include <rtems/rtems/support.h>
     
    6061  RTEMS_API_Control       *api;
    6162
     63  if ( !rtems_configuration_get_notepads_enabled() )
     64    return RTEMS_NOT_CONFIGURED;
     65   
    6266  /*
    6367   *  NOTE:  There is no check for < RTEMS_NOTEPAD_FIRST because that would
  • cpukit/sapi/include/confdefs.h

    rf02ada81 r4cb19041  
    694694  #endif
    695695
     696  #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
     697    #define CONFIGURE_NOTEPADS_ENABLED           FALSE
     698  #else
     699    #define CONFIGURE_NOTEPADS_ENABLED           TRUE
     700  #endif
     701
    696702  #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES
    697703    #define CONFIGURE_MAXIMUM_TASK_VARIABLES      0
     
    741747  #ifndef CONFIGURE_TICKS_PER_TIMESLICE
    742748    #define CONFIGURE_TICKS_PER_TIMESLICE        50
     749  #endif
     750
     751  #ifndef CONFIGURE_DISABLE_CLASSIC_NOTEPADS
     752    #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \
     753      sizeof(RTEMS_API_Control)
     754  #else
     755    #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \
     756      (sizeof(RTEMS_API_Control) - (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)))
    743757  #endif
    744758
     
    12031217  ((_tasks) * \
    12041218   (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \
    1205     _Configure_From_workspace(sizeof(RTEMS_API_Control)) + \
     1219    _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API) + \
    12061220    _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY) + \
    12071221    _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API) + \
     
    12231237
    12241238#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
    1225   _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) )
     1239_Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) )
    12261240
    12271241#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
    1228   _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) )
     1242_Configure_Object_RAM(_queues, sizeof(Message_queue_Control) )
    12291243
    12301244#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
    1231   _Configure_Object_RAM(_partitions, sizeof(Partition_Control) )
     1245_Configure_Object_RAM(_partitions, sizeof(Partition_Control) )
    12321246
    12331247#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
    1234   _Configure_Object_RAM(_regions, sizeof(Region_Control) )
     1248_Configure_Object_RAM(_regions, sizeof(Region_Control) )
    12351249
    12361250#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
    1237   _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) )
     1251_Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) )
    12381252
    12391253#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
    1240   _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) )
     1254_Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) )
    12411255
    12421256#define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
    1243   _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) )
     1257_Configure_Object_RAM(_barriers, sizeof(Barrier_Control) )
    12441258
    12451259#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
    1246   _Configure_Object_RAM(_extensions, sizeof(Extension_Control) )
     1260_Configure_Object_RAM(_extensions, sizeof(Extension_Control) )
    12471261
    12481262#ifdef CONFIGURE_MP_APPLICATION
     
    14971511  rtems_api_configuration_table Configuration_RTEMS_API = {
    14981512    CONFIGURE_MAXIMUM_TASKS,
     1513    CONFIGURE_NOTEPADS_ENABLED,
    14991514    CONFIGURE_MAXIMUM_TIMERS,
    15001515    CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES +
Note: See TracChangeset for help on using the changeset viewer.