Changeset 43b6f75 in rtems
- Timestamp:
- 11/30/00 14:08:30 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- c1a24fbe
- Parents:
- 7f8c11c
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/score/ChangeLog
r7f8c11c r43b6f75 1 2 2000-11-30 Joel Sherrill <joel@OARcorp.com> 3 4 * General effort to make things compile with macros not inlines 5 * inline/rtems/score/coremutex.inl: Added comment indicating 6 for macros there is another copy of 7 _CORE_mutex_Seize_interrupt_trylock() in src/coremutexseize.c. 8 * src/coremutexseize.c: Added body of 9 _CORE_mutex_Seize_interrupt_trylock() for macro case. 10 * macros/rtems/score/coremutex.inl: Added prototype for 11 _CORE_mutex_Seize_interrupt_trylock() since there is a real 12 body when macros are enabled. 13 * macros/rtems/score/coresem.inl: Added macro implementation of 14 _CORE_semaphore_Seize_isr_disable. 15 * macros/score/Makefile.am: Fixed typos. 16 * rtems/score/address.inl: Correct macro implementation of 17 _Addresses_Is_aligned() so it would compile. 18 * macros/rtems/score/coremsg.inl: Added closing parentheses. 1 19 2 20 2000-11-28 Chris Johns <ccj@acm.org> -
c/src/exec/score/inline/rtems/score/coremutex.inl
r7f8c11c r43b6f75 114 114 * 115 115 * NOTE: There is no MACRO version of this routine. 116 * A body is in coremutexseize.c that is duplicated 117 * from the .inl by hand. 116 118 */ 117 119 -
c/src/exec/score/macros/rtems/score/Makefile.am
r7f8c11c r43b6f75 19 19 I_FILES = $(STD_I_FILES) $(MP_I_FILES) 20 20 else 21 I_FILES = $(STD_I_FILES 21 I_FILES = $(STD_I_FILES) 22 22 endif 23 23 24 24 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score \ 25 $(I_FILES:%=$(PROJECT_INCLUDE)/rtems/score %)25 $(I_FILES:%=$(PROJECT_INCLUDE)/rtems/score/%) 26 26 27 27 $(PROJECT_INCLUDE)/rtems/score: -
c/src/exec/score/macros/rtems/score/address.inl
r7f8c11c r43b6f75 53 53 54 54 #if (CPU_ALIGNMENT == 0) 55 #define _Addresses_Is_aligned( _address ) \ 55 56 (TRUE) 56 57 #elif defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES) 58 #define _Addresses_Is_aligned( _address ) \ 57 59 ( ( (unsigned short)(_address) % CPU_ALIGNMENT ) == 0 ) 60 #else 58 61 #define _Addresses_Is_aligned( _address ) \ 59 62 ( ( (unsigned32)(_address) % CPU_ALIGNMENT ) == 0 ) 60 #else61 63 #endif 62 64 -
c/src/exec/score/macros/rtems/score/coremsg.inl
r7f8c11c r43b6f75 22 22 * 23 23 */ 24 24 25 25 #define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \ 26 26 _id, _api_message_queue_mp_support, _wait, _timeout ) \ 27 27 _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \ 28 28 (_id), (_api_message_queue_mp_support), \ 29 CORE_MESSAGE_QUEUE_SEND_REQUEST, (_wait), (_timeout) 29 CORE_MESSAGE_QUEUE_SEND_REQUEST, (_wait), (_timeout) ) 30 30 31 31 /*PAGE … … 39 39 _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \ 40 40 (_id), (_api_message_queue_mp_support), \ 41 CORE_MESSAGE_QUEUE_URGENT_REQUEST, (_wait), (_timeout) 41 CORE_MESSAGE_QUEUE_URGENT_REQUEST, (_wait), (_timeout) ) 42 42 43 43 /*PAGE -
c/src/exec/score/macros/rtems/score/coremutex.inl
r7f8c11c r43b6f75 64 64 ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING ) 65 65 66 /*PAGE 67 * 68 * _CORE_mutex_Seize_interrupt_trylock 69 * 70 * NOTE: This is not really a MACRO version of this routine. 71 * A body is in coremutexseize.c that is duplicated 72 * from the .inl by hand. 73 */ 74 75 int _CORE_mutex_Seize_interrupt_trylock( 76 CORE_mutex_Control *the_mutex, 77 ISR_Level *level_p 78 ); 79 66 80 #endif 67 81 /* end of include file */ -
c/src/exec/score/macros/rtems/score/coresem.inl
r7f8c11c r43b6f75 35 35 ( (_the_semaphore)->count ) 36 36 37 /*PAGE 38 * 39 * _CORE_semaphore_Seize_isr_disable 40 * 41 * DESCRIPTION: 42 * 43 * This routine attempts to receive a unit from the_semaphore. 44 * If a unit is available or if the wait flag is FALSE, then the routine 45 * returns. Otherwise, the calling task is blocked until a unit becomes 46 * available. 47 * 48 * NOTE: There is currently no MACRO version of this routine. 49 */ 50 51 #define _CORE_semaphore_Seize_isr_disable( \ 52 _the_semaphore, _id, _wait, _timeout, _level_p) \ 53 { \ 54 Thread_Control *executing; \ 55 ISR_Level level = *(_level_p); \ 56 \ 57 /* disabled when you get here */ \ 58 \ 59 executing = _Thread_Executing; \ 60 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; \ 61 if ( (_the_semaphore)->count != 0 ) { \ 62 (_the_semaphore)->count -= 1; \ 63 _ISR_Enable( level ); \ 64 } else if ( !(_wait) ) { \ 65 _ISR_Enable( level ); \ 66 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; \ 67 } else { \ 68 _Thread_Disable_dispatch(); \ 69 _ISR_Enable( level ); \ 70 _Thread_queue_Enter_critical_section( &(_the_semaphore)->Wait_queue ); \ 71 executing->Wait.queue = &(_the_semaphore)->Wait_queue; \ 72 executing->Wait.id = (_id); \ 73 _ISR_Enable( level ); \ 74 \ 75 _Thread_queue_Enqueue( &(_the_semaphore)->Wait_queue, (_timeout) ); \ 76 _Thread_Enable_dispatch(); \ 77 } \ 78 } 79 37 80 38 81 #endif -
c/src/exec/score/src/coremutexseize.c
r7f8c11c r43b6f75 83 83 _Thread_Enable_dispatch(); 84 84 } 85 86 #if !defined(USE_INLINES) 87 int _CORE_mutex_Seize_interrupt_trylock( 88 CORE_mutex_Control *the_mutex, 89 ISR_Level *level_p 90 ) 91 { 92 Thread_Control *executing; 93 ISR_Level level = *level_p; 94 95 /* disabled when you get here */ 96 97 executing = _Thread_Executing; 98 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 99 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 100 the_mutex->lock = CORE_MUTEX_LOCKED; 101 the_mutex->holder = executing; 102 the_mutex->holder_id = executing->Object.id; 103 the_mutex->nest_count = 1; 104 executing->resource_count++; 105 if ( the_mutex->Attributes.discipline != 106 CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING ) { 107 _ISR_Enable( level ); 108 return 0; 109 } 110 /* else must be CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING */ 111 { 112 Priority_Control ceiling; 113 Priority_Control current; 114 115 ceiling = the_mutex->Attributes.priority_ceiling; 116 current = executing->current_priority; 117 if ( current == ceiling ) { 118 _ISR_Enable( level ); 119 return 0; 120 } 121 if ( current > ceiling ) { 122 _Thread_Disable_dispatch(); 123 _ISR_Enable( level ); 124 _Thread_Change_priority( 125 the_mutex->holder, 126 the_mutex->Attributes.priority_ceiling, 127 FALSE 128 ); 129 _Thread_Enable_dispatch(); 130 return 0; 131 } 132 /* if ( current < ceiling ) */ { 133 executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 134 the_mutex->nest_count = 0; /* undo locking above */ 135 executing->resource_count--; /* undo locking above */ 136 _ISR_Enable( level ); 137 return 0; 138 } 139 } 140 return 0; 141 } 142 return 1; 143 } 144 #endif -
cpukit/score/ChangeLog
r7f8c11c r43b6f75 1 2 2000-11-30 Joel Sherrill <joel@OARcorp.com> 3 4 * General effort to make things compile with macros not inlines 5 * inline/rtems/score/coremutex.inl: Added comment indicating 6 for macros there is another copy of 7 _CORE_mutex_Seize_interrupt_trylock() in src/coremutexseize.c. 8 * src/coremutexseize.c: Added body of 9 _CORE_mutex_Seize_interrupt_trylock() for macro case. 10 * macros/rtems/score/coremutex.inl: Added prototype for 11 _CORE_mutex_Seize_interrupt_trylock() since there is a real 12 body when macros are enabled. 13 * macros/rtems/score/coresem.inl: Added macro implementation of 14 _CORE_semaphore_Seize_isr_disable. 15 * macros/score/Makefile.am: Fixed typos. 16 * rtems/score/address.inl: Correct macro implementation of 17 _Addresses_Is_aligned() so it would compile. 18 * macros/rtems/score/coremsg.inl: Added closing parentheses. 1 19 2 20 2000-11-28 Chris Johns <ccj@acm.org> -
cpukit/score/inline/rtems/score/coremutex.inl
r7f8c11c r43b6f75 114 114 * 115 115 * NOTE: There is no MACRO version of this routine. 116 * A body is in coremutexseize.c that is duplicated 117 * from the .inl by hand. 116 118 */ 117 119 -
cpukit/score/macros/rtems/score/address.inl
r7f8c11c r43b6f75 53 53 54 54 #if (CPU_ALIGNMENT == 0) 55 #define _Addresses_Is_aligned( _address ) \ 55 56 (TRUE) 56 57 #elif defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES) 58 #define _Addresses_Is_aligned( _address ) \ 57 59 ( ( (unsigned short)(_address) % CPU_ALIGNMENT ) == 0 ) 60 #else 58 61 #define _Addresses_Is_aligned( _address ) \ 59 62 ( ( (unsigned32)(_address) % CPU_ALIGNMENT ) == 0 ) 60 #else61 63 #endif 62 64 -
cpukit/score/macros/rtems/score/coremsg.inl
r7f8c11c r43b6f75 22 22 * 23 23 */ 24 24 25 25 #define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \ 26 26 _id, _api_message_queue_mp_support, _wait, _timeout ) \ 27 27 _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \ 28 28 (_id), (_api_message_queue_mp_support), \ 29 CORE_MESSAGE_QUEUE_SEND_REQUEST, (_wait), (_timeout) 29 CORE_MESSAGE_QUEUE_SEND_REQUEST, (_wait), (_timeout) ) 30 30 31 31 /*PAGE … … 39 39 _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \ 40 40 (_id), (_api_message_queue_mp_support), \ 41 CORE_MESSAGE_QUEUE_URGENT_REQUEST, (_wait), (_timeout) 41 CORE_MESSAGE_QUEUE_URGENT_REQUEST, (_wait), (_timeout) ) 42 42 43 43 /*PAGE -
cpukit/score/macros/rtems/score/coremutex.inl
r7f8c11c r43b6f75 64 64 ( (_the_attribute)->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING ) 65 65 66 /*PAGE 67 * 68 * _CORE_mutex_Seize_interrupt_trylock 69 * 70 * NOTE: This is not really a MACRO version of this routine. 71 * A body is in coremutexseize.c that is duplicated 72 * from the .inl by hand. 73 */ 74 75 int _CORE_mutex_Seize_interrupt_trylock( 76 CORE_mutex_Control *the_mutex, 77 ISR_Level *level_p 78 ); 79 66 80 #endif 67 81 /* end of include file */ -
cpukit/score/macros/rtems/score/coresem.inl
r7f8c11c r43b6f75 35 35 ( (_the_semaphore)->count ) 36 36 37 /*PAGE 38 * 39 * _CORE_semaphore_Seize_isr_disable 40 * 41 * DESCRIPTION: 42 * 43 * This routine attempts to receive a unit from the_semaphore. 44 * If a unit is available or if the wait flag is FALSE, then the routine 45 * returns. Otherwise, the calling task is blocked until a unit becomes 46 * available. 47 * 48 * NOTE: There is currently no MACRO version of this routine. 49 */ 50 51 #define _CORE_semaphore_Seize_isr_disable( \ 52 _the_semaphore, _id, _wait, _timeout, _level_p) \ 53 { \ 54 Thread_Control *executing; \ 55 ISR_Level level = *(_level_p); \ 56 \ 57 /* disabled when you get here */ \ 58 \ 59 executing = _Thread_Executing; \ 60 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; \ 61 if ( (_the_semaphore)->count != 0 ) { \ 62 (_the_semaphore)->count -= 1; \ 63 _ISR_Enable( level ); \ 64 } else if ( !(_wait) ) { \ 65 _ISR_Enable( level ); \ 66 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; \ 67 } else { \ 68 _Thread_Disable_dispatch(); \ 69 _ISR_Enable( level ); \ 70 _Thread_queue_Enter_critical_section( &(_the_semaphore)->Wait_queue ); \ 71 executing->Wait.queue = &(_the_semaphore)->Wait_queue; \ 72 executing->Wait.id = (_id); \ 73 _ISR_Enable( level ); \ 74 \ 75 _Thread_queue_Enqueue( &(_the_semaphore)->Wait_queue, (_timeout) ); \ 76 _Thread_Enable_dispatch(); \ 77 } \ 78 } 79 37 80 38 81 #endif -
cpukit/score/src/coremutexseize.c
r7f8c11c r43b6f75 83 83 _Thread_Enable_dispatch(); 84 84 } 85 86 #if !defined(USE_INLINES) 87 int _CORE_mutex_Seize_interrupt_trylock( 88 CORE_mutex_Control *the_mutex, 89 ISR_Level *level_p 90 ) 91 { 92 Thread_Control *executing; 93 ISR_Level level = *level_p; 94 95 /* disabled when you get here */ 96 97 executing = _Thread_Executing; 98 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 99 if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 100 the_mutex->lock = CORE_MUTEX_LOCKED; 101 the_mutex->holder = executing; 102 the_mutex->holder_id = executing->Object.id; 103 the_mutex->nest_count = 1; 104 executing->resource_count++; 105 if ( the_mutex->Attributes.discipline != 106 CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING ) { 107 _ISR_Enable( level ); 108 return 0; 109 } 110 /* else must be CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING */ 111 { 112 Priority_Control ceiling; 113 Priority_Control current; 114 115 ceiling = the_mutex->Attributes.priority_ceiling; 116 current = executing->current_priority; 117 if ( current == ceiling ) { 118 _ISR_Enable( level ); 119 return 0; 120 } 121 if ( current > ceiling ) { 122 _Thread_Disable_dispatch(); 123 _ISR_Enable( level ); 124 _Thread_Change_priority( 125 the_mutex->holder, 126 the_mutex->Attributes.priority_ceiling, 127 FALSE 128 ); 129 _Thread_Enable_dispatch(); 130 return 0; 131 } 132 /* if ( current < ceiling ) */ { 133 executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 134 the_mutex->nest_count = 0; /* undo locking above */ 135 executing->resource_count--; /* undo locking above */ 136 _ISR_Enable( level ); 137 return 0; 138 } 139 } 140 return 0; 141 } 142 return 1; 143 } 144 #endif
Note: See TracChangeset
for help on using the changeset viewer.