Changeset 77c330ce in rtems


Ignore:
Timestamp:
Jul 26, 2010, 10:03:18 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
9bd0258d
Parents:
bc3fe3c
Message:

2010-07-26 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/privateenv.c, libmisc/cpuuse/cpuusagereport.c, posix/Makefile.am, posix/include/rtems/posix/key.h, posix/src/keycreate.c, posix/src/keydelete.c, score/src/iterateoverthreads.c: Since removing ITRON, the loop over all APIs for tasks has a path that cannot be reached. Either modify the code or mark tests for NULL as RTEMS_DEBUG.
  • posix/src/keyfreememory.c: New file.
Location:
cpukit
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rbc3fe3c r77c330ce  
     12010-07-26      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libcsupport/src/privateenv.c, libmisc/cpuuse/cpuusagereport.c,
     4        posix/Makefile.am, posix/include/rtems/posix/key.h,
     5        posix/src/keycreate.c, posix/src/keydelete.c,
     6        score/src/iterateoverthreads.c: Since removing ITRON, the loop over
     7        all APIs for tasks has a path that cannot be reached. Either modify
     8        the code or mark tests for NULL as RTEMS_DEBUG.
     9        * posix/src/keyfreememory.c: New file.
     10
    1112010-07-26      Joel Sherrill <joel.sherrill@oarcorp.com>
    212
  • cpukit/libcsupport/src/privateenv.c

    rbc3fe3c r77c330ce  
    123123  rtems_id           current_task_id;
    124124
    125   sc=rtems_task_ident(RTEMS_SELF,0,&current_task_id);
    126   if (sc != RTEMS_SUCCESSFUL) return sc;
     125  current_task_id = rtems_task_self();
    127126
    128127  if (rtems_current_user_env->task_id==current_task_id) {
  • cpukit/libmisc/cpuuse/cpuusagereport.c

    rbc3fe3c r77c330ce  
    22 *  CPU Usage Reporter
    33 *
    4  *  COPYRIGHT (c) 1989-2009
     4 *  COPYRIGHT (c) 1989-2010.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    7272  #else
    7373    for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
    74       if ( !_Objects_Information_table[ api_index ] )
    75         continue;
     74      /*
     75       *  Since the removal of ITRON, this cannot occur.
     76       */
     77      #if defined(RTEMS_DEBUG)
     78        if ( !_Objects_Information_table[ api_index ] )
     79          continue;
     80      #endif
     81
    7682      information = _Objects_Information_table[ api_index ][ 1 ];
    7783      if ( information ) {
     
    99105  );
    100106
    101   for ( api_index = 1 ;
    102         api_index <= OBJECTS_APIS_LAST ;
    103         api_index++ ) {
    104     if ( !_Objects_Information_table[ api_index ] )
    105       continue;
     107  for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
     108    /*
     109     *  Since the removal of ITRON, this cannot occur.
     110     */
     111    #if defined(RTEMS_DEBUG)
     112      if ( !_Objects_Information_table[ api_index ] )
     113        continue;
     114    #endif
     115
    106116    information = _Objects_Information_table[ api_index ][ 1 ];
    107117    if ( information ) {
  • cpukit/posix/Makefile.am

    rbc3fe3c r77c330ce  
    9090## KEY_C_FILES
    9191libposix_a_SOURCES += src/key.c src/keycreate.c src/keydelete.c \
    92     src/keygetspecific.c src/keyrundestructors.c src/keysetspecific.c
     92    src/keygetspecific.c src/keyfreememory.c src/keyrundestructors.c \
     93    src/keysetspecific.c
    9394
    9495## MEMORY_C_FILES
  • cpukit/posix/include/rtems/posix/key.h

    rbc3fe3c r77c330ce  
    88 *  POSIX key.
    99 *
    10  *  COPYRIGHT (c) 1989-2008.
     10 *  COPYRIGHT (c) 1989-2010.
    1111 *  On-Line Applications Research Corporation (OAR).
    1212 *
     
    7070
    7171/**
     72 *  @brief Free Key Memory
     73 *
     74 *  This memory frees the key table memory associated with @a the_key.
     75 *
     76 *  @param[in] the_key is the POSIX key to free the table memory of.
     77 */
     78void _POSIX_Keys_Free_memory(
     79  POSIX_Keys_Control *the_key
     80);
     81
     82/**
    7283 *  @brief _POSIX_Keys_Free
    7384 *
  • cpukit/posix/src/keycreate.c

    rbc3fe3c r77c330ce  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2010.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    2424#include <rtems/posix/key.h>
    2525
    26 /*PAGE
    27  *
     26/*
    2827 *  17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163
    2928 */
     
    5756   *  NOTE: Currently RTEMS Classic API tasks are always enabled.
    5857   */
     58  for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) {
     59    the_key->Values[ the_api ] = NULL;
    5960
    60   for ( the_api = 1;
    61         the_api <= OBJECTS_APIS_LAST;
    62         the_api++ ) {
     61    #if defined(RTEMS_DEBUG)
     62      /*
     63       *  Since the removal of ITRON, this cannot occur.
     64       */
     65      if ( !_Objects_Information_table[ api_index ] )
     66        continue;
    6367
    64     if ( _Objects_Information_table[ the_api ] ) {
    65       #if defined(RTEMS_DEBUG)
    66         /*
    67          * Currently all managers are installed if the API is installed.
    68          * This would be a horrible implementation error.
    69          */
    70         if (_Objects_Information_table[ the_api ][ 1 ] == NULL )
    71           _Internal_error_Occurred(
    72             INTERNAL_ERROR_CORE,
    73             true,
    74             INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY
    75           );
    76       #endif
    77       bytes_to_allocate = sizeof( void * ) *
    78         (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
    79       table = _Workspace_Allocate( bytes_to_allocate );
    80       if ( !table ) {
    81         for ( --the_api;
    82               the_api >= 1;
    83               the_api-- )
    84           _Workspace_Free( the_key->Values[ the_api ] );
     68      /*
     69       * Currently all managers are installed if the API is installed.
     70       * This would be a horrible implementation error.
     71       */
     72      if (_Objects_Information_table[ the_api ][ 1 ] == NULL )
     73        _Internal_error_Occurred(
     74          INTERNAL_ERROR_CORE,
     75          true,
     76          INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY
     77        );
     78    #endif
    8579
    86         _POSIX_Keys_Free( the_key );
    87         _Thread_Enable_dispatch();
    88         return ENOMEM;
    89       }
     80    bytes_to_allocate = sizeof( void * ) *
     81      (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1);
     82    table = _Workspace_Allocate( bytes_to_allocate );
     83    if ( !table ) {
     84      _POSIX_Keys_Free_memory( the_key );
    9085
    91       the_key->Values[ the_api ] = table;
    92       memset( table, '\0', bytes_to_allocate );
    93     } else {
    94       the_key->Values[ the_api ] = NULL;
     86      _POSIX_Keys_Free( the_key );
     87      _Thread_Enable_dispatch();
     88      return ENOMEM;
    9589    }
    9690
    97 
     91    the_key->Values[ the_api ] = table;
     92    memset( table, '\0', bytes_to_allocate );
    9893  }
    9994
    10095  _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 );
    101 
    10296  *key = the_key->Object.id;
    103 
    10497  _Thread_Enable_dispatch();
    105 
    10698  return 0;
    10799}
  • cpukit/posix/src/keydelete.c

    rbc3fe3c r77c330ce  
    2424#include <rtems/posix/key.h>
    2525
    26 /*PAGE
    27  *
     26/*
    2827 *  17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167
    2928 */
    30 
    3129int pthread_key_delete(
    3230  pthread_key_t  key
    3331)
    3432{
    35   register POSIX_Keys_Control *the_key;
    36   Objects_Locations            location;
    37   uint32_t                     the_api;
     33  POSIX_Keys_Control *the_key;
     34  Objects_Locations   location;
    3835
    3936  the_key = _POSIX_Keys_Get( key, &location );
     
    4340      _Objects_Close( &_POSIX_Keys_Information, &the_key->Object );
    4441
    45       for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ )
    46         if ( the_key->Values[ the_api ] )
    47           _Workspace_Free( the_key->Values[ the_api ] );
     42      _POSIX_Keys_Free_memory( the_key );
    4843
    4944      /*
     
    5146       *         of the application to free the memory.
    5247       */
    53 
    5448      _POSIX_Keys_Free( the_key );
    5549      _Thread_Enable_dispatch();
  • cpukit/score/src/iterateoverthreads.c

    rbc3fe3c r77c330ce  
    66 *         invoke specified function
    77 *
    8  *  COPYRIGHT (c) 1989-2003.
     8 *  COPYRIGHT (c) 1989-2010.
    99 *  On-Line Applications Research Corporation (OAR).
    1010 *
     
    3434
    3535  for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
    36     if ( !_Objects_Information_table[ api_index ] )
    37       continue;
     36    /*
     37     *  Since the removal of ITRON, this cannot occur.
     38     */
     39    #if defined(RTEMS_DEBUG)
     40      if ( !_Objects_Information_table[ api_index ] )
     41        continue;
     42    #endif
    3843
    3944    information = _Objects_Information_table[ api_index ][ 1 ];
Note: See TracChangeset for help on using the changeset viewer.