Changeset 77c330ce in rtems
- Timestamp:
- Jul 26, 2010, 10:03:18 PM (11 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 9bd0258d
- Parents:
- bc3fe3c
- Location:
- cpukit
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
rbc3fe3c r77c330ce 1 2010-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 1 11 2010-07-26 Joel Sherrill <joel.sherrill@oarcorp.com> 2 12 -
cpukit/libcsupport/src/privateenv.c
rbc3fe3c r77c330ce 123 123 rtems_id current_task_id; 124 124 125 sc=rtems_task_ident(RTEMS_SELF,0,¤t_task_id); 126 if (sc != RTEMS_SUCCESSFUL) return sc; 125 current_task_id = rtems_task_self(); 127 126 128 127 if (rtems_current_user_env->task_id==current_task_id) { -
cpukit/libmisc/cpuuse/cpuusagereport.c
rbc3fe3c r77c330ce 2 2 * CPU Usage Reporter 3 3 * 4 * COPYRIGHT (c) 1989-20 094 * COPYRIGHT (c) 1989-2010. 5 5 * On-Line Applications Research Corporation (OAR). 6 6 * … … 72 72 #else 73 73 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 76 82 information = _Objects_Information_table[ api_index ][ 1 ]; 77 83 if ( information ) { … … 99 105 ); 100 106 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 106 116 information = _Objects_Information_table[ api_index ][ 1 ]; 107 117 if ( information ) { -
cpukit/posix/Makefile.am
rbc3fe3c r77c330ce 90 90 ## KEY_C_FILES 91 91 libposix_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 93 94 94 95 ## MEMORY_C_FILES -
cpukit/posix/include/rtems/posix/key.h
rbc3fe3c r77c330ce 8 8 * POSIX key. 9 9 * 10 * COPYRIGHT (c) 1989-20 08.10 * COPYRIGHT (c) 1989-2010. 11 11 * On-Line Applications Research Corporation (OAR). 12 12 * … … 70 70 71 71 /** 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 */ 78 void _POSIX_Keys_Free_memory( 79 POSIX_Keys_Control *the_key 80 ); 81 82 /** 72 83 * @brief _POSIX_Keys_Free 73 84 * -
cpukit/posix/src/keycreate.c
rbc3fe3c r77c330ce 1 1 /* 2 * COPYRIGHT (c) 1989-20 07.2 * COPYRIGHT (c) 1989-2010. 3 3 * On-Line Applications Research Corporation (OAR). 4 4 * … … 24 24 #include <rtems/posix/key.h> 25 25 26 /*PAGE 27 * 26 /* 28 27 * 17.1.1 Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 29 28 */ … … 57 56 * NOTE: Currently RTEMS Classic API tasks are always enabled. 58 57 */ 58 for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 59 the_key->Values[ the_api ] = NULL; 59 60 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; 63 67 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 85 79 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 ); 90 85 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; 95 89 } 96 90 97 91 the_key->Values[ the_api ] = table; 92 memset( table, '\0', bytes_to_allocate ); 98 93 } 99 94 100 95 _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); 101 102 96 *key = the_key->Object.id; 103 104 97 _Thread_Enable_dispatch(); 105 106 98 return 0; 107 99 } -
cpukit/posix/src/keydelete.c
rbc3fe3c r77c330ce 24 24 #include <rtems/posix/key.h> 25 25 26 /*PAGE 27 * 26 /* 28 27 * 17.1.3 Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 29 28 */ 30 31 29 int pthread_key_delete( 32 30 pthread_key_t key 33 31 ) 34 32 { 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; 38 35 39 36 the_key = _POSIX_Keys_Get( key, &location ); … … 43 40 _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); 44 41 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 ); 48 43 49 44 /* … … 51 46 * of the application to free the memory. 52 47 */ 53 54 48 _POSIX_Keys_Free( the_key ); 55 49 _Thread_Enable_dispatch(); -
cpukit/score/src/iterateoverthreads.c
rbc3fe3c r77c330ce 6 6 * invoke specified function 7 7 * 8 * COPYRIGHT (c) 1989-20 03.8 * COPYRIGHT (c) 1989-2010. 9 9 * On-Line Applications Research Corporation (OAR). 10 10 * … … 34 34 35 35 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 38 43 39 44 information = _Objects_Information_table[ api_index ][ 1 ];
Note: See TracChangeset
for help on using the changeset viewer.